-
Notifications
You must be signed in to change notification settings - Fork 47
rich formatting support for interactive messages #99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListPicker Lambda// Lambda code for Lex bot
/* CREATE A LIST PICKER */
function createSimpleListPickerFromOptions(title, options) {
let elements = options.map((option) => {
return { title: option };
});
return {
templateType: TEMPLATE_TYPES.LISTPICKER,
version: "1.0",
data: {
content: {
title: "How can I help you? [richLink](https://example.com)<!--rehype:target=_self-->", // default {:target=\"_blank"}
subtitle: "**Bold Subtitle** *italics* [richLink](https://somelink.com) https://plainlink.com.",
elements: elements,
},
},
};
} ListPicker UI DemoTimePicker LambdaSIMPLE_TIMEPICKER: {
templateType: TEMPLATE_TYPES.TIMEPICKER,
version: "1.0",
data: {
content: {
title: "Schedule appointment [richLink](https://example.com)<!--rehype:target=_self-->",
subtitle: "**Bold pick option:** *italics* [richLink](https://somelink.com) https://plainlink.com.",
timeslots: [
{
date: "2020-10-31T18:00+00:00",
duration: 60,
},
{
date: "2020-10-15T13:00+00:00",
duration: 60,
},
{
date: "2020-10-15T16:00+00:00",
duration: 60,
},
],
},
},
}, TimePicker UI demoListPicker Images LambdaDEPARTMENT_WITH_MULTIPLE_IMAGES: {
templateType: TEMPLATE_TYPES.LISTPICKER,
version: "1.0",
data: {
content: {
title: "Which department do you want to select? [richLink](https://somelink.com) https://plainlink.com",
subtitle: "**Bold pick option:** *italics* [richLink](https://somelink.com) https://plainlink.com.",
imageType: "URL",
imageData: IMAGE_URLS.COMPANY,
elements: [
{
title: DEPARTMENT_SLOT.BILLING,
subtitle: "Request billing information",
imageType: "URL",
imageData: IMAGE_URLS.BILLING,
},
{
title: DEPARTMENT_SLOT.NEW_SERVICE,
subtitle: "Set up a new service",
imageType: "URL",
imageData: IMAGE_URLS.NEW_SERVICE,
},
{
title: DEPARTMENT_SLOT.CANCELLATION,
subtitle: "Request a cancellation",
imageType: "URL",
imageData: IMAGE_URLS.CANCELLATION,
},
],
},
},
}, ListPicker Images UI DemoDev Tool Screenshot |
4381184
to
f1dea9b
Compare
f1dea9b
to
623fa0e
Compare
spencerlepine
commented
Feb 14, 2023
@@ -1,11 +1,13 @@ | |||
# Keep compatible webpack@4.x - Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clean up dependabot auto-PR creation, we should raise them monthly, and ignore breaking major upgrades, since we will ignore anyways.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference
Description of changes:
Created component
<RichLinkRenderer />
to support markdown hyperlinks for interactive message title/subtitles.Should create anchor tag for the following:
"[amazon.com](https://amazon.com)"
=> amazon.com"https://amazon.com"
=> https://amazon.com"[amazon.com](https://amazon.com){:target="_self"}"
=> amazon.com"[amazon.com](https://amazon.com){:target="_blank"}"
=> amazon.comInteractive Message Lex Bot
Set up a lex bot following the blog post. In the lex lambda, modify the intent title passed to user to be rich text, e.g.
title: "How can we help? [Learn More](https://oursite.com)"
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.