From 107e160e3911674d50f105402a3ae7008df532ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maaria=20Wahlstr=C3=B6m?= Date: Tue, 8 Oct 2024 12:00:10 +0300 Subject: [PATCH 1/2] MSCR-581 Make modal x-button stick to top right and interactable while spinner visible --- mscr-ui/src/modules/form/form.styles.tsx | 6 ++- mscr-ui/src/modules/form/index.tsx | 50 ++++++++++-------------- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/mscr-ui/src/modules/form/form.styles.tsx b/mscr-ui/src/modules/form/form.styles.tsx index 46cf705f5..7a6b40d0a 100644 --- a/mscr-ui/src/modules/form/form.styles.tsx +++ b/mscr-ui/src/modules/form/form.styles.tsx @@ -17,8 +17,12 @@ export const WideMultiSelect = styled(MultiSelect)` export const CloseButton = styled(Button)` max-width: 55px; - &&:hover { + position: absolute; + z-index: 700; + right: 0; + &&:hover, &&:focus { background: none; + position: absolute; } `; diff --git a/mscr-ui/src/modules/form/index.tsx b/mscr-ui/src/modules/form/index.tsx index 17f0d9258..d168a2cf2 100644 --- a/mscr-ui/src/modules/form/index.tsx +++ b/mscr-ui/src/modules/form/index.tsx @@ -551,38 +551,30 @@ export default function FormModal({ variant={isSmall ? 'smallScreen' : 'default'} style={{ position: 'relative' }} > + } + aria-label="t('cancel')" + onClick={() => handleClose()} + />
- -
-
- - {contentType == Type.Schema - ? modalType == ModalType.RegisterNewFull - ? t('content-form.title.schema-register') - : modalType == ModalType.MscrCopy - ? t('content-form.title.schema-mscr-copy') - : t('content-form.title.schema-revision') - : modalType == ModalType.RegisterNewFull - ? t('content-form.title.crosswalk-register') - : modalType == ModalType.RegisterNewMscr - ? t('content-form.title.crosswalk-create') - : modalType == ModalType.MscrCopy - ? t('content-form.title.crosswalk-mscr-copy') - : t('content-form.title.crosswalk-revision')} - -
-
- } - aria-label="t('cancel')" - onClick={() => handleClose()} - > -
-
+ + {contentType == Type.Schema + ? modalType == ModalType.RegisterNewFull + ? t('content-form.title.schema-register') + : modalType == ModalType.MscrCopy + ? t('content-form.title.schema-mscr-copy') + : t('content-form.title.schema-revision') + : modalType == ModalType.RegisterNewFull + ? t('content-form.title.crosswalk-register') + : modalType == ModalType.RegisterNewMscr + ? t('content-form.title.crosswalk-create') + : modalType == ModalType.MscrCopy + ? t('content-form.title.crosswalk-mscr-copy') + : t('content-form.title.crosswalk-revision')} + {(modalType == ModalType.RegisterNewFull || modalType == ModalType.RevisionFull) && From ad3215f374bd5de18446cb5305944bc67cdbb4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maaria=20Wahlstr=C3=B6m?= Date: Tue, 8 Oct 2024 12:04:49 +0300 Subject: [PATCH 2/2] MSCR-581 Change Cancel button to say Close when content submitted in modal --- mscr-ui/src/modules/form/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mscr-ui/src/modules/form/index.tsx b/mscr-ui/src/modules/form/index.tsx index d168a2cf2..c7dff51f6 100644 --- a/mscr-ui/src/modules/form/index.tsx +++ b/mscr-ui/src/modules/form/index.tsx @@ -639,7 +639,7 @@ export default function FormModal({ : t('content-form.button.crosswalk-revision')}