@kartverket/backstage-plugin-risk-scorecard 1.0.10 → 1.0.12

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.
@@ -1,9 +1,9 @@
1
1
  import React, { useState, useEffect, useCallback, createContext, useContext, Fragment, useRef } from 'react';
2
- import { makeStyles, FormControl, FormLabel, FormHelperText, TextField as TextField$1, Grid, Typography, Box as Box$1, Paper, Button, Radio, CircularProgress, Dialog, DialogTitle, DialogActions, Stepper, Step, StepButton, Divider as Divider$1, Drawer, List, ListSubheader, ListItem, ListItemText as ListItemText$1, ClickAwayListener, Tooltip, DialogContent, DialogContentText, IconButton, Tab } from '@material-ui/core';
3
- import { InfoCard, ContentHeader } from '@backstage/core-components';
2
+ import { makeStyles, FormControl, FormLabel, FormHelperText, TextField as TextField$1, Grid, Typography, Box as Box$1, useTheme, Paper, Button, Radio, CircularProgress, Dialog, DialogTitle, DialogActions, Stepper, Step, StepButton, Divider as Divider$1, Drawer, List, ListSubheader, ListItem, ListItemText as ListItemText$1, ClickAwayListener, Tooltip, DialogContent, DialogContentText, IconButton, Tab } from '@material-ui/core';
3
+ import { InfoCard, ContentHeader, SupportButton } from '@backstage/core-components';
4
4
  import { useEntity } from '@backstage/plugin-catalog-react';
5
5
  import { useRouteRef, useApi, googleAuthApiRef, identityApiRef, fetchApiRef, configApiRef } from '@backstage/core-plugin-api';
6
- import { s as scenarioRouteRef, r as riScRouteRef, p as pluginRiScTranslationRef } from './index-aa781c2b.esm.js';
6
+ import { s as scenarioRouteRef, r as riScRouteRef, p as pluginRiScTranslationRef } from './index-f0f7d618.esm.js';
7
7
  import { useNavigate, useLocation, useParams } from 'react-router';
8
8
  import { useEffectOnce } from 'react-use';
9
9
  import { useSearchParams, Routes, Route } from 'react-router-dom';
@@ -1371,8 +1371,7 @@ const ScenarioStep = () => {
1371
1371
  xs: 12,
1372
1372
  style: {
1373
1373
  display: "flex",
1374
- flexDirection: "column",
1375
- justifyContent: "space-between"
1374
+ flexDirection: "column"
1376
1375
  }
1377
1376
  },
1378
1377
  /* @__PURE__ */ React.createElement(Box$1, null, /* @__PURE__ */ React.createElement(Typography, { className: label }, t("dictionary.threatActors")), /* @__PURE__ */ React.createElement(Typography, { className: labelSubtitle }, t("scenarioDrawer.threatActorSubtitle"))),
@@ -1392,8 +1391,7 @@ const ScenarioStep = () => {
1392
1391
  xs: 12,
1393
1392
  style: {
1394
1393
  display: "flex",
1395
- flexDirection: "column",
1396
- justifyContent: "space-between"
1394
+ flexDirection: "column"
1397
1395
  }
1398
1396
  },
1399
1397
  /* @__PURE__ */ React.createElement(Box$1, null, /* @__PURE__ */ React.createElement(Typography, { className: label }, t("dictionary.vulnerabilities")), /* @__PURE__ */ React.createElement(Typography, { className: labelSubtitle }, t("scenarioDrawer.vulnerabilitySubtitle"))),
@@ -1425,6 +1423,7 @@ const ActionEdit = ({
1425
1423
  const { t } = useTranslationRef(pluginRiScTranslationRef);
1426
1424
  const { paper, formControl } = useInputFieldStyles();
1427
1425
  const { label, labelSubtitle } = useFontStyles();
1426
+ const theme = useTheme();
1428
1427
  const setDescription = (description) => updateAction({
1429
1428
  ...action,
1430
1429
  description
@@ -1524,7 +1523,29 @@ const ActionEdit = ({
1524
1523
  }
1525
1524
  },
1526
1525
  /* @__PURE__ */ React.createElement(Typography, { className: label }, t("dictionary.deadline")),
1527
- /* @__PURE__ */ React.createElement(FormControl$1, { className: formControl }, /* @__PURE__ */ React.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: nb }, /* @__PURE__ */ React.createElement(DatePicker, { value: action.deadline, onChange: setDeadline })))
1526
+ /* @__PURE__ */ React.createElement(FormControl$1, { className: formControl }, /* @__PURE__ */ React.createElement(LocalizationProvider, { dateAdapter: AdapterDateFns, adapterLocale: nb }, /* @__PURE__ */ React.createElement(
1527
+ DatePicker,
1528
+ {
1529
+ value: action.deadline,
1530
+ onChange: setDeadline,
1531
+ sx: {
1532
+ ".MuiInputBase-root": {
1533
+ color: theme.palette.type === "dark" ? "white" : "black"
1534
+ },
1535
+ ".MuiOutlinedInput-notchedOutline": {
1536
+ borderColor: theme.palette.type === "dark" ? "#616161" : "#0000003b"
1537
+ },
1538
+ ".MuiOutlinedInput-root": {
1539
+ "&:hover .MuiOutlinedInput-notchedOutline": {
1540
+ borderColor: theme.palette.type === "dark" ? "white" : "black"
1541
+ }
1542
+ },
1543
+ ".MuiIconButton-root": {
1544
+ color: theme.palette.type === "dark" ? "white" : "black"
1545
+ }
1546
+ }
1547
+ }
1548
+ )))
1528
1549
  )));
1529
1550
  };
1530
1551
 
@@ -2902,9 +2923,9 @@ const useStatusTextStyles = makeStyles(() => ({
2902
2923
  wrap: "wrap"
2903
2924
  },
2904
2925
  prIcon: {
2905
- fontSize: "12px",
2906
2926
  margin: "0px",
2907
2927
  padding: "0px",
2928
+ marginBottom: "-1px",
2908
2929
  marginRight: "2px",
2909
2930
  marginLeft: "2px"
2910
2931
  }
@@ -2938,14 +2959,11 @@ function ChipTextStatus({ status }) {
2938
2959
  const chipText = useChipText(status);
2939
2960
  return /* @__PURE__ */ React.createElement("span", { className: statusChipText }, chipText);
2940
2961
  }
2941
- function PRStatus({
2942
- status,
2943
- classes
2944
- }) {
2962
+ function PRStatus({ status, classes }) {
2945
2963
  const { t } = useTranslationRef(pluginRiScTranslationRef);
2946
2964
  switch (status) {
2947
2965
  case RiScStatus.SentForApproval:
2948
- return /* @__PURE__ */ React.createElement(Typography, { className: classes.prStatus }, /* @__PURE__ */ React.createElement(GitHubIcon, { className: classes.prIcon }), t("rosStatus.prStatus"));
2966
+ return /* @__PURE__ */ React.createElement(Typography, { className: classes.prStatus }, /* @__PURE__ */ React.createElement(GitHubIcon, { fontSize: "inherit", className: classes.prIcon }), t("rosStatus.prStatus"));
2949
2967
  case RiScStatus.Draft:
2950
2968
  case RiScStatus.Published:
2951
2969
  default:
@@ -3141,7 +3159,7 @@ const Plugin = () => {
3141
3159
  isFetching,
3142
3160
  updateStatus: updateRiScStatus
3143
3161
  }
3144
- ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: t("contentHeader.title") }), isFetching && /* @__PURE__ */ React.createElement(Spinner, { size: 80 }), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 4 }, riScs !== null && riScs.length !== 0 && /* @__PURE__ */ React.createElement(
3162
+ ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ContentHeader, { title: t("contentHeader.title") }, /* @__PURE__ */ React.createElement(SupportButton, null)), isFetching && /* @__PURE__ */ React.createElement(Spinner, { size: 80 }), /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 4 }, riScs !== null && riScs.length !== 0 && /* @__PURE__ */ React.createElement(
3145
3163
  Grid,
3146
3164
  {
3147
3165
  item: true,
@@ -3196,4 +3214,4 @@ const RiScPlugin = () => {
3196
3214
  };
3197
3215
 
3198
3216
  export { RiScPlugin };
3199
- //# sourceMappingURL=index-32d8d9ac.esm.js.map
3217
+ //# sourceMappingURL=index-55c3e55b.esm.js.map