From 91db9f23344f701f3044d62718e87ed1ef880e9c Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Tue, 12 Nov 2024 20:49:43 +0100 Subject: [PATCH 1/7] fix: fix styling and alerts --- .../components-form/AlertRenderer.js | 2 +- .../Extensibility/components/Alert.js | 2 +- src/index.tsx | 1 + src/shared/ResourceForm/components/Presets.js | 2 +- .../ResourceForm/components/Presets.scss | 1 + .../ResourceForm/components/ResourceForm.scss | 5 ++ src/styles/reset.css | 86 +------------------ 7 files changed, 14 insertions(+), 85 deletions(-) diff --git a/src/components/Extensibility/components-form/AlertRenderer.js b/src/components/Extensibility/components-form/AlertRenderer.js index 319dc53e2a..2f46d0d51e 100644 --- a/src/components/Extensibility/components-form/AlertRenderer.js +++ b/src/components/Extensibility/components-form/AlertRenderer.js @@ -33,7 +33,7 @@ export function AlertRenderer({ let schemaType = 'Information'; if (severity === 'warning') { - schemaType = 'Warning'; + schemaType = 'Critical'; } else if (severity === 'error') { schemaType = 'Negative'; } else if (severity === 'success') { diff --git a/src/components/Extensibility/components/Alert.js b/src/components/Extensibility/components/Alert.js index 278997b7e1..bd7ee2321d 100644 --- a/src/components/Extensibility/components/Alert.js +++ b/src/components/Extensibility/components/Alert.js @@ -6,7 +6,7 @@ export const Alert = ({ value, schema, structure, ...props }) => { let schemaType = 'Information'; if (structure.severity === 'warning') { - schemaType = 'Warning'; + schemaType = 'Critical'; } else if (structure.severity === 'error') { schemaType = 'Negative'; } else if (structure.severity === 'success') { diff --git a/src/index.tsx b/src/index.tsx index f7130c9ec2..a895cb29fb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -19,6 +19,7 @@ import '@ui5/webcomponents-icons-tnt/dist/network.js'; import '@ui5/webcomponents-icons-tnt/dist/application.js'; import '@ui5/webcomponents-icons-tnt/dist/application-service.js'; import '@sap-ui/common-css/dist/sap-margin.css'; +import '@sap-ui/common-css/dist/sap-padding.css'; import './styles/reset.css'; import './styles/sapIllus-Fills.css'; diff --git a/src/shared/ResourceForm/components/Presets.js b/src/shared/ResourceForm/components/Presets.js index 28c36bba69..31e81e8670 100644 --- a/src/shared/ResourceForm/components/Presets.js +++ b/src/shared/ResourceForm/components/Presets.js @@ -33,7 +33,7 @@ export function Presets({ return inlinePresets ? ( presetDropdown ) : ( -
+
{presetDropdown}
); diff --git a/src/shared/ResourceForm/components/Presets.scss b/src/shared/ResourceForm/components/Presets.scss index d81ab7bded..fa4c074bd5 100644 --- a/src/shared/ResourceForm/components/Presets.scss +++ b/src/shared/ResourceForm/components/Presets.scss @@ -1,5 +1,6 @@ .resource-form { .preset-separator { border-bottom: 1px solid var(--sapList_GroupHeaderBorderColor); + padding-bottom: 1rem; } } diff --git a/src/shared/ResourceForm/components/ResourceForm.scss b/src/shared/ResourceForm/components/ResourceForm.scss index b1b7df0f58..c398d70af8 100644 --- a/src/shared/ResourceForm/components/ResourceForm.scss +++ b/src/shared/ResourceForm/components/ResourceForm.scss @@ -14,6 +14,11 @@ form .resource-form { ui5-form-item::part(layout) { grid-template-columns: none; } + + &::part(layout) { + padding: 0; + } + form { overflow: hidden; flex-grow: 1; diff --git a/src/styles/reset.css b/src/styles/reset.css index 46b8c64a51..ad7d7a8e0b 100644 --- a/src/styles/reset.css +++ b/src/styles/reset.css @@ -3,94 +3,16 @@ License: none (public domain) */ -/* html, -body, -div, -span, -applet, -object, -iframe, -h1, -h2, -h3, -h4, -h5, -h6, -p, -blockquote, -pre, -a, -abbr, -acronym, -address, -big, -cite, -code, -del, -dfn, -em, -img, -ins, -kbd, -q, -s, -samp, -small, -strike, -strong, -sub, -sup, -tt, -var, -b, -u, -i, -center, -dl, -dt, -dd, -ol, -ul, -li, -fieldset, -form, -label, -legend, -table, -caption, -tbody, -tfoot, -thead, -tr, -th, -td, -article, -aside, -canvas, -details, -embed, -figure, -figcaption, -footer, -header, -hgroup, -menu, -nav, -output, -ruby, -section, -summary, -time, -mark, -audio, -video { +html, +ul { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; -} */ +} +*/ /* HTML5 display-role reset for older browsers */ article, aside, From 51e70e1902a00a76ac7684823a925b8d4f9b2314 Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Wed, 13 Nov 2024 08:29:02 +0100 Subject: [PATCH 2/7] fix: fix unsaved message --- .../UnsavedMessageBox/UnsavedMessageBox.tsx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx index c40d2985fc..030006e7d4 100644 --- a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx +++ b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx @@ -22,23 +22,13 @@ export function UnsavedMessageBox({ isOpen }: UnsavedMessageBoxProps) { ); const [isFormOpen, setIsFormOpen] = useRecoilState(isFormOpenState); - const handleClose = (event: { - detail: { - action: - | string - | ForwardRefExoticComponent< - ButtonPropTypes & - WithWebComponentPropTypes & - RefAttributes - >; - }; - }) => { - if (event.detail.action === '0: custom action') { + const handleClose = (action, escapedPressed) => { + if (action === '0: custom action' || escapedPressed) { if (isResourceEdited.discardAction) { isResourceEdited.discardAction(); } setIsFormOpen({ formOpen: false, leavingForm: false }); - } else if (event.detail.action === '1: custom action') { + } else if (action === '1: custom action') { setIsResourceEdited({ isEdited: true }); setIsFormOpen({ formOpen: true, leavingForm: false }); return; From c6d24e9e7d5d361a8ea96ba235feeb8d01b8d4c2 Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Thu, 14 Nov 2024 08:23:11 +0100 Subject: [PATCH 3/7] fix: fix background in add modules --- src/components/KymaModules/KymaModulesAddModule.js | 1 + src/components/KymaModules/KymaModulesAddModule.scss | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/components/KymaModules/KymaModulesAddModule.js b/src/components/KymaModules/KymaModulesAddModule.js index 6c58c756a5..bc234e715a 100644 --- a/src/components/KymaModules/KymaModulesAddModule.js +++ b/src/components/KymaModules/KymaModulesAddModule.js @@ -248,6 +248,7 @@ export default function KymaModulesAddModule({ initialUnchangedResource={initialUnchangedResource} afterCreatedCustomMessage={t('kyma-modules.module-added')} formWithoutPanel + className="add-modules-form" > {modulesAddData?.length !== 0 ? ( <> diff --git a/src/components/KymaModules/KymaModulesAddModule.scss b/src/components/KymaModules/KymaModulesAddModule.scss index be858f29f2..e10482b681 100644 --- a/src/components/KymaModules/KymaModulesAddModule.scss +++ b/src/components/KymaModules/KymaModulesAddModule.scss @@ -75,6 +75,10 @@ } } +.add-modules-form::part(layout) { + background-color: var(--sapBackgroundColor); +} + @container (max-width: 350px) { .gridbox-addModule { --card-width: 300px; From 10956b3ded7b3e89696a6a8a9cb0384b73a17856 Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Thu, 14 Nov 2024 08:26:21 +0100 Subject: [PATCH 4/7] fix: remove unused --- .../components/UnsavedMessageBox/UnsavedMessageBox.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx index 030006e7d4..de8a241d5f 100644 --- a/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx +++ b/src/shared/components/UnsavedMessageBox/UnsavedMessageBox.tsx @@ -1,12 +1,5 @@ -import { - Button, - ButtonDomRef, - ButtonPropTypes, - MessageBox, - WithWebComponentPropTypes, -} from '@ui5/webcomponents-react'; +import { Button, MessageBox } from '@ui5/webcomponents-react'; import { useTranslation } from 'react-i18next'; -import { ForwardRefExoticComponent, RefAttributes } from 'react'; import { useRecoilState } from 'recoil'; import { isResourceEditedState } from 'state/resourceEditedAtom'; import { isFormOpenState } from 'state/formOpenAtom'; From a073f6a564569f1340e6bbf44da8449aeeb5ff83 Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Thu, 14 Nov 2024 10:12:34 +0100 Subject: [PATCH 5/7] fix: passing props --- .../components/ResourcesList/ResourcesList.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/shared/components/ResourcesList/ResourcesList.js b/src/shared/components/ResourcesList/ResourcesList.js index 2280842e21..ae7f3e4237 100644 --- a/src/shared/components/ResourcesList/ResourcesList.js +++ b/src/shared/components/ResourcesList/ResourcesList.js @@ -92,6 +92,19 @@ export function ResourcesList({ return <>; // wait for the context update } + const allProps = { + customHeaderActions, + resourceUrl, + resourceType, + resourceTitle, + isCompact, + description, + layoutNumber, + resources, + filterFn, + ...props, + }; + const content = ( <> ) : ( - + )} ); From 7b7f5ab6205cea376037e3349f43baa4879fd8a2 Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Thu, 14 Nov 2024 10:30:06 +0100 Subject: [PATCH 6/7] fix: key error --- src/shared/ResourceForm/inputs/Text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/ResourceForm/inputs/Text.js b/src/shared/ResourceForm/inputs/Text.js index 19614e062c..31b7d7aaa7 100644 --- a/src/shared/ResourceForm/inputs/Text.js +++ b/src/shared/ResourceForm/inputs/Text.js @@ -1,8 +1,8 @@ import { useValidation } from 'shared/hooks/useValidation'; import { Input } from '@ui5/webcomponents-react'; -export function Text(props) { - return ; +export function Text({ key, ...props }) { + return ; } export function WrappedText({ value, setValue, onChange, inputRef, ...props }) { From 394dc20c5cc9116c5a17d19c41e1c46f9c68989f Mon Sep 17 00:00:00 2001 From: Oliwia Gowor Date: Fri, 15 Nov 2024 07:58:43 +0100 Subject: [PATCH 7/7] fix: resources in list --- src/shared/components/ResourcesList/ResourcesList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/ResourcesList/ResourcesList.js b/src/shared/components/ResourcesList/ResourcesList.js index ae7f3e4237..77486ad7c7 100644 --- a/src/shared/components/ResourcesList/ResourcesList.js +++ b/src/shared/components/ResourcesList/ResourcesList.js @@ -182,9 +182,9 @@ function Resources(props) { ); }