-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fluent theme] Hide buttons, suggested actions FnF and flow layout, D…
…TMF FnF (#5132) * Hide attach file and telephone keypad button * Touch up * Smaller suggested actions button * Fix telephone keypad color contrast * Sort * Suggested actions fit-and-finish * Add entry * Disable Terrapin * Fix tests
- Loading branch information
Showing
38 changed files
with
218 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file modified
BIN
-100 Bytes
(99%)
...hots__/html/attach-file-js-fluent-theme-applied-attach-a-single-file-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-90 Bytes
(99%)
.../attach-multiple-files-js-fluent-theme-applied-attach-multiple-files-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-120 Bytes
(99%)
...shots__/html/auto-resize-js-fluent-theme-applied-textbox-auto-resize-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-53 Bytes
(100%)
...shots__/html/auto-resize-js-fluent-theme-applied-textbox-auto-resize-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-87 Bytes
(100%)
...shots__/html/auto-resize-js-fluent-theme-applied-textbox-auto-resize-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-89 Bytes
(100%)
...ml/drag-and-drop-upload-js-fluent-theme-applied-drag-and-drop-upload-3-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-109 Bytes
(100%)
...-theme-fallback-js-fluent-theme-applied-uses-fluent-theme-if-present-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-104 Bytes
(99%)
...napshots__/html/focus-back-js-fluent-theme-applied-places-focus-back-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-104 Bytes
(99%)
...napshots__/html/focus-back-js-fluent-theme-applied-places-focus-back-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.03 KB
...ns-hide-upload-button-is-truthy-should-not-render-attach-file-button-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-171 Bytes
(100%)
...e-length-js-fluent-theme-applied-handles-max-message-length-exceeded-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-106 Bytes
(99%)
...snapshots__/html/send-on-enter-js-fluent-theme-applied-send-on-enter-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-104 Bytes
(99%)
...-send-button-click-js-fluent-theme-applied-send-on-send-button-click-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-95 Bytes
(99%)
..._image_snapshots__/html/simple-js-fluent-theme-applied-should-render-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-153 Bytes
(100%)
.../suggested-actions-js-fluent-theme-applied-renders-suggested-actions-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.8 KB
...js-fluent-theme-applied-renders-suggested-actions-with-a-flow-layout-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...__image_snapshots__/html/tab-order-js-fluent-theme-applied-tab-order-2-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14.8 KB
(180%)
...luent-theme-applied-telephone-keypad-when-tapped-should-send-message-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script> | ||
<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> | ||
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script> | ||
</head> | ||
<body> | ||
<main id="webchat"></main> | ||
<script type="text/babel"> | ||
run(async function () { | ||
const { | ||
React, | ||
ReactDOM: { render }, | ||
WebChat: { FluentThemeProvider, ReactWebChat } | ||
} = window; // Imports in UMD fashion. | ||
|
||
const { directLine, store } = testHelpers.createDirectLineEmulator(); | ||
|
||
const App = () => ( | ||
<ReactWebChat directLine={directLine} store={store} styleOptions={{ hideUploadButton: true }} /> | ||
); | ||
|
||
render( | ||
<FluentThemeProvider> | ||
<App /> | ||
</FluentThemeProvider>, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
// THEN: No attach button should be render. | ||
expect(pageElements.byTestId(WebChat.testIds.sendBoxUploadButton)).toBeFalsy(); | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains 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
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('Fluent theme applied', () => { | ||
test('when styleOptions.hideUploadButton is truthy should not render attach file button', () => runHTML('fluentTheme/hideAttachFileButton')); | ||
}); |
80 changes: 80 additions & 0 deletions
80
__tests__/html/fluentTheme/suggestedActions.layout.flow.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<!doctype html> | ||
<html lang="en-US"> | ||
<head> | ||
<link href="/assets/index.css" rel="stylesheet" type="text/css" /> | ||
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script> | ||
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script> | ||
<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> | ||
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script> | ||
</head> | ||
<body> | ||
<main id="webchat"></main> | ||
<script type="text/babel"> | ||
run(async function () { | ||
const { | ||
React, | ||
ReactDOM: { render }, | ||
WebChat: { FluentThemeProvider, ReactWebChat } | ||
} = window; // Imports in UMD fashion. | ||
|
||
const { directLine, store } = testHelpers.createDirectLineEmulator(); | ||
|
||
const App = () => ( | ||
<ReactWebChat directLine={directLine} store={store} styleOptions={{ suggestedActionLayout: 'flow' }} /> | ||
); | ||
|
||
render( | ||
<FluentThemeProvider> | ||
<App /> | ||
</FluentThemeProvider>, | ||
document.getElementById('webchat') | ||
); | ||
|
||
await pageConditions.uiConnected(); | ||
|
||
await directLine.emulateIncomingActivity({ | ||
type: 'message', | ||
textFormat: 'plain', | ||
text: 'Please select one of the actions below', | ||
suggestedActions: { | ||
actions: [ | ||
{ title: 'A', type: 'imBack' }, | ||
{ title: 'B', type: 'imBack' }, | ||
{ title: 'C', type: 'imBack' }, | ||
{ title: 'D', type: 'imBack' }, | ||
{ title: 'E', type: 'imBack' }, | ||
{ title: 'F', type: 'imBack' }, | ||
{ title: 'G', type: 'imBack' }, | ||
{ title: 'H', type: 'imBack' }, | ||
{ title: 'I', type: 'imBack' }, | ||
{ title: 'J', type: 'imBack' }, | ||
{ title: 'K', type: 'imBack' }, | ||
{ title: 'L', type: 'imBack' }, | ||
{ title: 'M', type: 'imBack' }, | ||
{ title: 'N', type: 'imBack' }, | ||
{ title: 'O', type: 'imBack' }, | ||
{ title: 'P', type: 'imBack' }, | ||
{ title: 'Q', type: 'imBack' }, | ||
{ title: 'R', type: 'imBack' }, | ||
{ title: 'S', type: 'imBack' }, | ||
{ title: 'T', type: 'imBack' }, | ||
{ title: 'U', type: 'imBack' }, | ||
{ title: 'V', type: 'imBack' }, | ||
{ title: 'W', type: 'imBack' }, | ||
{ title: 'X', type: 'imBack' }, | ||
{ title: 'Y', type: 'imBack' }, | ||
{ title: 'Z', type: 'imBack' } | ||
], | ||
to: [] | ||
} | ||
}); | ||
|
||
// THEN: Should render the activity. | ||
await host.snapshot(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains 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
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('Fluent theme applied', () => { | ||
test('renders suggested actions with a flow layout', () => runHTML('fluentTheme/suggestedActions.layout.flow')); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.