@kartverket/backstage-plugin-risk-scorecard 3.10.2 → 3.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/css/theme.css +6 -0
  2. package/dist/components/common/Input.esm.js +1 -1
  3. package/dist/components/common/Input.esm.js.map +1 -1
  4. package/dist/components/common/{MarkdownInput.esm.js → MarkdownInput/MarkdownInput.esm.js} +11 -10
  5. package/dist/components/common/MarkdownInput/MarkdownInput.esm.js.map +1 -0
  6. package/dist/components/common/MarkdownInput/MarkdownInput.module.css.esm.js +8 -0
  7. package/dist/components/common/MarkdownInput/MarkdownInput.module.css.esm.js.map +1 -0
  8. package/dist/components/riScDialog/ConfigRiscInfo.esm.js +2 -2
  9. package/dist/components/riScDialog/ConfigRiscInfo.esm.js.map +1 -1
  10. package/dist/components/riScDialog/MatrixDialog.esm.js +22 -49
  11. package/dist/components/riScDialog/MatrixDialog.esm.js.map +1 -1
  12. package/dist/components/riScDialog/RiScDialog.esm.js +169 -132
  13. package/dist/components/riScDialog/RiScDialog.esm.js.map +1 -1
  14. package/dist/components/riScDialog/RiScDialog.module.css.esm.js +2 -2
  15. package/dist/components/riScDialog/SupportDialog.esm.js +48 -35
  16. package/dist/components/riScDialog/SupportDialog.esm.js.map +1 -1
  17. package/dist/components/riScInfo/MigrationDialog.esm.js +41 -37
  18. package/dist/components/riScInfo/MigrationDialog.esm.js.map +1 -1
  19. package/dist/components/riScInfo/PublishDialog.esm.js +51 -40
  20. package/dist/components/riScInfo/PublishDialog.esm.js.map +1 -1
  21. package/dist/components/riScInfo/RiScSelectionCard.module.css.esm.js +2 -2
  22. package/dist/components/riScPlugin/FeedbackDialog.esm.js +1 -1
  23. package/dist/components/riScPlugin/FeedbackDialog.esm.js.map +1 -1
  24. package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js +10 -16
  25. package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js.map +1 -1
  26. package/dist/components/riskMatrix/Tabs.esm.js +4 -2
  27. package/dist/components/riskMatrix/Tabs.esm.js.map +1 -1
  28. package/dist/components/riskMatrix/Tabs.module.css.esm.js +2 -2
  29. package/dist/components/riskMatrix/tabsStyle.esm.js +15 -0
  30. package/dist/components/riskMatrix/tabsStyle.esm.js.map +1 -0
  31. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +1 -0
  32. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -1
  33. package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js +1 -1
  34. package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js +37 -31
  35. package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js.map +1 -1
  36. package/dist/components/scenarioDrawer/components/ScenarioDrawer.module.css.esm.js +8 -0
  37. package/dist/components/scenarioDrawer/components/ScenarioDrawer.module.css.esm.js.map +1 -0
  38. package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js +1 -1
  39. package/dist/components/scenarioWizard/ScenarioWizard.module.css.esm.js +8 -0
  40. package/dist/components/scenarioWizard/ScenarioWizard.module.css.esm.js.map +1 -0
  41. package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js +18 -16
  42. package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js.map +1 -1
  43. package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +1 -1
  44. package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js +1 -1
  45. package/dist/utils/style.esm.js +2 -4
  46. package/dist/utils/style.esm.js.map +1 -1
  47. package/dist/utils/utilityfunctions.esm.js +4 -1
  48. package/dist/utils/utilityfunctions.esm.js.map +1 -1
  49. package/package.json +1 -1
  50. package/dist/components/common/MarkdownInput.esm.js.map +0 -1
  51. package/dist/components/common/mixins.esm.js +0 -12
  52. package/dist/components/common/mixins.esm.js.map +0 -1
package/css/theme.css CHANGED
@@ -55,6 +55,9 @@ Remember to prefix custom styles with 'ros-' to avoid conflicts with other plugi
55
55
  --ros-risc-status-not-published: var(--ros-orange-400);
56
56
  --ros-risc-status-error: var(--ros-red-700);
57
57
 
58
+ --ros-input-text-color: #757575;
59
+ --ros-input-disabledBackground: rgba(0, 0, 0, 0.12);
60
+
58
61
  /* -------Button styles------- */
59
62
  .ros-button-red {
60
63
  background-color: var(--ros-red-bright);
@@ -81,4 +84,7 @@ Remember to prefix custom styles with 'ros-' to avoid conflicts with other plugi
81
84
  --ros-risc-status-very-outdated: var(--ros-red-300);
82
85
  --ros-risc-status-not-published: var(--ros-orange-100);
83
86
  --ros-risc-status-error: var(--ros-red-700);
87
+
88
+ --ros-input-text-color: #ffffff80;
89
+ --ros-input-disabledBackground: rgba(255, 255, 255, 0.12);
84
90
  }
@@ -24,7 +24,7 @@ const Input = forwardRef(
24
24
  InputProps: {
25
25
  sx: (theme) => ({
26
26
  "&.Mui-disabled": {
27
- color: commonTextColor(theme, true)
27
+ color: commonTextColor(theme)
28
28
  }
29
29
  })
30
30
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Input.esm.js","sources":["../../../src/components/common/Input.tsx"],"sourcesContent":["import FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport { forwardRef } from 'react';\nimport { formHelperText, formLabel } from './typography';\nimport { commonTextColor, formControlStyles } from '../../utils/style';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n};\n\nexport const Input = forwardRef<HTMLInputElement, Props>(\n ({ label, sublabel, error, helperText, required, ...props }, ref) => {\n return (\n <FormControl sx={formControlStyles} error={error} required={required}>\n {label && (\n <FormLabel required={required} sx={formLabel}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <TextField\n id=\"filled-multiline-static\"\n error={error}\n multiline\n fullWidth\n variant=\"outlined\"\n inputRef={ref}\n InputProps={{\n sx: theme => ({\n '&.Mui-disabled': {\n color: commonTextColor(theme, true),\n },\n }),\n }}\n {...props}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAYO,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,CAAC,EAAE,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,YAAY,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACnE,IAAA,uBACE,IAAA,CAAC,WAAA,EAAA,EAAY,EAAA,EAAI,iBAAA,EAAmB,OAAc,QAAA,EAC/C,QAAA,EAAA;AAAA,MAAA,KAAA,oBACC,GAAA,CAAC,SAAA,EAAA,EAAU,QAAA,EAAoB,EAAA,EAAI,WAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,MAED,QAAA,oBACC,GAAA,CAAC,cAAA,EAAA,EAAe,EAAA,EAAI,gBAAiB,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAG,yBAAA;AAAA,UACH,KAAA;AAAA,UACA,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAS,IAAA;AAAA,UACT,OAAA,EAAQ,UAAA;AAAA,UACR,QAAA,EAAU,GAAA;AAAA,UACV,UAAA,EAAY;AAAA,YACV,IAAI,CAAA,KAAA,MAAU;AAAA,cACZ,gBAAA,EAAkB;AAAA,gBAChB,KAAA,EAAO,eAAA,CAAgB,KAAA,EAAO,IAAI;AAAA;AACpC,aACF;AAAA,WACF;AAAA,UACC,GAAG;AAAA;AAAA,OACN;AAAA,MACC,UAAA,oBAAc,GAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAA,UAAA,EAAW;AAAA,KAAA,EAC7C,CAAA;AAAA,EAEJ;AACF;;;;"}
1
+ {"version":3,"file":"Input.esm.js","sources":["../../../src/components/common/Input.tsx"],"sourcesContent":["import FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport TextField, { TextFieldProps } from '@mui/material/TextField';\nimport { forwardRef } from 'react';\nimport { formHelperText, formLabel } from './typography';\nimport { commonTextColor, formControlStyles } from '../../utils/style';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n};\n\nexport const Input = forwardRef<HTMLInputElement, Props>(\n ({ label, sublabel, error, helperText, required, ...props }, ref) => {\n return (\n <FormControl sx={formControlStyles} error={error} required={required}>\n {label && (\n <FormLabel required={required} sx={formLabel}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <TextField\n id=\"filled-multiline-static\"\n error={error}\n multiline\n fullWidth\n variant=\"outlined\"\n inputRef={ref}\n InputProps={{\n sx: theme => ({\n '&.Mui-disabled': {\n color: commonTextColor(theme, true),\n },\n }),\n }}\n {...props}\n />\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;AAYO,MAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,CAAC,EAAE,KAAA,EAAO,QAAA,EAAU,KAAA,EAAO,YAAY,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACnE,IAAA,uBACE,IAAA,CAAC,WAAA,EAAA,EAAY,EAAA,EAAI,iBAAA,EAAmB,OAAc,QAAA,EAC/C,QAAA,EAAA;AAAA,MAAA,KAAA,oBACC,GAAA,CAAC,SAAA,EAAA,EAAU,QAAA,EAAoB,EAAA,EAAI,WAChC,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,MAED,QAAA,oBACC,GAAA,CAAC,cAAA,EAAA,EAAe,EAAA,EAAI,gBAAiB,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,SAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAG,yBAAA;AAAA,UACH,KAAA;AAAA,UACA,SAAA,EAAS,IAAA;AAAA,UACT,SAAA,EAAS,IAAA;AAAA,UACT,OAAA,EAAQ,UAAA;AAAA,UACR,QAAA,EAAU,GAAA;AAAA,UACV,UAAA,EAAY;AAAA,YACV,IAAI,CAAA,KAAA,MAAU;AAAA,cACZ,gBAAA,EAAkB;AAAA,gBAChB,KAAA,EAAO,eAAA,CAAgB,KAAW;AAAA;AACpC,aACF;AAAA,WACF;AAAA,UACC,GAAG;AAAA;AAAA,OACN;AAAA,MACC,UAAA,oBAAc,GAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAA,UAAA,EAAW;AAAA,KAAA,EAC7C,CAAA;AAAA,EAEJ;AACF;;;;"}
@@ -4,9 +4,10 @@ import FormControl from '@mui/material/FormControl';
4
4
  import FormHelperText from '@mui/material/FormHelperText';
5
5
  import FormLabel from '@mui/material/FormLabel';
6
6
  import MDEditor from '@uiw/react-md-editor';
7
- import { formLabel, formHelperText } from './typography.esm.js';
8
- import { useTheme } from '@mui/material/styles';
9
- import { formControlStyles, commonBackgroundColor, commonTextColor } from '../../utils/style.esm.js';
7
+ import { formLabel, formHelperText } from '../typography.esm.js';
8
+ import classNames from 'classnames';
9
+ import { getActiveTheme } from '../../../utils/utilityfunctions.esm.js';
10
+ import styles from './MarkdownInput.module.css.esm.js';
10
11
 
11
12
  const MarkdownInput = forwardRef(
12
13
  ({
@@ -22,7 +23,6 @@ const MarkdownInput = forwardRef(
22
23
  const [markdownContent, setMarkdownContent] = useState(
23
24
  value
24
25
  );
25
- const theme = useTheme();
26
26
  useEffect(() => {
27
27
  setMarkdownContent(value);
28
28
  }, [value]);
@@ -41,14 +41,18 @@ const MarkdownInput = forwardRef(
41
41
  }
42
42
  }
43
43
  };
44
- return /* @__PURE__ */ jsxs(FormControl, { sx: formControlStyles, error, children: [
44
+ const editorClassName = classNames(styles.MarkDownInput, {
45
+ [styles["MarkDownInput--disabled"]]: disabled
46
+ });
47
+ return /* @__PURE__ */ jsxs(FormControl, { className: styles.MarkDownInputFormControl, error, children: [
45
48
  label && /* @__PURE__ */ jsx(FormLabel, { sx: formLabel, children: label }),
46
49
  sublabel && /* @__PURE__ */ jsx(FormHelperText, { sx: formHelperText, children: sublabel }),
47
50
  /* @__PURE__ */ jsx(
48
51
  "div",
49
52
  {
50
- "data-color-mode": theme.palette.mode,
51
53
  onFocusCapture,
54
+ "data-color-mode": getActiveTheme(),
55
+ className: styles.MarkDownInputWrapper,
52
56
  children: /* @__PURE__ */ jsx(
53
57
  MDEditor,
54
58
  {
@@ -57,10 +61,7 @@ const MarkdownInput = forwardRef(
57
61
  onChange: handleMarkdownChange,
58
62
  preview: "edit",
59
63
  height: minRows ? minRows * 24 : 64,
60
- style: {
61
- color: commonTextColor(theme, disabled),
62
- backgroundColor: commonBackgroundColor(theme, disabled)
63
- }
64
+ className: editorClassName
64
65
  }
65
66
  )
66
67
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownInput.esm.js","sources":["../../../../src/components/common/MarkdownInput/MarkdownInput.tsx"],"sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport MDEditor from '@uiw/react-md-editor';\nimport { formHelperText, formLabel } from '../typography';\nimport { TextFieldProps } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { getActiveTheme } from '../../../utils/utilityfunctions';\nimport styles from './MarkdownInput.module.css';\n\ntype Props = TextFieldProps & {\n sublabel?: string;\n value?: string;\n onMarkdownChange?: (markdown: string) => void;\n minRows?: number;\n};\n\nexport const MarkdownInput = forwardRef<HTMLDivElement, Props>(\n (\n {\n label,\n sublabel,\n error,\n helperText,\n minRows,\n value,\n onMarkdownChange,\n disabled = false,\n },\n ref,\n ) => {\n const [markdownContent, setMarkdownContent] = useState<string | undefined>(\n value,\n );\n\n useEffect(() => {\n setMarkdownContent(value);\n }, [value]);\n\n const handleMarkdownChange = (newValue: string | undefined) => {\n setMarkdownContent(newValue || '');\n onMarkdownChange?.(newValue || '');\n };\n\n const onFocusCapture = (event: React.FocusEvent<HTMLDivElement>) => {\n if (event.relatedTarget) {\n const root = event.currentTarget as HTMLDivElement;\n const target = root.querySelector(\n 'textarea, [contenteditable=\"true\"]',\n ) as HTMLElement | null;\n if (target) {\n setTimeout(() => target.focus());\n }\n }\n };\n const editorClassName = classNames(styles.MarkDownInput, {\n [styles['MarkDownInput--disabled']]: disabled,\n });\n\n return (\n <FormControl className={styles.MarkDownInputFormControl} error={error}>\n {label && <FormLabel sx={formLabel}>{label}</FormLabel>}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n <div\n onFocusCapture={onFocusCapture}\n data-color-mode={getActiveTheme()}\n className={styles.MarkDownInputWrapper}\n >\n <MDEditor\n ref={ref}\n value={markdownContent}\n onChange={handleMarkdownChange}\n preview=\"edit\"\n height={minRows ? minRows * 24 : 64}\n className={editorClassName}\n />\n </div>\n {helperText && <FormHelperText>{helperText}</FormHelperText>}\n </FormControl>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;AAkBO,MAAM,aAAA,GAAgB,UAAA;AAAA,EAC3B,CACE;AAAA,IACE,KAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,QAAA,GAAW;AAAA,KAEb,GAAA,KACG;AACH,IAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,QAAA;AAAA,MAC5C;AAAA,KACF;AAEA,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,kBAAA,CAAmB,KAAK,CAAA;AAAA,IAC1B,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,IAAA,MAAM,oBAAA,GAAuB,CAAC,QAAA,KAAiC;AAC7D,MAAA,kBAAA,CAAmB,YAAY,EAAE,CAAA;AACjC,MA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AA;AACb;AAAA,OACF;AAAA,MACC,UAAA,oBAAc,GAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAA,UAAA,EAAW;AAAA,KAAA,EAC7C,CAAA;AAAA,EAEJ;AACF;;;;"}
@@ -0,0 +1,8 @@
1
+ import styleInject from '../../../node_modules_dist/style-inject/dist/style-inject.es.esm.js';
2
+
3
+ var css_248z = ".MarkdownInput-module_MarkDownInput__cJtct {\n color: inherit;\n background-color: inherit;\n border: none;\n box-shadow: none;\n}\n\n.MarkdownInput-module_MarkDownInputFormControl__C-zxH {\n width: 100%;\n gap: 4px;\n}\n\n.MarkdownInput-module_MarkDownInput--disabled__rDXm- {\n color: var(--ros-input-text-color);\n background-color: var(--ros-input-disabledBackground);\n}\n\n.MarkdownInput-module_MarkDownInputWrapper__CarVS {\n border: 1px solid rgba(0, 0, 0, 0.23);\n border-radius: 4px;\n}\n\n[data-theme-mode='dark'] {\n .MarkdownInput-module_MarkDownInputWrapper__CarVS {\n border: 1px solid rgba(255, 255, 255, 0.23);\n }\n}\n";
4
+ var styles = {"MarkDownInput":"MarkdownInput-module_MarkDownInput__cJtct","MarkDownInputFormControl":"MarkdownInput-module_MarkDownInputFormControl__C-zxH","MarkDownInput--disabled":"MarkdownInput-module_MarkDownInput--disabled__rDXm-","MarkDownInputWrapper":"MarkdownInput-module_MarkDownInputWrapper__CarVS"};
5
+ styleInject(css_248z);
6
+
7
+ export { styles as default };
8
+ //# sourceMappingURL=MarkdownInput.module.css.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownInput.module.css.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { MarkdownInput } from '../common/MarkdownInput.esm.js';
2
+ import { MarkdownInput } from '../common/MarkdownInput/MarkdownInput.esm.js';
3
3
  import { Input } from '../common/Input.esm.js';
4
4
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
5
  import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
@@ -8,7 +8,7 @@ import { Flex } from '@backstage/ui';
8
8
  function ConfigRiscInfo(props) {
9
9
  const { t } = useTranslationRef(pluginRiScTranslationRef);
10
10
  const currentScope = props.watch("content.scope");
11
- return /* @__PURE__ */ jsxs(Flex, { gap: "16px", direction: "column", children: [
11
+ return /* @__PURE__ */ jsxs(Flex, { gap: "16px", direction: "column", px: "1px", children: [
12
12
  /* @__PURE__ */ jsx(
13
13
  Input,
14
14
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigRiscInfo.esm.js","sources":["../../../src/components/riScDialog/ConfigRiscInfo.tsx"],"sourcesContent":["import { MarkdownInput } from '../common/MarkdownInput';\nimport { Input } from '../common/Input';\nimport {\n UseFormRegister,\n UseFormSetValue,\n UseFormWatch,\n} from 'react-hook-form/dist/types/form';\nimport { RiScWithMetadata } from '../../utils/types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\nimport { Flex } from '@backstage/ui';\n\ninterface ConfigRiscInfoProps {\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n setValue: UseFormSetValue<RiScWithMetadata>;\n watch: UseFormWatch<RiScWithMetadata>;\n}\n\nfunction ConfigRiscInfo(props: ConfigRiscInfoProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const currentScope = props.watch('content.scope');\n return (\n <Flex gap=\"16px\" direction=\"column\">\n <Input\n required\n {...props.register('content.title', { required: true })}\n error={props.errors?.content?.title !== undefined}\n label={t('dictionary.title')}\n helperText={props.errors?.content?.title && t('rosDialog.titleError')}\n />\n <MarkdownInput\n {...props.register('content.scope')}\n value={currentScope}\n label={t('dictionary.scope')}\n sublabel={t('rosDialog.scopeDescription')}\n error={props.errors?.content?.scope !== undefined}\n minRows={8}\n onMarkdownChange={value => props.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","sources":["../../../src/components/riScDialog/ConfigRiscInfo.tsx"],"sourcesContent":["import { MarkdownInput } from '../common/MarkdownInput';\nimport { Input } from '../common/Input';\nimport {\n UseFormRegister,\n UseFormSetValue,\n UseFormWatch,\n} from 'react-hook-form/dist/types/form';\nimport { RiScWithMetadata } from '../../utils/types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\nimport { Flex } from '@backstage/ui';\n\ninterface ConfigRiscInfoProps {\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n setValue: UseFormSetValue<RiScWithMetadata>;\n watch: UseFormWatch<RiScWithMetadata>;\n}\n\nfunction ConfigRiscInfo(props: ConfigRiscInfoProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const currentScope = props.watch('content.scope');\n return (\n <Flex gap=\"16px\" direction=\"column\" px=\"1px\">\n <Input\n required\n {...props.register('content.title', { required: true })}\n error={props.errors?.content?.title !== undefined}\n label={t('dictionary.title')}\n helperText={props.errors?.content?.title && t('rosDialog.titleError')}\n />\n <MarkdownInput\n {...props.register('content.scope')}\n value={currentScope}\n label={t('dictionary.scope')}\n sublabel={t('rosDialog.scopeDescription')}\n error={props.errors?.content?.scope !== undefined}\n minRows={8}\n onMarkdownChange={value => props.setValue('content.scope', value)}\n />\n </Flex>\n );\n}\n\nexport default ConfigRiscInfo;\n"],"names":[],"mappings":";;;;;;;AAoBA,SAAS,eAAe,KAAA,EAA4B;AAClD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,MAAM,YAAA,GAAe,KAAA,CAAM,KAAA,CAAM,eAAe,CAAA;AAChD,EAAA,4BACG,IAAA,EAAA,EAAK,GAAA,EAAI,QAAO,SAAA,EAAU,QAAA,EAAS,IAAG,KAAA,EACrC,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAQ,IAAA;AAAA,QACP,GAAG,KAAA,CAAM,QAAA,CAAS,iBAAiB,EAAE,QAAA,EAAU,MAAM,CAAA;AAAA,QACtD,KAAA,EAAO,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,KAAA,KAAU,MAAA;AAAA,QACxC,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,QAC3B,YAAY,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,KAAA,IAAS,EAAE,sBAAsB;AAAA;AAAA,KACtE;AAAA,oBACA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACE,GAAG,KAAA,CAAM,QAAA,CAAS,eAAe,CAAA;AAAA,QAClC,KAAA,EAAO,YAAA;AAAA,QACP,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,QAC3B,QAAA,EAAU,EAAE,4BAA4B,CAAA;AAAA,QACxC,KAAA,EAAO,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,KAAA,KAAU,MAAA;AAAA,QACxC,OAAA,EAAS,CAAA;AAAA,QACT,gBAAA,EAAkB,CAAA,KAAA,KAAS,KAAA,CAAM,QAAA,CAAS,iBAAiB,KAAK;AAAA;AAAA;AAClE,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -1,63 +1,36 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable.esm.js';
3
- import CloseIcon from '@mui/icons-material/Close';
4
3
  import { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable.esm.js';
5
4
  import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
6
5
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
7
6
  import Box from '@mui/material/Box';
8
- import Dialog from '@mui/material/Dialog';
9
- import DialogTitle from '@mui/material/DialogTitle';
10
- import IconButton from '@mui/material/IconButton';
11
- import DialogContent from '@mui/material/DialogContent';
12
- import DialogActions from '@mui/material/DialogActions';
13
- import { Text, Button } from '@backstage/ui';
7
+ import { DialogTrigger, Dialog, DialogHeader, Text, DialogBody, DialogFooter, Button } from '@backstage/ui';
8
+ import styles from './RiScDialog.module.css.esm.js';
14
9
 
15
10
  function MatrixDialog({
16
11
  open,
17
12
  close
18
13
  }) {
19
14
  const { t } = useTranslationRef(pluginRiScTranslationRef);
20
- return /* @__PURE__ */ jsxs(Dialog, { maxWidth: "lg", open, onClose: close, children: [
21
- /* @__PURE__ */ jsx(DialogTitle, { children: t("scenarioDrawer.riskMatrixModal.title") }),
22
- /* @__PURE__ */ jsx(
23
- IconButton,
24
- {
25
- "aria-label": "close",
26
- onClick: close,
27
- sx: {
28
- position: "absolute",
29
- right: 8,
30
- top: 8,
31
- color: (theme) => theme.palette.grey[500]
32
- },
33
- children: /* @__PURE__ */ jsx(CloseIcon, {})
34
- }
35
- ),
36
- /* @__PURE__ */ jsxs(DialogContent, { children: [
37
- /* @__PURE__ */ jsx(Text, { as: "p", variant: "body-large", style: { paddingBottom: "32px" }, children: t("scenarioStepper.initialRiskStep.subtitle") }),
38
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
39
- Text,
40
- {
41
- variant: "title-x-small",
42
- weight: "bold",
43
- style: { paddingBottom: "4px" },
44
- children: t("dictionary.probability")
45
- }
46
- ) }),
47
- /* @__PURE__ */ jsx(ProbabilityTableInfoWithHeaders, {}),
48
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
49
- Text,
50
- {
51
- variant: "title-x-small",
52
- weight: "bold",
53
- style: { paddingTop: "32px", paddingBottom: "4px" },
54
- children: t("dictionary.consequence")
55
- }
56
- ) }),
57
- /* @__PURE__ */ jsx(ConsequenceTableInfoWithHeaders, {})
58
- ] }),
59
- /* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: close, children: t("dictionary.close") }) })
60
- ] });
15
+ return /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
16
+ Dialog,
17
+ {
18
+ isOpen: open,
19
+ onOpenChange: close,
20
+ className: styles.matrixDialog,
21
+ children: [
22
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", weight: "bold", children: t("scenarioDrawer.riskMatrixModal.title") }) }),
23
+ /* @__PURE__ */ jsxs(DialogBody, { children: [
24
+ /* @__PURE__ */ jsx(Text, { as: "p", variant: "body-large", className: styles.matrixDialogBody, children: t("scenarioStepper.initialRiskStep.subtitle") }),
25
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", weight: "bold", children: t("dictionary.probability") }) }),
26
+ /* @__PURE__ */ jsx(ProbabilityTableInfoWithHeaders, {}),
27
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", weight: "bold", children: t("dictionary.consequence") }) }),
28
+ /* @__PURE__ */ jsx(ConsequenceTableInfoWithHeaders, {})
29
+ ] }),
30
+ /* @__PURE__ */ jsx(DialogFooter, { className: styles.matrixDialogFooter, children: /* @__PURE__ */ jsx(Button, { onClick: close, children: t("dictionary.close") }) })
31
+ ]
32
+ }
33
+ ) });
61
34
  }
62
35
 
63
36
  export { MatrixDialog };
@@ -1 +1 @@
1
- {"version":3,"file":"MatrixDialog.esm.js","sources":["../../../src/components/riScDialog/MatrixDialog.tsx"],"sourcesContent":["import { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Box from '@mui/material/Box';\nimport Dialog from '@mui/material/Dialog';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport IconButton from '@mui/material/IconButton';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogActions from '@mui/material/DialogActions';\nimport { Button, Text } from '@backstage/ui';\n\nexport function MatrixDialog({\n open,\n close,\n}: {\n open: boolean;\n close: () => void;\n}) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n return (\n <Dialog maxWidth=\"lg\" open={open} onClose={close}>\n <DialogTitle>{t('scenarioDrawer.riskMatrixModal.title')}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={close}\n sx={{\n position: 'absolute',\n right: 8,\n top: 8,\n color: theme => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n <DialogContent>\n <Text as=\"p\" variant=\"body-large\" style={{ paddingBottom: '32px' }}>\n {t('scenarioStepper.initialRiskStep.subtitle')}\n </Text>\n <Box>\n <Text\n variant=\"title-x-small\"\n weight=\"bold\"\n style={{ paddingBottom: '4px' }}\n >\n {t('dictionary.probability')}\n </Text>\n </Box>\n <ProbabilityTableInfoWithHeaders />\n <Box>\n <Text\n variant=\"title-x-small\"\n weight=\"bold\"\n style={{ paddingTop: '32px', paddingBottom: '4px' }}\n >\n {t('dictionary.consequence')}\n </Text>\n </Box>\n <ConsequenceTableInfoWithHeaders />\n </DialogContent>\n <DialogActions>\n <Button onClick={close}>{t('dictionary.close')}</Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAaO,SAAS,YAAA,CAAa;AAAA,EAC3B,IAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAA,4BACG,MAAA,EAAA,EAAO,QAAA,EAAS,IAAA,EAAK,IAAA,EAAY,SAAS,KAAA,EACzC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAA,EAAA,EAAa,QAAA,EAAA,CAAA,CAAE,sCAAsC,CAA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,GAAA,CAAC,iBACC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,SAAS,KAAA,EAAQ,QAAA,EAAA,CAAA,CAAE,kBAAkB,CAAA,EAAE,CAAA,EACjD;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"MatrixDialog.esm.js","sources":["../../../src/components/riScDialog/MatrixDialog.tsx"],"sourcesContent":["import { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable';\nimport { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Box from '@mui/material/Box';\nimport {\n Button,\n Text,\n Dialog,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTrigger,\n} from '@backstage/ui';\nimport styles from './RiScDialog.module.css';\n\nexport function MatrixDialog({\n open,\n close,\n}: {\n open: boolean;\n close: () => void;\n}) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n return (\n <DialogTrigger>\n <Dialog\n isOpen={open}\n onOpenChange={close}\n className={styles.matrixDialog}\n >\n <DialogHeader>\n <Text variant=\"title-x-small\" weight=\"bold\">\n {t('scenarioDrawer.riskMatrixModal.title')}\n </Text>\n </DialogHeader>\n <DialogBody>\n <Text as=\"p\" variant=\"body-large\" className={styles.matrixDialogBody}>\n {t('scenarioStepper.initialRiskStep.subtitle')}\n </Text>\n <Box>\n <Text variant=\"title-x-small\" weight=\"bold\">\n {t('dictionary.probability')}\n </Text>\n </Box>\n <ProbabilityTableInfoWithHeaders />\n <Box>\n <Text variant=\"title-x-small\" weight=\"bold\">\n {t('dictionary.consequence')}\n </Text>\n </Box>\n <ConsequenceTableInfoWithHeaders />\n </DialogBody>\n <DialogFooter className={styles.matrixDialogFooter}>\n <Button onClick={close}>{t('dictionary.close')}</Button>\n </DialogFooter>\n </Dialog>\n </DialogTrigger>\n );\n}\n"],"names":[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AAgC;AAAA,SAAA,EACnC,CAAA;AAAA,wBACA,GAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAW,MAAA,CAAO,kBAAA,EAC9B,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAS,KAAA,EAAQ,QAAA,EAAA,CAAA,CAAE,kBAAkB,CAAA,EAAE,CAAA,EACjD;AAAA;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
@@ -1,21 +1,15 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useState, useEffect } from 'react';
3
3
  import { emptyRiSc, isDeeplyEqual } from '../../utils/utilityfunctions.esm.js';
4
4
  import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
5
5
  import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
6
6
  import { useRiScs } from '../../contexts/RiScContext.esm.js';
7
7
  import { useForm } from 'react-hook-form';
8
- import Dialog from '@mui/material/Dialog';
9
- import DialogContent from '@mui/material/DialogContent';
10
- import DialogTitle from '@mui/material/DialogTitle';
11
- import DialogActions from '@mui/material/DialogActions';
12
- import { dialogActions } from '../common/mixins.esm.js';
13
8
  import { Stepper, Step, StepLabel } from '@mui/material';
14
9
  import ConfigEncryptionDialog from './ConfigEncryptionDialog.esm.js';
15
10
  import ConfigRiscInfo from './ConfigRiscInfo.esm.js';
16
11
  import ConfigInitialRisc from './ConfigInitialRisc.esm.js';
17
- import { Text, Button, Flex } from '@backstage/ui';
18
- import Divider from '@mui/material/Divider';
12
+ import { DialogTrigger, Dialog, DialogHeader, Text, DialogBody, Flex, Button, DialogFooter } from '@backstage/ui';
19
13
  import styles from './RiScDialog.module.css.esm.js';
20
14
  import { useDefaultRiScTypeDescriptors } from '../../contexts/DefaultRiScTypesContext.esm.js';
21
15
 
@@ -133,136 +127,179 @@ function RiScDialog({
133
127
  onClose();
134
128
  });
135
129
  if (dialogState === 1 /* Create */) {
136
- return /* @__PURE__ */ jsxs(Dialog, { open: true, onClose, children: [
137
- /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", children: t("rosDialog.titleNew") }) }),
138
- /* @__PURE__ */ jsxs(DialogContent, { children: [
139
- /* @__PURE__ */ jsx(RiScStepper, { activeStep }),
140
- /* @__PURE__ */ jsx(Divider, { className: styles.subtitleDivider }),
141
- /* @__PURE__ */ jsxs(
142
- Text,
143
- {
144
- as: "h2",
145
- variant: "title-x-small",
146
- weight: "bold",
147
- className: styles.subtitle,
148
- children: [
149
- activeStep === 0 && t("rosDialog.initialRiscTitle"),
150
- activeStep === 1 && t("rosDialog.titleAndScope"),
151
- activeStep === 2 && t("rosDialog.stepEncryption")
152
- ]
153
- }
154
- ),
155
- activeStep === 0 && /* @__PURE__ */ jsx(
156
- ConfigInitialRisc,
157
- {
158
- dialogState,
159
- switchOn,
160
- setSwitchOn,
161
- setValue,
162
- selectedRiScId,
163
- setSelectedRiScId
164
- }
165
- ),
166
- activeStep === 1 && /* @__PURE__ */ jsx(
167
- ConfigRiscInfo,
168
- {
169
- register,
170
- errors,
171
- setValue,
172
- watch
173
- }
174
- ),
175
- activeStep === 2 && /* @__PURE__ */ jsx(
176
- ConfigEncryptionDialog,
177
- {
178
- gcpCryptoKeys,
179
- setValue,
180
- state: dialogState,
181
- register,
182
- errors
183
- }
184
- )
185
- ] }),
186
- /* @__PURE__ */ jsxs(DialogActions, { sx: dialogActions, children: [
187
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
188
- /* @__PURE__ */ jsxs(Flex, { children: [
189
- /* @__PURE__ */ jsx(
190
- Button,
191
- {
192
- size: "medium",
193
- variant: "secondary",
194
- isDisabled: activeStep === 0,
195
- onClick: handleBack,
196
- children: t("dictionary.previous")
197
- }
198
- ),
199
- activeStep < 2 ? /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleNext, children: t("dictionary.next") }) : /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.save") })
200
- ] })
201
- ] })
202
- ] });
130
+ return /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
131
+ Dialog,
132
+ {
133
+ isOpen: true,
134
+ onOpenChange: onClose,
135
+ className: styles.createRiscDialog,
136
+ children: [
137
+ /* @__PURE__ */ jsx(DialogHeader, { className: styles.initRiscDialogTitle, children: /* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", children: t("rosDialog.titleNew") }) }),
138
+ /* @__PURE__ */ jsxs(DialogBody, { className: styles.riscDialogBody, children: [
139
+ /* @__PURE__ */ jsx(RiScStepper, { activeStep }),
140
+ /* @__PURE__ */ jsxs(
141
+ Text,
142
+ {
143
+ as: "h2",
144
+ variant: "title-x-small",
145
+ weight: "bold",
146
+ className: styles.subtitle,
147
+ children: [
148
+ activeStep === 0 && t("rosDialog.initialRiscTitle"),
149
+ activeStep === 1 && t("rosDialog.titleAndScope"),
150
+ activeStep === 2 && t("rosDialog.stepEncryption")
151
+ ]
152
+ }
153
+ ),
154
+ activeStep === 0 && /* @__PURE__ */ jsx(
155
+ ConfigInitialRisc,
156
+ {
157
+ dialogState,
158
+ switchOn,
159
+ setSwitchOn,
160
+ setValue,
161
+ selectedRiScId,
162
+ setSelectedRiScId
163
+ }
164
+ ),
165
+ activeStep === 1 && /* @__PURE__ */ jsx(
166
+ ConfigRiscInfo,
167
+ {
168
+ register,
169
+ errors,
170
+ setValue,
171
+ watch
172
+ }
173
+ ),
174
+ activeStep === 2 && /* @__PURE__ */ jsx(
175
+ ConfigEncryptionDialog,
176
+ {
177
+ gcpCryptoKeys,
178
+ setValue,
179
+ state: dialogState,
180
+ register,
181
+ errors
182
+ }
183
+ ),
184
+ /* @__PURE__ */ jsxs(Flex, { pt: "16px", justify: "between", children: [
185
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
186
+ /* @__PURE__ */ jsxs(Flex, { children: [
187
+ /* @__PURE__ */ jsx(
188
+ Button,
189
+ {
190
+ size: "medium",
191
+ variant: "secondary",
192
+ isDisabled: activeStep === 0,
193
+ onClick: handleBack,
194
+ children: t("dictionary.previous")
195
+ }
196
+ ),
197
+ activeStep < 2 ? /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleNext, children: t("dictionary.next") }) : /* @__PURE__ */ jsx(
198
+ Button,
199
+ {
200
+ size: "medium",
201
+ variant: "primary",
202
+ onClick: handleFinish,
203
+ children: t("dictionary.save")
204
+ }
205
+ )
206
+ ] })
207
+ ] })
208
+ ] })
209
+ ]
210
+ }
211
+ ) });
203
212
  }
204
213
  if (dialogState === 5 /* Delete */) {
205
- return /* @__PURE__ */ jsxs(Dialog, { open: true, onClose, children: [
206
- /* @__PURE__ */ jsx(DialogTitle, { children: t("deleteDialog.title") }),
207
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContent, { children: t("deleteDialog.confirmationMessage") }) }),
208
- /* @__PURE__ */ jsxs(DialogActions, { children: [
209
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
210
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.delete") })
211
- ] })
212
- ] });
214
+ return /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
215
+ Dialog,
216
+ {
217
+ isOpen: true,
218
+ onOpenChange: onClose,
219
+ className: styles.createRiscDialog,
220
+ children: [
221
+ /* @__PURE__ */ jsx(DialogHeader, { className: styles.riscDialogTitle, children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", weight: "bold", children: t("deleteDialog.title") }) }),
222
+ /* @__PURE__ */ jsx(DialogBody, { className: styles.riscDialogBody, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
223
+ t("deleteDialog.confirmationMessage"),
224
+ /* @__PURE__ */ jsxs(Flex, { justify: "between", pt: "16px", children: [
225
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
226
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.delete") })
227
+ ] })
228
+ ] }) })
229
+ ]
230
+ }
231
+ ) });
213
232
  }
214
233
  if (dialogState === 2 /* EditRiscInfo */) {
215
- return /* @__PURE__ */ jsxs(Dialog, { open: true, onClose, children: [
216
- /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", children: t("rosDialog.titleEdit") }) }),
217
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
218
- ConfigRiscInfo,
219
- {
220
- register,
221
- errors,
222
- setValue,
223
- watch
224
- }
225
- ) }),
226
- /* @__PURE__ */ jsxs(DialogActions, { sx: dialogActions, children: [
227
- /* @__PURE__ */ jsxs(
228
- Button,
229
- {
230
- size: "medium",
231
- variant: "tertiary",
232
- onClick: onDelete,
233
- className: styles.deleteButton,
234
- children: [
235
- /* @__PURE__ */ jsx("i", { className: `ri-delete-bin-line ${styles.deleteButtonIcon}` }),
236
- t("contentHeader.deleteButton")
237
- ]
238
- }
239
- ),
240
- /* @__PURE__ */ jsxs(Flex, { children: [
241
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
242
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.save") })
243
- ] })
244
- ] })
245
- ] });
234
+ return /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
235
+ Dialog,
236
+ {
237
+ isOpen: true,
238
+ onOpenChange: onClose,
239
+ className: styles.createRiscDialog,
240
+ children: [
241
+ /* @__PURE__ */ jsx(DialogHeader, { className: styles.riscDialogTitle, children: /* @__PURE__ */ jsx(Text, { variant: "title-x-small", weight: "bold", children: t("rosDialog.titleEdit") }) }),
242
+ /* @__PURE__ */ jsx(DialogBody, { className: styles.riscDialogBody, children: /* @__PURE__ */ jsx(
243
+ ConfigRiscInfo,
244
+ {
245
+ register,
246
+ errors,
247
+ setValue,
248
+ watch
249
+ }
250
+ ) }),
251
+ /* @__PURE__ */ jsxs(DialogFooter, { className: styles.riscDialogFooter, children: [
252
+ /* @__PURE__ */ jsxs(
253
+ Button,
254
+ {
255
+ size: "medium",
256
+ variant: "tertiary",
257
+ onClick: onDelete,
258
+ className: styles.deleteButton,
259
+ children: [
260
+ /* @__PURE__ */ jsx("i", { className: `ri-delete-bin-line ${styles.deleteButtonIcon}` }),
261
+ t("contentHeader.deleteButton")
262
+ ]
263
+ }
264
+ ),
265
+ /* @__PURE__ */ jsxs(Flex, { children: [
266
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
267
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.save") })
268
+ ] })
269
+ ] })
270
+ ]
271
+ }
272
+ ) });
246
273
  }
247
274
  if (dialogState === 4 /* EditEncryption */) {
248
- return /* @__PURE__ */ jsxs(Dialog, { open: true, onClose, children: [
249
- /* @__PURE__ */ jsx(DialogTitle, { children: /* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", children: t("rosDialog.editEncryption") }) }),
250
- /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
251
- ConfigEncryptionDialog,
252
- {
253
- gcpCryptoKeys,
254
- sopsData: selectedRiSc?.sopsConfig,
255
- setValue,
256
- state: dialogState,
257
- register,
258
- errors
259
- }
260
- ) }),
261
- /* @__PURE__ */ jsxs(DialogActions, { sx: dialogActions, children: [
262
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
263
- /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.save") })
264
- ] })
265
- ] });
275
+ return /* @__PURE__ */ jsx(DialogTrigger, { children: /* @__PURE__ */ jsxs(
276
+ Dialog,
277
+ {
278
+ isOpen: true,
279
+ onOpenChange: onClose,
280
+ className: styles.createRiscDialog,
281
+ children: [
282
+ /* @__PURE__ */ jsx(DialogHeader, { className: styles.riscDialogTitle, children: /* @__PURE__ */ jsx(Text, { variant: "title-small", weight: "bold", children: t("rosDialog.editEncryption") }) }),
283
+ /* @__PURE__ */ jsxs(DialogBody, { className: styles.riscDialogBody, children: [
284
+ /* @__PURE__ */ jsx(
285
+ ConfigEncryptionDialog,
286
+ {
287
+ gcpCryptoKeys,
288
+ sopsData: selectedRiSc?.sopsConfig,
289
+ setValue,
290
+ state: dialogState,
291
+ register,
292
+ errors
293
+ }
294
+ ),
295
+ /* @__PURE__ */ jsxs(Flex, { justify: "between", className: styles.riscDialogFooter, children: [
296
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "secondary", onClick: onClose, children: t("dictionary.cancel") }),
297
+ /* @__PURE__ */ jsx(Button, { size: "medium", variant: "primary", onClick: handleFinish, children: t("dictionary.save") })
298
+ ] })
299
+ ] })
300
+ ]
301
+ }
302
+ ) });
266
303
  }
267
304
  return null;
268
305
  }