Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cake-bot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleksandr Barabash
cake-bot
Commits
f7e6fe24
Commit
f7e6fe24
authored
Jul 14, 2023
by
Oleksandr Barabash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task_link card added
parent
9e0e0b76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
messaging_extension_action_preview_bot.py
bots/messaging_extension_action_preview_bot.py
+14
-4
medx.py
entities/json/medx.py
+2
-0
card_helper.py
utils/card_helper.py
+2
-1
No files found.
bots/messaging_extension_action_preview_bot.py
View file @
f7e6fe24
...
@@ -395,10 +395,10 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -395,10 +395,10 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
title
=
i18n
.
t
(
"text_upload_title"
)
title
=
i18n
.
t
(
"text_upload_title"
)
url
=
self
.
generate_url
(
f
"https://{AppConfig.MARS_FQDN}/"
,
url
=
self
.
generate_url
(
f
"https://{AppConfig.MARS_FQDN}/"
,
turn_context
.
activity
.
conversation
.
id
)
turn_context
.
activity
.
conversation
.
id
)
card
=
CardHelper
.
load_assets_card
(
"
link_card"
,
card
=
CardHelper
.
load_assets_card
(
"
task_card"
,
context
=
dict
(
context
=
dict
(
title
=
title
,
title
=
title
,
header
=
header
,
task_type
=
MXTypes
.
Task
.
LINK
,
url
=
url
,
task_url
=
url
header
=
header
))
))
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
attachments
=
[
CardFactory
.
adaptive_card
(
card
)]
await
turn_context
.
send_activity
(
await
turn_context
.
send_activity
(
Activity
(
type
=
ActivityTypes
.
message
,
attachments
=
attachments
)
Activity
(
type
=
ActivityTypes
.
message
,
attachments
=
attachments
)
...
@@ -551,6 +551,16 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
...
@@ -551,6 +551,16 @@ class TeamsMessagingExtensionsActionPreviewBot(TeamsActivityHandler):
task_module_request
.
data
.
get
(
mx_object_key
,
dict
())
task_module_request
.
data
.
get
(
mx_object_key
,
dict
())
)
)
if
mx
.
type
==
MXTypes
.
Task
.
LINK
and
mx
.
url
:
task_info
=
TaskModuleTaskInfo
(
title
=
TaskModuleConfig
.
TITLE
,
width
=
TaskModuleConfig
.
WIDTH
,
height
=
TaskModuleConfig
.
HEIGHT
,
url
=
mx
.
url
,
fallback_url
=
mx
.
url
)
return
TaskModuleResponse
(
task
=
TaskModuleContinueResponse
(
value
=
task_info
)
)
if
mx
.
type
==
MXTypes
.
Task
.
NOTIFICATION
and
mx
.
notification_id
:
if
mx
.
type
==
MXTypes
.
Task
.
NOTIFICATION
and
mx
.
notification_id
:
# 1. save action to DB
# 1. save action to DB
# 2. return URL
# 2. return URL
...
...
entities/json/medx.py
View file @
f7e6fe24
...
@@ -14,6 +14,7 @@ class MXTypes:
...
@@ -14,6 +14,7 @@ class MXTypes:
""" Task types """
""" Task types """
DEFAULT
=
"task/default"
DEFAULT
=
"task/default"
NOTIFICATION
=
"task/notification"
NOTIFICATION
=
"task/notification"
LINK
=
"task/link"
@dataclass
@dataclass
...
@@ -21,3 +22,4 @@ class MedX(CamelCaseMixin):
...
@@ -21,3 +22,4 @@ class MedX(CamelCaseMixin):
""" MedX data """
""" MedX data """
type
:
str
type
:
str
notification_id
:
Optional
[
str
]
notification_id
:
Optional
[
str
]
url
:
Optional
[
str
]
utils/card_helper.py
View file @
f7e6fe24
...
@@ -5,6 +5,7 @@ from typing import Dict, Any, Optional, Mapping, Union
...
@@ -5,6 +5,7 @@ from typing import Dict, Any, Optional, Mapping, Union
from
botbuilder.core
import
TurnContext
from
botbuilder.core
import
TurnContext
from
config
import
CARDS_PATH
from
config
import
CARDS_PATH
from
entities.json.medx
import
MXTypes
from
entities.json.notification
import
NotificationCosmos
from
entities.json.notification
import
NotificationCosmos
from
utils.functions
import
get_i18n
from
utils.functions
import
get_i18n
from
utils.json_func
import
json_loads
from
utils.json_func
import
json_loads
...
@@ -89,7 +90,7 @@ class CardHelper:
...
@@ -89,7 +90,7 @@ class CardHelper:
"type"
:
"task/fetch"
"type"
:
"task/fetch"
},
},
"mx"
:
{
"mx"
:
{
"type"
:
"task/notification"
,
"type"
:
MXTypes
.
Task
.
NOTIFICATION
,
"notificationId"
:
notification_id
"notificationId"
:
notification_id
}
}
}}]
}}]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment