forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chat: implement errorlist component (DevExpress#28187)
- Loading branch information
1 parent
15afc49
commit 38319c8
Showing
68 changed files
with
649 additions
and
23 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
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,77 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import Chat from 'devextreme-testcafe-models/chat'; | ||
import { createUser } from './data'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { createWidget } from '../../helpers/createWidget'; | ||
import { getFullThemeName, testScreenshot } from '../../helpers/themeUtils'; | ||
|
||
fixture.disablePageReloads`ChatErrorList` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
test('Errorlist appearance', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
const chat = new Chat('#container'); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Errorlist with one error.png', { element: '#container' }); | ||
|
||
await chat.option('errors', [ | ||
{ id: 1, message: 'Error Message 1. Error Description...' }, | ||
{ id: 2, message: 'Error Message 2. Message was not sent' }, | ||
{ id: 3, message: 'Error Message 3. An unexpected issue occurred while processing your request. Please check your internet connection or contact support for further assistance.' }, | ||
]); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Errorlist with long text in error.png', { | ||
element: '#container', | ||
shouldTestInCompact: true, | ||
compactCallBack: async () => { | ||
await chat.repaint(); | ||
}, | ||
}); | ||
|
||
const darkTheme = getFullThemeName().replace('light', 'dark'); | ||
await testScreenshot(t, takeScreenshot, 'Errorlist with long text in error.png', { element: '#container', theme: darkTheme }); | ||
|
||
await chat.option('rtlEnabled', true); | ||
|
||
await testScreenshot(t, takeScreenshot, 'Errorlist appearance in RTL mode.png', { element: '#container' }); | ||
|
||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
const userFirst = createUser(1, 'First'); | ||
const userSecond = createUser(2, 'Second'); | ||
const msInDay = 86400000; | ||
const today = new Date().setHours(7, 22, 0, 0); | ||
const yesterday = today - msInDay; | ||
|
||
const items = [{ | ||
timestamp: yesterday, | ||
author: userSecond, | ||
text: 'Message text 1', | ||
}, { | ||
timestamp: yesterday, | ||
author: userSecond, | ||
text: 'Message text 2', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 3', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 4', | ||
}, { | ||
timestamp: today, | ||
author: userFirst, | ||
text: 'Message text 5', | ||
}]; | ||
|
||
return createWidget('dxChat', { | ||
items, | ||
user: userFirst, | ||
width: 400, | ||
height: 600, | ||
errors: [{ id: 1, message: 'Error Message 1. Error Description...' }], | ||
}); | ||
}); |
Binary file added
BIN
+51.7 KB
...eme/tests/chat/etalons/Errorlist appearance in RTL mode (fluent-blue-light).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
+48.2 KB
...extreme/tests/chat/etalons/Errorlist appearance in RTL mode (generic-light).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
+49 KB
...e/tests/chat/etalons/Errorlist appearance in RTL mode (material-blue-light).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
+51.5 KB
...eme/tests/chat/etalons/Errorlist with long text in error (fluent-blue-dark).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
+51.8 KB
...me/tests/chat/etalons/Errorlist with long text in error (fluent-blue-light).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
+43.5 KB
.../chat/etalons/Errorlist with long text in error (fluent-blue-light-compact).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
+46.4 KB
...extreme/tests/chat/etalons/Errorlist with long text in error (generic-dark).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
+48.2 KB
...xtreme/tests/chat/etalons/Errorlist with long text in error (generic-light).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
+42.1 KB
...ests/chat/etalons/Errorlist with long text in error (generic-light-compact).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
+45.8 KB
...e/tests/chat/etalons/Errorlist with long text in error (material-blue-dark).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
+49 KB
.../tests/chat/etalons/Errorlist with long text in error (material-blue-light).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
+43.9 KB
...hat/etalons/Errorlist with long text in error (material-blue-light-compact).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
+30.6 KB
...-devextreme/tests/chat/etalons/Errorlist with one error (fluent-blue-light).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
+28.7 KB
...cafe-devextreme/tests/chat/etalons/Errorlist with one error (generic-light).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
+30.1 KB
...evextreme/tests/chat/etalons/Errorlist with one error (material-blue-light).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
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
10 changes: 10 additions & 0 deletions
10
packages/devextreme-scss/scss/widgets/base/chat/layout/chat-errorlist/_index.scss
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,10 @@ | ||
.dx-chat-errorlist { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.dx-chat-errorlist-error { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
} |
33 changes: 33 additions & 0 deletions
33
packages/devextreme-scss/scss/widgets/base/chat/layout/chat-errorlist/_mixins.scss
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,33 @@ | ||
@use "../../../icons" as *; | ||
|
||
@mixin chat-errorlist( | ||
$color, | ||
$padding-block, | ||
$padding-inline, | ||
$error-padding-block, | ||
$row-gap, | ||
$icon-size, | ||
$content-column-gap, | ||
) { | ||
.dx-chat-errorlist { | ||
color: $color; | ||
padding-block: $padding-block; | ||
padding-inline: $padding-inline; | ||
row-gap: $row-gap; | ||
} | ||
|
||
.dx-chat-errorlist:empty { | ||
padding-block: 0; | ||
padding-inline: 0; | ||
} | ||
|
||
.dx-chat-errorlist-error { | ||
column-gap: $content-column-gap; | ||
padding-block: $error-padding-block; | ||
} | ||
|
||
.dx-chat-errorlist-error-icon { | ||
@include dx-icon(errorcircle); | ||
@include dx-icon-sizing($icon-size); | ||
} | ||
} |
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.