Skip to content

Commit 72cfd96

Browse files
Merge pull request #1645 from ral-facilities/add-warning-alert-banne-for-no-rule-#1628
Improve alert banners for systems table within dialogs #1628
2 parents 5c52bd2 + 61bcd9b commit 72cfd96

File tree

8 files changed

+113
-83
lines changed

8 files changed

+113
-83
lines changed

cypress/e2e/with_mock_data/items.cy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ describe('Items', () => {
419419
// Operational is 'not allowed' by rules so admin user should be able to bypass this and select usasge status
420420
cy.findAllByText('Operational').first().click();
421421

422-
cy.findByText('Item Creation Rule Applied').should('exist');
422+
cy.findByText(
423+
'WARNING: No rule exists for creating a new item within this system type'
424+
).should('exist');
423425

424426
cy.findByRole('button', { name: 'Next' }).click();
425427

@@ -1836,7 +1838,9 @@ describe('Items', () => {
18361838
cy.findByRole('button', { name: 'navigate to systems home' }).click();
18371839
cy.findAllByText('Scrapped').first().click();
18381840

1839-
cy.findByText('Item Moving Rule Applied').should('exist');
1841+
cy.findByText(
1842+
'WARNING: No rule exists for moving this item between these system types'
1843+
).should('exist');
18401844

18411845
cy.findByRole('button', { name: 'Next' }).click();
18421846

src/items/__snapshots__/itemDialog.component.test.tsx.snap

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,15 +1400,15 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
14001400
tabindex="-1"
14011401
>
14021402
<div
1403-
aria-labelledby=":r3ep:"
1403+
aria-labelledby=":r3ej:"
14041404
aria-modal="true"
14051405
class="MuiPaper-root MuiPaper-elevation MuiPaper-rounded MuiPaper-elevation24 MuiDialog-paper MuiDialog-paperScrollPaper MuiDialog-paperWidthXl MuiDialog-paperFullWidth css-ji9sn5-MuiPaper-root-MuiDialog-paper"
14061406
role="dialog"
14071407
style="--Paper-shadow: 0px 11px 15px -7px rgba(0,0,0,0.2),0px 24px 38px 3px rgba(0,0,0,0.14),0px 9px 46px 8px rgba(0,0,0,0.12);"
14081408
>
14091409
<h2
14101410
class="MuiTypography-root MuiTypography-h6 MuiDialogTitle-root css-19csis5-MuiTypography-root-MuiDialogTitle-root"
1411-
id=":r3ep:"
1411+
id=":r3ej:"
14121412
>
14131413
Edit Item as Admin
14141414
<svg
@@ -1677,7 +1677,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
16771677
</p>
16781678
<svg
16791679
aria-hidden="true"
1680-
aria-label="The item's usage status will remain the same, as defined by the rules"
1680+
aria-label="The item's usage status will remain the same, according to the rules"
16811681
class="MuiSvgIcon-root MuiSvgIcon-fontSizeSmall css-120dh41-MuiSvgIcon-root"
16821682
data-mui-internal-clone-element="true"
16831683
data-testid="InfoOutlinedIcon"
@@ -1943,12 +1943,12 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
19431943
</span>
19441944
</div>
19451945
<input
1946-
aria-describedby=":r3f4:-helper-text"
1946+
aria-describedby=":r3eu:-helper-text"
19471947
aria-invalid="false"
19481948
aria-label="Filter by Name"
19491949
autocomplete="off"
19501950
class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-110vr2a-MuiInputBase-input-MuiInput-input"
1951-
id=":r3f4:"
1951+
id=":r3eu:"
19521952
placeholder="Filter by Name"
19531953
title="Filter by Name"
19541954
type="text"
@@ -1986,7 +1986,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
19861986
</div>
19871987
<p
19881988
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-v98l45-MuiFormHelperText-root"
1989-
id=":r3f4:-helper-text"
1989+
id=":r3eu:-helper-text"
19901990
>
19911991
<label>
19921992
Filter Mode: Fuzzy
@@ -2131,13 +2131,13 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
21312131
</span>
21322132
</div>
21332133
<div
2134-
aria-describedby=":r3fd:-helper-text"
2134+
aria-describedby=":r3f7:-helper-text"
21352135
aria-expanded="false"
21362136
aria-haspopup="listbox"
21372137
aria-label="Filter by Type"
2138-
aria-labelledby=":r3fd:"
2138+
aria-labelledby=":r3f7:"
21392139
class="MuiSelect-select MuiSelect-standard MuiSelect-multiple MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-10y8whu-MuiSelect-select-MuiInputBase-input-MuiInput-input"
2140-
id=":r3fd:"
2140+
id=":r3f7:"
21412141
role="combobox"
21422142
tabindex="0"
21432143
>
@@ -2199,7 +2199,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
21992199
</div>
22002200
<p
22012201
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-v98l45-MuiFormHelperText-root"
2202-
id=":r3fd:-helper-text"
2202+
id=":r3f7:-helper-text"
22032203
>
22042204
<label>
22052205
Filter Mode: Includes any
@@ -2306,11 +2306,11 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
23062306
class="MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd css-6h9cc6-MuiInputBase-root-MuiInput-root"
23072307
>
23082308
<input
2309-
aria-describedby=":r3fm:-helper-text"
2309+
aria-describedby=":r3fg:-helper-text"
23102310
aria-invalid="false"
23112311
autocomplete="off"
23122312
class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedEnd css-1yrc8ca-MuiInputBase-input-MuiInput-input"
2313-
id=":r3fm:"
2313+
id=":r3fg:"
23142314
inputmode="text"
23152315
placeholder="Min"
23162316
type="text"
@@ -2341,7 +2341,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
23412341
</div>
23422342
<p
23432343
class="MuiFormHelperText-root MuiFormHelperText-sizeMedium css-18y2hez-MuiFormHelperText-root"
2344-
id=":r3fm:-helper-text"
2344+
id=":r3fg:-helper-text"
23452345
>
23462346
<label>
23472347
Filter Mode: Between Inclusive
@@ -2358,7 +2358,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
23582358
aria-invalid="false"
23592359
autocomplete="off"
23602360
class="MuiInputBase-input MuiInput-input MuiInputBase-inputAdornedEnd css-1yrc8ca-MuiInputBase-input-MuiInput-input"
2361-
id=":r3fp:"
2361+
id=":r3fj:"
23622362
inputmode="text"
23632363
placeholder="Max"
23642364
type="text"
@@ -2430,7 +2430,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
24302430
>
24312431
<label
24322432
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-animated MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-animated css-10j3yc8-MuiFormLabel-root-MuiInputLabel-root"
2433-
for="mrt-rows-per-page-:r3et:"
2433+
for="mrt-rows-per-page-:r3en:"
24342434
>
24352435
Rows per page
24362436
</label>
@@ -2451,7 +2451,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
24512451
aria-hidden="true"
24522452
aria-invalid="false"
24532453
class="MuiSelect-nativeInput css-j0riat-MuiSelect-nativeInput"
2454-
id="mrt-rows-per-page-:r3et:"
2454+
id="mrt-rows-per-page-:r3en:"
24552455
tabindex="-1"
24562456
value="5"
24572457
/>
@@ -2565,7 +2565,7 @@ exports[`ItemDialog > Edit Item > displays warning when in admin mode for edit 1
25652565
data-popper-escaped=""
25662566
data-popper-placement="top"
25672567
data-popper-reference-hidden=""
2568-
id=":r3eq:"
2568+
id=":r3ek:"
25692569
role="tooltip"
25702570
style="position: absolute; top: auto; left: 0px; margin: 0px; right: auto; bottom: 0px; transform: translate(0px, 0px);"
25712571
>

0 commit comments

Comments
 (0)