@kartverket/backstage-plugin-risk-scorecard 1.3.1 → 1.5.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.
Files changed (51) hide show
  1. package/dist/components/riScDialog/MatrixDialog.esm.js +53 -0
  2. package/dist/components/riScDialog/MatrixDialog.esm.js.map +1 -0
  3. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js +126 -0
  4. package/dist/components/riScInfo/riScStatus/DifferenceText.esm.js.map +1 -0
  5. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js +121 -0
  6. package/dist/components/riScInfo/riScStatus/RiScDifferenceDialog.esm.js.map +1 -0
  7. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js +87 -19
  8. package/dist/components/riScInfo/riScStatus/RiScStatusComponent.esm.js.map +1 -1
  9. package/dist/components/riScPlugin/RiScPlugin.esm.js +10 -6
  10. package/dist/components/riScPlugin/RiScPlugin.esm.js.map +1 -1
  11. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js +67 -13
  12. package/dist/components/scenarioDrawer/ScenarioDrawer.esm.js.map +1 -1
  13. package/dist/components/scenarioDrawer/components/ActionBox.esm.js +112 -27
  14. package/dist/components/scenarioDrawer/components/ActionBox.esm.js.map +1 -1
  15. package/dist/components/scenarioDrawer/components/{ActionFormSection.esm.js → ActionFormItem.esm.js} +27 -38
  16. package/dist/components/scenarioDrawer/components/ActionFormItem.esm.js.map +1 -0
  17. package/dist/components/scenarioDrawer/components/ActionsSection.esm.js +44 -4
  18. package/dist/components/scenarioDrawer/components/ActionsSection.esm.js.map +1 -1
  19. package/dist/components/scenarioDrawer/components/DeleteActionConfirmation.esm.js +27 -0
  20. package/dist/components/scenarioDrawer/components/DeleteActionConfirmation.esm.js.map +1 -0
  21. package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js +25 -10
  22. package/dist/components/scenarioDrawer/components/RiskFormSection.esm.js.map +1 -1
  23. package/dist/components/scenarioDrawer/components/ScopeFormSection.esm.js.map +1 -1
  24. package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js +25 -2
  25. package/dist/components/scenarioDrawer/scenarioDrawerComponents.esm.js.map +1 -1
  26. package/dist/components/scenarioTable/ScenarioTable.esm.js +94 -6
  27. package/dist/components/scenarioTable/ScenarioTable.esm.js.map +1 -1
  28. package/dist/components/scenarioTable/ScenarioTableRow.esm.js +50 -3
  29. package/dist/components/scenarioTable/ScenarioTableRow.esm.js.map +1 -1
  30. package/dist/components/scenarioTable/ScenarioTableStyles.esm.js +9 -0
  31. package/dist/components/scenarioTable/ScenarioTableStyles.esm.js.map +1 -1
  32. package/dist/components/scenarioWizard/ScenarioWizard.esm.js +2 -1
  33. package/dist/components/scenarioWizard/ScenarioWizard.esm.js.map +1 -1
  34. package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js +30 -2
  35. package/dist/components/scenarioWizard/components/ConsequenceTable.esm.js.map +1 -1
  36. package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js +31 -2
  37. package/dist/components/scenarioWizard/components/ProbabilityTable.esm.js.map +1 -1
  38. package/dist/contexts/RiScContext.esm.js +91 -28
  39. package/dist/contexts/RiScContext.esm.js.map +1 -1
  40. package/dist/contexts/ScenarioContext.esm.js +40 -3
  41. package/dist/contexts/ScenarioContext.esm.js.map +1 -1
  42. package/dist/utils/hooks.esm.js +37 -17
  43. package/dist/utils/hooks.esm.js.map +1 -1
  44. package/dist/utils/translations.esm.js +89 -9
  45. package/dist/utils/translations.esm.js.map +1 -1
  46. package/dist/utils/types.esm.js +1 -0
  47. package/dist/utils/types.esm.js.map +1 -1
  48. package/dist/utils/utilityfunctions.esm.js +64 -19
  49. package/dist/utils/utilityfunctions.esm.js.map +1 -1
  50. package/package.json +3 -1
  51. package/dist/components/scenarioDrawer/components/ActionFormSection.esm.js.map +0 -1
@@ -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;;;;"}
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import List from '@mui/material/List';
3
+ import ListItem from '@mui/material/ListItem';
4
+ import Typography from '@mui/material/Typography';
5
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
6
+ import { pluginRiScTranslationRef } from '../../../utils/translations.esm.js';
7
+
8
+ const DifferenceText = ({
9
+ differenceFetchState
10
+ }) => {
11
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
12
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13
+ Typography,
14
+ {
15
+ sx: {
16
+ fontWeight: 700,
17
+ paddingBottom: "4px"
18
+ }
19
+ },
20
+ t("rosStatus.difference.differences.titleRemoved")
21
+ ), /* @__PURE__ */ React.createElement(
22
+ List,
23
+ {
24
+ sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" }
25
+ },
26
+ differenceFetchState.differenceState.entriesOnLeft.length === 0 && /* @__PURE__ */ React.createElement(
27
+ ListItem,
28
+ {
29
+ sx: {
30
+ display: "list-item",
31
+ marginLeft: "26px",
32
+ paddingTop: "4px",
33
+ paddingBottom: "4px"
34
+ }
35
+ },
36
+ /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.difference.differences.noneRemoved"))
37
+ ),
38
+ differenceFetchState.differenceState.entriesOnLeft.map((item) => /* @__PURE__ */ React.createElement(
39
+ ListItem,
40
+ {
41
+ key: item,
42
+ sx: {
43
+ display: "list-item",
44
+ marginLeft: "26px",
45
+ paddingTop: "4px",
46
+ paddingBottom: "4px"
47
+ }
48
+ },
49
+ /* @__PURE__ */ React.createElement(Typography, null, item)
50
+ ))
51
+ ), /* @__PURE__ */ React.createElement(
52
+ Typography,
53
+ {
54
+ sx: {
55
+ fontWeight: 700,
56
+ paddingBottom: "4px"
57
+ }
58
+ },
59
+ t("rosStatus.difference.differences.titleExisting")
60
+ ), /* @__PURE__ */ React.createElement(
61
+ List,
62
+ {
63
+ sx: { paddingBottom: "40px", paddingTop: 0, listStyleType: "disc" }
64
+ },
65
+ differenceFetchState.differenceState.difference.length === 0 && /* @__PURE__ */ React.createElement(
66
+ ListItem,
67
+ {
68
+ sx: {
69
+ display: "list-item",
70
+ marginLeft: "26px",
71
+ paddingTop: "4px",
72
+ paddingBottom: "4px"
73
+ }
74
+ },
75
+ /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.difference.differences.noneExisting"))
76
+ ),
77
+ differenceFetchState.differenceState.difference.map((item) => /* @__PURE__ */ React.createElement(
78
+ ListItem,
79
+ {
80
+ key: item,
81
+ sx: {
82
+ display: "list-item",
83
+ marginLeft: "26px",
84
+ paddingTop: "4px",
85
+ paddingBottom: "4px"
86
+ }
87
+ },
88
+ /* @__PURE__ */ React.createElement(Typography, null, item)
89
+ ))
90
+ ), /* @__PURE__ */ React.createElement(
91
+ Typography,
92
+ {
93
+ sx: {
94
+ fontWeight: 700,
95
+ paddingBottom: "4px"
96
+ }
97
+ },
98
+ t("rosStatus.difference.differences.titleAdded")
99
+ ), /* @__PURE__ */ React.createElement(List, { sx: { listStyleType: "disc", paddingTop: 0 } }, differenceFetchState.differenceState.entriesOnRight.length === 0 && /* @__PURE__ */ React.createElement(
100
+ ListItem,
101
+ {
102
+ sx: {
103
+ display: "list-item",
104
+ marginLeft: "26px",
105
+ paddingTop: "4px",
106
+ paddingBottom: "4px"
107
+ }
108
+ },
109
+ /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.difference.differences.noneAdded"))
110
+ ), differenceFetchState.differenceState.entriesOnRight.map((item) => /* @__PURE__ */ React.createElement(
111
+ ListItem,
112
+ {
113
+ key: item,
114
+ sx: {
115
+ display: "list-item",
116
+ marginLeft: "26px",
117
+ paddingTop: "4px",
118
+ paddingBottom: "4px"
119
+ }
120
+ },
121
+ /* @__PURE__ */ React.createElement(Typography, null, item)
122
+ ))));
123
+ };
124
+
125
+ export { DifferenceText };
126
+ //# sourceMappingURL=DifferenceText.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DifferenceText.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/DifferenceText.tsx"],"sourcesContent":["import React from 'react';\nimport { DifferenceFetchState } from '../../../utils/types';\nimport List from '@mui/material/List';\nimport ListItem from '@mui/material/ListItem';\nimport Typography from '@mui/material/Typography';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\n\ntype DifferenceTextProps = {\n differenceFetchState: DifferenceFetchState;\n};\n\nexport const DifferenceText = ({\n differenceFetchState,\n}: DifferenceTextProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n return (\n <>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleRemoved')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.entriesOnLeft.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneRemoved')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.entriesOnLeft.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleExisting')}\n </Typography>\n <List\n sx={{ paddingBottom: '40px', paddingTop: 0, listStyleType: 'disc' }}\n >\n {differenceFetchState.differenceState.difference.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneExisting')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.difference.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>{item}</Typography>\n </ListItem>\n ))}\n </List>\n <Typography\n sx={{\n fontWeight: 700,\n paddingBottom: '4px',\n }}\n >\n {t('rosStatus.difference.differences.titleAdded')}\n </Typography>\n <List sx={{ listStyleType: 'disc', paddingTop: 0 }}>\n {differenceFetchState.differenceState.entriesOnRight.length === 0 && (\n <ListItem\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n paddingTop: '4px',\n paddingBottom: '4px',\n }}\n >\n <Typography>\n {t('rosStatus.difference.differences.noneAdded')}\n </Typography>\n </ListItem>\n )}\n {differenceFetchState.differenceState.entriesOnRight.map(item => (\n <ListItem\n key={item}\n sx={{\n display: 'list-item',\n marginLeft: '26px',\n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KAAA,CAAA,aAAA,CAAC,kBAAY,IAAK,CAAA;AAAA,GAErB,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,121 @@
1
+ import React from 'react';
2
+ import Box from '@mui/material/Box';
3
+ import Typography from '@mui/material/Typography';
4
+ import Card from '@mui/material/Card';
5
+ import CircularProgress from '@mui/material/CircularProgress';
6
+ import { ErrorOutline, Favorite } from '@mui/icons-material';
7
+ import { DifferenceText } from './DifferenceText.esm.js';
8
+ import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
9
+ import { pluginRiScTranslationRef } from '../../../utils/translations.esm.js';
10
+ import { parseISODateFromEncryptedROS } from '../../../utils/utilityfunctions.esm.js';
11
+ import { parseISO } from 'date-fns';
12
+
13
+ const RiScDifferenceDialog = ({
14
+ differenceFetchState
15
+ }) => {
16
+ const { t } = useTranslationRef(pluginRiScTranslationRef);
17
+ const formatedDateString = parseISODateFromEncryptedROS(
18
+ differenceFetchState.defaultLastModifiedDateString
19
+ );
20
+ const parsedDateString = formatedDateString ? parseISO(formatedDateString).toLocaleDateString() : null;
21
+ return /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.difference.description")), /* @__PURE__ */ React.createElement(
22
+ Typography,
23
+ {
24
+ sx: {
25
+ fontWeight: 700,
26
+ fontSize: "0.8rem",
27
+ paddingBottom: "40px"
28
+ }
29
+ },
30
+ parsedDateString && t("rosStatus.difference.publishDate", {
31
+ date: parsedDateString
32
+ })
33
+ ), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(
34
+ Typography,
35
+ {
36
+ variant: "h3",
37
+ sx: {
38
+ fontSize: 18
39
+ }
40
+ },
41
+ t("rosStatus.difference.differences.title")
42
+ ), /* @__PURE__ */ React.createElement(
43
+ Card,
44
+ {
45
+ sx: {
46
+ backgroundColor: "rgb(51, 51, 51)",
47
+ padding: "20px",
48
+ position: "relative",
49
+ marginBottom: "20px",
50
+ minHeight: "260px"
51
+ }
52
+ },
53
+ differenceFetchState.isLoading && /* @__PURE__ */ React.createElement(
54
+ Box,
55
+ {
56
+ sx: {
57
+ display: "flex",
58
+ flexDirection: "column",
59
+ alignItems: "center",
60
+ margin: "auto 0"
61
+ }
62
+ },
63
+ /* @__PURE__ */ React.createElement(
64
+ CircularProgress,
65
+ {
66
+ size: 30,
67
+ sx: { marginLeft: 1, color: "inherit", margin: "10px" }
68
+ }
69
+ ),
70
+ t("rosStatus.difference.fetching")
71
+ ),
72
+ differenceFetchState.status !== null && differenceFetchState.status !== "Success" && differenceFetchState.status !== "GithubFileNotFound" && /* @__PURE__ */ React.createElement(
73
+ Box,
74
+ {
75
+ sx: {
76
+ display: "flex",
77
+ flexDirection: "column",
78
+ alignItems: "center",
79
+ margin: "auto 0"
80
+ }
81
+ },
82
+ /* @__PURE__ */ React.createElement(
83
+ ErrorOutline,
84
+ {
85
+ sx: {
86
+ fontSize: "30px",
87
+ marginBottom: "16px",
88
+ color: "red"
89
+ }
90
+ }
91
+ ),
92
+ t("rosStatus.difference.error")
93
+ ),
94
+ differenceFetchState.status !== null && differenceFetchState.status === "GithubFileNotFound" && /* @__PURE__ */ React.createElement(
95
+ Box,
96
+ {
97
+ sx: {
98
+ display: "flex",
99
+ flexDirection: "column",
100
+ alignItems: "center",
101
+ margin: "auto 0"
102
+ }
103
+ },
104
+ /* @__PURE__ */ React.createElement(
105
+ Favorite,
106
+ {
107
+ sx: {
108
+ fontSize: "30px",
109
+ marginBottom: "16px",
110
+ color: "green"
111
+ }
112
+ }
113
+ ),
114
+ t("rosStatus.difference.newROS")
115
+ ),
116
+ differenceFetchState.status === "Success" && /* @__PURE__ */ React.createElement(DifferenceText, { differenceFetchState })
117
+ )));
118
+ };
119
+
120
+ export { RiScDifferenceDialog };
121
+ //# sourceMappingURL=RiScDifferenceDialog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiScDifferenceDialog.esm.js","sources":["../../../../src/components/riScInfo/riScStatus/RiScDifferenceDialog.tsx"],"sourcesContent":["import React from 'react';\nimport { DifferenceFetchState } from '../../../utils/types';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport Card from '@mui/material/Card';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport { ErrorOutline, Favorite } from '@mui/icons-material';\nimport { DifferenceText } from './DifferenceText';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\nimport { parseISODateFromEncryptedROS } from '../../../utils/utilityfunctions';\nimport { parseISO } from 'date-fns';\n\ntype RiScDifferenceDialogProps = {\n differenceFetchState: DifferenceFetchState;\n};\n\nexport const RiScDifferenceDialog = ({\n differenceFetchState,\n}: RiScDifferenceDialogProps) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const formatedDateString = parseISODateFromEncryptedROS(\n differenceFetchState.defaultLastModifiedDateString,\n );\n\n const parsedDateString = formatedDateString\n ? parseISO(formatedDateString).toLocaleDateString()\n : null;\n return (\n <Box>\n <Typography>{t('rosStatus.difference.description')}</Typography>\n <Typography\n sx={{\n fontWeight: 700,\n fontSize: '0.8rem',\n paddingBottom: '40px',\n }}\n >\n {parsedDateString &&\n t('rosStatus.difference.publishDate', {\n date: parsedDateString,\n })}\n </Typography>\n <Box>\n <Typography\n variant=\"h3\"\n sx={{\n fontSize: 18,\n }}\n >\n {t('rosStatus.difference.differences.title')}\n </Typography>\n <Card\n sx={{\n backgroundColor: 'rgb(51, 51, 51)',\n padding: '20px',\n position: 'relative',\n marginBottom: '20px',\n minHeight: '260px',\n }}\n >\n {differenceFetchState.isLoading && (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n margin: 'auto 0',\n }}\n >\n <CircularProgress\n size={30}\n sx={{ marginLeft: 1, color: 'inherit', margin: '10px' }}\n />\n {t('rosStatus.difference.fetching')}\n </Box>\n )}\n {differenceFetchState.status !== null &&\n differenceFetchState.status !== 'Success' &&\n differenceFetchState.status !== 'GithubFileNotFound' && (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n margin: 'auto 0',\n }}\n >\n <ErrorOutline\n sx={{\n fontSize: '30px',\n marginBottom: '16px',\n color: 'red',\n }}\n />\n {t('rosStatus.difference.error')}\n </Box>\n )}\n {differenceFetchState.status !== null &&\n differenceFetchState.status === 'GithubFileNotFound' && (\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n margin: 'auto 0',\n }}\n >\n <Favorite\n sx={{\n fontSize: '30px',\n marginBottom: '16px',\n color: 'green',\n }}\n />\n {t('rosStatus.difference.newROS')}\n </Box>\n )}\n {differenceFetchState.status === 'Success' && (\n <DifferenceText differenceFetchState={differenceFetchState} />\n )}\n </Card>\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBO,MAAM,uBAAuB,CAAC;AAAA,EACnC,oBAAA;AACF,CAAiC,KAAA;AAC/B,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AAExD,EAAA,MAAM,kBAAqB,GAAA,4BAAA;AAAA,IACzB,oBAAqB,CAAA,6BAAA;AAAA,GACvB,CAAA;AAEA,EAAA,MAAM,mBAAmB,kBACrB,GAAA,QAAA,CAAS,kBAAkB,CAAA,CAAE,oBAC7B,GAAA,IAAA,CAAA;AACJ,EAAA,2CACG,GACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,kBAAY,CAAE,CAAA,kCAAkC,CAAE,CACnD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,UAAY,EAAA,GAAA;AAAA,QACZ,QAAU,EAAA,QAAA;AAAA,QACV,aAAe,EAAA,MAAA;AAAA,OACjB;AAAA,KAAA;AAAA,IAEC,gBAAA,IACC,EAAE,kCAAoC,EAAA;AAAA,MACpC,IA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ACT,aAAe,EAAA,QAAA;AAAA,UACf,UAAY,EAAA,QAAA;AAAA,UACZ,MAAQ,EAAA,QAAA;AAAA,SACV;AAAA,OAAA;AAAA,sBAEA,KAAA,CAAA,aAAA;AAAA,QAAC,YAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,QAAU,EAAA,MAAA;AAAA,YACV,YAAc,EAAA,MAAA;AAAA,YACd,KAAO,EAAA,KAAA;AAAA,WACT;AAAA,SAAA;AAAA,OACF;AAAA,MACC,EAAE,4BAA4B,CAAA;AAAA,KACjC;AAAA,IAEH,oBAAqB,CAAA,MAAA,KAAW,IAC/B,IAAA,oBAAA,CAAqB,WAAW,oBAC9B,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,GAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,OAAS,EAAA,MAAA;AAAA,UACT,aAAe,EAAA,QAAA;AAAA,UACf,UAAY,EAAA,QAAA;AAAA,UACZ,MAAQ,EAAA,QAAA;AAAA,SACV;AAAA,OAAA;AAAA,sBAEA,KAAA,CAAA,aAAA;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,EAAI,EAAA;AAAA,YACF,QAAU,EAAA,MAAA;AAAA,YACV,YAAc,EAAA,MAAA;AAAA,YACd,KAAO,EAAA,OAAA;AAAA,WACT;AAAA,SAAA;AAAA,OACF;AAAA,MACC,EAAE,6BAA6B,CAAA;AAAA,KAClC;AAAA,IAEH,oBAAqB,CAAA,MAAA,KAAW,SAC/B,oBAAA,KAAA,CAAA,aAAA,CAAC,kBAAe,oBAA4C,EAAA,CAAA;AAAA,GAGlE,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import { RiScStatus } from '../../../utils/types.esm.js';
3
3
  import Alert from '@mui/material/Alert';
4
4
  import Button from '@mui/material/Button';
@@ -18,18 +18,23 @@ 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 '@mui/material/Box';
22
+ import { WarningAmberOutlined } from '@mui/icons-material';
23
+ import { useAuthenticatedFetch } from '../../../utils/hooks.esm.js';
24
+ import { RiScDifferenceDialog } from './RiScDifferenceDialog.esm.js';
21
25
 
22
26
  const RiScPublishDialog = ({
23
27
  openDialog,
24
28
  handleCancel,
25
- handlePublish
29
+ handlePublish,
30
+ differenceFetchState
26
31
  }) => {
27
32
  const { t } = useTranslationRef(pluginRiScTranslationRef);
28
33
  const [riskOwnerApproves, setRiskOwnerApproves] = useState(false);
29
34
  const handleCheckboxInput = (event) => {
30
35
  setRiskOwnerApproves(event.target.checked);
31
36
  };
32
- return /* @__PURE__ */ React.createElement(Dialog, { open: openDialog }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("publishDialog.title")), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Alert, { severity: "info", icon: false }, /* @__PURE__ */ React.createElement(
37
+ return /* @__PURE__ */ React.createElement(Dialog, { open: openDialog }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("publishDialog.title")), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(RiScDifferenceDialog, { differenceFetchState }), /* @__PURE__ */ React.createElement(Alert, { severity: "info", icon: false }, /* @__PURE__ */ React.createElement(
33
38
  FormControlLabel,
34
39
  {
35
40
  control: /* @__PURE__ */ React.createElement(
@@ -42,7 +47,7 @@ const RiScPublishDialog = ({
42
47
  ),
43
48
  label: t("publishDialog.checkboxLabel")
44
49
  }
45
- ))), /* @__PURE__ */ React.createElement(DialogActions, { sx: dialogActions }, /* @__PURE__ */ React.createElement(
50
+ )))), /* @__PURE__ */ React.createElement(DialogActions, { sx: dialogActions }, /* @__PURE__ */ React.createElement(
46
51
  Button,
47
52
  {
48
53
  variant: "contained",
@@ -56,14 +61,23 @@ const RiScPublishDialog = ({
56
61
  const RiScMigrationDialog = ({
57
62
  openDialog,
58
63
  handleCancel,
59
- handleUpdate
64
+ handleUpdate,
65
+ migrationVersions
60
66
  }) => {
61
67
  const { t } = useTranslationRef(pluginRiScTranslationRef);
62
68
  const [saveMigration, setSaveMigration] = useState(false);
63
69
  const handleCheckboxInput = (event) => {
64
70
  setSaveMigration(event.target.checked);
65
71
  };
66
- return /* @__PURE__ */ React.createElement(Dialog, { open: openDialog }, /* @__PURE__ */ React.createElement(DialogTitle, null, t("migrationDialog.title")), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Alert, { severity: "info", icon: false }, /* @__PURE__ */ React.createElement(
72
+ 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(
73
+ Link,
74
+ {
75
+ underline: "always",
76
+ target: "_blank",
77
+ href: "https://github.com/kartverket/backstage-plugin-risk-scorecard-backend/blob/main/docs/schemaChangelog.md"
78
+ },
79
+ t("migrationDialog.changelog")
80
+ ), " ", t("migrationDialog.description4"))), /* @__PURE__ */ React.createElement(Alert, { severity: "info", icon: false }, /* @__PURE__ */ React.createElement(
67
81
  FormControlLabel,
68
82
  {
69
83
  control: /* @__PURE__ */ React.createElement(
@@ -91,7 +105,13 @@ const RosAcceptance = ({
91
105
  }) => {
92
106
  const { t } = useTranslationRef(pluginRiScTranslationRef);
93
107
  if (migration) {
94
- return /* @__PURE__ */ React.createElement(Typography, { paragraph: true, sx: subtitle1 }, t("rosStatus.statusBadge.migration"));
108
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, { paragraph: true, sx: subtitle1 }, /* @__PURE__ */ React.createElement(
109
+ WarningAmberOutlined,
110
+ {
111
+ fontSize: "medium",
112
+ sx: { transform: "translateY(5px)", marginTop: "5px" }
113
+ }
114
+ ), " ", t("rosStatus.statusBadge.migration.title")), /* @__PURE__ */ React.createElement(Typography, null, t("rosStatus.statusBadge.migration.description")));
95
115
  }
96
116
  switch (status) {
97
117
  case RiScStatus.Draft:
@@ -103,22 +123,69 @@ const RosAcceptance = ({
103
123
  return /* @__PURE__ */ React.createElement(Typography, { paragraph: true, sx: subtitle1 }, t("rosStatus.statusBadge.error"));
104
124
  }
105
125
  };
126
+ const emptyDifferenceFetchState = {
127
+ differenceState: {
128
+ entriesOnLeft: [],
129
+ entriesOnRight: [],
130
+ difference: []
131
+ },
132
+ status: null,
133
+ isLoading: false,
134
+ errorMessage: "",
135
+ currentDifferenceId: "",
136
+ defaultLastModifiedDateString: ""
137
+ };
106
138
  const RiScStatusComponent = ({
107
139
  selectedRiSc,
108
140
  publishRiScFn
109
141
  }) => {
110
142
  const { t } = useTranslationRef(pluginRiScTranslationRef);
143
+ const { fetchDifference } = useAuthenticatedFetch();
111
144
  const [publishRiScDialogIsOpen, setPublishRiScDialogIsOpen] = useState(false);
112
145
  const [migrationDialogIsOpen, setMigrationDialogIsOpen] = useState(false);
146
+ const [differenceFetchState, setDifferenceFetchState] = useState(emptyDifferenceFetchState);
113
147
  const { updateRiSc } = useRiScs();
114
148
  const handleApproveAndPublish = () => {
115
149
  publishRiScFn();
116
150
  setPublishRiScDialogIsOpen(false);
117
151
  };
152
+ const getDifferences = () => {
153
+ if (!selectedRiSc || differenceFetchState.isLoading || differenceFetchState.currentDifferenceId === selectedRiSc.id)
154
+ return;
155
+ setDifferenceFetchState({ ...differenceFetchState, isLoading: true });
156
+ fetchDifference(
157
+ selectedRiSc,
158
+ (response) => {
159
+ setDifferenceFetchState({
160
+ differenceState: response.differenceState,
161
+ isLoading: false,
162
+ currentDifferenceId: selectedRiSc.id,
163
+ status: response.status,
164
+ errorMessage: response.errorMessage,
165
+ defaultLastModifiedDateString: response.defaultLastModifiedDateString
166
+ });
167
+ },
168
+ () => {
169
+ setDifferenceFetchState({
170
+ ...emptyDifferenceFetchState,
171
+ errorMessage: t("rosStatus.difference.error"),
172
+ status: "FrontendFallback"
173
+ // Fallback when the backend does not deliver a response with status
174
+ });
175
+ }
176
+ );
177
+ };
118
178
  const handleUpdate = () => {
119
179
  updateRiSc(selectedRiSc.content);
120
180
  setMigrationDialogIsOpen(false);
121
181
  };
182
+ const handleOpenPublishRiScDialog = () => {
183
+ setPublishRiScDialogIsOpen(true);
184
+ getDifferences();
185
+ };
186
+ useEffect(() => {
187
+ setDifferenceFetchState(emptyDifferenceFetchState);
188
+ }, [selectedRiSc]);
122
189
  return /* @__PURE__ */ React.createElement(InfoCard, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Status"), /* @__PURE__ */ React.createElement(
123
190
  RosAcceptance,
124
191
  {
@@ -130,12 +197,11 @@ const RiScStatusComponent = ({
130
197
  {
131
198
  color: "primary",
132
199
  variant: "contained",
133
- onClick: () => setPublishRiScDialogIsOpen(!publishRiScDialogIsOpen),
134
- disabled: selectedRiSc.status !== RiScStatus.Draft,
200
+ onClick: handleOpenPublishRiScDialog,
135
201
  sx: { display: "block", marginLeft: "auto" }
136
202
  },
137
203
  t("rosStatus.approveButton")
138
- ), selectedRiSc.migrationStatus?.migrationChanges && /* @__PURE__ */ React.createElement(
204
+ ), selectedRiSc.migrationStatus?.migrationChanges && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
139
205
  Button,
140
206
  {
141
207
  color: "primary",
@@ -143,20 +209,22 @@ const RiScStatusComponent = ({
143
209
  onClick: () => setMigrationDialogIsOpen(!migrationDialogIsOpen),
144
210
  sx: { display: "block", marginLeft: "auto" }
145
211
  },
146
- /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, t("rosStatus.saveButton"))
147
- ), /* @__PURE__ */ React.createElement(
148
- RiScPublishDialog,
149
- {
150
- openDialog: publishRiScDialogIsOpen,
151
- handlePublish: handleApproveAndPublish,
152
- handleCancel: () => setPublishRiScDialogIsOpen(false)
153
- }
212
+ /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, t("rosStatus.moreInformationButton"))
154
213
  ), /* @__PURE__ */ React.createElement(
155
214
  RiScMigrationDialog,
156
215
  {
157
216
  openDialog: migrationDialogIsOpen,
158
217
  handleUpdate,
159
- handleCancel: () => setMigrationDialogIsOpen(false)
218
+ handleCancel: () => setMigrationDialogIsOpen(false),
219
+ migrationVersions: selectedRiSc.migrationStatus?.migrationVersions
220
+ }
221
+ )), /* @__PURE__ */ React.createElement(
222
+ RiScPublishDialog,
223
+ {
224
+ openDialog: publishRiScDialogIsOpen,
225
+ handlePublish: handleApproveAndPublish,
226
+ handleCancel: () => setPublishRiScDialogIsOpen(false),
227
+ differenceFetchState
160
228
  }
161
229
  ));
162
230
  };
@@ -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.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 <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,C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Z,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, useEffect, useState } from 'react';\nimport {\n DifferenceFetchState,\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 '@mui/material/Box';\nimport { WarningAmberOutlined } from '@mui/icons-material';\nimport { useAuthenticatedFetch } from '../../../utils/hooks';\nimport { RiScDifferenceDialog } from './RiScDifferenceDialog';\n\ninterface RiScPublishDialogProps {\n openDialog: boolean;\n handleCancel: () => void;\n handlePublish: () => void;\n differenceFetchState: DifferenceFetchState;\n}\n\nconst 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 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 <>\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\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\nconst emptyDifferenceFetchState: DifferenceFetchState = {\n differenceState: {\n entriesOnLeft: [],\n entriesOnRight: [],\n difference: [],\n },\n status: null,\n isLoading: false,\n errorMessage: '',\n currentDifferenceId: '',\n defaultLastModifiedDateString: '',\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 const { fetchDifference } = useAuthenticatedFetch();\n\n const [publishRiScDialogIsOpen, setPublishRiScDialogIsOpen] =\n useState<boolean>(false);\n\n const [migrationDialogIsOpen, setMigrationDialogIsOpen] =\n useState<boolean>(false);\n\n const [differenceFetchState, setDifferenceFetchState] =\n useState<DifferenceFetchState>(emptyDifferenceFetchState);\n\n const { updateRiSc } = useRiScs();\n\n const handleApproveAndPublish = () => {\n publishRiScFn();\n setPublishRiScDialogIsOpen(false);\n };\n\n const getDifferences = () => {\n if (\n !selectedRiSc ||\n differenceFetchState.isLoading ||\n differenceFetchState.currentDifferenceId === selectedRiSc.id\n )\n return;\n\n setDifferenceFetchState({ ...differenceFetchState, isLoading: true });\n fetchDifference(\n selectedRiSc,\n response => {\n setDifferenceFetchState({\n differenceState: response.differenceState,\n isLoading: false,\n currentDifferenceId: selectedRiSc.id,\n status: response.status,\n errorMessage: response.errorMessage,\n defaultLastModifiedDateString: response.defaultLastModifiedDateString,\n });\n },\n () => {\n setDifferenceFetchState({\n ...emptyDifferenceFetchState,\n errorMessage: t('rosStatus.difference.error'),\n status: 'FrontendFallback', // Fallback when the backend does not deliver a response with status\n });\n },\n );\n };\n\n const handleUpdate = () => {\n updateRiSc(selectedRiSc.content);\n setMigrationDialogIsOpen(false);\n };\n\n const handleOpenPublishRiScDialog = () => {\n setPublishRiScDialogIsOpen(true);\n getDifferences();\n };\n\n useEffect(() => {\n setDifferenceFetchState(emptyDifferenceFetchState);\n }, [selectedRiSc]);\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={handleOpenPublishRiScDialog}\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 differenceFetchState={differenceFetchState}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,oBAAoB,CAAC;AAAA,EACzB,UAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,oBAAA;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;A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