Commit cb12710
authored
refactor(ui): migrate toast notifications to core-components toast (open-metadata#29545)
* refactor(ui): migrate toast notifications to core-components toast
Replace useAlertStore + inline AlertBar pattern with toast from
@openmetadata/ui-core-components across the application.
- ToastUtils: showErrorToast/showSuccessToast/showWarningToast/showInfoToast
now delegate to toast.error/success/warning/info
- AlertBar: decoupled from useAlertStore, now a pure display component
- Remove store-driven AlertBar renders from PageLayoutV1, OntologyEntityPanel,
auth pages (ForgotPassword, SignInPage, BasicSignup, ResetPassword),
and ContextCenter pages (Documents, Memories, Articles, Dashboard)
- Delete useAlertStore (addAlert had zero callers after ToastUtils migration)
AlertBar component retained for standalone in-page use (forms/modals).
* fix(ui): add alert-message testid to Toast for Playwright compatibility
* fix(ui): fix toast dismiss timings for warnings and errors
Rule-violation warnings were dismissing after 2.2s (core default)
instead of 5s, diverging from showWarningToast and the old
useAlertStore behavior. Non-rule errors now correctly pass empty
options so toast.error keeps its timeout:0 (stays until dismissed).
Also bumps the global default timeout from 2200ms to 3500ms.
* style(ui): reformat toast.error call for readability
* lint fix
* fix(e2e): scope alert-icon check to matched toast in toastNotification
Strict mode violation when multiple toasts appear simultaneously —
getByTestId('alert-icon') resolved to 2 elements. Scope both the
wait and the icon assertion to the toast matching the expected message.
* fix(e2e): handle duplicate toasts in toastNotification; reduce success timeout
.filter({ hasText }) resolves to 2 elements when the same success
message fires twice in quick succession. Add .first() to avoid strict
mode violation. Also reduce showSuccessToast default from 5000ms to
3000ms to shrink the overlap window.
* fix(e2e): handle duplicate toasts in toastNotification; reduce success timeout
- Replace raw getByText toast assertions in TestLibrary.spec.ts with
toastNotification() to avoid strict mode violations when duplicate
toasts appear simultaneously.
- Fix announcementForm: toast.success has no close button, so replace
alert-icon-close click with toastNotification() verification.
* fix(e2e): replace raw alert-bar assertions with toastNotification()
Strict mode violations when multiple toasts appear simultaneously —
unscoped getByTestId('alert-bar') / toHaveText resolves to 2+ elements.
Replace all such patterns with toastNotification() which scopes to the
matching toast via .filter({ hasText }).first().
Files updated: Login.spec.ts, user.ts, entity.ts, DataProductRename,
MutuallyExclusiveColumnTags, NavigationBlocker, TestSuitePipelineRedeploy,
Domains, Entity.1 parent d077465 commit cb12710
37 files changed
Lines changed: 92 additions & 460 deletions
File tree
- openmetadata-ui-core-components/src/main/resources/ui/src/components/application/toast
- openmetadata-ui/src/main/resources/ui
- playwright
- e2e
- Features
- DataQuality
- Pages
- utils
- src
- components
- AlertBar
- DataProducts/DataProductsDetailsPage
- DataQuality/BundleSuiteForm
- Domain/DomainDetails
- Modals/AnnouncementModal
- OntologyExplorer
- PageLayoutV1
- common/EntityPageInfos/AnnouncementDrawer
- hooks
- pages
- ContextCenterPage
- ContextCenterArticlesPage
- ContextCenterDashboardPage
- ContextCenterDocumentsPage
- ContextCenterMemoriesPage
- ForgotPassword
- LoginPage
- ResetPassword
- SignUp
- utils
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
| 400 | + | |
406 | 401 | | |
407 | 402 | | |
408 | 403 | | |
| |||
Lines changed: 21 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
| |||
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
158 | | - | |
| 163 | + | |
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
| |||
206 | 211 | | |
207 | 212 | | |
208 | 213 | | |
209 | | - | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
| |||
235 | 240 | | |
236 | 241 | | |
237 | 242 | | |
238 | | - | |
| 243 | + | |
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
| |||
280 | 285 | | |
281 | 286 | | |
282 | 287 | | |
283 | | - | |
| 288 | + | |
284 | 289 | | |
285 | 290 | | |
286 | 291 | | |
| |||
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
394 | | - | |
| 399 | + | |
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
| |||
631 | 636 | | |
632 | 637 | | |
633 | 638 | | |
634 | | - | |
| 639 | + | |
635 | 640 | | |
636 | 641 | | |
637 | 642 | | |
| |||
720 | 725 | | |
721 | 726 | | |
722 | 727 | | |
723 | | - | |
| 728 | + | |
724 | 729 | | |
725 | 730 | | |
726 | 731 | | |
| |||
750 | 755 | | |
751 | 756 | | |
752 | 757 | | |
753 | | - | |
| 758 | + | |
754 | 759 | | |
755 | 760 | | |
756 | 761 | | |
| |||
831 | 836 | | |
832 | 837 | | |
833 | 838 | | |
834 | | - | |
| 839 | + | |
835 | 840 | | |
836 | 841 | | |
837 | 842 | | |
| |||
953 | 958 | | |
954 | 959 | | |
955 | 960 | | |
956 | | - | |
| 961 | + | |
957 | 962 | | |
958 | 963 | | |
959 | 964 | | |
| |||
1034 | 1039 | | |
1035 | 1040 | | |
1036 | 1041 | | |
1037 | | - | |
| 1042 | + | |
1038 | 1043 | | |
1039 | 1044 | | |
1040 | 1045 | | |
| |||
1060 | 1065 | | |
1061 | 1066 | | |
1062 | 1067 | | |
1063 | | - | |
| 1068 | + | |
1064 | 1069 | | |
1065 | 1070 | | |
1066 | 1071 | | |
| |||
1114 | 1119 | | |
1115 | 1120 | | |
1116 | 1121 | | |
1117 | | - | |
| 1122 | + | |
1118 | 1123 | | |
1119 | 1124 | | |
1120 | 1125 | | |
| |||
1190 | 1195 | | |
1191 | 1196 | | |
1192 | 1197 | | |
1193 | | - | |
| 1198 | + | |
1194 | 1199 | | |
1195 | 1200 | | |
1196 | 1201 | | |
| |||
1232 | 1237 | | |
1233 | 1238 | | |
1234 | 1239 | | |
1235 | | - | |
| 1240 | + | |
1236 | 1241 | | |
1237 | 1242 | | |
1238 | 1243 | | |
| |||
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 108 | + | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 219 | + | |
223 | 220 | | |
224 | 221 | | |
225 | 222 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
2729 | 2730 | | |
2730 | 2731 | | |
2731 | 2732 | | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
2736 | | - | |
2737 | | - | |
2738 | | - | |
| 2733 | + | |
2739 | 2734 | | |
2740 | 2735 | | |
2741 | 2736 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
1597 | 1598 | | |
1598 | 1599 | | |
1599 | 1600 | | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
| 1601 | + | |
1606 | 1602 | | |
1607 | 1603 | | |
1608 | 1604 | | |
| |||
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 128 | + | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 137 | + | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
| |||
0 commit comments