@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.
- package/css/theme.css +6 -0
- package/dist/components/common/Input.esm.js +1 -1
- package/dist/components/common/Input.esm.js.map +1 -1
- package/dist/components/common/{MarkdownInput.esm.js → MarkdownInput/MarkdownInput.esm.js} +11 -10
- package/dist/components/common/MarkdownInput/MarkdownInput.esm.js.map +1 -0
- package/dist/components/common/MarkdownInput/MarkdownInput.module.css.esm.js +8 -0
- package/dist/components/common/MarkdownInput/MarkdownInput.module.css.esm.js.map +1 -0
- package/dist/components/riScDialog/ConfigRiscInfo.esm.js +2 -2
- package/dist/components/riScDialog/ConfigRiscInfo.esm.js.map +1 -1
- package/dist/components/riScDialog/MatrixDialog.esm.js +22 -49
- package/dist/components/riScDialog/MatrixDialog.esm.js.map +1 -1
- package/dist/components/riScDialog/RiScDialog.esm.js +169 -132
- package/dist/components/riScDialog/RiScDialog.esm.js.map +1 -1
- package/dist/components/riScDialog/RiScDialog.module.css.esm.js +2 -2
- package/dist/components/riScDialog/SupportDialog.esm.js +48 -35
- package/dist/components/riScDialog/SupportDialog.esm.js.map +1 -1
- package/dist/components/riScInfo/MigrationDialog.esm.js +41 -37
- package/dist/components/riScInfo/MigrationDialog.esm.js.map +1 -1
- package/dist/components/riScInfo/PublishDialog.esm.js +51 -40
- package/dist/components/riScInfo/PublishDialog.esm.js.map +1 -1
- package/dist/components/riScInfo/RiScSelectionCard.module.css.esm.js +2 -2
- package/dist/components/riScPlugin/FeedbackDialog.esm.js +1 -1
- package/dist/components/riScPlugin/FeedbackDialog.esm.js.map +1 -1
- package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js +10 -16
- package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js.map +1 -1
- package/dist/components/riskMatrix/Tabs.esm.js +4 -2
- package/dist/components/riskMatrix/Tabs.esm.js.map +1 -1
- package/dist/components/riskMatrix/Tabs.module.css.esm.js +2 -2
- package/dist/components/riskMatrix/tabsStyle.esm.js +15 -0
- package/dist/components/riskMatrix/tabsStyle.esm.js.map +1 -0
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +1 -0
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js +1 -1
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js +37 -31
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ScenarioDrawer.module.css.esm.js +8 -0
- package/dist/components/scenarioDrawer/components/ScenarioDrawer.module.css.esm.js.map +1 -0
- package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js +1 -1
- package/dist/components/scenarioWizard/ScenarioWizard.module.css.esm.js +8 -0
- package/dist/components/scenarioWizard/ScenarioWizard.module.css.esm.js.map +1 -0
- package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js +18 -16
- package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js.map +1 -1
- package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +1 -1
- package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js +1 -1
- package/dist/utils/style.esm.js +2 -4
- package/dist/utils/style.esm.js.map +1 -1
- package/dist/utils/utilityfunctions.esm.js +4 -1
- package/dist/utils/utilityfunctions.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/common/MarkdownInput.esm.js.map +0 -1
- package/dist/components/common/mixins.esm.js +0 -12
- 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
|
}
|
|
@@ -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,
|
|
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 '
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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,MAAA,gBAAA,GAAmB,YAAY,EAAE,CAAA;AAAA,IACnC,CAAA;AAEA,IAAA,MAAM,cAAA,GAAiB,CAAC,KAAA,KAA4C;AAClE,MAAA,IAAI,MAAM,aAAA,EAAe;AACvB,QAAA,MAAM,OAAO,KAAA,CAAM,aAAA;AACnB,QAAA,MAAM,SAAS,IAAA,CAAK,aAAA;AAAA,UAClB;AAAA,SACF;AACA,QAAA,IAAI,MAAA,EAAQ;AACV,UAAA,UAAA,CAAW,MAAM,MAAA,CAAO,KAAA,EAAO,CAAA;AAAA,QACjC;AAAA,MACF;AAAA,IACF,CAAA;AACA,IAAA,MAAM,eAAA,GAAkB,UAAA,CAAW,MAAA,CAAO,aAAA,EAAe;AAAA,MACvD,CAAC,MAAA,CAAO,yBAAyB,CAAC,GAAG;AAAA,KACtC,CAAA;AAED,IAAA,uBACE,IAAA,CAAC,WAAA,EAAA,EAAY,SAAA,EAAW,MAAA,CAAO,0BAA0B,KAAA,EACtD,QAAA,EAAA;AAAA,MAAA,KAAA,oBAAS,GAAA,CAAC,SAAA,EAAA,EAAU,EAAA,EAAI,SAAA,EAAY,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,MAC1C,QAAA,oBACC,GAAA,CAAC,cAAA,EAAA,EAAe,EAAA,EAAI,gBAAiB,QAAA,EAAA,QAAA,EAAS,CAAA;AAAA,sBAEhD,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,cAAA;AAAA,UACA,mBAAiB,cAAA,EAAe;AAAA,UAChC,WAAW,MAAA,CAAO,oBAAA;AAAA,UAElB,QAAA,kBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,GAAA;AAAA,cACA,KAAA,EAAO,eAAA;AAAA,cACP,QAAA,EAAU,oBAAA;AAAA,cACV,OAAA,EAAQ,MAAA;AAAA,cACR,MAAA,EAAQ,OAAA,GAAU,OAAA,GAAU,EAAA,GAAK,EAAA;AAAA,cACjC,SAAA,EAAW;AAAA;AAAA;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.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,
|
|
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\" 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 {
|
|
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 '@
|
|
9
|
-
import
|
|
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__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
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":[],"mappings":";;;;;;;;;AAgBO,SAAS,YAAA,CAAa;AAAA,EAC3B,IAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAA,2BACG,aAAA,EAAA,EACC,QAAA,kBAAA,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,IAAA;AAAA,MACR,YAAA,EAAc,KAAA;AAAA,MACd,WAAW,MAAA,CAAO,YAAA;AAAA,MAElB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,YAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,eAAA,EAAgB,QAAO,MAAA,EAClC,QAAA,EAAA,CAAA,CAAE,sCAAsC,CAAA,EAC3C,CAAA,EACF,CAAA;AAAA,6BACC,UAAA,EAAA,EACC,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,GAAA,EAAI,OAAA,EAAQ,YAAA,EAAa,WAAW,MAAA,CAAO,gBAAA,EACjD,QAAA,EAAA,CAAA,CAAE,0CAA0C,CAAA,EAC/C,CAAA;AAAA,0BACA,GAAA,CAAC,GAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,eAAA,EAAgB,MAAA,EAAO,MAAA,EAClC,QAAA,EAAA,CAAA,CAAE,wBAAwB,CAAA,EAC7B,CAAA,EACF,CAAA;AAAA,8BACC,+BAAA,EAAA,EAAgC,CAAA;AAAA,0BACjC,GAAA,CAAC,GAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,OAAA,EAAQ,eAAA,EAAgB,MAAA,EAAO,MAAA,EAClC,QAAA,EAAA,CAAA,CAAE,wBAAwB,CAAA,EAC7B,CAAA,EACF,CAAA;AAAA,8BACC,+BAAA,EAAA,EAAgC;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 {
|
|
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,
|
|
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__ */
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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__ */
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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__ */
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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__ */
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
}
|