mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-29 20:05:25 +08:00
Use compatible Markdown link in DingTalk A2UI branding
This commit is contained in:
@@ -36,9 +36,8 @@ def brand_components() -> list[dict[str, typing.Any]]:
|
||||
},
|
||||
{
|
||||
'id': 'langbot-brand-link',
|
||||
'component': 'Link',
|
||||
'text': 'LangBot',
|
||||
'action': {'functionCall': {'call': 'openUrl', 'args': {'url': LANGBOT_CARD_URL}}},
|
||||
'component': 'Markdown',
|
||||
'content': f'[LangBot]({LANGBOT_CARD_URL})',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ def test_text_card_keeps_brand_when_content_updates():
|
||||
assert by_id['langbot-brand']['children'] == ['langbot-brand-icon', 'langbot-brand-link']
|
||||
assert by_id['langbot-brand-icon']['url'] == 'https://langbot.app/logo-blue.png'
|
||||
assert by_id['langbot-brand-icon']['previewEnabled'] is False
|
||||
assert by_id['langbot-brand-link']['action']['functionCall'] == {
|
||||
'call': 'openUrl',
|
||||
'args': {'url': 'https://langbot.app?utm_source=dingtalk&utm_medium=bot_card&utm_campaign=langbot'},
|
||||
}
|
||||
assert by_id['langbot-brand-link']['component'] == 'Markdown'
|
||||
assert by_id['langbot-brand-link']['content'] == (
|
||||
'[LangBot](https://langbot.app?utm_source=dingtalk&utm_medium=bot_card&utm_campaign=langbot)'
|
||||
)
|
||||
assert update_text_card_messages('surface-id', 'done')[0]['updateDataModel']['path'] == '/content'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user