Skip to content

Commit 48ee9b6

Browse files
authored
Form Smart Paste: created a screenshot test for loader (DevExpress#31032)
1 parent d88de22 commit 48ee9b6

18 files changed

+91
-18
lines changed

apps/demos/Demos/Form/SmartPaste/Angular/app/app.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
your changes affect Smart Paste result.</div
55
>
66
<div class="instruction"
7-
>Paste text from the clipboard to populate the form. Press Ctrl+Shift+V or
8-
use the "Smart Paste" button under the form.</div
7+
>Paste text from the clipboard to populate the form. Press Ctrl+Shift+V
8+
(when the form is focused) or use the "Smart Paste" button under the
9+
form.</div
910
>
1011
<div class="textarea-container">
1112
<dx-button

apps/demos/Demos/Form/SmartPaste/Angular/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class AppComponent {
122122
if (clipboardText) {
123123
form.smartPaste(clipboardText);
124124
} else {
125-
showNotification('Copy the text to paste into the form', '#form');
125+
showNotification('Clipboard is empty. Copy text before pasting', '#form');
126126
}
127127
})
128128
.catch(() => {

apps/demos/Demos/Form/SmartPaste/React/App.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const zipAIOptions = { instruction: 'If the text does not contain a ZIP, determi
4343

4444
const resetButtonOptions: ButtonTypes.Properties = {
4545
stylingMode: 'outlined',
46-
type: 'normal'
46+
type: 'normal',
4747
};
4848
const smartPasteButtonOptions: ButtonTypes.Properties = {
4949
stylingMode: 'contained',
@@ -94,8 +94,8 @@ export const aiIntegration = new AIIntegration({
9494
const signal = controller.signal;
9595

9696
const aiPrompt: AIMessage[] = [
97-
{ role: 'system', content: prompt.system, },
98-
{ role: 'user', content: prompt.user, },
97+
{ role: 'system', content: prompt.system },
98+
{ role: 'user', content: prompt.user },
9999
];
100100

101101
const promise = getAIResponse(aiPrompt, signal);
@@ -121,7 +121,7 @@ const App = () => {
121121

122122
const onCopy = useCallback(() => {
123123
navigator.clipboard.writeText(text);
124-
showNotification('Text copied to clipboard', "#textarea", false, '0 -20');
124+
showNotification('Text copied to clipboard', '#textarea', false, '0 -20');
125125
}, [text]);
126126

127127
const shortcutHandler = useCallback((event: KeyboardEvent) => {
@@ -131,7 +131,7 @@ const App = () => {
131131
if (clipboardText) {
132132
formRef.current?.instance().smartPaste(clipboardText);
133133
} else {
134-
showNotification('Copy the text to paste into the form', '#form');
134+
showNotification('Clipboard is empty. Copy text before pasting', '#form');
135135
}
136136
})
137137
.catch(() => {
@@ -149,12 +149,12 @@ const App = () => {
149149
}, []);
150150

151151
return (
152-
<>
152+
<React.Fragment>
153153
<div id="textarea-label" className="instruction">
154154
Copy text from the editor below to the clipboard. Edit the text to see how your changes affect Smart Paste result.
155155
</div>
156156
<div className="instruction">
157-
Paste text from the clipboard to populate the form. Press Ctrl+Shift+V or use the "Smart Paste" button under the form.
157+
Paste text from the clipboard to populate the form. Press Ctrl+Shift+V (when the form is focused) or use the "Smart Paste" button under the form.
158158
</div>
159159
<div className="textarea-container">
160160
<Button
@@ -250,7 +250,7 @@ const App = () => {
250250
<ButtonItem buttonOptions={resetButtonOptions} name="reset" />
251251
</GroupItem>
252252
</Form>
253-
</>
253+
</React.Fragment>
254254
);
255255
};
256256

apps/demos/Demos/Form/SmartPaste/ReactJs/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const App = () => {
109109
if (clipboardText) {
110110
formRef.current?.instance().smartPaste(clipboardText);
111111
} else {
112-
showNotification('Copy the text to paste into the form', '#form');
112+
showNotification('Clipboard is empty. Copy text before pasting', '#form');
113113
}
114114
})
115115
.catch(() => {
@@ -133,8 +133,8 @@ const App = () => {
133133
affect Smart Paste result.
134134
</div>
135135
<div className="instruction">
136-
Paste text from the clipboard to populate the form. Press Ctrl+Shift+V or use the "Smart
137-
Paste" button under the form.
136+
Paste text from the clipboard to populate the form. Press Ctrl+Shift+V (when the form is
137+
focused) or use the "Smart Paste" button under the form.
138138
</div>
139139
<div className="textarea-container">
140140
<Button

apps/demos/Demos/Form/SmartPaste/Vue/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
<div class="instruction">
1010
Paste text from the clipboard to populate the form.
11-
Press Ctrl+Shift+V or use the "Smart Paste" button under the form.
11+
Press Ctrl+Shift+V (when the form is focused) or use the "Smart Paste" button under the form.
1212
</div>
1313
<div class="textarea-container">
1414
<DxButton
@@ -250,7 +250,7 @@ onMounted(() => {
250250
if (clipboardText) {
251251
formRef.value.instance.smartPaste(clipboardText);
252252
} else {
253-
showNotification('Copy the text to paste into the form', '#form');
253+
showNotification('Clipboard is empty. Copy text before pasting', '#form');
254254
}
255255
})
256256
.catch(() => {

apps/demos/Demos/Form/SmartPaste/jQuery/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<body class="dx-viewport">
2222
<div class="demo-container">
2323
<div class="instruction" id="textarea-label">Copy text from the editor below to the clipboard. Edit the text to see how your changes affect Smart Paste result.</div>
24-
<div class="instruction">Paste text from the clipboard to populate the form. Press Ctrl+Shift+V or use the "Smart Paste" button under the form.</div>
24+
<div class="instruction">Paste text from the clipboard to populate the form. Press Ctrl+Shift+V (when the form is focused) or use the "Smart Paste" button under the form.</div>
2525
<div class="textarea-container">
2626
<div id="copy"></div>
2727
<div id="textarea"></div>

apps/demos/Demos/Form/SmartPaste/jQuery/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ $(() => {
7070
form.smartPaste(text);
7171
} else {
7272
showNotification(
73-
'Copy the text to paste into the form',
73+
'Clipboard is empty. Copy text before pasting',
7474
'#form',
7575
);
7676
}
2.88 KB
Loading
3.36 KB
Loading
2.94 KB
Loading

0 commit comments

Comments
 (0)