@kartverket/backstage-plugin-risk-scorecard 3.1.2 → 3.1.4
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/dist/components/common/Select.esm.js +9 -7
- package/dist/components/common/Select.esm.js.map +1 -1
- package/dist/components/riScDialog/ConfigRiscInfo.esm.js +9 -4
- package/dist/components/riScDialog/ConfigRiscInfo.esm.js.map +1 -1
- package/dist/components/riScInfo/MigrationDialog.esm.js +2 -2
- package/dist/components/riScInfo/MigrationDialog.esm.js.map +1 -1
- package/dist/components/riScInfo/PublishDialog.esm.js +2 -2
- package/dist/components/riScInfo/PublishDialog.esm.js.map +1 -1
- package/dist/components/riskMatrix/AggregatedCost.esm.js +8 -8
- package/dist/components/riskMatrix/AggregatedCost.esm.js.map +1 -1
- package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js +55 -14
- package/dist/components/riskMatrix/EstimatedRiskInfoDialog.esm.js.map +1 -1
- package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js +3 -3
- package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +19 -19
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ActionBox.esm.js +47 -41
- package/dist/components/scenarioDrawer/components/ActionBox.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js +18 -14
- package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ActionsSection.esm.js +14 -11
- package/dist/components/scenarioDrawer/components/ActionsSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js +55 -22
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js +116 -71
- package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/RiskOptionDisplay.esm.js +45 -0
- package/dist/components/scenarioDrawer/components/RiskOptionDisplay.esm.js.map +1 -0
- package/dist/components/scenarioDrawer/components/RiskSection.esm.js +18 -10
- package/dist/components/scenarioDrawer/components/RiskSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js +20 -16
- package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js +4 -4
- package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTable.esm.js +15 -15
- package/dist/components/scenarioTable/ScenarioTable.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTableProgressBar.esm.js +46 -0
- package/dist/components/scenarioTable/ScenarioTableProgressBar.esm.js.map +1 -0
- package/dist/components/scenarioTable/ScenarioTableRow.esm.js +21 -21
- package/dist/components/scenarioTable/ScenarioTableRow.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTableStyles.esm.js +2 -1
- package/dist/components/scenarioTable/ScenarioTableStyles.esm.js.map +1 -1
- package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js +1 -1
- package/dist/components/scenarioWizard/components/CloseConfirmation.esm.js.map +1 -1
- package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +56 -19
- package/dist/components/scenarioWizard/steps/ActionsStep.esm.js.map +1 -1
- package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js +17 -14
- package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js.map +1 -1
- package/dist/contexts/ScenarioContext.esm.js +9 -9
- package/dist/contexts/ScenarioContext.esm.js.map +1 -1
- package/dist/utils/constants.esm.js +42 -9
- package/dist/utils/constants.esm.js.map +1 -1
- package/dist/utils/hooks.esm.js +3 -3
- package/dist/utils/hooks.esm.js.map +1 -1
- package/dist/utils/translations.esm.js +465 -432
- package/dist/utils/translations.esm.js.map +1 -1
- package/dist/utils/types.esm.js.map +1 -1
- package/dist/utils/utilityfunctions.esm.js +74 -55
- package/dist/utils/utilityfunctions.esm.js.map +1 -1
- package/package.json +10 -1
- package/dist/risc_schema_en_v4_0.json.esm.js +0 -88
- package/dist/risc_schema_en_v4_0.json.esm.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useController } from 'react-hook-form';
|
|
3
2
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
4
|
-
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
5
3
|
import Box from '@mui/material/Box';
|
|
4
|
+
import Checkbox from '@mui/material/Checkbox';
|
|
6
5
|
import Chip from '@mui/material/Chip';
|
|
7
6
|
import FormControl from '@mui/material/FormControl';
|
|
8
7
|
import FormHelperText from '@mui/material/FormHelperText';
|
|
9
8
|
import FormLabel from '@mui/material/FormLabel';
|
|
10
|
-
import MUISelect from '@mui/material/Select';
|
|
11
|
-
import Checkbox from '@mui/material/Checkbox';
|
|
12
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
13
9
|
import ListItemText from '@mui/material/ListItemText';
|
|
10
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
11
|
+
import MUISelect from '@mui/material/Select';
|
|
12
|
+
import { useController } from 'react-hook-form';
|
|
13
|
+
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
14
14
|
import { formLabel, formHelperText } from './typography.esm.js';
|
|
15
15
|
|
|
16
16
|
function Select({
|
|
@@ -24,13 +24,14 @@ function Select({
|
|
|
24
24
|
multiple,
|
|
25
25
|
labelTranslationKey,
|
|
26
26
|
options,
|
|
27
|
+
rules,
|
|
27
28
|
...props
|
|
28
29
|
}) {
|
|
29
30
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
30
31
|
const { field } = useController({
|
|
31
32
|
name,
|
|
32
33
|
control,
|
|
33
|
-
rules: { required }
|
|
34
|
+
rules: { ...rules, required }
|
|
34
35
|
});
|
|
35
36
|
function renderValue(values) {
|
|
36
37
|
if (!multiple) {
|
|
@@ -64,7 +65,7 @@ function Select({
|
|
|
64
65
|
}
|
|
65
66
|
return fieldValue === optionValue;
|
|
66
67
|
}
|
|
67
|
-
return /* @__PURE__ */ jsxs(FormControl, { sx: { width: "100%", gap: "4px" }, children: [
|
|
68
|
+
return /* @__PURE__ */ jsxs(FormControl, { error, sx: { width: "100%", gap: "4px" }, children: [
|
|
68
69
|
label && /* @__PURE__ */ jsx(FormLabel, { sx: formLabel, required, children: label }),
|
|
69
70
|
sublabel && /* @__PURE__ */ jsx(FormHelperText, { sx: formHelperText, children: sublabel }),
|
|
70
71
|
/* @__PURE__ */ jsx(
|
|
@@ -73,6 +74,7 @@ function Select({
|
|
|
73
74
|
MenuProps: {
|
|
74
75
|
disablePortal: true
|
|
75
76
|
},
|
|
77
|
+
error,
|
|
76
78
|
variant: "outlined",
|
|
77
79
|
renderValue,
|
|
78
80
|
multiple,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/common/Select.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Select.esm.js","sources":["../../../src/components/common/Select.tsx"],"sourcesContent":["import { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Box from '@mui/material/Box';\nimport Checkbox from '@mui/material/Checkbox';\nimport Chip from '@mui/material/Chip';\nimport FormControl from '@mui/material/FormControl';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport FormLabel from '@mui/material/FormLabel';\nimport ListItemText from '@mui/material/ListItemText';\nimport MenuItem from '@mui/material/MenuItem';\nimport MUISelect, { SelectProps } from '@mui/material/Select';\nimport {\n Control,\n FieldValues,\n Path,\n RegisterOptions,\n useController,\n type UseControllerReturn,\n} from 'react-hook-form';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { formHelperText, formLabel } from './typography';\n\ntype Props<T extends FieldValues> = SelectProps & {\n sublabel?: string;\n helperText?: string;\n control?: Control<T, any>;\n name: Path<T>;\n labelTranslationKey?: string;\n options: {\n value: string | number;\n renderedValue: React.ReactNode | string | number;\n }[];\n rules?: Omit<\n RegisterOptions<T, string & Path<T>>,\n 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'\n >;\n};\n\nexport function Select<T extends FieldValues>({\n label,\n sublabel,\n error,\n helperText,\n required,\n control,\n name,\n multiple,\n labelTranslationKey,\n options,\n rules,\n ...props\n}: Props<T>) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const { field } = useController({\n name,\n control,\n rules: { ...rules, required },\n });\n\n // values er strengt tatt unknown, men da må vi bruke mye ts-ignore for å komme i mål\n function renderValue(values: any) {\n if (!multiple) {\n return options.find(option => option.value === values)?.renderedValue;\n }\n return (\n <Box\n sx={{\n display: 'flex',\n flexWrap: 'wrap',\n marginBottom: 0,\n paddingBottom: 0,\n }}\n >\n {values.map((value: string) => (\n <Chip\n key={value}\n label={\n /* @ts-ignore Because ts can't typecheck strings against our keys */\n labelTranslationKey ? t(`${labelTranslationKey}.${value}`) : value\n }\n />\n ))}\n </Box>\n );\n }\n\n function handleChecked(\n fieldValue: UseControllerReturn['field']['value'],\n optionValue: Props<T>['options'][number]['value'],\n ) {\n if (Array.isArray(fieldValue)) {\n return fieldValue.includes(optionValue);\n }\n return fieldValue === optionValue;\n }\n\n return (\n <FormControl error={error} sx={{ width: '100%', gap: '4px' }}>\n {label && (\n <FormLabel sx={formLabel} required={required}>\n {label}\n </FormLabel>\n )}\n {sublabel && (\n <FormHelperText sx={formHelperText}>{sublabel}</FormHelperText>\n )}\n\n <MUISelect\n MenuProps={{\n disablePortal: true,\n }}\n error={error}\n variant=\"outlined\"\n renderValue={renderValue}\n multiple={multiple}\n SelectDisplayProps={\n multiple\n ? {\n style: {\n paddingBottom: 8,\n paddingTop: 16,\n minHeight: 40,\n },\n }\n : {}\n }\n inputRef={field.ref}\n {...field}\n {...props}\n >\n {options.map(option => (\n <MenuItem key={option.value} value={option.value}>\n {multiple && (\n <Checkbox checked={handleChecked(field.value, option.value)} />\n )}\n <ListItemText primary={option.renderedValue} />\n </MenuItem>\n ))}\n </MUISelect>\n {error && <FormHelperText error>{helperText}</FormHelperText>}\n </FormControl>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqCO,SAAS,MAA8B,CAAA;AAAA,EAC5C,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,mBAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAa,EAAA;AACX,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAM,MAAA,EAAE,KAAM,EAAA,GAAI,aAAc,CAAA;AAAA,IAC9B,IAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAO,EAAA,EAAE,GAAG,KAAA,EAAO,QAAS;AAAA,GAC7B,CAAA;AAGD,EAAA,SAAS,YAAY,MAAa,EAAA;AAChC,IAAA,IAAI,CAAC,QAAU,EAAA;AACb,MAAA,OAAO,QAAQ,IAAK,CAAA,CAAA,MAAA,KAAU,MAAO,CAAA,KAAA,KAAU,MAAM,CAAG,EAAA,aAAA;AAAA;AAE1D,IACE,uBAAA,GAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,QAAU,EAAA,MAAA;AAAA,UACV,YAAc,EAAA,CAAA;AAAA,UACd,aAAe,EAAA;AAAA,SACjB;AAAA,QAEC,QAAA,EAAA,MAAA,CAAO,GAAI,CAAA,CAAC,KACX,qBAAA,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YAEC,KAAA;AAAA;AA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,EAAA,QAAA,EAAA;AAAA,UACC,QAAA,oBAAA,GAAA,CAAC,YAAS,OAAS,EAAA,aAAA,CAAc,MAAM,KAAO,EAAA,MAAA,CAAO,KAAK,CAAG,EAAA,CAAA;AAAA,0BAE9D,GAAA,CAAA,YAAA,EAAA,EAAa,OAAS,EAAA,MAAA,CAAO,aAAe,EAAA;AAAA,SAJhC,EAAA,EAAA,MAAA,CAAO,KAKtB,CACD;AAAA;AAAA,KACH;AAAA,IACC,KAAS,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,KAAA,EAAK,MAAE,QAAW,EAAA,UAAA,EAAA;AAAA,GAC9C,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -29,14 +29,13 @@ function ConfigRiscInfo({
|
|
|
29
29
|
...register("content.title", { required: true }),
|
|
30
30
|
error: errors?.content?.title !== void 0,
|
|
31
31
|
label: t("dictionary.title"),
|
|
32
|
-
|
|
32
|
+
helperText: errors?.content?.title && t("rosDialog.titleError")
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
35
|
/* @__PURE__ */ jsx(
|
|
36
36
|
MarkdownInput,
|
|
37
37
|
{
|
|
38
|
-
|
|
39
|
-
...register("content.scope", { required: true }),
|
|
38
|
+
...register("content.scope"),
|
|
40
39
|
value: currentScope,
|
|
41
40
|
label: t("dictionary.scope"),
|
|
42
41
|
sublabel: t("rosDialog.scopeDescription"),
|
|
@@ -69,7 +68,13 @@ function ConfigRiscInfo({
|
|
|
69
68
|
/* @__PURE__ */ jsx(
|
|
70
69
|
FormControlLabel,
|
|
71
70
|
{
|
|
72
|
-
control: /* @__PURE__ */ jsx(
|
|
71
|
+
control: /* @__PURE__ */ jsx(
|
|
72
|
+
Switch,
|
|
73
|
+
{
|
|
74
|
+
checked: createRiScFrom === CreateRiScFrom.Default,
|
|
75
|
+
onChange: handleChangeCreateRiScFrom
|
|
76
|
+
}
|
|
77
|
+
),
|
|
73
78
|
label: createRiScFrom === CreateRiScFrom.Scratch ? t("dictionary.no") : t("dictionary.yes")
|
|
74
79
|
}
|
|
75
80
|
)
|
|
@@ -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 { CreateRiScFrom, RiScDialogStates } from './RiScDialog';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport Box from '@mui/material/Box';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Switch from '@mui/material/Switch';\nimport Typography from '@mui/material/Typography';\nimport { DialogContentText } from '@mui/material';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\n\ninterface ConfigRiscInfoProps {\n dialogState: RiScDialogStates;\n createRiScFrom: CreateRiScFrom;\n handleChangeCreateRiScFrom: () => void;\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n setValue: UseFormSetValue<RiScWithMetadata>;\n watch: UseFormWatch<RiScWithMetadata>;\n}\n\nfunction ConfigRiscInfo({\n dialogState,\n createRiScFrom,\n handleChangeCreateRiScFrom,\n register,\n errors,\n setValue,\n watch,\n}: ConfigRiscInfoProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const currentScope = watch('content.scope');\n\n return (\n <>\n <Input\n required\n {...register('content.title', { required: true })}\n error={errors?.content?.title !== undefined}\n label={t('dictionary.title')}\n
|
|
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 { CreateRiScFrom, RiScDialogStates } from './RiScDialog';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport Box from '@mui/material/Box';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Switch from '@mui/material/Switch';\nimport Typography from '@mui/material/Typography';\nimport { DialogContentText } from '@mui/material';\nimport { FieldErrors } from 'react-hook-form/dist/types/errors';\n\ninterface ConfigRiscInfoProps {\n dialogState: RiScDialogStates;\n createRiScFrom: CreateRiScFrom;\n handleChangeCreateRiScFrom: () => void;\n register: UseFormRegister<RiScWithMetadata>;\n errors: FieldErrors<RiScWithMetadata>;\n setValue: UseFormSetValue<RiScWithMetadata>;\n watch: UseFormWatch<RiScWithMetadata>;\n}\n\nfunction ConfigRiscInfo({\n dialogState,\n createRiScFrom,\n handleChangeCreateRiScFrom,\n register,\n errors,\n setValue,\n watch,\n}: ConfigRiscInfoProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const currentScope = watch('content.scope');\n\n return (\n <>\n <Input\n required\n {...register('content.title', { required: true })}\n error={errors?.content?.title !== undefined}\n label={t('dictionary.title')}\n helperText={errors?.content?.title && t('rosDialog.titleError')}\n />\n <MarkdownInput\n {...register('content.scope')}\n value={currentScope}\n label={t('dictionary.scope')}\n sublabel={t('rosDialog.scopeDescription')}\n error={errors?.content?.scope !== undefined}\n minRows={8}\n onMarkdownChange={value => setValue('content.scope', value)}\n />\n\n {dialogState === RiScDialogStates.Create && (\n <div>\n <DialogContentText>\n {t('rosDialog.generateInitialDescription')}\n </DialogContentText>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n }}\n >\n <Typography\n sx={{\n fontWeight: 'bold',\n }}\n >\n {t('rosDialog.generateInitialToggleDescription')}\n </Typography>\n <FormControlLabel\n control={\n <Switch\n checked={createRiScFrom === CreateRiScFrom.Default}\n onChange={handleChangeCreateRiScFrom}\n />\n }\n label={\n createRiScFrom === CreateRiScFrom.Scratch\n ? t('dictionary.no')\n : t('dictionary.yes')\n }\n />\n </Box>\n </div>\n )}\n </>\n );\n}\n\nexport default ConfigRiscInfo;\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BA,SAAS,cAAe,CAAA;AAAA,EACtB,WAAA;AAAA,EACA,cAAA;AAAA,EACA,0BAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAwB,EAAA;AACtB,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAM,MAAA,YAAA,GAAe,MAAM,eAAe,CAAA;AAE1C,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,QAAQ,EAAA,IAAA;AAAA,QACP,GAAG,QAAS,CAAA,eAAA,EAAiB,EAAE,QAAA,EAAU,MAAM,CAAA;AAAA,QAChD,KAAA,EAAO,MAAQ,EAAA,OAAA,EAAS,KAAU,KAAA,MAAA;AAAA,QAClC,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,QAC3B,UAAY,EAAA,MAAA,EAAQ,OAAS,EAAA,KAAA,IAAS,EAAE,sBAAsB;AAAA;AAAA,KAChE;AAAA,oBACA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAS,eAAe,CAAA;AAAA,QAC5B,KAAO,EAAA,YAAA;AAAA,QACP,KAAA,EAAO,EAAE,kBAAkB,CAAA;AAAA,QAC3B,QAAA,EAAU,EAAE,4BAA4B,CAAA;AAAA,QACxC,KAAA,EAAO,MAAQ,EAAA,OAAA,EAAS,KAAU,KAAA,MAAA;AAAA,QAClC,OAAS,EAAA,CAAA;AAAA,QACT,gBAAkB,EAAA,CAAA,KAAA,KAAS,QAAS,CAAA,eAAA,EAAiB,KAAK;AAAA;AAAA,KAC5D;AAAA,IAEC,WAAgB,KAAA,gBAAA,CAAiB,MAChC,oBAAA,IAAA,CAAC,KACC,EAAA,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,iBAAA,EAAA,EACE,QAAE,EAAA,CAAA,CAAA,sCAAsC,CAC3C,EAAA,CAAA;AAAA,sBACA,IAAA;AAAA,QAAC,GAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,OAAS,EAAA,MAAA;AAAA,YACT,aAAe,EAAA,KAAA;AAAA,YACf,UAAY,EAAA,QAAA;AAAA,YACZ,GAAK,EAAA;AAAA,WACP;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,UAAA;AAAA,cAAA;AAAA,gBACC,EAAI,EAAA;AAAA,kBACF,UAAY,EAAA;AAAA,iBACd;AAAA,gBAEC,YAAE,4CAA4C;AAAA;AAAA,aACjD;AAAA,4BACA,GAAA;AAAA,cAAC,gBAAA;AAAA,cAAA;AAAA,gBACC,OACE,kBAAA,GAAA;AAAA,kBAAC,MAAA;AAAA,kBAAA;AAAA,oBACC,OAAA,EAAS,mBAAmB,cAAe,CAAA,OAAA;AAAA,oBAC3C,QAAU,EAAA;AAAA;AAAA,iBACZ;AAAA,gBAEF,KAAA,EACE,mBAAmB,cAAe,CAAA,OAAA,GAC9B,EAAE,eAAe,CAAA,GACjB,EAAE,gBAAgB;AAAA;AAAA;AAE1B;AAAA;AAAA;AACF,KACF,EAAA;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -65,6 +65,7 @@ const RiScMigrationDialog = ({
|
|
|
65
65
|
) })
|
|
66
66
|
] }),
|
|
67
67
|
/* @__PURE__ */ jsxs(DialogActions, { sx: dialogActions, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", onClick: handleCancel, children: t("dictionary.cancel") }),
|
|
68
69
|
/* @__PURE__ */ jsx(
|
|
69
70
|
Button,
|
|
70
71
|
{
|
|
@@ -73,8 +74,7 @@ const RiScMigrationDialog = ({
|
|
|
73
74
|
disabled: !saveMigration,
|
|
74
75
|
children: t("dictionary.confirm")
|
|
75
76
|
}
|
|
76
|
-
)
|
|
77
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", onClick: handleCancel, children: t("dictionary.cancel") })
|
|
77
|
+
)
|
|
78
78
|
] })
|
|
79
79
|
] });
|
|
80
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDialog.esm.js","sources":["../../../src/components/riScInfo/MigrationDialog.tsx"],"sourcesContent":["import { ReactComponentElement, useState } from 'react';\nimport Alert from '@mui/material/Alert';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogActions from '@mui/material/DialogActions';\nimport Link from '@mui/material/Link';\nimport Typography from '@mui/material/Typography';\nimport Checkbox from '@mui/material/Checkbox';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Box from '@mui/material/Box';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { MigrationVersions } from '../../utils/types';\nimport { dialogActions } from '../common/mixins';\nimport { URLS } from '../../urls';\n\ninterface RiScMigrationDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handleUpdate: () => void;\n migrationVersions?: MigrationVersions;\n}\n\nexport const RiScMigrationDialog = ({\n openDialog,\n handleCancel,\n handleUpdate,\n migrationVersions,\n}: RiScMigrationDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [saveMigration, setSaveMigration] = useState<boolean>(false);\n\n function handleCheckboxInput(event: React.ChangeEvent<HTMLInputElement>) {\n setSaveMigration(event.target.checked);\n }\n\n return (\n <Dialog open={openDialog}>\n <DialogTitle>{t('migrationDialog.title')}</DialogTitle>\n <DialogContent>\n <Box sx={{ marginBottom: '16px' }}>\n <Typography>\n {t('migrationDialog.description')}\n {migrationVersions?.toVersion} {t('migrationDialog.description2')}{' '}\n {migrationVersions?.fromVersion}\n {t('migrationDialog.description3')}\n <Link\n underline=\"always\"\n target=\"_blank\"\n href={URLS.external.github_com__kartverket_changelog}\n >\n {t('migrationDialog.changelog')}\n </Link>{' '}\n {t('migrationDialog.description4')}\n </Typography>\n </Box>\n <Alert severity=\"info\" icon={false}>\n <FormControlLabel\n control={\n <Checkbox\n checked={saveMigration}\n onChange={handleCheckboxInput}\n />\n }\n label={t('migrationDialog.checkboxLabel')}\n />\n </Alert>\n </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button
|
|
1
|
+
{"version":3,"file":"MigrationDialog.esm.js","sources":["../../../src/components/riScInfo/MigrationDialog.tsx"],"sourcesContent":["import { ReactComponentElement, useState } from 'react';\nimport Alert from '@mui/material/Alert';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogActions from '@mui/material/DialogActions';\nimport Link from '@mui/material/Link';\nimport Typography from '@mui/material/Typography';\nimport Checkbox from '@mui/material/Checkbox';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Box from '@mui/material/Box';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { MigrationVersions } from '../../utils/types';\nimport { dialogActions } from '../common/mixins';\nimport { URLS } from '../../urls';\n\ninterface RiScMigrationDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handleUpdate: () => void;\n migrationVersions?: MigrationVersions;\n}\n\nexport const RiScMigrationDialog = ({\n openDialog,\n handleCancel,\n handleUpdate,\n migrationVersions,\n}: RiScMigrationDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [saveMigration, setSaveMigration] = useState<boolean>(false);\n\n function handleCheckboxInput(event: React.ChangeEvent<HTMLInputElement>) {\n setSaveMigration(event.target.checked);\n }\n\n return (\n <Dialog open={openDialog}>\n <DialogTitle>{t('migrationDialog.title')}</DialogTitle>\n <DialogContent>\n <Box sx={{ marginBottom: '16px' }}>\n <Typography>\n {t('migrationDialog.description')}\n {migrationVersions?.toVersion} {t('migrationDialog.description2')}{' '}\n {migrationVersions?.fromVersion}\n {t('migrationDialog.description3')}\n <Link\n underline=\"always\"\n target=\"_blank\"\n href={URLS.external.github_com__kartverket_changelog}\n >\n {t('migrationDialog.changelog')}\n </Link>{' '}\n {t('migrationDialog.description4')}\n </Typography>\n </Box>\n <Alert severity=\"info\" icon={false}>\n <FormControlLabel\n control={\n <Checkbox\n checked={saveMigration}\n onChange={handleCheckboxInput}\n />\n }\n label={t('migrationDialog.checkboxLabel')}\n />\n </Alert>\n </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n <Button\n variant=\"contained\"\n onClick={handleUpdate}\n disabled={!saveMigration}\n >\n {t('dictionary.confirm')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAyBO,MAAM,sBAAsB,CAAC;AAAA,EAClC,UAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAA4D,KAAA;AAC1D,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAkB,KAAK,CAAA;AAEjE,EAAA,SAAS,oBAAoB,KAA4C,EAAA;AACvE,IAAiB,gBAAA,CAAA,KAAA,CAAM,OAAO,OAAO,CAAA;AAAA;AAGvC,EACE,uBAAA,IAAA,CAAC,MAAO,EAAA,EAAA,IAAA,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AO,SAAQ,UAAW,EAAA,KAAA,EAAM,WAAU,OAAS,EAAA,YAAA,EACjD,QAAE,EAAA,CAAA,CAAA,mBAAmB,CACxB,EAAA,CAAA;AAAA,sBACA,GAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UACC,OAAQ,EAAA,WAAA;AAAA,UACR,OAAS,EAAA,YAAA;AAAA,UACT,UAAU,CAAC,aAAA;AAAA,UAEV,YAAE,oBAAoB;AAAA;AAAA;AACzB,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -44,6 +44,7 @@ const RiScPublishDialog = ({
|
|
|
44
44
|
) })
|
|
45
45
|
] }) }),
|
|
46
46
|
/* @__PURE__ */ jsxs(DialogActions, { sx: dialogActions, children: [
|
|
47
|
+
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", onClick: handleCancel, children: t("dictionary.cancel") }),
|
|
47
48
|
/* @__PURE__ */ jsx(
|
|
48
49
|
Button,
|
|
49
50
|
{
|
|
@@ -53,8 +54,7 @@ const RiScPublishDialog = ({
|
|
|
53
54
|
disabled: !riskOwnerApproves,
|
|
54
55
|
children: t("dictionary.confirm")
|
|
55
56
|
}
|
|
56
|
-
)
|
|
57
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "primary", onClick: handleCancel, children: t("dictionary.cancel") })
|
|
57
|
+
)
|
|
58
58
|
] })
|
|
59
59
|
] });
|
|
60
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublishDialog.esm.js","sources":["../../../src/components/riScInfo/PublishDialog.tsx"],"sourcesContent":["import { ReactComponentElement, useState } from 'react';\nimport Alert from '@mui/material/Alert';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogActions from '@mui/material/DialogActions';\nimport Checkbox from '@mui/material/Checkbox';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { DifferenceFetchState } from '../../utils/types';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { RiScDifferenceDialog } from './riScStatus/RiScDifferenceDialog';\nimport { dialogActions } from '../common/mixins';\n\ninterface RiScPublishDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handlePublish: () => void;\n differenceFetchState: DifferenceFetchState;\n}\n\nexport const RiScPublishDialog = ({\n openDialog,\n handleCancel,\n handlePublish,\n differenceFetchState,\n}: RiScPublishDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [riskOwnerApproves, setRiskOwnerApproves] = useState<boolean>(false);\n\n function handleCheckboxInput(event: React.ChangeEvent<HTMLInputElement>) {\n setRiskOwnerApproves(event.target.checked);\n }\n\n return (\n <Dialog open={openDialog}>\n <DialogTitle>{t('publishDialog.title')}</DialogTitle>\n <DialogContent>\n <>\n <RiScDifferenceDialog differenceFetchState={differenceFetchState} />\n <Alert severity=\"info\" icon={false}>\n <FormControlLabel\n control={\n <Checkbox\n color=\"primary\"\n checked={riskOwnerApproves}\n onChange={handleCheckboxInput}\n />\n }\n label={t('publishDialog.checkboxLabel')}\n />\n </Alert>\n </>\n </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button
|
|
1
|
+
{"version":3,"file":"PublishDialog.esm.js","sources":["../../../src/components/riScInfo/PublishDialog.tsx"],"sourcesContent":["import { ReactComponentElement, useState } from 'react';\nimport Alert from '@mui/material/Alert';\nimport Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport DialogActions from '@mui/material/DialogActions';\nimport Checkbox from '@mui/material/Checkbox';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { DifferenceFetchState } from '../../utils/types';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { RiScDifferenceDialog } from './riScStatus/RiScDifferenceDialog';\nimport { dialogActions } from '../common/mixins';\n\ninterface RiScPublishDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handlePublish: () => void;\n differenceFetchState: DifferenceFetchState;\n}\n\nexport const RiScPublishDialog = ({\n openDialog,\n handleCancel,\n handlePublish,\n differenceFetchState,\n}: RiScPublishDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [riskOwnerApproves, setRiskOwnerApproves] = useState<boolean>(false);\n\n function handleCheckboxInput(event: React.ChangeEvent<HTMLInputElement>) {\n setRiskOwnerApproves(event.target.checked);\n }\n\n return (\n <Dialog open={openDialog}>\n <DialogTitle>{t('publishDialog.title')}</DialogTitle>\n <DialogContent>\n <>\n <RiScDifferenceDialog differenceFetchState={differenceFetchState} />\n <Alert severity=\"info\" icon={false}>\n <FormControlLabel\n control={\n <Checkbox\n color=\"primary\"\n checked={riskOwnerApproves}\n onChange={handleCheckboxInput}\n />\n }\n label={t('publishDialog.checkboxLabel')}\n />\n </Alert>\n </>\n </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handlePublish}\n disabled={!riskOwnerApproves}\n >\n {t('dictionary.confirm')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAM,oBAAoB,CAAC;AAAA,EAChC,UAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAA0D,KAAA;AACxD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AAExD,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,KAAK,CAAA;AAEzE,EAAA,SAAS,oBAA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zB,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
3
3
|
import { Box, Typography, IconButton } from '@material-ui/core';
|
|
4
4
|
import InfoIcon from '@mui/icons-material/Info';
|
|
5
|
-
import {
|
|
6
|
-
import { formatNumber } from '../../utils/utilityfunctions.esm.js';
|
|
7
|
-
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
8
|
-
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
5
|
+
import { useState } from 'react';
|
|
9
6
|
import { useFontStyles } from '../../utils/style.esm.js';
|
|
7
|
+
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
8
|
+
import { formatNumber } from '../../utils/utilityfunctions.esm.js';
|
|
9
|
+
import { EstimatedRiskInfoDialog } from './EstimatedRiskInfoDialog.esm.js';
|
|
10
10
|
import { useAggregatedCostStyles } from './aggregatedCostStyle.esm.js';
|
|
11
11
|
|
|
12
12
|
function AggregatedCost({ riSc, initialRisk }) {
|
|
@@ -14,9 +14,9 @@ function AggregatedCost({ riSc, initialRisk }) {
|
|
|
14
14
|
const { outerBox, innerBox } = useAggregatedCostStyles();
|
|
15
15
|
const { label2, body2 } = useFontStyles();
|
|
16
16
|
const [showDialog, setShowDialog] = useState(false);
|
|
17
|
-
const cost = riSc.scenarios.map(
|
|
18
|
-
|
|
19
|
-
).reduce((a, b) => a + b, 0);
|
|
17
|
+
const cost = riSc.scenarios.map((scenario) => {
|
|
18
|
+
return initialRisk ? scenario.risk.probability * scenario.risk.consequence : scenario.remainingRisk.probability * scenario.remainingRisk.consequence;
|
|
19
|
+
}).reduce((a, b) => a + b, 0);
|
|
20
20
|
return /* @__PURE__ */ jsxs(Box, { className: outerBox, children: [
|
|
21
21
|
/* @__PURE__ */ jsx(Typography, { className: label2, children: t("riskMatrix.estimatedRisk.title") }),
|
|
22
22
|
/* @__PURE__ */ jsxs(Box, { className: innerBox, children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregatedCost.esm.js","sources":["../../../src/components/riskMatrix/AggregatedCost.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"AggregatedCost.esm.js","sources":["../../../src/components/riskMatrix/AggregatedCost.tsx"],"sourcesContent":["import { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Box, IconButton, Typography } from '@material-ui/core';\nimport InfoIcon from '@mui/icons-material/Info';\nimport { useState } from 'react';\nimport { useFontStyles } from '../../utils/style';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { RiSc } from '../../utils/types';\nimport { formatNumber } from '../../utils/utilityfunctions';\nimport { EstimatedRiskInfoDialog } from './EstimatedRiskInfoDialog';\nimport { useAggregatedCostStyles } from './aggregatedCostStyle';\n\ninterface AggregatedCostProps {\n riSc: RiSc;\n initialRisk: boolean;\n}\n\nexport function AggregatedCost({ riSc, initialRisk }: AggregatedCostProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const { outerBox, innerBox } = useAggregatedCostStyles();\n const { label2, body2 } = useFontStyles();\n\n const [showDialog, setShowDialog] = useState(false);\n\n const cost = riSc.scenarios\n .map(scenario => {\n return initialRisk\n ? scenario.risk.probability * scenario.risk.consequence\n : scenario.remainingRisk.probability *\n scenario.remainingRisk.consequence;\n })\n .reduce((a, b) => a + b, 0);\n\n return (\n <Box className={outerBox}>\n <Typography className={label2}>\n {t('riskMatrix.estimatedRisk.title')}\n </Typography>\n <Box className={innerBox}>\n <Typography className={body2}>\n {formatNumber(cost, t)}{' '}\n {t('riskMatrix.estimatedRisk.unit.nokPerYear')}\n </Typography>\n <IconButton size=\"small\" onClick={() => setShowDialog(true)}>\n <InfoIcon />\n </IconButton>\n </Box>\n <EstimatedRiskInfoDialog\n isOpen={showDialog}\n onClose={()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EAAA,EAAA,IAAA,EAAK,OAAQ,EAAA,OAAA,EAAS,MAAM,aAAA,CAAc,IAAI,CAAA,EACxD,QAAC,kBAAA,GAAA,CAAA,QAAA,EAAA,EAAS,CACZ,EAAA;AAAA,KACF,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,MAAQ,EAAA,UAAA;AAAA,QACR,OAAA,EAAS,MAAM,aAAA,CAAc,KAAK;AAAA;AAAA;AACpC,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { Dialog, Paper, DialogTitle, DialogContent, DialogContentText, Typography } from '@material-ui/core';
|
|
4
|
-
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
5
2
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
3
|
+
import { Dialog, Paper, DialogTitle, DialogContent, DialogContentText, Typography } from '@material-ui/core';
|
|
4
|
+
import { Fragment } from 'react';
|
|
6
5
|
import { consequenceOptions, probabilityOptions } from '../../utils/constants.esm.js';
|
|
7
|
-
import {
|
|
6
|
+
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
7
|
+
import { formatNOK, consequenceIndexToTranslationKeys, probabilityIndexToTranslationKeys } from '../../utils/utilityfunctions.esm.js';
|
|
8
8
|
import { useEstimatedRiskInfoDialogStyles } from './estimatedRiskInfoDialogStyle.esm.js';
|
|
9
9
|
|
|
10
10
|
function EstimatedRiskInfoDialog({
|
|
@@ -18,24 +18,65 @@ function EstimatedRiskInfoDialog({
|
|
|
18
18
|
/* @__PURE__ */ jsxs(DialogContent, { className: text, dividers: true, children: [
|
|
19
19
|
/* @__PURE__ */ jsx(DialogContentText, { className: text, children: t("infoDialog.description") }),
|
|
20
20
|
/* @__PURE__ */ jsx(Typography, { style: { fontWeight: "bold" }, children: t("infoDialog.calculatedHowTitle") }),
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ jsxs(DialogContentText, { className: text, children: [
|
|
22
|
+
t("infoDialog.calculatedHow"),
|
|
23
|
+
/* @__PURE__ */ jsx("sup", { children: t("infoDialog.calculatedHowExponent") }),
|
|
24
|
+
" ",
|
|
25
|
+
t("riskMatrix.estimatedRisk.unit.nokPerYear"),
|
|
26
|
+
"."
|
|
27
|
+
] }),
|
|
22
28
|
/* @__PURE__ */ jsx(Typography, { style: { fontWeight: "bold" }, children: t("infoDialog.consequenceTitle") }),
|
|
23
29
|
/* @__PURE__ */ jsx(DialogContentText, { className: text, children: consequenceOptions.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
-
index + 1,
|
|
25
|
-
": ",
|
|
30
|
+
/* @__PURE__ */ jsx("b", { children: index + 1 }),
|
|
31
|
+
": 20",
|
|
32
|
+
/* @__PURE__ */ jsx("sup", { children: index + 3 }),
|
|
33
|
+
" =",
|
|
34
|
+
" ",
|
|
26
35
|
formatNOK(option),
|
|
36
|
+
" ",
|
|
37
|
+
t("infoDialog.consequenceUnit"),
|
|
38
|
+
" =",
|
|
39
|
+
" ",
|
|
40
|
+
/* @__PURE__ */ jsx("b", { children: t(consequenceIndexToTranslationKeys[index], {}) }),
|
|
27
41
|
/* @__PURE__ */ jsx("br", {})
|
|
28
|
-
] },
|
|
42
|
+
] }, index)) }),
|
|
29
43
|
/* @__PURE__ */ jsx(Typography, { style: { fontWeight: "bold" }, children: t("infoDialog.probabilityTitle") }),
|
|
30
44
|
/* @__PURE__ */ jsx(DialogContentText, { className: text, children: probabilityOptions.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
-
index + 1,
|
|
32
|
-
": ",
|
|
45
|
+
/* @__PURE__ */ jsx("b", { children: index + 1 }),
|
|
46
|
+
": 20",
|
|
47
|
+
/* @__PURE__ */ jsx("sup", { children: index - 2 }),
|
|
48
|
+
" = ",
|
|
33
49
|
option,
|
|
34
|
-
"
|
|
35
|
-
t(
|
|
50
|
+
" ",
|
|
51
|
+
t("infoDialog.probabilityUnit"),
|
|
52
|
+
" =",
|
|
53
|
+
" ",
|
|
54
|
+
/* @__PURE__ */ jsx("b", { children: t(probabilityIndexToTranslationKeys[index], {}) }),
|
|
36
55
|
/* @__PURE__ */ jsx("br", {})
|
|
37
|
-
] },
|
|
38
|
-
/* @__PURE__ */
|
|
56
|
+
] }, index)) }),
|
|
57
|
+
/* @__PURE__ */ jsxs(DialogContentText, { className: text, children: [
|
|
58
|
+
t("infoDialog.example.part1"),
|
|
59
|
+
/* @__PURE__ */ jsx("b", { children: "2" }),
|
|
60
|
+
" (20",
|
|
61
|
+
/* @__PURE__ */ jsx("sup", { children: "4" }),
|
|
62
|
+
" = 160,000 ",
|
|
63
|
+
t("infoDialog.consequenceUnit"),
|
|
64
|
+
")",
|
|
65
|
+
t("infoDialog.example.part2"),
|
|
66
|
+
/* @__PURE__ */ jsx("b", { children: "4" }),
|
|
67
|
+
" (20",
|
|
68
|
+
/* @__PURE__ */ jsx("sup", { children: "1" }),
|
|
69
|
+
" = 20 ",
|
|
70
|
+
t("infoDialog.probabilityUnit"),
|
|
71
|
+
")",
|
|
72
|
+
t("infoDialog.example.part3"),
|
|
73
|
+
"20",
|
|
74
|
+
/* @__PURE__ */ jsx("sup", { children: "1+4-1" }),
|
|
75
|
+
" = 160,000",
|
|
76
|
+
" ",
|
|
77
|
+
t("riskMatrix.estimatedRisk.unit.nokPerYear"),
|
|
78
|
+
"."
|
|
79
|
+
] })
|
|
39
80
|
] })
|
|
40
81
|
] }) });
|
|
41
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EstimatedRiskInfoDialog.esm.js","sources":["../../../src/components/riskMatrix/EstimatedRiskInfoDialog.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"EstimatedRiskInfoDialog.esm.js","sources":["../../../src/components/riskMatrix/EstimatedRiskInfoDialog.tsx"],"sourcesContent":["import { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n Dialog,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Paper,\n Typography,\n} from '@material-ui/core';\nimport { Fragment } from 'react';\nimport { consequenceOptions, probabilityOptions } from '../../utils/constants';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport {\n consequenceIndexToTranslationKeys,\n formatNOK,\n probabilityIndexToTranslationKeys,\n} from '../../utils/utilityfunctions';\nimport { useEstimatedRiskInfoDialogStyles } from './estimatedRiskInfoDialogStyle';\n\ninterface EstimatedRiskInfoDialogProps {\n isOpen: boolean;\n onClose: () => void;\n}\n\nexport function EstimatedRiskInfoDialog({\n isOpen,\n onClose,\n}: EstimatedRiskInfoDialogProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const { paper, title, text } = useEstimatedRiskInfoDialogStyles();\n\n return (\n <Dialog open={isOpen} onClose={onClose} maxWidth=\"xs\">\n <Paper className={paper}>\n <DialogTitle className={title}>{t('infoDialog.title')}</DialogTitle>\n <DialogContent className={text} dividers>\n <DialogContentText className={text}>\n {t('infoDialog.description')}\n </DialogContentText>\n <Typography style={{ fontWeight: 'bold' }}>\n {t('infoDialog.calculatedHowTitle')}\n </Typography>\n <DialogContentText className={text}>\n {t('infoDialog.calculatedHow')}\n <sup>{t('infoDialog.calculatedHowExponent')}</sup>{' '}\n {t('riskMatrix.estimatedRisk.unit.nokPerYear')}.\n </DialogContentText>\n <Typography style={{ fontWeight: 'bold' }}>\n {t('infoDialog.consequenceTitle')}\n </Typography>\n <DialogContentText className={text}>\n {consequenceOptions.map((option, index) => (\n <Fragment key={index}>\n <b>{index + 1}</b>: 20<sup>{index + 3}</sup> ={' '}\n {formatNOK(option)} {t('infoDialog.consequenceUnit')} ={' '}\n <b>{t(consequenceIndexToTranslationKeys[index] as any, {})}</b>\n <br />\n </Fragment>\n ))}\n </DialogContentText>\n <Typography style={{ fontWeight: 'bold' }}>\n {t('infoDialog.probabilityTitle')}\n </Typography>\n <DialogContentText className={text}>\n {probabilityOptions.map((option, index) => (\n <Fragment key={index}>\n <b>{index + 1}</b>: 20<sup>{index - 2}</sup> = {option}{' '}\n {t('infoDialog.probabilityUnit')} ={' '}\n <b>{t(probabilityIndexToTranslationKeys[index] as any, {})}</b>\n <br />\n </Fragment>\n ))}\n </DialogContentText>\n\n <DialogContentText className={text}>\n {t('infoDialog.example.part1')}\n <b>2</b> (20<sup>4</sup> = 160,000 {t('infoDialog.consequenceUnit')}\n ){t('infoDialog.example.part2')}\n <b>4</b> (20<sup>1</sup> = 20 {t('infoDialog.probabilityUnit')})\n {t('infoDialog.example.part3')}\n 20<sup>1+4-1</sup> = 160,000{' '}\n {t('riskMatrix.estimatedRisk.unit.nokPerYear')}.\n </DialogContentText>\n </DialogContent>\n </Paper>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,uBAAwB,CAAA;AAAA,EACtC,MAAA;AAAA,EACA;AACF,CAAiC,EAAA;AAC/B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,MAAM,EAAE,KAAA,EAAO,KAAO,EAAA,IAAA,KAAS,gCAAiC,EAAA;AAEhE,EACE,uBAAA,GAAA,CAAC,MAAO,EAAA,EAAA,IAAA,EAAM,MAAQ,EAAA,OAAA,EAAkB,UAAS,IAC/C,EAAA,QAAA,kBAAA,IAAA,CAAC,KAAM,EAAA,EAAA,SAAA,EAAW,KAChB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,WAAY,EAAA,EAAA,SAAA,EAAW,KAAQ,EAAA,QAAA,EAAA,CAAA,CAAE,kBAAkB,CAAE,EAAA,CAAA;AAAA,oBACrD,IAAA,CAAA,aAAA,EAAA,EAAc,SAAW,EAAA,IAAA,EAAM,UAAQ,IACtC,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,iBAAkB,E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AAA,QAClE,EAAE,0BAA0B,CAAA;AAAA,wBAC9B,GAAA,CAAC,OAAE,QAAC,EAAA,GAAA,EAAA,CAAA;AAAA,QAAI,MAAA;AAAA,wBAAI,GAAA,CAAC,SAAI,QAAC,EAAA,GAAA,EAAA,CAAA;AAAA,QAAM,QAAA;AAAA,QAAO,EAAE,4BAA4B,CAAA;AAAA,QAAE,GAAA;AAAA,QAC9D,EAAE,0BAA0B,CAAA;AAAA,QAAE,IAAA;AAAA,wBAC7B,GAAA,CAAC,SAAI,QAAK,EAAA,OAAA,EAAA,CAAA;AAAA,QAAM,YAAA;AAAA,QAAW,GAAA;AAAA,QAC5B,EAAE,0CAA0C,CAAA;AAAA,QAAE;AAAA,OACjD,EAAA;AAAA,KACF,EAAA;AAAA,GAAA,EACF,CACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -2,11 +2,11 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { List, ListSubheader, Typography, ListItem, ListItemText, ClickAwayListener, Tooltip, Paper } from '@material-ui/core';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import CircleIcon from '@material-ui/icons/FiberManualRecord';
|
|
5
|
-
import { probabilityOptions, consequenceOptions } from '../../utils/constants.esm.js';
|
|
6
5
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
7
6
|
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
8
7
|
import { useRiskMatrixStyles } from './riskMatrixStyle.esm.js';
|
|
9
8
|
import { useScenario } from '../../contexts/ScenarioContext.esm.js';
|
|
9
|
+
import { findProbabilityIndex, findConsequenceIndex } from '../../utils/utilityfunctions.esm.js';
|
|
10
10
|
|
|
11
11
|
function RiskMatrixScenarioCount({
|
|
12
12
|
riSc,
|
|
@@ -31,9 +31,9 @@ function RiskMatrixScenarioCount({
|
|
|
31
31
|
openScenarioDrawer(ID);
|
|
32
32
|
}
|
|
33
33
|
const scenarios = riSc.scenarios.filter(
|
|
34
|
-
(scenario) =>
|
|
34
|
+
(scenario) => findProbabilityIndex(
|
|
35
35
|
initialRisk ? scenario.risk.probability : scenario.remainingRisk.probability
|
|
36
|
-
) === probability &&
|
|
36
|
+
) === probability && findConsequenceIndex(
|
|
37
37
|
initialRisk ? scenario.risk.consequence : scenario.remainingRisk.consequence
|
|
38
38
|
) === consequence
|
|
39
39
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RiskMatrixScenarioCount.esm.js","sources":["../../../src/components/riskMatrix/RiskMatrixScenarioCount.tsx"],"sourcesContent":["import {\n ClickAwayListener,\n List,\n ListItem,\n ListItemText,\n ListSubheader,\n Paper,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport { useState } from 'react';\nimport CircleIcon from '@material-ui/icons/FiberManualRecord';\nimport {
|
|
1
|
+
{"version":3,"file":"RiskMatrixScenarioCount.esm.js","sources":["../../../src/components/riskMatrix/RiskMatrixScenarioCount.tsx"],"sourcesContent":["import {\n ClickAwayListener,\n List,\n ListItem,\n ListItemText,\n ListSubheader,\n Paper,\n Tooltip,\n Typography,\n} from '@material-ui/core';\nimport { useState } from 'react';\nimport CircleIcon from '@material-ui/icons/FiberManualRecord';\nimport { RiSc } from '../../utils/types';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useRiskMatrixStyles } from './riskMatrixStyle';\nimport { useScenario } from '../../contexts/ScenarioContext';\nimport {\n findConsequenceIndex,\n findProbabilityIndex,\n} from '../../utils/utilityfunctions';\n\ninterface ScenarioCountProps {\n riSc: RiSc;\n probability: number;\n consequence: number;\n initialRisk: boolean;\n}\n\nexport function RiskMatrixScenarioCount({\n riSc,\n probability,\n consequence,\n initialRisk,\n}: ScenarioCountProps) {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const {\n circle,\n centered,\n circleText,\n text,\n tooltip,\n tooltipArrow,\n tooltipText,\n } = useRiskMatrixStyles();\n\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const { openScenarioDrawer } = useScenario();\n\n function handleScenarioClick(ID: string) {\n setTooltipOpen(false);\n openScenarioDrawer(ID);\n }\n\n const scenarios = riSc.scenarios.filter(\n scenario =>\n findProbabilityIndex(\n initialRisk\n ? scenario.risk.probability\n : scenario.remainingRisk.probability,\n ) === probability &&\n findConsequenceIndex(\n initialRisk\n ? scenario.risk.consequence\n : scenario.remainingRisk.consequence,\n ) === consequence,\n );\n\n if (scenarios.length === 0) {\n return null;\n }\n\n const tooltipList = (\n <List dense>\n <ListSubheader className={tooltipText}>\n <Typography variant=\"h6\" className={tooltipText}>\n {t('riskMatrix.tooltip.title')}\n </Typography>\n </ListSubheader>\n {scenarios.map(s => (\n <ListItem\n key={s.ID}\n button\n disableGutters\n className={tooltipText}\n onClick={() => {\n handleScenarioClick(s.ID);\n }}\n >\n <CircleIcon className={tooltipText} style={{ width: '10px' }} />\n <ListItemText\n className={tooltipText}\n style={{ paddingLeft: '0.6rem' }}\n >\n <span>{s.title}</span>\n </ListItemText>\n </ListItem>\n ))}\n </List>\n );\n\n return (\n <ClickAwayListener onClickAway={() => setTooltipOpen(false)}>\n <Tooltip\n interactive\n classes={{ tooltip: tooltip, arrow: tooltipArrow }}\n title={tooltipList}\n placement=\"right\"\n arrow\n open={tooltipOpen}\n >\n <Paper\n className={`${circle} ${centered}`}\n elevation={10}\n onClick={() => setTooltipOpen(!tooltipOpen)}\n >\n <Typography className={`${circleText} ${text}`}>\n {scenarios.length}\n </Typography>\n </Paper>\n </Tooltip>\n </ClickAwayListener>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,SAAS,uBAAwB,CAAA;AAAA,EACtC,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAAuB,EAAA;AACrB,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAM,MAAA;AAAA,IACJ,MAAA;AAAA,IAC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MACb,EAAA;AAAA;AAAA;AACF;AAAA,GAEJ,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
3
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
4
|
+
import Alert from '@mui/material/Alert';
|
|
3
5
|
import Box from '@mui/material/Box';
|
|
6
|
+
import Button from '@mui/material/Button';
|
|
7
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
8
|
+
import Drawer from '@mui/material/Drawer';
|
|
9
|
+
import Typography from '@mui/material/Typography';
|
|
10
|
+
import { useState, useRef, useEffect } from 'react';
|
|
11
|
+
import { useForm } from 'react-hook-form';
|
|
12
|
+
import { useRiScs } from '../../contexts/RiScContext.esm.js';
|
|
4
13
|
import { useScenario } from '../../contexts/ScenarioContext.esm.js';
|
|
5
|
-
import { RiskSection } from './components/RiskSection.esm.js';
|
|
6
|
-
import { ActionsSection } from './components/ActionsSection.esm.js';
|
|
7
|
-
import DeleteIcon from '@mui/icons-material/Delete';
|
|
8
|
-
import { DeleteConfirmation } from './components/DeleteConfirmation.esm.js';
|
|
9
|
-
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
10
14
|
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
11
|
-
import { ScopeSection } from './components/ScopeSection.esm.js';
|
|
12
|
-
import { useForm } from 'react-hook-form';
|
|
13
15
|
import { ProcessingStatus } from '../../utils/types.esm.js';
|
|
14
|
-
import ScenarioForm from './components/RiskFormSection.esm.js';
|
|
15
|
-
import ScopeFormSection from './components/ScopeFormSection.esm.js';
|
|
16
|
-
import Drawer from '@mui/material/Drawer';
|
|
17
|
-
import Button from '@mui/material/Button';
|
|
18
|
-
import { useRiScs } from '../../contexts/RiScContext.esm.js';
|
|
19
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
20
|
-
import Alert from '@mui/material/Alert';
|
|
21
16
|
import { getAlertSeverity } from '../../utils/utilityfunctions.esm.js';
|
|
22
|
-
import Typography from '@mui/material/Typography';
|
|
23
17
|
import { MatrixDialog } from '../riScDialog/MatrixDialog.esm.js';
|
|
24
18
|
import { CloseConfirmation } from '../scenarioWizard/components/CloseConfirmation.esm.js';
|
|
19
|
+
import { ActionsSection } from './components/ActionsSection.esm.js';
|
|
20
|
+
import { DeleteConfirmation } from './components/DeleteConfirmation.esm.js';
|
|
21
|
+
import ScenarioForm from './components/RiskFormSection.esm.js';
|
|
22
|
+
import { RiskSection } from './components/RiskSection.esm.js';
|
|
23
|
+
import ScopeFormSection from './components/ScopeFormSection.esm.js';
|
|
24
|
+
import { ScopeSection } from './components/ScopeSection.esm.js';
|
|
25
25
|
|
|
26
26
|
function ScenarioDrawer() {
|
|
27
27
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
@@ -42,7 +42,7 @@ function ScenarioDrawer() {
|
|
|
42
42
|
const deleteScenarioRef = useRef(null);
|
|
43
43
|
const formMethods = useForm({
|
|
44
44
|
defaultValues: mapScenarioToFormScenario(scenario),
|
|
45
|
-
mode: "
|
|
45
|
+
mode: "onChange"
|
|
46
46
|
});
|
|
47
47
|
function onCancel() {
|
|
48
48
|
formMethods.reset(mapScenarioToFormScenario(scenario));
|
|
@@ -195,8 +195,8 @@ function ScenarioDrawer() {
|
|
|
195
195
|
/* @__PURE__ */ jsx(
|
|
196
196
|
DeleteConfirmation,
|
|
197
197
|
{
|
|
198
|
-
deleteConfirmationIsOpen,
|
|
199
|
-
setDeleteConfirmationIsOpen
|
|
198
|
+
isOpen: deleteConfirmationIsOpen,
|
|
199
|
+
setIsOpen: setDeleteConfirmationIsOpen
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
202
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenarioDrawer.esm.js","sources":["../../../src/components/scenarioDrawer/ScenarioDrawer.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport Box from '@mui/material/Box';\nimport { useScenario } from '../../contexts/ScenarioContext';\nimport { RiskSection } from './components/RiskSection';\nimport { ActionsSection } from './components/ActionsSection';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport { DeleteConfirmation } from './components/DeleteConfirmation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { ScopeSection } from './components/ScopeSection';\nimport { useForm } from 'react-hook-form';\nimport { FormScenario, ProcessingStatus } from '../../utils/types';\nimport RiskFormSection from './components/RiskFormSection';\nimport ScopeFormSection from './components/ScopeFormSection';\nimport Drawer from '@mui/material/Drawer';\nimport Button from '@mui/material/Button';\nimport { useRiScs } from '../../contexts/RiScContext';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport Alert from '@mui/material/Alert';\nimport { getAlertSeverity } from '../../utils/utilityfunctions';\nimport Typography from '@mui/material/Typography';\nimport { MatrixDialog } from '../riScDialog/MatrixDialog';\nimport { CloseConfirmation } from '../scenarioWizard/components/CloseConfirmation';\n\nexport function ScenarioDrawer() {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const [isEditing, setIsEditing] = useState(false);\n const {\n scenario,\n isDrawerOpen,\n closeScenarioForm,\n submitEditedScenarioToRiSc,\n mapScenarioToFormScenario,\n mapFormScenarioToScenario,\n collapseAllActions,\n } = useScenario();\n\n const [deleteConfirmationIsOpen, setDeleteConfirmationIsOpen] =\n useState(false);\n\n const [showCloseConfirmation, setShowCloseConfirmation] = useState(false);\n\n const [isMatrixDialogOpen, setIsMatrixDialogOpen] = useState<boolean>(false);\n\n const { updateStatus, response } = useRiScs();\n\n // Used to scroll to the bottom of the drawer when the user deletes a scenario\n // via the quick edit and DeleteConfirmation\n const deleteScenarioRef = useRef<HTMLDivElement>(null);\n\n const formMethods = useForm<FormScenario>({\n defaultValues: mapScenarioToFormScenario(scenario),\n mode: 'onBlur',\n });\n\n function onCancel() {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n setIsEditing(false);\n }\n\n function handleClose() {\n closeScenarioForm();\n setIsEditing(false);\n setShowCloseConfirmation(false);\n collapseAllActions();\n }\n\n function onClose() {\n if (formMethods.formState.isDirty) {\n setShowCloseConfirmation(true);\n } else {\n closeScenarioForm();\n setIsEditing(false);\n collapseAllActions();\n }\n }\n\n const onSubmit = formMethods.handleSubmit((data: FormScenario) => {\n submitEditedScenarioToRiSc(mapFormScenarioToScenario(data), () =>\n setIsEditing(false),\n );\n });\n\n function onSubmitAndCloseDialog() {\n onSubmit();\n setShowCloseConfirmation(false);\n\n if (deleteScenarioRef.current) {\n deleteScenarioRef.current.scrollIntoView({ behavior: 'smooth' });\n }\n }\n\n useEffect(() => {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scenario]);\n\n return (\n <Drawer\n PaperProps={{\n sx: theme => ({\n padding: theme.spacing(4),\n width: '50%',\n gap: theme.spacing(3),\n [theme.breakpoints.down('sm')]: {\n width: '90%',\n padding: theme.spacing(2),\n },\n backgroundColor:\n theme.palette.mode === 'dark' ? '#333333' : '#f8f8f8',\n }),\n }}\n variant=\"temporary\"\n anchor=\"right\"\n open={isDrawerOpen}\n onClose={onClose}\n >\n <Box\n sx={{\n display: 'flex',\n gap: '16px',\n marginLeft: 'auto',\n }}\n >\n {!isEditing && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setIsEditing(true)}\n >\n {t('dictionary.edit')}\n </Button>\n )}\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={isEditing ? onCancel : onClose}\n >\n {t(isEditing ? 'dictionary.cancel' : 'dictionary.close')}\n </Button>\n </Box>\n\n {isEditing ? (\n <>\n <ScopeFormSection formMethods={formMethods} />\n <RiskFormSection\n formMethods={formMethods}\n setIsMatrixDialogOpen={setIsMatrixDialogOpen}\n />\n </>\n ) : (\n <>\n <ScopeSection />\n <RiskSection />\n </>\n )}\n <ActionsSection\n formMethods={formMethods}\n isEditing={isEditing}\n onSubmit={onSubmit}\n />\n <Box\n sx={{\n display: 'flex',\n gap: '16px',\n }}\n >\n {isEditing && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={onSubmit}\n disabled={!formMethods.formState.isDirty || updateStatus.isLoading}\n >\n {t('dictionary.save')}\n {updateStatus.isLoading && (\n <CircularProgress\n size={16}\n sx={{ marginLeft: 1, color: 'inherit' }}\n />\n )}\n </Button>\n )}\n <div ref={deleteScenarioRef}>\n <Button\n startIcon={<DeleteIcon />}\n variant=\"text\"\n color=\"primary\"\n onClick={() => setDeleteConfirmationIsOpen(true)}\n sx={{ marginLeft: 'auto' }}\n >\n {t('scenarioDrawer.deleteScenarioButton')}\n </Button>\n </div>\n </Box>\n\n {response &&\n response.status !== ProcessingStatus.ErrorWhenFetchingRiScs && (\n <Alert severity={getAlertSeverity(updateStatus)}>\n <Typography>{response.statusMessage}</Typography>\n </Alert>\n )}\n\n <DeleteConfirmation\n deleteConfirmationIsOpen={deleteConfirmationIsOpen}\n setDeleteConfirmationIsOpen={setDeleteConfirmationIsOpen}\n />\n <MatrixDialog\n open={isMatrixDialogOpen}\n close={() => setIsMatrixDialogOpen(false)}\n />\n <CloseConfirmation\n isOpen={showCloseConfirmation}\n close={handleClose}\n save={onSubmitAndCloseDialog}\n />\n </Drawer>\n );\n}\n"],"names":["RiskFormSection"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,SAAS,cAAiB,GAAA;AAC/B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA;AACxD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAChD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,0BAAA;AAAA,IACA,yBAAA;AAAA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YACC,IAAM,EAAA,kBAAA;AAAA,YACN,KAAA,EAAO,MAAM,qBAAA,CAAsB,KAAK;AAAA;AAAA,SAC1C;AAAA,wBACA,GAAA;AAAA,UAAC,iBAAA;AAAA,UAAA;AAAA,YACC,MAAQ,EAAA,qBAAA;AAAA,YACR,KAAO,EAAA,WAAA;AAAA,YACP,IAAM,EAAA;AAAA;AAAA;AACR;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"ScenarioDrawer.esm.js","sources":["../../../src/components/scenarioDrawer/ScenarioDrawer.tsx"],"sourcesContent":["import { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport DeleteIcon from '@mui/icons-material/Delete';\nimport Alert from '@mui/material/Alert';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport Drawer from '@mui/material/Drawer';\nimport Typography from '@mui/material/Typography';\nimport { useEffect, useRef, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport { useRiScs } from '../../contexts/RiScContext';\nimport { useScenario } from '../../contexts/ScenarioContext';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { FormScenario, ProcessingStatus } from '../../utils/types';\nimport { getAlertSeverity } from '../../utils/utilityfunctions';\nimport { MatrixDialog } from '../riScDialog/MatrixDialog';\nimport { CloseConfirmation } from '../scenarioWizard/components/CloseConfirmation';\nimport { ActionsSection } from './components/ActionsSection';\nimport { DeleteConfirmation } from './components/DeleteConfirmation';\nimport RiskFormSection from './components/RiskFormSection';\nimport { RiskSection } from './components/RiskSection';\nimport ScopeFormSection from './components/ScopeFormSection';\nimport { ScopeSection } from './components/ScopeSection';\n\nexport function ScenarioDrawer() {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const [isEditing, setIsEditing] = useState(false);\n const {\n scenario,\n isDrawerOpen,\n closeScenarioForm,\n submitEditedScenarioToRiSc,\n mapScenarioToFormScenario,\n mapFormScenarioToScenario,\n collapseAllActions,\n } = useScenario();\n\n const [deleteConfirmationIsOpen, setDeleteConfirmationIsOpen] =\n useState(false);\n\n const [showCloseConfirmation, setShowCloseConfirmation] = useState(false);\n\n const [isMatrixDialogOpen, setIsMatrixDialogOpen] = useState<boolean>(false);\n\n const { updateStatus, response } = useRiScs();\n\n // Used to scroll to the bottom of the drawer when the user deletes a scenario\n // via the quick edit and DeleteConfirmation\n const deleteScenarioRef = useRef<HTMLDivElement>(null);\n\n const formMethods = useForm<FormScenario>({\n defaultValues: mapScenarioToFormScenario(scenario),\n mode: 'onChange',\n });\n\n function onCancel() {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n setIsEditing(false);\n }\n\n function handleClose() {\n closeScenarioForm();\n setIsEditing(false);\n setShowCloseConfirmation(false);\n collapseAllActions();\n }\n\n function onClose() {\n if (formMethods.formState.isDirty) {\n setShowCloseConfirmation(true);\n } else {\n closeScenarioForm();\n setIsEditing(false);\n collapseAllActions();\n }\n }\n\n const onSubmit = formMethods.handleSubmit((data: FormScenario) => {\n submitEditedScenarioToRiSc(mapFormScenarioToScenario(data), () =>\n setIsEditing(false),\n );\n });\n\n function onSubmitAndCloseDialog() {\n onSubmit();\n setShowCloseConfirmation(false);\n\n if (deleteScenarioRef.current) {\n deleteScenarioRef.current.scrollIntoView({ behavior: 'smooth' });\n }\n }\n\n useEffect(() => {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [scenario]);\n\n return (\n <Drawer\n PaperProps={{\n sx: theme => ({\n padding: theme.spacing(4),\n width: '50%',\n gap: theme.spacing(3),\n [theme.breakpoints.down('sm')]: {\n width: '90%',\n padding: theme.spacing(2),\n },\n backgroundColor:\n theme.palette.mode === 'dark' ? '#333333' : '#f8f8f8',\n }),\n }}\n variant=\"temporary\"\n anchor=\"right\"\n open={isDrawerOpen}\n onClose={onClose}\n >\n <Box\n sx={{\n display: 'flex',\n gap: '16px',\n marginLeft: 'auto',\n }}\n >\n {!isEditing && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setIsEditing(true)}\n >\n {t('dictionary.edit')}\n </Button>\n )}\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={isEditing ? onCancel : onClose}\n >\n {t(isEditing ? 'dictionary.cancel' : 'dictionary.close')}\n </Button>\n </Box>\n\n {isEditing ? (\n <>\n <ScopeFormSection formMethods={formMethods} />\n <RiskFormSection\n formMethods={formMethods}\n setIsMatrixDialogOpen={setIsMatrixDialogOpen}\n />\n </>\n ) : (\n <>\n <ScopeSection />\n <RiskSection />\n </>\n )}\n <ActionsSection\n formMethods={formMethods}\n isEditing={isEditing}\n onSubmit={onSubmit}\n />\n <Box\n sx={{\n display: 'flex',\n gap: '16px',\n }}\n >\n {isEditing && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={onSubmit}\n disabled={!formMethods.formState.isDirty || updateStatus.isLoading}\n >\n {t('dictionary.save')}\n {updateStatus.isLoading && (\n <CircularProgress\n size={16}\n sx={{ marginLeft: 1, color: 'inherit' }}\n />\n )}\n </Button>\n )}\n <div ref={deleteScenarioRef}>\n <Button\n startIcon={<DeleteIcon />}\n variant=\"text\"\n color=\"primary\"\n onClick={() => setDeleteConfirmationIsOpen(true)}\n sx={{ marginLeft: 'auto' }}\n >\n {t('scenarioDrawer.deleteScenarioButton')}\n </Button>\n </div>\n </Box>\n\n {response &&\n response.status !== ProcessingStatus.ErrorWhenFetchingRiScs && (\n <Alert severity={getAlertSeverity(updateStatus)}>\n <Typography>{response.statusMessage}</Typography>\n </Alert>\n )}\n\n <DeleteConfirmation\n isOpen={deleteConfirmationIsOpen}\n setIsOpen={setDeleteConfirmationIsOpen}\n />\n <MatrixDialog\n open={isMatrixDialogOpen}\n close={() => setIsMatrixDialogOpen(false)}\n />\n <CloseConfirmation\n isOpen={showCloseConfirmation}\n close={handleClose}\n save={onSubmitAndCloseDialog}\n />\n </Drawer>\n );\n}\n"],"names":["RiskFormSection"],"mappings":";;;;;;;;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