diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b76cd819..421ddd541e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Added support of [contentless activity in livestream](https://github.com/microsoft/BotFramework-WebChat/blob/main/docs/LIVESTREAMING.md#scenario-3-interim-activities-with-no-content), in PR [#5430](https://github.com/microsoft/BotFramework-WebChat/pull/5430), by [@compulim](https://github.com/compulim) - Added sliding dots typing indicator in Fluent theme, in PR [#5447](https://github.com/microsoft/BotFramework-WebChat/pull/5447) and PR [#5448](https://github.com/microsoft/BotFramework-WebChat/pull/5448), by [@compulim](https://github.com/compulim) - (Experimental) Add an ability to pass `completion` prop into Fluent send box and expose the component, in PR [#5466](https://github.com/microsoft/BotFramework-WebChat/pull/5466), by [@OEvgeny](https://github.com/OEvgeny) -- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny) +- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460) and in PR [#5469](https://github.com/microsoft/BotFramework-WebChat/pull/5469), by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny) ### Changed diff --git a/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html b/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html new file mode 100644 index 0000000000..9de8a2b339 --- /dev/null +++ b/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html @@ -0,0 +1,71 @@ + + +
+ + + + + + + + + + + + + + + diff --git a/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html.snap-1.png b/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html.snap-1.png new file mode 100644 index 0000000000..0cd371996b Binary files /dev/null and b/__tests__/html2/fluentTheme/feedbackForm.noDisclaimer.html.snap-1.png differ diff --git a/packages/component/src/Activity/private/getDisclaimer.ts b/packages/component/src/Activity/private/getDisclaimer.ts index 908b009626..5872f96931 100644 --- a/packages/component/src/Activity/private/getDisclaimer.ts +++ b/packages/component/src/Activity/private/getDisclaimer.ts @@ -1,6 +1,6 @@ import { type WebChatActivity } from 'botframework-webchat-core'; -import hasFeedbackLoop from './hasFeedbackLoop'; +import { hasDisclaimer } from './hasFeedbackLoop'; export default function getDisclaimer(activity: WebChatActivity): string | undefined { - return hasFeedbackLoop(activity) ? activity.channelData.feedbackLoop.disclaimer : undefined; + return hasDisclaimer(activity) ? activity.channelData.feedbackLoop.disclaimer : undefined; } diff --git a/packages/component/src/Activity/private/hasFeedbackLoop.ts b/packages/component/src/Activity/private/hasFeedbackLoop.ts index 98ffe63691..e9e7518699 100644 --- a/packages/component/src/Activity/private/hasFeedbackLoop.ts +++ b/packages/component/src/Activity/private/hasFeedbackLoop.ts @@ -1,17 +1,36 @@ import { type WebChatActivity } from 'botframework-webchat-core'; -import { literal, object, safeParse, string, type InferOutput } from 'valibot'; +import { literal, object, optional, safeParse, string, union, type InferOutput } from 'valibot'; -const activityWithFeedbackLoopSchema = object({ +const activityWithFeedbackLoopSchemaWithDisclaimer = object({ channelData: object({ feedbackLoop: object({ - disclaimer: string(), + disclaimer: optional(string()), type: literal('default') }) }) }); -type FeedbackActivity = WebChatActivity & InferOutput