@kartverket/backstage-plugin-risk-scorecard 1.3.0 → 1.4.0
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/Spinner.esm.js +24 -6
- package/dist/components/common/Spinner.esm.js.map +1 -1
- package/dist/components/riScDialog/MatrixDialog.esm.js +53 -0
- package/dist/components/riScDialog/MatrixDialog.esm.js.map +1 -0
- package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js +32 -14
- package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js.map +1 -1
- package/dist/components/riScPlugin/RiScPlugin.esm.js +2 -2
- package/dist/components/riScPlugin/RiScPlugin.esm.js.map +1 -1
- package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js +2 -2
- package/dist/components/riskMatrix/RiskMatrixScenarioCount.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +39 -13
- package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ActionBox.esm.js +104 -35
- package/dist/components/scenarioDrawer/components/ActionBox.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/{ActionFormSection.esm.js → ActionFormItem.esm.js} +19 -38
- package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js.map +1 -0
- package/dist/components/scenarioDrawer/components/ActionsSection.esm.js +38 -7
- package/dist/components/scenarioDrawer/components/ActionsSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js +19 -4
- package/dist/components/scenarioDrawer/components/DeleteConfirmation.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js +25 -10
- package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js.map +1 -1
- package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js +25 -2
- package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTable.esm.js +98 -10
- package/dist/components/scenarioTable/ScenarioTable.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTableRow.esm.js +50 -3
- package/dist/components/scenarioTable/ScenarioTableRow.esm.js.map +1 -1
- package/dist/components/scenarioTable/ScenarioTableStyles.esm.js +9 -0
- package/dist/components/scenarioTable/ScenarioTableStyles.esm.js.map +1 -1
- package/dist/components/scenarioWizard/ScenarioWizard.esm.js +55 -63
- package/dist/components/scenarioWizard/ScenarioWizard.esm.js.map +1 -1
- package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js +92 -55
- package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js.map +1 -1
- package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js +54 -27
- package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js.map +1 -1
- package/dist/components/scenarioWizard/components/RiskRadioButton.esm.js +22 -0
- package/dist/components/scenarioWizard/components/RiskRadioButton.esm.js.map +1 -0
- package/dist/components/scenarioWizard/steps/ActionsStep.esm.js +92 -14
- package/dist/components/scenarioWizard/steps/ActionsStep.esm.js.map +1 -1
- package/dist/components/scenarioWizard/steps/RiskStep.esm.js +3 -49
- package/dist/components/scenarioWizard/steps/RiskStep.esm.js.map +1 -1
- package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js +47 -48
- package/dist/components/scenarioWizard/steps/ScenarioStep.esm.js.map +1 -1
- package/dist/components/scenarioWizard/wizardStyles.esm.js +9 -6
- package/dist/components/scenarioWizard/wizardStyles.esm.js.map +1 -1
- package/dist/contexts/RiScContext.esm.js +27 -68
- package/dist/contexts/RiScContext.esm.js.map +1 -1
- package/dist/contexts/ScenarioContext.esm.js +75 -154
- package/dist/contexts/ScenarioContext.esm.js.map +1 -1
- package/dist/utils/DTOs.esm.js.map +1 -1
- package/dist/utils/constants.esm.js +3 -1
- package/dist/utils/constants.esm.js.map +1 -1
- package/dist/utils/hooks.esm.js +4 -17
- package/dist/utils/hooks.esm.js.map +1 -1
- package/dist/utils/style.esm.js +1 -48
- package/dist/utils/style.esm.js.map +1 -1
- package/dist/utils/translations.esm.js +27 -5
- package/dist/utils/translations.esm.js.map +1 -1
- package/dist/utils/types.esm.js +0 -1
- package/dist/utils/types.esm.js.map +1 -1
- package/dist/utils/utilityfunctions.esm.js +40 -12
- package/dist/utils/utilityfunctions.esm.js.map +1 -1
- package/package.json +3 -1
- package/dist/components/common/Dropdown.esm.js +0 -79
- package/dist/components/common/Dropdown.esm.js.map +0 -1
- package/dist/components/common/Textfield.esm.js +0 -64
- package/dist/components/common/Textfield.esm.js.map +0 -1
- package/dist/components/scenarioDrawer/components/ActionFormSection.esm.js.map +0 -1
- package/dist/components/scenarioWizard/components/ActionEdit.esm.js +0 -111
- package/dist/components/scenarioWizard/components/ActionEdit.esm.js.map +0 -1
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import { CircularProgress } from '@material-ui/core';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
4
4
|
|
|
5
|
-
const Spinner = ({ size }) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const Spinner = ({ size }) => /* @__PURE__ */ React.createElement(
|
|
6
|
+
Box,
|
|
7
|
+
{
|
|
8
|
+
sx: {
|
|
9
|
+
display: "flex",
|
|
10
|
+
minWidth: "100wh",
|
|
11
|
+
height: "100vh",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
alignItems: "flex-start"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
/* @__PURE__ */ React.createElement(
|
|
17
|
+
CircularProgress,
|
|
18
|
+
{
|
|
19
|
+
size,
|
|
20
|
+
sx: {
|
|
21
|
+
display: "flex",
|
|
22
|
+
marginTop: "200px"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
);
|
|
9
27
|
|
|
10
28
|
export { Spinner };
|
|
11
29
|
//# sourceMappingURL=Spinner.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.esm.js","sources":["../../../src/components/common/Spinner.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Spinner.esm.js","sources":["../../../src/components/common/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport Box from '@mui/material/Box';\nimport CircularProgress from '@mui/material/CircularProgress';\n\nexport const Spinner = ({ size }: { size?: string | number }) => (\n <Box\n sx={{\n display: 'flex',\n minWidth: '100wh',\n height: '100vh',\n justifyContent: 'center',\n alignItems: 'flex-start',\n }}\n >\n <CircularProgress\n size={size}\n sx={{\n display: 'flex',\n marginTop: '200px',\n }}\n />\n </Box>\n);\n"],"names":[],"mappings":";;;;AAIO,MAAM,OAAU,GAAA,CAAC,EAAE,IAAA,EACxB,qBAAA,KAAA,CAAA,aAAA;AAAA,EAAC,GAAA;AAAA,EAAA;AAAA,IACC,EAAI,EAAA;AAAA,MACF,OAAS,EAAA,MAAA;AAAA,MACT,QAAU,EAAA,OAAA;AAAA,MACV,MAAQ,EAAA,OAAA;AAAA,MACR,cAAgB,EAAA,QAAA;AAAA,MAChB,UAAY,EAAA,YAAA;AAAA,KACd;AAAA,GAAA;AAAA,kBAEA,KAAA,CAAA,aAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,SAAW,EAAA,OAAA;AAAA,OACb;AAAA,KAAA;AAAA,GACF;AACF;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable.esm.js';
|
|
3
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
4
|
+
import { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable.esm.js';
|
|
5
|
+
import { heading3 } from '../common/typography.esm.js';
|
|
6
|
+
import { pluginRiScTranslationRef } from '../../utils/translations.esm.js';
|
|
7
|
+
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
8
|
+
import Box from '@mui/material/Box';
|
|
9
|
+
import Dialog from '@mui/material/Dialog';
|
|
10
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
11
|
+
import IconButton from '@mui/material/IconButton';
|
|
12
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
13
|
+
import Typography from '@mui/material/Typography';
|
|
14
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
15
|
+
import Button from '@mui/material/Button';
|
|
16
|
+
|
|
17
|
+
const MatrixDialog = ({
|
|
18
|
+
open,
|
|
19
|
+
close
|
|
20
|
+
}) => {
|
|
21
|
+
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
22
|
+
return /* @__PURE__ */ React.createElement(Dialog, { maxWidth: "lg", open, onClose: close }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("scenarioDrawer.riskMatrixModal.title")), /* @__PURE__ */ React.createElement(
|
|
23
|
+
IconButton,
|
|
24
|
+
{
|
|
25
|
+
"aria-label": "close",
|
|
26
|
+
onClick: close,
|
|
27
|
+
sx: {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
right: 8,
|
|
30
|
+
top: 8,
|
|
31
|
+
color: (theme) => theme.palette.grey[500]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
/* @__PURE__ */ React.createElement(CloseIcon, null)
|
|
35
|
+
), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(
|
|
36
|
+
Typography,
|
|
37
|
+
{
|
|
38
|
+
sx: {
|
|
39
|
+
paddingBottom: "32px"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
t("scenarioStepper.initialRiskStep.subtitle")
|
|
43
|
+
), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, { sx: { ...heading3, paddingBottom: "4px" } }, t("dictionary.probability"))), /* @__PURE__ */ React.createElement(ProbabilityTableInfoWithHeaders, null), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(
|
|
44
|
+
Typography,
|
|
45
|
+
{
|
|
46
|
+
sx: { ...heading3, paddingTop: "16px", paddingBottom: "4px" }
|
|
47
|
+
},
|
|
48
|
+
t("dictionary.consequence")
|
|
49
|
+
)), /* @__PURE__ */ React.createElement(ConsequenceTableInfoWithHeaders, null)), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: close }, t("dictionary.close"))));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { MatrixDialog };
|
|
53
|
+
//# sourceMappingURL=MatrixDialog.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatrixDialog.esm.js","sources":["../../../src/components/riScDialog/MatrixDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { ConsequenceTableInfoWithHeaders } from '../scenarioWizard/components/ConsequenceTable';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { ProbabilityTableInfoWithHeaders } from '../scenarioWizard/components/ProbabilityTable';\nimport { heading3 } from '../common/typography';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport Box from '@mui/material/Box';\nimport Dialog from '@mui/material/Dialog';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport IconButton from '@mui/material/IconButton';\nimport DialogContent from '@mui/material/DialogContent';\nimport Typography from '@mui/material/Typography';\nimport DialogActions from '@mui/material/DialogActions';\nimport Button from '@mui/material/Button';\n\nexport const MatrixDialog = ({\n open,\n close,\n}: {\n open: boolean;\n close: () => void;\n}) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n return (\n <Dialog maxWidth=\"lg\" open={open} onClose={close}>\n <DialogTitle>{t('scenarioDrawer.riskMatrixModal.title')}</DialogTitle>\n <IconButton\n aria-label=\"close\"\n onClick={close}\n sx={{\n position: 'absolute',\n right: 8,\n top: 8,\n color: theme => theme.palette.grey[500],\n }}\n >\n <CloseIcon />\n </IconButton>\n <DialogContent>\n <Typography\n sx={{\n paddingBottom: '32px',\n }}\n >\n {t('scenarioStepper.initialRiskStep.subtitle')}\n </Typography>\n <Box>\n <Typography sx={{ ...heading3, paddingBottom: '4px' }}>\n {t('dictionary.probability')}\n </Typography>\n </Box>\n <ProbabilityTableInfoWithHeaders />\n <Box>\n <Typography\n sx={{ ...heading3, paddingTop: '16px', paddingBottom: '4px' }}\n >\n {t('dictionary.consequence')}\n </Typography>\n </Box>\n <ConsequenceTableInfoWithHeaders />\n </DialogContent>\n <DialogActions>\n <Button onClick={close}>{t('dictionary.close')}</Button>\n </DialogActions>\n </Dialog>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAgBO,MAAM,eAAe,CAAC;AAAA,EAC3B,IAAA;AAAA,EACA,KAAA;AACF,CAGM,KAAA;AACJ,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,QAAS,EAAA,IAAA,EAAK,IAAY,EAAA,OAAA,EAAS,KACzC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,WAAa,EAAA,IAAA,EAAA,CAAA,CAAE,sCAAsC,CAAE,CACxD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAW,EAAA,OAAA;AAAA,MACX,OAAS,EAAA,KAAA;AAAA,MACT,EAAI,EAAA;AAAA,QACF,QAAU,EAAA,UAAA;AAAA,QACV,KAAO,EAAA,CAAA;AAAA,QACP,GAAK,EAAA,CAAA;AAAA,QACL,KAAO,EAAA,CAAA,KAAA,KAAS,KAAM,CAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAAA,OACxC;AAAA,KAAA;AAAA,wCAEC,SAAU,EAAA,IAAA,CAAA;AAAA,GACb,sCACC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,aAAe,EAAA,MAAA;AAAA,OACjB;AAAA,KAAA;AAAA,IAEC,EAAE,0CAA0C,CAAA;AAAA,GAC/C,sCACC,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,EAAI,EAAA,EAAE,GAAG,QAAU,EAAA,aAAA,EAAe,OAC3C,EAAA,EAAA,CAAA,CAAE,wBAAwB,CAC7B,CACF,mBACC,KAAA,CAAA,aAAA,CAAA,+BAAA,EAAA,IAAgC,CACjC,kBAAA,KAAA,CAAA,aAAA,CAAC,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAI,EAAE,GAAG,UAAU,UAAY,EAAA,MAAA,EAAQ,eAAe,KAAM,EAAA;AAAA,KAAA;AAAA,IAE3D,EAAE,wBAAwB,CAAA;AAAA,GAE/B,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,+BAAgC,EAAA,IAAA,CACnC,mBACC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,SAAS,KAAQ,EAAA,EAAA,CAAA,CAAE,kBAAkB,CAAE,CACjD,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -18,6 +18,8 @@ import { InfoCard } from '@backstage/core-components';
|
|
|
18
18
|
import { PullRequestSvg } from '../../common/Icons.esm.js';
|
|
19
19
|
import { useRiScs } from '../../../contexts/RiScContext.esm.js';
|
|
20
20
|
import { subtitle1 } from '../../common/typography.esm.js';
|
|
21
|
+
import { Box } from '@material-ui/core';
|
|
22
|
+
import { WarningAmberOutlined } from '@mui/icons-material';
|
|
21
23
|
|
|
22
24
|
const RiScPublishDialog = ({
|
|
23
25
|
openDialog,
|
|
@@ -56,14 +58,23 @@ const RiScPublishDialog = ({
|
|
|
56
58
|
const RiScMigrationDialog = ({
|
|
57
59
|
openDialog,
|
|
58
60
|
handleCancel,
|
|
59
|
-
handleUpdate
|
|
61
|
+
handleUpdate,
|
|
62
|
+
migrationVersions
|
|
60
63
|
}) => {
|
|
61
64
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
62
65
|
const [saveMigration, setSaveMigration] = useState(false);
|
|
63
66
|
const handleCheckboxInput = (event) => {
|
|
64
67
|
setSaveMigration(event.target.checked);
|
|
65
68
|
};
|
|
66
|
-
return /* @__PURE__ */ React.createElement(Dialog, { open: openDialog }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("migrationDialog.title")), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(
|
|
69
|
+
return /* @__PURE__ */ React.createElement(Dialog, { open: openDialog }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("migrationDialog.title")), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Box, { sx: { marginBottom: "16px" } }, /* @__PURE__ */ React.createElement(Typography, null, t("migrationDialog.description"), migrationVersions?.toVersion, " ", t("migrationDialog.description2"), " ", migrationVersions?.fromVersion, t("migrationDialog.description3"), /* @__PURE__ */ React.createElement(
|
|
70
|
+
Link,
|
|
71
|
+
{
|
|
72
|
+
underline: "always",
|
|
73
|
+
target: "_blank",
|
|
74
|
+
href: "https://github.com/kartverket/backstage-plugin-risk-scorecard-backend/blob/main/docs/schemaChangelog.md"
|
|
75
|
+
},
|
|
76
|
+
t("migrationDialog.changelog")
|
|
77
|
+
), " ", t("migrationDialog.description4"))), /* @__PURE__ */ React.createElement(Alert, { severity: "info", icon: false }, /* @__PURE__ */ React.createElement(
|
|
67
78
|
FormControlLabel,
|
|
68
79
|
{
|
|
69
80
|
control: /* @__PURE__ */ React.createElement(
|
|
@@ -91,7 +102,13 @@ const RosAcceptance = ({
|
|
|
91
102
|
}) => {
|
|
92
103
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
93
104
|
if (migration) {
|
|
94
|
-
return /* @__PURE__ */ React.createElement(Typography, { paragraph: true, sx: subtitle1 },
|
|
105
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { paragraph: true, sx: subtitle1 }, /* @__PURE__ */ React.createElement(
|
|
106
|
+
WarningAmberOutlined,
|
|
107
|
+
{
|
|
108
|
+
fontSize: "medium",
|
|
109
|
+
sx: { transform: "translateY(5px)", marginTop: "5px" }
|
|
110
|
+
}
|
|
111
|
+
), " ", t("rosStatus.statusBadge.migration.title")), /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.statusBadge.migration.description")));
|
|
95
112
|
}
|
|
96
113
|
switch (status) {
|
|
97
114
|
case RiScStatus.Draft:
|
|
@@ -123,9 +140,9 @@ const RiScStatusComponent = ({
|
|
|
123
140
|
RosAcceptance,
|
|
124
141
|
{
|
|
125
142
|
status: selectedRiSc.status,
|
|
126
|
-
migration: selectedRiSc.migrationChanges
|
|
143
|
+
migration: selectedRiSc.migrationStatus?.migrationChanges
|
|
127
144
|
}
|
|
128
|
-
), selectedRiSc.status === RiScStatus.SentForApproval && !selectedRiSc.migrationChanges && /* @__PURE__ */ React.createElement(Typography, { sx: { fontWeight: 700 }, paragraph: true, variant: "subtitle1" }, /* @__PURE__ */ React.createElement(PullRequestSvg, null), t("rosStatus.prStatus"), /* @__PURE__ */ React.createElement(Link, { target: "_blank", href: selectedRiSc.pullRequestUrl }, "Github")), selectedRiSc.status === RiScStatus.Draft && !selectedRiSc.migrationChanges && /* @__PURE__ */ React.createElement(
|
|
145
|
+
), selectedRiSc.status === RiScStatus.SentForApproval && !selectedRiSc.migrationStatus?.migrationChanges && /* @__PURE__ */ React.createElement(Typography, { sx: { fontWeight: 700 }, paragraph: true, variant: "subtitle1" }, /* @__PURE__ */ React.createElement(PullRequestSvg, null), t("rosStatus.prStatus"), /* @__PURE__ */ React.createElement(Link, { target: "_blank", href: selectedRiSc.pullRequestUrl }, "Github")), selectedRiSc.status === RiScStatus.Draft && !selectedRiSc.migrationStatus?.migrationChanges && /* @__PURE__ */ React.createElement(
|
|
129
146
|
Button,
|
|
130
147
|
{
|
|
131
148
|
color: "primary",
|
|
@@ -135,7 +152,7 @@ const RiScStatusComponent = ({
|
|
|
135
152
|
sx: { display: "block", marginLeft: "auto" }
|
|
136
153
|
},
|
|
137
154
|
t("rosStatus.approveButton")
|
|
138
|
-
), selectedRiSc.migrationChanges && /* @__PURE__ */ React.createElement(
|
|
155
|
+
), selectedRiSc.migrationStatus?.migrationChanges && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
139
156
|
Button,
|
|
140
157
|
{
|
|
141
158
|
color: "primary",
|
|
@@ -143,21 +160,22 @@ const RiScStatusComponent = ({
|
|
|
143
160
|
onClick: () => setMigrationDialogIsOpen(!migrationDialogIsOpen),
|
|
144
161
|
sx: { display: "block", marginLeft: "auto" }
|
|
145
162
|
},
|
|
146
|
-
/* @__PURE__ */ React.createElement(Typography, { variant: "button" }, t("rosStatus.
|
|
163
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "button" }, t("rosStatus.moreInformationButton"))
|
|
147
164
|
), /* @__PURE__ */ React.createElement(
|
|
165
|
+
RiScMigrationDialog,
|
|
166
|
+
{
|
|
167
|
+
openDialog: migrationDialogIsOpen,
|
|
168
|
+
handleUpdate,
|
|
169
|
+
handleCancel: () => setMigrationDialogIsOpen(false),
|
|
170
|
+
migrationVersions: selectedRiSc.migrationStatus?.migrationVersions
|
|
171
|
+
}
|
|
172
|
+
)), /* @__PURE__ */ React.createElement(
|
|
148
173
|
RiScPublishDialog,
|
|
149
174
|
{
|
|
150
175
|
openDialog: publishRiScDialogIsOpen,
|
|
151
176
|
handlePublish: handleApproveAndPublish,
|
|
152
177
|
handleCancel: () => setPublishRiScDialogIsOpen(false)
|
|
153
178
|
}
|
|
154
|
-
), /* @__PURE__ */ React.createElement(
|
|
155
|
-
RiScMigrationDialog,
|
|
156
|
-
{
|
|
157
|
-
openDialog: migrationDialogIsOpen,
|
|
158
|
-
handleUpdate,
|
|
159
|
-
handleCancel: () => setMigrationDialogIsOpen(false)
|
|
160
|
-
}
|
|
161
179
|
));
|
|
162
180
|
};
|
|
163
181
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RiScStatusComponent.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/RiScStatusComponent.tsx"],"sourcesContent":["import React, { ReactComponentElement, useState } from 'react';\nimport { RiScStatus, RiScWithMetadata } from '../../../utils/types';\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 { pluginRiScTranslationRef } from '../../../utils/translations';\nimport CheckIcon from '@mui/icons-material/Check';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { dialogActions } from '../../common/mixins';\nimport { InfoCard } from '@backstage/core-components';\nimport { PullRequestSvg } from '../../common/Icons';\nimport { useRiScs } from '../../../contexts/RiScContext';\nimport { subtitle1 } from '../../common/typography';\n\ninterface RiScPublishDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handlePublish: () => void;\n}\n\nconst RiScPublishDialog = ({\n openDialog,\n handleCancel,\n handlePublish,\n}: RiScPublishDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [riskOwnerApproves, setRiskOwnerApproves] = useState<boolean>(false);\n\n const 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 <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 </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handlePublish}\n disabled={!riskOwnerApproves}\n >\n {t('dictionary.confirm')}\n </Button>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\ninterface RiScMigrationDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handleUpdate: () => void;\n}\n\nconst RiScMigrationDialog = ({\n openDialog,\n handleCancel,\n handleUpdate,\n}: RiScMigrationDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [saveMigration, setSaveMigration] = useState<boolean>(false);\n\n const 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 <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\n variant=\"contained\"\n onClick={handleUpdate}\n disabled={!saveMigration}\n >\n {t('dictionary.confirm')}\n </Button>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\nconst RosAcceptance = ({\n status,\n migration,\n}: {\n status: RiScStatus;\n migration?: boolean;\n}): React.JSX.Element => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n if (migration) {\n return (\n <Typography paragraph sx={subtitle1}>\n {t('rosStatus.statusBadge.migration')}\n </Typography>\n );\n }\n switch (status) {\n case RiScStatus.Draft:\n return (\n <Typography paragraph sx={subtitle1}>\n {t('rosStatus.statusBadge.missing')}\n </Typography>\n );\n case RiScStatus.SentForApproval:\n case RiScStatus.Published:\n return (\n <Typography paragraph sx={subtitle1}>\n <CheckIcon fontSize=\"medium\" sx={{ transform: 'translateY(5px)' }} />{' '}\n {t('rosStatus.statusBadge.approved')}\n </Typography>\n );\n default:\n return (\n <Typography paragraph sx={subtitle1}>\n {t('rosStatus.statusBadge.error')}\n </Typography>\n );\n }\n};\n\ninterface RiScStatusProps {\n selectedRiSc: RiScWithMetadata;\n publishRiScFn: () => void;\n}\n\nexport const RiScStatusComponent = ({\n selectedRiSc,\n publishRiScFn,\n}: RiScStatusProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [publishRiScDialogIsOpen, setPublishRiScDialogIsOpen] =\n useState<boolean>(false);\n\n const [migrationDialogIsOpen, setMigrationDialogIsOpen] =\n useState<boolean>(false);\n\n const { updateRiSc } = useRiScs();\n\n const handleApproveAndPublish = () => {\n publishRiScFn();\n setPublishRiScDialogIsOpen(false);\n };\n\n const handleUpdate = () => {\n updateRiSc(selectedRiSc.content);\n setMigrationDialogIsOpen(false);\n };\n\n return (\n <InfoCard>\n <Typography variant=\"h5\">Status</Typography>\n\n <RosAcceptance\n status={selectedRiSc.status}\n migration={selectedRiSc.migrationChanges}\n />\n {selectedRiSc.status === RiScStatus.SentForApproval &&\n !selectedRiSc.migrationChanges && (\n <Typography sx={{ fontWeight: 700 }} paragraph variant=\"subtitle1\">\n <PullRequestSvg />\n {t('rosStatus.prStatus')}\n <Link target=\"_blank\" href={selectedRiSc.pullRequestUrl}>\n Github\n </Link>\n </Typography>\n )}\n {selectedRiSc.status === RiScStatus.Draft &&\n !selectedRiSc.migrationChanges && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setPublishRiScDialogIsOpen(!publishRiScDialogIsOpen)}\n disabled={selectedRiSc.status !== RiScStatus.Draft}\n sx={{ display: 'block', marginLeft: 'auto' }}\n >\n {t('rosStatus.approveButton')}\n </Button>\n )}\n {selectedRiSc.migrationChanges && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setMigrationDialogIsOpen(!migrationDialogIsOpen)}\n sx={{ display: 'block', marginLeft: 'auto' }}\n >\n <Typography variant=\"button\">{t('rosStatus.saveButton')}</Typography>\n </Button>\n )}\n <RiScPublishDialog\n openDialog={publishRiScDialogIsOpen}\n handlePublish={handleApproveAndPublish}\n handleCancel={() => setPublishRiScDialogIsOpen(false)}\n />\n <RiScMigrationDialog\n openDialog={migrationDialogIsOpen}\n handleUpdate={handleUpdate}\n handleCancel={() => setMigrationDialogIsOpen(false)}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,oBAAoB,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AACF,CAA0D,KAAA;AACxD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAEzE,EAAM,MAAA,mBAAA,GAAsB,CAAC,KAA+C,KAAA;AAC1E,IAAqB,oBAAA,CAAA,KAAA,CAAM,OAAO,OAAO,CAAA,CAAA;AAAA,GAC3C,CAAA;AAEA,EAAA,2CACG,MAAO,EAAA,EAAA,IAAA,EAAM,UACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAa,CAAE,CAAA,qBAAqB,CAAE,CAAA,sCACtC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CA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AAAA,KAAA;AAAA,IAE1C,EAAE,yBAAyB,CAAA;AAAA,GAC9B,EAEH,aAAa,gBACZ,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,SAAA;AAAA,MACN,OAAQ,EAAA,WAAA;AAAA,MACR,OAAS,EAAA,MAAM,wBAAyB,CAAA,CAAC,qBAAqB,CAAA;AAAA,MAC9D,EAAI,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,YAAY,MAAO,EAAA;AAAA,KAAA;AAAA,wCAE1C,UAAW,EAAA,EAAA,OAAA,EAAQ,QAAU,EAAA,EAAA,CAAA,CAAE,sBAAsB,CAAE,CAAA;AAAA,GAG5D,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,uBAAA;AAAA,MACZ,aAAe,EAAA,uBAAA;AAAA,MACf,YAAA,EAAc,MAAM,0BAAA,CAA2B,KAAK,CAAA;AAAA,KAAA;AAAA,GAEtD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,qBAAA;AAAA,MACZ,YAAA;AAAA,MACA,YAAA,EAAc,MAAM,wBAAA,CAAyB,KAAK,CAAA;AAAA,KAAA;AAAA,GAEtD,CAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"RiScStatusComponent.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/RiScStatusComponent.tsx"],"sourcesContent":["import React, { ReactComponentElement, useState } from 'react';\nimport {\n MigrationVersions,\n RiScStatus,\n RiScWithMetadata,\n} from '../../../utils/types';\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 { pluginRiScTranslationRef } from '../../../utils/translations';\nimport CheckIcon from '@mui/icons-material/Check';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { dialogActions } from '../../common/mixins';\nimport { InfoCard } from '@backstage/core-components';\nimport { PullRequestSvg } from '../../common/Icons';\nimport { useRiScs } from '../../../contexts/RiScContext';\nimport { subtitle1 } from '../../common/typography';\nimport { Box } from '@material-ui/core';\nimport { WarningAmberOutlined } from '@mui/icons-material';\n\ninterface RiScPublishDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handlePublish: () => void;\n}\n\nconst RiScPublishDialog = ({\n openDialog,\n handleCancel,\n handlePublish,\n}: RiScPublishDialogProps): ReactComponentElement<any> => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [riskOwnerApproves, setRiskOwnerApproves] = useState<boolean>(false);\n\n const 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 <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 </DialogContent>\n <DialogActions sx={dialogActions}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n onClick={handlePublish}\n disabled={!riskOwnerApproves}\n >\n {t('dictionary.confirm')}\n </Button>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\ninterface RiScMigrationDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handleUpdate: () => void;\n migrationVersions?: MigrationVersions;\n}\n\nconst 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 const 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=\"https://github.com/kartverket/backstage-plugin-risk-scorecard-backend/blob/main/docs/schemaChangelog.md\"\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\n variant=\"contained\"\n onClick={handleUpdate}\n disabled={!saveMigration}\n >\n {t('dictionary.confirm')}\n </Button>\n <Button variant=\"outlined\" color=\"primary\" onClick={handleCancel}>\n {t('dictionary.cancel')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\nconst RosAcceptance = ({\n status,\n migration,\n}: {\n status: RiScStatus;\n migration?: boolean;\n}): React.JSX.Element => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n if (migration) {\n return (\n <>\n <Typography paragraph sx={subtitle1}>\n <WarningAmberOutlined\n fontSize=\"medium\"\n sx={{ transform: 'translateY(5px)', marginTop: '5px' }}\n />{' '}\n {t('rosStatus.statusBadge.migration.title')}\n </Typography>\n <Typography>\n {t('rosStatus.statusBadge.migration.description')}\n </Typography>\n </>\n );\n }\n switch (status) {\n case RiScStatus.Draft:\n return (\n <Typography paragraph sx={subtitle1}>\n {t('rosStatus.statusBadge.missing')}\n </Typography>\n );\n case RiScStatus.SentForApproval:\n case RiScStatus.Published:\n return (\n <Typography paragraph sx={subtitle1}>\n <CheckIcon fontSize=\"medium\" sx={{ transform: 'translateY(5px)' }} />{' '}\n {t('rosStatus.statusBadge.approved')}\n </Typography>\n );\n default:\n return (\n <Typography paragraph sx={subtitle1}>\n {t('rosStatus.statusBadge.error')}\n </Typography>\n );\n }\n};\n\ninterface RiScStatusProps {\n selectedRiSc: RiScWithMetadata;\n publishRiScFn: () => void;\n}\n\nexport const RiScStatusComponent = ({\n selectedRiSc,\n publishRiScFn,\n}: RiScStatusProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [publishRiScDialogIsOpen, setPublishRiScDialogIsOpen] =\n useState<boolean>(false);\n\n const [migrationDialogIsOpen, setMigrationDialogIsOpen] =\n useState<boolean>(false);\n\n const { updateRiSc } = useRiScs();\n\n const handleApproveAndPublish = () => {\n publishRiScFn();\n setPublishRiScDialogIsOpen(false);\n };\n\n const handleUpdate = () => {\n updateRiSc(selectedRiSc.content);\n setMigrationDialogIsOpen(false);\n };\n\n return (\n <InfoCard>\n <Typography variant=\"h5\">Status</Typography>\n\n <RosAcceptance\n status={selectedRiSc.status}\n migration={selectedRiSc.migrationStatus?.migrationChanges}\n />\n {selectedRiSc.status === RiScStatus.SentForApproval &&\n !selectedRiSc.migrationStatus?.migrationChanges && (\n <Typography sx={{ fontWeight: 700 }} paragraph variant=\"subtitle1\">\n <PullRequestSvg />\n {t('rosStatus.prStatus')}\n <Link target=\"_blank\" href={selectedRiSc.pullRequestUrl}>\n Github\n </Link>\n </Typography>\n )}\n {selectedRiSc.status === RiScStatus.Draft &&\n !selectedRiSc.migrationStatus?.migrationChanges && (\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setPublishRiScDialogIsOpen(!publishRiScDialogIsOpen)}\n disabled={selectedRiSc.status !== RiScStatus.Draft}\n sx={{ display: 'block', marginLeft: 'auto' }}\n >\n {t('rosStatus.approveButton')}\n </Button>\n )}\n {selectedRiSc.migrationStatus?.migrationChanges && (\n <>\n <Button\n color=\"primary\"\n variant=\"contained\"\n onClick={() => setMigrationDialogIsOpen(!migrationDialogIsOpen)}\n sx={{ display: 'block', marginLeft: 'auto' }}\n >\n <Typography variant=\"button\">\n {t('rosStatus.moreInformationButton')}\n </Typography>\n </Button>\n <RiScMigrationDialog\n openDialog={migrationDialogIsOpen}\n handleUpdate={handleUpdate}\n handleCancel={() => setMigrationDialogIsOpen(false)}\n migrationVersions={selectedRiSc.migrationStatus?.migrationVersions}\n />\n </>\n )}\n <RiScPublishDialog\n openDialog={publishRiScDialogIsOpen}\n handlePublish={handleApproveAndPublish}\n handleCancel={() => setPublishRiScDialogIsOpen(false)}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,oBAAoB,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AACF,CAA0D,KAAA;AACxD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAEzE,EAAM,MAAA,mBAAA,GAAsB,CAAC,KAA+C,KAAA;AAC1E,IAAqB,oBAAA,CAAA,KAAA,CAAM,OAAO,OAAO,CAAA,CAAA;AAAA,GAC3C,CAAA;AAEA,EAAA,2CACG,MAAO,EAAA,EAAA,IAAA,EAAM,UACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBAAa,CAAE,CAAA,qBAAqB,CAAE,CAAA,sCACtC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SAAM,QAAS,EAAA,MAAA,EAAO,M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qB,CAAA;AAAA,MAC9D,EAAI,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,YAAY,MAAO,EAAA;AAAA,KAAA;AAAA,wCAE1C,UAAW,EAAA,EAAA,OAAA,EAAQ,QACjB,EAAA,EAAA,CAAA,CAAE,iCAAiC,CACtC,CAAA;AAAA,GAEF,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,mBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,qBAAA;AAAA,MACZ,YAAA;AAAA,MACA,YAAA,EAAc,MAAM,wBAAA,CAAyB,KAAK,CAAA;AAAA,MAClD,iBAAA,EAAmB,aAAa,eAAiB,EAAA,iBAAA;AAAA,KAAA;AAAA,GAErD,CAEF,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,uBAAA;AAAA,MACZ,aAAe,EAAA,uBAAA;AAAA,MACf,YAAA,EAAc,MAAM,0BAAA,CAA2B,KAAK,CAAA;AAAA,KAAA;AAAA,GAExD,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -4,7 +4,6 @@ import { useSearchParams } from 'react-router-dom';
|
|
|
4
4
|
import { ScenarioWizard } from '../scenarioWizard/ScenarioWizard.esm.js';
|
|
5
5
|
import { ScenarioDrawer } from '../scenarioDrawer/ScenarioDrawer.esm.js';
|
|
6
6
|
import { RiskMatrix } from '../riskMatrix/RiskMatrix.esm.js';
|
|
7
|
-
import { ScenarioTable } from '../scenarioTable/ScenarioTable.esm.js';
|
|
8
7
|
import Alert from '@mui/material/Alert';
|
|
9
8
|
import Button from '@mui/material/Button';
|
|
10
9
|
import Grid from '@mui/material/Grid';
|
|
@@ -21,6 +20,7 @@ import { useRiScs } from '../../contexts/RiScContext.esm.js';
|
|
|
21
20
|
import MUISelect from '@mui/material/Select';
|
|
22
21
|
import MenuItem from '@mui/material/MenuItem';
|
|
23
22
|
import ListItemText from '@mui/material/ListItemText';
|
|
23
|
+
import { ScenarioTableWrapper } from '../scenarioTable/ScenarioTable.esm.js';
|
|
24
24
|
|
|
25
25
|
const RiScPlugin = () => {
|
|
26
26
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
@@ -95,7 +95,7 @@ const RiScPlugin = () => {
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
t("contentHeader.createNewButton")
|
|
98
|
-
)), selectedRiSc && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(RiScInfo, { riSc: selectedRiSc, edit: openEditRiScDialog })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true, md: 7, lg: 8 }, /* @__PURE__ */ React.createElement(
|
|
98
|
+
)), selectedRiSc && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(RiScInfo, { riSc: selectedRiSc, edit: openEditRiScDialog })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true, md: 7, lg: 8 }, /* @__PURE__ */ React.createElement(ScenarioTableWrapper, { riSc: selectedRiSc })), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true, md: 5, lg: 4 }, /* @__PURE__ */ React.createElement(RiskMatrix, { riSc: selectedRiSc.content }))))), riScDialogState !== RiScDialogStates.Closed && /* @__PURE__ */ React.createElement(RiScDialog, { onClose: closeRiScDialog, dialogState: riScDialogState }), !scenarioWizardStep && /* @__PURE__ */ React.createElement(ScenarioDrawer, null));
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
export { RiScPlugin };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RiScPlugin.esm.js","sources":["../../../src/components/riScPlugin/RiScPlugin.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { ContentHeader, SupportButton } from '@backstage/core-components';\nimport { useSearchParams } from 'react-router-dom';\nimport { ScenarioWizard } from '../scenarioWizard/ScenarioWizard';\nimport { ScenarioDrawer } from '../scenarioDrawer/ScenarioDrawer';\nimport { RiskMatrix } from '../riskMatrix/RiskMatrix';\nimport
|
|
1
|
+
{"version":3,"file":"RiScPlugin.esm.js","sources":["../../../src/components/riScPlugin/RiScPlugin.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { ContentHeader, SupportButton } from '@backstage/core-components';\nimport { useSearchParams } from 'react-router-dom';\nimport { ScenarioWizard } from '../scenarioWizard/ScenarioWizard';\nimport { ScenarioDrawer } from '../scenarioDrawer/ScenarioDrawer';\nimport { RiskMatrix } from '../riskMatrix/RiskMatrix';\nimport Alert from '@mui/material/Alert';\nimport Button from '@mui/material/Button';\nimport Grid from '@mui/material/Grid';\nimport LinearProgress from '@mui/material/LinearProgress';\nimport Typography from '@mui/material/Typography';\nimport { getAlertSeverity } from '../../utils/utilityfunctions';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../utils/translations';\nimport { RiScDialog, RiScDialogStates } from '../riScDialog/RiScDialog';\nimport { RiScInfo } from '../riScInfo/RiScInfo';\nimport AddCircle from '@mui/icons-material/AddCircle';\nimport { Spinner } from '../common/Spinner';\nimport { useRiScs } from '../../contexts/RiScContext';\nimport Select from '@mui/material/Select';\nimport MenuItem from '@mui/material/MenuItem';\nimport ListItemText from '@mui/material/ListItemText';\nimport { ScenarioWizardSteps } from '../../contexts/ScenarioContext';\nimport { ScenarioTableWrapper } from '../scenarioTable/ScenarioTable';\n\nexport const RiScPlugin = () => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const [riScDialogState, setRiScDialogState] = useState<RiScDialogStates>(\n RiScDialogStates.Closed,\n );\n\n const openCreateRiScDialog = () =>\n setRiScDialogState(RiScDialogStates.Create);\n const openEditRiScDialog = () => setRiScDialogState(RiScDialogStates.Edit);\n const closeRiScDialog = () => setRiScDialogState(RiScDialogStates.Closed);\n\n const {\n selectedRiSc,\n riScs,\n selectRiSc,\n isFetching,\n resetRiScStatus,\n response,\n riScUpdateStatus,\n } = useRiScs();\n\n const [searchParams] = useSearchParams();\n const scenarioWizardStep = searchParams.get(\n 'step',\n ) as ScenarioWizardSteps | null;\n\n useEffect(() => {\n if (scenarioWizardStep !== null) resetRiScStatus();\n }, [resetRiScStatus, scenarioWizardStep]);\n\n return (\n <>\n {response && (\n <Alert\n severity={getAlertSeverity(response.status)}\n sx={{ marginBottom: 2 }}\n >\n <Typography>{response.statusMessage}</Typography>\n </Alert>\n )}\n {riScUpdateStatus.isLoading && (\n <LinearProgress\n sx={{\n position: 'sticky',\n top: 0,\n margin: 2,\n }}\n />\n )}\n\n {scenarioWizardStep !== null ? (\n <ScenarioWizard step={scenarioWizardStep} />\n ) : (\n <>\n <ContentHeader title={t('contentHeader.title')}>\n <SupportButton />\n </ContentHeader>\n\n {isFetching && <Spinner size={80} />}\n\n <Grid container spacing={4}>\n {riScs !== null && riScs.length !== 0 && (\n <Grid\n item\n xs={12}\n sm={6}\n sx={{\n maxWidth: '600px',\n minWidth: '300px',\n }}\n >\n <Select\n variant=\"standard\"\n value={selectedRiSc?.content.title ?? ''}\n onChange={e => selectRiSc(e.target.value)}\n sx={{ width: '100%' }}\n >\n {riScs.map(riSc => (\n <MenuItem key={riSc.id} value={riSc.content.title}>\n <ListItemText primary={riSc.content.title} />\n </MenuItem>\n )) ?? []}\n </Select>\n </Grid>\n )}\n\n {!isFetching && (\n <Grid item xs>\n <Button\n startIcon={<AddCircle />}\n variant=\"text\"\n color=\"primary\"\n onClick={openCreateRiScDialog}\n sx={{\n minWidth: '205px',\n }}\n >\n {t('contentHeader.createNewButton')}\n </Button>\n </Grid>\n )}\n\n {selectedRiSc && (\n <>\n <Grid item xs={12}>\n <RiScInfo riSc={selectedRiSc} edit={openEditRiScDialog} />\n </Grid>\n <Grid item xs md={7} lg={8}>\n <ScenarioTableWrapper riSc={selectedRiSc} />\n </Grid>\n <Grid item xs md={5} lg={4}>\n <RiskMatrix riSc={selectedRiSc.content} />\n </Grid>\n </>\n )}\n </Grid>\n </>\n )}\n\n {riScDialogState !== RiScDialogStates.Closed && (\n <RiScDialog onClose={closeRiScDialog} dialogState={riScDialogState} />\n )}\n\n {!scenarioWizardStep && <ScenarioDrawer />}\n </>\n );\n};\n"],"names":["Select"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,aAAa,MAAM;AAC9B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAM,MAAA,CAAC,eAAiB,EAAA,kBAAkB,CAAI,GAAA,QAAA;AAAA,IAC5C,gBAAiB,CAAA,MAAA;AAAA,GACnB,CAAA;AAEA,EAAA,MAAM,oBAAuB,GAAA,MAC3B,kBAAmB,CAAA,gBAAA,CAAiB,MAAM,CAAA,CAAA;AAC5C,EAAA,MAAM,kBAAqB,GAAA,MAAM,kBAAmB,CAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACzE,EAAA,MAAM,eAAkB,GAAA,MAAM,kBAAmB,CAAA,gBAAA,CAAiB,MAAM,CAAA,CAAA;AAExE,EAAM,MAAA;AAAA,IACJ,YAAA;AAAA,IACA,KAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,eAAA;AAAA,IACA,QAAA;AAAA,IACA,gBAAA;AAAA,MACE,QAAS,EAAA,CAAA;AAEb,EAAM,MAAA,CAAC,YAAY,CAAA,GAAI,eAAgB,EAAA,CAAA;AACvC,EAAA,MAAM,qBAAqB,YAAa,CAAA,GAAA;AAAA,IACtC,MAAA;AAAA,GACF,CAAA;AAEA,EAAA,SAAA,CAAU,MAAM;AACd,IAAI,IAAA,kBAAA,KAAuB,MAAsB,eAAA,EAAA,CAAA;AAAA,GAChD,EAAA,CAAC,eAAiB,EAAA,kBAAkB,CAAC,CAAA,CAAA;AAExC,EAAA,iEAEK,QACC,oBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AA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,kBACC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IAAC,EAAA,EAAA,EAAI,CAAG,EAAA,EAAA,EAAI,CACvB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,oBAAqB,EAAA,EAAA,IAAA,EAAM,cAAc,CAC5C,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAC,EAAE,EAAA,IAAA,EAAC,IAAI,CAAG,EAAA,EAAA,EAAI,CACvB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,IAAA,EAAM,YAAa,CAAA,OAAA,EAAS,CAC1C,CACF,CAEJ,CACF,CAAA,EAGD,eAAoB,KAAA,gBAAA,CAAiB,MACpC,oBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAS,EAAA,eAAA,EAAiB,WAAa,EAAA,eAAA,EAAiB,CAGrE,EAAA,CAAC,kBAAsB,oBAAA,KAAA,CAAA,aAAA,CAAC,oBAAe,CAC1C,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -24,10 +24,10 @@ const RiskMatrixScenarioCount = ({
|
|
|
24
24
|
tooltipText
|
|
25
25
|
} = useRiskMatrixStyles();
|
|
26
26
|
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
27
|
-
const {
|
|
27
|
+
const { openScenarioDrawer } = useScenario();
|
|
28
28
|
const handleScenarioClick = (ID) => {
|
|
29
29
|
setTooltipOpen(false);
|
|
30
|
-
|
|
30
|
+
openScenarioDrawer(ID);
|
|
31
31
|
};
|
|
32
32
|
const scenarios = riSc.scenarios.filter(
|
|
33
33
|
(scenario) => probabilityOptions.indexOf(
|
|
@@ -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 React, { useState } from 'react';\nimport CircleIcon from '@material-ui/icons/FiberManualRecord';\nimport { consequenceOptions, probabilityOptions } from '../../utils/constants';\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';\n\ninterface ScenarioCountProps {\n riSc: RiSc;\n probability: number;\n consequence: number;\n initialRisk: boolean;\n}\n\nexport const 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 {
|
|
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 React, { useState } from 'react';\nimport CircleIcon from '@material-ui/icons/FiberManualRecord';\nimport { consequenceOptions, probabilityOptions } from '../../utils/constants';\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';\n\ninterface ScenarioCountProps {\n riSc: RiSc;\n probability: number;\n consequence: number;\n initialRisk: boolean;\n}\n\nexport const 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 const handleScenarioClick = (ID: string) => {\n setTooltipOpen(false);\n openScenarioDrawer(ID);\n };\n\n const scenarios = riSc.scenarios.filter(\n scenario =>\n probabilityOptions.indexOf(\n initialRisk\n ? scenario.risk.probability\n : scenario.remainingRisk.probability,\n ) === probability &&\n consequenceOptions.indexOf(\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":";;;;;;;;;AA0BO,MAAM,0BAA0B,CAAC;AAAA,EACtC,IAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AACF,CAA0B,KAAA;AACxB,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EAAA;AAAA,QACX,OAAS,EAAA,MAAM,cAAe,CAAA,CAAC,WAAW,CAAA;AAAA,OAAA;AAAA,sBAE1C,KAAA,CAAA,aAAA,CAAC,cAAW,SAAW,EAAA,CAAA,EAAG,UAAU,CAAI,CAAA,EAAA,IAAI,CACzC,CAAA,EAAA,EAAA,SAAA,CAAU,MACb,CAAA;AAAA,KACF;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -11,7 +11,6 @@ import { ScopeSection } from './components/ScopeSection.esm.js';
|
|
|
11
11
|
import { useForm } from 'react-hook-form';
|
|
12
12
|
import { ProcessingStatus } from '../../utils/types.esm.js';
|
|
13
13
|
import ScenarioForm from './components/RiskFormSection.esm.js';
|
|
14
|
-
import ActionFormSection from './components/ActionFormSection.esm.js';
|
|
15
14
|
import ScopeFormSection from './components/ScopeFormSection.esm.js';
|
|
16
15
|
import Drawer from '@mui/material/Drawer';
|
|
17
16
|
import Button from '@mui/material/Button';
|
|
@@ -20,6 +19,7 @@ import CircularProgress from '@mui/material/CircularProgress';
|
|
|
20
19
|
import Alert from '@mui/material/Alert';
|
|
21
20
|
import { getAlertSeverity } from '../../utils/utilityfunctions.esm.js';
|
|
22
21
|
import Typography from '@mui/material/Typography';
|
|
22
|
+
import { MatrixDialog } from '../riScDialog/MatrixDialog.esm.js';
|
|
23
23
|
|
|
24
24
|
const ScenarioDrawer = () => {
|
|
25
25
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
@@ -27,29 +27,35 @@ const ScenarioDrawer = () => {
|
|
|
27
27
|
const {
|
|
28
28
|
scenario,
|
|
29
29
|
isDrawerOpen,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
closeScenarioForm,
|
|
31
|
+
submitEditedScenarioToRiSc,
|
|
32
|
+
mapScenarioToFormScenario,
|
|
33
|
+
mapFormScenarioToScenario
|
|
33
34
|
} = useScenario();
|
|
35
|
+
const [deleteConfirmationIsOpen, setDeleteConfirmationIsOpen] = useState(false);
|
|
36
|
+
const [isMatrixDialogOpen, setIsMatrixDialogOpen] = useState(false);
|
|
34
37
|
const { riScUpdateStatus, response } = useRiScs();
|
|
35
38
|
const formMethods = useForm({
|
|
36
|
-
defaultValues: scenario,
|
|
39
|
+
defaultValues: mapScenarioToFormScenario(scenario),
|
|
37
40
|
mode: "onBlur"
|
|
38
41
|
});
|
|
39
42
|
const onCancel = () => {
|
|
40
|
-
formMethods.reset(scenario);
|
|
43
|
+
formMethods.reset(mapScenarioToFormScenario(scenario));
|
|
41
44
|
setIsEditing(false);
|
|
42
45
|
};
|
|
43
46
|
const onClose = () => {
|
|
44
|
-
|
|
47
|
+
closeScenarioForm();
|
|
45
48
|
setIsEditing(false);
|
|
46
49
|
};
|
|
47
50
|
const onSubmit = formMethods.handleSubmit((data) => {
|
|
48
|
-
submitEditedScenarioToRiSc(
|
|
51
|
+
submitEditedScenarioToRiSc(
|
|
52
|
+
mapFormScenarioToScenario(data),
|
|
53
|
+
() => setIsEditing(false)
|
|
54
|
+
);
|
|
49
55
|
});
|
|
50
56
|
useEffect(() => {
|
|
51
|
-
formMethods.reset(scenario);
|
|
52
|
-
}, [scenario, formMethods]);
|
|
57
|
+
formMethods.reset(mapScenarioToFormScenario(scenario));
|
|
58
|
+
}, [scenario, formMethods, mapScenarioToFormScenario]);
|
|
53
59
|
return /* @__PURE__ */ React.createElement(
|
|
54
60
|
Drawer,
|
|
55
61
|
{
|
|
@@ -98,7 +104,14 @@ const ScenarioDrawer = () => {
|
|
|
98
104
|
t(isEditing ? "dictionary.cancel" : "dictionary.close")
|
|
99
105
|
)
|
|
100
106
|
),
|
|
101
|
-
isEditing ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ScopeFormSection, { formMethods }), /* @__PURE__ */ React.createElement(
|
|
107
|
+
isEditing ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ScopeFormSection, { formMethods }), /* @__PURE__ */ React.createElement(
|
|
108
|
+
ScenarioForm,
|
|
109
|
+
{
|
|
110
|
+
formMethods,
|
|
111
|
+
setIsMatrixDialogOpen
|
|
112
|
+
}
|
|
113
|
+
)) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ScopeSection, null), /* @__PURE__ */ React.createElement(RiskSection, null)),
|
|
114
|
+
/* @__PURE__ */ React.createElement(ActionsSection, { formMethods, isEditing }),
|
|
102
115
|
/* @__PURE__ */ React.createElement(
|
|
103
116
|
Box,
|
|
104
117
|
{
|
|
@@ -130,14 +143,27 @@ const ScenarioDrawer = () => {
|
|
|
130
143
|
startIcon: /* @__PURE__ */ React.createElement(DeleteIcon, null),
|
|
131
144
|
variant: "text",
|
|
132
145
|
color: "primary",
|
|
133
|
-
onClick:
|
|
146
|
+
onClick: () => setDeleteConfirmationIsOpen(true),
|
|
134
147
|
sx: { marginLeft: "auto" }
|
|
135
148
|
},
|
|
136
149
|
t("scenarioDrawer.deleteScenarioButton")
|
|
137
150
|
)
|
|
138
151
|
),
|
|
139
152
|
response && response.status !== ProcessingStatus.ErrorWhenFetchingRiScs && /* @__PURE__ */ React.createElement(Alert, { severity: getAlertSeverity(response.status) }, /* @__PURE__ */ React.createElement(Typography, null, response.statusMessage)),
|
|
140
|
-
/* @__PURE__ */ React.createElement(
|
|
153
|
+
/* @__PURE__ */ React.createElement(
|
|
154
|
+
DeleteConfirmation,
|
|
155
|
+
{
|
|
156
|
+
deleteConfirmationIsOpen,
|
|
157
|
+
setDeleteConfirmationIsOpen
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ React.createElement(
|
|
161
|
+
MatrixDialog,
|
|
162
|
+
{
|
|
163
|
+
open: isMatrixDialogOpen,
|
|
164
|
+
close: () => setIsMatrixDialogOpen(false)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
141
167
|
);
|
|
142
168
|
};
|
|
143
169
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScenarioDrawer.esm.js","sources":["../../../src/components/scenarioDrawer/ScenarioDrawer.tsx"],"sourcesContent":["import React, { useEffect, 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 {
|
|
1
|
+
{"version":3,"file":"ScenarioDrawer.esm.js","sources":["../../../src/components/scenarioDrawer/ScenarioDrawer.tsx"],"sourcesContent":["import React, { useEffect, 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';\n\nexport const 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 } = useScenario();\n\n const [deleteConfirmationIsOpen, setDeleteConfirmationIsOpen] =\n useState(false);\n\n const [isMatrixDialogOpen, setIsMatrixDialogOpen] = useState<boolean>(false);\n\n const { riScUpdateStatus, response } = useRiScs();\n\n const formMethods = useForm<FormScenario>({\n defaultValues: mapScenarioToFormScenario(scenario),\n mode: 'onBlur',\n });\n\n const onCancel = () => {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n setIsEditing(false);\n };\n\n const onClose = () => {\n closeScenarioForm();\n setIsEditing(false);\n };\n\n const onSubmit = formMethods.handleSubmit((data: FormScenario) => {\n submitEditedScenarioToRiSc(mapFormScenarioToScenario(data), () =>\n setIsEditing(false),\n );\n });\n\n useEffect(() => {\n formMethods.reset(mapScenarioToFormScenario(scenario));\n }, [scenario, formMethods, mapScenarioToFormScenario]);\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 formMethods={formMethods} isEditing={isEditing} />\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={\n !formMethods.formState.isDirty || riScUpdateStatus.isLoading\n }\n >\n {t('dictionary.save')}\n {riScUpdateStatus.isLoading && (\n <CircularProgress\n size={16}\n sx={{ marginLeft: 1, color: 'inherit' }}\n />\n )}\n </Button>\n )}\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 </Box>\n\n {response &&\n response.status !== ProcessingStatus.ErrorWhenFetchingRiScs && (\n <Alert severity={getAlertSeverity(response.status)}>\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 </Drawer>\n );\n};\n"],"names":["RiskFormSection"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,iBAAiB,MAAM;AAClC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AACxD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAChD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,YAAA;AAAA,IACA,iBAAA;AAAA,IACA,0BAAA;AAAA,IACA,yBAAA;AAAA,IACA,yBAAA;AAAA,MACE,WAAY,EAAA,CAAA;AAEhB,EAAA,MAAM,CAAC,wBAAA,EAA0B,2BAA2B,CAAA,GAC1D,SAA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