@kartverket/backstage-plugin-risk-scorecard 1.5.1 → 1.5.2
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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Risk Scorecard (RiSc)
|
|
2
2
|
|
|
3
|
-
This is a plugin for Backstage that helps you and your team when working continuously with
|
|
3
|
+
This is a plugin for Backstage that helps you and your team when working continuously with risk analysis (:))
|
|
4
4
|
The plugin is dependent on a backend service in order to decrypt and communicate with GitHub, and some configuration is
|
|
5
5
|
necessary for them to communicate.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ import Typography from '@mui/material/Typography';
|
|
|
12
12
|
const ProbabilityTableInfo = () => {
|
|
13
13
|
const { t } = useTranslationRef(pluginRiScTranslationRef);
|
|
14
14
|
const getContentCell = (row) => /* @__PURE__ */ React.createElement(Box, { sx: riskCell }, t(`probabilityTable.cells.${row + 1}`));
|
|
15
|
-
return /* @__PURE__ */ React.createElement(Box, { sx: riskRow }, getContentCell(
|
|
15
|
+
return /* @__PURE__ */ React.createElement(Box, { sx: riskRow }, getContentCell(0), getContentCell(1), getContentCell(2), getContentCell(3), getContentCell(4));
|
|
16
16
|
};
|
|
17
17
|
const ProbabilityTable = ({
|
|
18
18
|
formMethods,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProbabilityTable.esm.js","sources":["../../../../src/components/scenarioWizard/components/ProbabilityTable.tsx"],"sourcesContent":["import React from 'react';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { riskTable, riskCell, riskRow, riskLabelCell } from '../wizardStyles';\nimport { useController, UseFormReturn } from 'react-hook-form';\nimport { FormScenario } from '../../../utils/types';\nimport { RiskRadioButton } from './RiskRadioButton';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport Box from '@mui/material/Box';\nimport { probabilityOptions } from '../../../utils/constants';\nimport Typography from '@mui/material/Typography';\n\nexport const ProbabilityTableInfo = () => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const getContentCell = (row: number) => (\n <Box sx={riskCell}>\n {/* @ts-ignore */}\n {t(`probabilityTable.cells.${row + 1}`)}\n </Box>\n );\n\n return (\n <Box sx={riskRow}>\n {getContentCell(
|
|
1
|
+
{"version":3,"file":"ProbabilityTable.esm.js","sources":["../../../../src/components/scenarioWizard/components/ProbabilityTable.tsx"],"sourcesContent":["import React from 'react';\nimport { pluginRiScTranslationRef } from '../../../utils/translations';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { riskTable, riskCell, riskRow, riskLabelCell } from '../wizardStyles';\nimport { useController, UseFormReturn } from 'react-hook-form';\nimport { FormScenario } from '../../../utils/types';\nimport { RiskRadioButton } from './RiskRadioButton';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport Box from '@mui/material/Box';\nimport { probabilityOptions } from '../../../utils/constants';\nimport Typography from '@mui/material/Typography';\n\nexport const ProbabilityTableInfo = () => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n const getContentCell = (row: number) => (\n <Box sx={riskCell}>\n {/* @ts-ignore */}\n {t(`probabilityTable.cells.${row + 1}`)}\n </Box>\n );\n\n return (\n <Box sx={riskRow}>\n {getContentCell(0)}\n {getContentCell(1)}\n {getContentCell(2)}\n {getContentCell(3)}\n {getContentCell(4)}\n </Box>\n );\n};\n\nexport const ProbabilityTable = ({\n formMethods,\n riskType,\n}: {\n formMethods: UseFormReturn<FormScenario>;\n riskType: keyof Pick<FormScenario, 'risk' | 'remainingRisk'>;\n}) => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const { field } = useController({\n name: `${riskType}.probability`,\n control: formMethods.control,\n });\n\n const getRadioLabel = (row: number) => {\n /* @ts-ignore Because ts can't typecheck strings agains our keys */\n return `${row}: ${t(`probabilityTable.rows.${row}`)}`;\n };\n\n const getRadioCell = (row: number) => (\n <RiskRadioButton\n value={probabilityOptions[row]}\n ref={field.ref}\n label={getRadioLabel(row + 1)}\n />\n );\n\n return (\n <Box sx={riskTable}>\n <RadioGroup {...field} sx={riskRow}>\n {getRadioCell(0)}\n {getRadioCell(1)}\n {getRadioCell(2)}\n {getRadioCell(3)}\n {getRadioCell(4)}\n </RadioGroup>\n <ProbabilityTableInfo />\n </Box>\n );\n};\n\nexport const ProbabilityTableInfoWithHeaders = () => {\n const { t } = useTranslationRef(pluginRiScTranslationRef);\n\n const getRadioLabel = (row: number) => {\n return (\n /* @ts-ignore Because ts can't typecheck strings agains our keys */\n <Typography fontWeight={500}>{`${row}: ${t(\n `probabilityTable.rows.${row}`,\n )}`}</Typography>\n );\n };\n return (\n <Box sx={riskTable}>\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: 'auto repeat(5, 1fr)',\n gap: '4px',\n overflow: 'auto',\n }}\n >\n <Box sx={riskLabelCell} />\n {getRadioLabel(1)}\n {getRadioLabel(2)}\n {getRadioLabel(3)}\n {getRadioLabel(4)}\n {getRadioLabel(5)}\n </Box>\n <ProbabilityTableInfo />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAYO,MAAM,uBAAuB,MAAM;AACxC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,wBAAwB,CAAA,CAAA;AACxD,EAAA,MAAM,cAAiB,GAAA,CAAC,GACtB,qBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,QAEN,EAAA,EAAA,CAAA,CAAE,CAA0B,uBAAA,EAAA,GAAA,GAAM,CAAC,CAAA,CAAE,CACxC,CAAA,CAAA;AAGF,EAAA,2CACG,GAAI,EAAA,EAAA,EAAA,EAAI,WACN,cAAe,CAAA,CAAC,GAChB,cAAe,CAAA,CAAC,CAChB,EAAA,cAAA,CAAe,CAAC,CAChB,EAAA,cAAA,CAAe,CAAC,CAChB,EAAA,cAAA,CAAe,CAAC,CACnB,CAAA,CAAA;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