Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
af88e0f
Fix types of RovingTabIndex
compulim Oct 16, 2023
d1f6c29
Add strings for CSAT
compulim Oct 16, 2023
d3063a8
Use bundler for module resolution
compulim Oct 16, 2023
166e8d5
Disable defaultProps
compulim Oct 16, 2023
03be872
Fix Entity type
compulim Oct 16, 2023
10bf97b
Fix type of Thing
compulim Oct 16, 2023
8164cc8
Add CSAT UI
compulim Oct 16, 2023
6378e64
Combine Star and StarFilled
compulim Oct 16, 2023
70f2417
Remove unused className prop
compulim Oct 16, 2023
edd29a7
Read reviewAction from prop
compulim Oct 16, 2023
13aa467
Fix END key
compulim Oct 16, 2023
5672d36
Fix aria-checked must always set
compulim Oct 16, 2023
2252d6d
Add tests
compulim Oct 16, 2023
027385a
Add test file
compulim Oct 16, 2023
eef59cf
Add snapshots
compulim Oct 16, 2023
3ce7cfc
Add entry
compulim Oct 16, 2023
54bf208
Allow customize of check mark color
compulim Oct 16, 2023
f392e10
Add doc
compulim Oct 16, 2023
a3f27bd
Rename to displaytext
compulim Oct 16, 2023
b743d70
Use lowercase for display text
compulim Oct 16, 2023
0ac6e0a
Update fields
compulim Oct 16, 2023
659cc6a
Add links
compulim Oct 16, 2023
3e16995
Clean up limitations
compulim Oct 16, 2023
7cd016c
Clean up
compulim Oct 16, 2023
f04b1d3
Add tests
compulim Oct 16, 2023
f654700
Replace any with unknown
compulim Oct 16, 2023
10d23ae
Remove as const
compulim Oct 16, 2023
c0561db
Use isNumber instead of casting
compulim Oct 16, 2023
33cde2d
Remove unset color
compulim Oct 16, 2023
bffcba9
Fix tests
compulim Oct 17, 2023
10fc284
Temporary disable scrollable-region-focusable
compulim Oct 18, 2023
76e254e
Remove comment
compulim Oct 18, 2023
f801eeb
Optional doneOptions
compulim Oct 20, 2023
daa0a5f
Add tooltip
compulim Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ rules:
react/no-will-update-set-state: error
react/prefer-es6-class: error
react/prefer-read-only-props: error
react/require-default-props: error
react/require-default-props: off # defaultProps is being deprecated
react/self-closing-comp: error
react/sort-default-props: error
react/sort-prop-types: error
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Resolves [#4841](https://github.com/microsoft/BotFramework-WebChat/issues/4841). Added link definitions UI in Markdown, by [@compulim](https://github.com/compulim), in PR [#4846](https://github.com/microsoft/BotFramework-WebChat/pull/4846)
- Resolves [#4842](https://github.com/microsoft/BotFramework-WebChat/issues/4842). Added provenance in activity status, by [@compulim](https://github.com/compulim), in PR [#4846](https://github.com/microsoft/BotFramework-WebChat/pull/4846)
- Resolves [#4856](https://github.com/microsoft/BotFramework-WebChat/issues/4856). Added types for `useStyleSet`, by [@compulim](https://github.com/compulim), in PR [#4857](https://github.com/microsoft/BotFramework-WebChat/pull/4857)
- Resolves [#2770](https://github.com/microsoft/BotFramework-WebChat/issues/2770). Added customer satisfactory (CSAT) card, by [@compulim](https://github.com/compulim), in PR [#4899](https://github.com/microsoft/BotFramework-WebChat/pull/4899)

## [4.15.9] - 2023-08-25

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions __tests__/html/attachment/customerSatisfactory/basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const { directLine, store } = testHelpers.createDirectLineEmulator();

WebChat.renderWebChat(
{
directLine,
store
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
role: 'bot'
},
type: 'message',
attachments: [
{
content: {
'@context': 'https://schema.org',
'@type': 'ReviewAction',
actionStatus: 'PotentialActionStatus',
description: 'Great! Please rate your experience.',
resultReview: {
'@type': 'Review',
reviewRating: {
'@type': 'Rating',
'ratingValue-input': {
'@type': 'PropertyValueSpecification',
valueName: 'rate'
}
}
},
target: {
'@type': 'EntryPoint',
actionPlatform: 'https://directline.botframework.com',
urlTemplate:
'ms-directline-postback:?valuetype=application/json&value=%7B%22rate%22%3A%22{rate}%22%7D'
}
},
contentType: 'application/ld+json'
}
]
});

await host.snapshot();

const [firstActivity] = pageElements.activities();
const buttons = firstActivity.querySelectorAll('[role="radio"]');
const submitButton = firstActivity.querySelector('[type="submit"]');

pageElements.sendBoxTextBox().focus();

expect(submitButton).toHaveProperty('ariaDisabled', 'true');

await host.sendShiftTab(3);
await host.sendKeys('ENTER');
expect(document.activeElement).toBe(buttons[0]);
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'false');
expect(buttons[2]).toHaveProperty('ariaChecked', 'false');
expect(buttons[3]).toHaveProperty('ariaChecked', 'false');
expect(buttons[4]).toHaveProperty('ariaChecked', 'false');
expect(submitButton).not.toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.sendKeys('ARROW_RIGHT');
expect(document.activeElement).toBe(buttons[1]);
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'true');
expect(buttons[2]).toHaveProperty('ariaChecked', 'false');
expect(buttons[3]).toHaveProperty('ariaChecked', 'false');
expect(buttons[4]).toHaveProperty('ariaChecked', 'false');
expect(submitButton).not.toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.sendKeys('HOME');
expect(document.activeElement).toBe(buttons[0]);
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'false');
expect(buttons[2]).toHaveProperty('ariaChecked', 'false');
expect(buttons[3]).toHaveProperty('ariaChecked', 'false');
expect(buttons[4]).toHaveProperty('ariaChecked', 'false');
expect(submitButton).not.toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.click(buttons[3]);
expect(document.activeElement).toBe(buttons[3]);
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'true');
expect(buttons[2]).toHaveProperty('ariaChecked', 'true');
expect(buttons[3]).toHaveProperty('ariaChecked', 'true');
expect(buttons[4]).toHaveProperty('ariaChecked', 'false');
expect(submitButton).not.toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.moveTo(document.body.clientWidth, document.body.clientHeight);
await host.sendKeys('END');
expect(document.activeElement).toBe(buttons[4]);
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'true');
expect(buttons[2]).toHaveProperty('ariaChecked', 'true');
expect(buttons[3]).toHaveProperty('ariaChecked', 'true');
expect(buttons[4]).toHaveProperty('ariaChecked', 'true');
expect(submitButton).not.toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.sendTab();
expect(document.activeElement).toBe(submitButton);
await host.snapshot();

const { activity, resolveAll } = await directLine.actPostActivity(() => host.sendKeys('ENTER'));

expect(document.activeElement).toBe(pageElements.sendBoxTextBox());
expect(submitButton).toHaveProperty('ariaDisabled', 'true');
expect(submitButton).toHaveProperty('ariaPressed', 'true');
await host.snapshot();

expect(activity).toHaveProperty('channelData.postBack', true);
expect(activity).toHaveProperty('text', undefined);
expect(activity).toHaveProperty('type', 'message');
expect(activity).toHaveProperty('value', { rate: '5' });
await resolveAll();
});
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions __tests__/html/attachment/customerSatisfactory/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */

describe('customer satisfactory attachment', () => {
test('should work', () => runHTML('attachment/customerSatisfactory/basic'));
});
76 changes: 76 additions & 0 deletions __tests__/html/attachment/customerSatisfactory/completed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const { directLine, store } = testHelpers.createDirectLineEmulator();

WebChat.renderWebChat(
{
directLine,
store
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
role: 'bot'
},
type: 'message',
attachments: [
{
content: {
'@context': 'https://schema.org',
'@type': 'ReviewAction',
actionStatus: 'CompletedActionStatus',
description: 'Great! Please rate your experience.',
resultReview: {
'@type': 'Review',
reviewRating: {
'@type': 'Rating',
ratingValue: 4
}
}
},
contentType: 'application/ld+json'
}
]
});

const [firstActivity] = pageElements.activities();
const buttons = firstActivity.querySelectorAll('[role="radio"]');
const submitButton = firstActivity.querySelector('[type="submit"]');

pageElements.sendBoxTextBox().focus();

expect(submitButton).toHaveProperty('ariaDisabled', 'true');
expect(submitButton).toHaveProperty('ariaPressed', 'true');
expect(buttons[0]).toHaveProperty('ariaChecked', 'true');
expect(buttons[1]).toHaveProperty('ariaChecked', 'true');
expect(buttons[2]).toHaveProperty('ariaChecked', 'true');
expect(buttons[3]).toHaveProperty('ariaChecked', 'true');
expect(buttons[4]).toHaveProperty('ariaChecked', 'false');
expect(buttons[0]).toHaveProperty('ariaDisabled', 'true');
expect(buttons[1]).toHaveProperty('ariaDisabled', 'true');
expect(buttons[2]).toHaveProperty('ariaDisabled', 'true');
expect(buttons[3]).toHaveProperty('ariaDisabled', 'true');
expect(buttons[4]).toHaveProperty('ariaDisabled', 'true');
await host.snapshot();

await host.sendShiftTab(3);
await host.sendKeys('ENTER');
expect(document.activeElement).toBe(pageElements.transcript());
});
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions __tests__/html/attachment/customerSatisfactory/completed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */

describe('customer satisfactory attachment with completed action', () => {
test('should work', () => runHTML('attachment/customerSatisfactory/completed'));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
</head>
<body>
<main id="webchat"></main>
<script>
run(async function () {
const { directLine, store } = testHelpers.createDirectLineEmulator();

WebChat.renderWebChat(
{
directLine,
store
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity({
from: {
role: 'bot'
},
type: 'message',
attachments: [
{
content: {
'@context': 'https://schema.org',
'@type': 'ReviewAction',
actionStatus: 'PotentialActionStatus',
description: 'Great! Please rate your experience.',
resultReview: {
'@type': 'Review',
reviewRating: {
'@type': 'Rating',
'ratingValue-input': {
'@type': 'PropertyValueSpecification',
valueName: 'rate'
}
}
},
target: {
'@type': 'EntryPoint',
actionPlatform: 'https://directline.botframework.com',
urlTemplate: 'ms-directline-imback:?title={rate}'
}
},
contentType: 'application/ld+json'
}
]
});

const [firstActivity] = pageElements.activities();
const buttons = firstActivity.querySelectorAll('[role="radio"]');
const submitButton = firstActivity.querySelector('[type="submit"]');

pageElements.sendBoxTextBox().focus();

expect(submitButton).toHaveProperty('ariaDisabled', 'true');

await host.click(buttons[4]);

const { activity, resolveAll } = await directLine.actPostActivity(() => host.click(submitButton));

expect(activity).toHaveProperty('text', '5');
expect(activity).toHaveProperty('type', 'message');
await resolveAll();
});
</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */

describe('customer satisfactory attachment with imBack of title', () => {
test('should work', () => runHTML('attachment/customerSatisfactory/imBack.title'));
});
Loading