@backstage-community/plugin-rbac 1.32.5 → 1.33.1

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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js +7 -6
  3. package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js.map +1 -1
  4. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js +7 -3
  5. package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js.map +1 -1
  6. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js +44 -19
  7. package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js.map +1 -1
  8. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js +65 -63
  9. package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js.map +1 -1
  10. package/dist/components/ConditionalAccess/ConditionsForm.esm.js +94 -85
  11. package/dist/components/ConditionalAccess/ConditionsForm.esm.js.map +1 -1
  12. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js +155 -101
  13. package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js.map +1 -1
  14. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js +98 -9
  15. package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js.map +1 -1
  16. package/dist/components/ConditionalAccess/CriteriaToggleButton.esm.js.map +1 -1
  17. package/dist/components/ConditionalAccess/CustomArrayField.esm.js +7 -10
  18. package/dist/components/ConditionalAccess/CustomArrayField.esm.js.map +1 -1
  19. package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js +30 -14
  20. package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js.map +1 -1
  21. package/dist/components/CreateRole/AddMembersForm.esm.js +7 -5
  22. package/dist/components/CreateRole/AddMembersForm.esm.js.map +1 -1
  23. package/dist/components/CreateRole/AddedMembersTable.esm.js +2 -10
  24. package/dist/components/CreateRole/AddedMembersTable.esm.js.map +1 -1
  25. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js +5 -2
  26. package/dist/components/CreateRole/AddedMembersTableColumn.esm.js.map +1 -1
  27. package/dist/components/CreateRole/MembersDropdownOption.esm.js +26 -21
  28. package/dist/components/CreateRole/MembersDropdownOption.esm.js.map +1 -1
  29. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js +59 -49
  30. package/dist/components/CreateRole/PermissionPoliciesForm.esm.js.map +1 -1
  31. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js +12 -17
  32. package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js.map +1 -1
  33. package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js +5 -5
  34. package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js.map +1 -1
  35. package/dist/components/CreateRole/RoleDetailsForm.esm.js +1 -1
  36. package/dist/components/CreateRole/RoleDetailsForm.esm.js.map +1 -1
  37. package/dist/components/CreateRole/RoleForm.esm.js +9 -3
  38. package/dist/components/CreateRole/RoleForm.esm.js.map +1 -1
  39. package/dist/components/DownloadUserStatistics.esm.js +8 -10
  40. package/dist/components/DownloadUserStatistics.esm.js.map +1 -1
  41. package/dist/components/EditRole.esm.js +9 -6
  42. package/dist/components/EditRole.esm.js.map +1 -1
  43. package/dist/components/RoleOverview/AboutCard.esm.js +55 -49
  44. package/dist/components/RoleOverview/AboutCard.esm.js.map +1 -1
  45. package/dist/components/RoleOverview/MembersCard.esm.js +12 -11
  46. package/dist/components/RoleOverview/MembersCard.esm.js.map +1 -1
  47. package/dist/components/RoleOverview/PermissionsCard.esm.js +12 -11
  48. package/dist/components/RoleOverview/PermissionsCard.esm.js.map +1 -1
  49. package/dist/components/RoleOverview/RoleOverviewPage.esm.js +1 -1
  50. package/dist/components/RoleOverview/RoleOverviewPage.esm.js.map +1 -1
  51. package/dist/components/RolesList/DeleteRole.esm.js +6 -4
  52. package/dist/components/RolesList/DeleteRole.esm.js.map +1 -1
  53. package/dist/components/RolesList/DeleteRoleDialog.esm.js +66 -41
  54. package/dist/components/RolesList/DeleteRoleDialog.esm.js.map +1 -1
  55. package/dist/components/RolesList/RolesList.esm.js +9 -10
  56. package/dist/components/RolesList/RolesList.esm.js.map +1 -1
  57. package/dist/components/RolesList/RolesListColumns.esm.js +2 -1
  58. package/dist/components/RolesList/RolesListColumns.esm.js.map +1 -1
  59. package/dist/components/RolesList/RolesListToolbar.esm.js +35 -32
  60. package/dist/components/RolesList/RolesListToolbar.esm.js.map +1 -1
  61. package/dist/components/SnackbarAlert.esm.js +2 -2
  62. package/dist/components/SnackbarAlert.esm.js.map +1 -1
  63. package/dist/utils/conditional-access-utils.esm.js +1 -122
  64. package/dist/utils/conditional-access-utils.esm.js.map +1 -1
  65. package/package.json +2 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  ### Dependencies
2
2
 
3
+ ## 1.33.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ba05b93: Fixed UI issues.
8
+
9
+ ## 1.33.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 757799e: Upgraded RBAC plugin from mui4 to mui5
14
+
3
15
  ## 1.32.5
4
16
 
5
17
  ### Patch Changes
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
- import { Box, Typography } from '@material-ui/core';
3
- import Tooltip from '@material-ui/core/Tooltip';
4
- import HelpOutlineIcon from '@material-ui/icons/HelpOutline';
2
+ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
3
+ import Box from '@mui/material/Box';
4
+ import Tooltip from '@mui/material/Tooltip';
5
+ import Typography from '@mui/material/Typography';
5
6
 
7
+ const tooltipTitle = () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", component: "p", align: "center" }, "Nested conditions are ", /* @__PURE__ */ React.createElement("b", null, "1 layer rules within a main condition"), ". It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions."), /* @__PURE__ */ React.createElement(Typography, { variant: "body1", component: "p", align: "center" }, "For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user."));
6
8
  const AddNestedConditionButton = () => {
7
- const tooltipTitle = () => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography, { variant: "body1", component: "p", align: "center" }, "Nested conditions are ", /* @__PURE__ */ React.createElement("b", null, "1 layer rules within a main condition"), ". It lets you allow appropriate access by using detailed permissions based on various conditions. You can add multiple nested conditions."), /* @__PURE__ */ React.createElement(Typography, { variant: "body1", component: "p", align: "center" }, "For example, you can allow access to all entity types in the main condition and use a nested condition to limit the access to entities owned by the user."));
8
9
  return /* @__PURE__ */ React.createElement(
9
10
  Box,
10
11
  {
11
- style: {
12
+ sx: {
12
13
  display: "flex",
13
14
  justifyContent: "center",
14
15
  alignItems: "center"
@@ -19,5 +20,5 @@ const AddNestedConditionButton = () => {
19
20
  );
20
21
  };
21
22
 
22
- export { AddNestedConditionButton };
23
+ export { AddNestedConditionButton, tooltipTitle };
23
24
  //# sourceMappingURL=AddNestedConditionButton.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddNestedConditionButton.esm.js","sources":["../../../src/components/ConditionalAccess/AddNestedConditionButton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport { Box, Typography } from '@material-ui/core';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport HelpOutlineIcon from '@material-ui/icons/HelpOutline';\n\nexport const AddNestedConditionButton = () => {\n const tooltipTitle = () => (\n <div>\n <Typography variant=\"body1\" component=\"p\" align=\"center\">\n Nested conditions are <b>1 layer rules within a main condition</b>. It\n lets you allow appropriate access by using detailed permissions based on\n various conditions. You can add multiple nested conditions.\n </Typography>\n <Typography variant=\"body1\" component=\"p\" align=\"center\">\n For example, you can allow access to all entity types in the main\n condition and use a nested condition to limit the access to entities\n owned by the user.\n </Typography>\n </div>\n );\n return (\n <Box\n style={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Typography variant=\"body1\" component=\"span\">\n Add Nested Condition\n </Typography>\n <Tooltip title={tooltipTitle()} placement=\"top\">\n <HelpOutlineIcon fontSize=\"inherit\" style={{ marginLeft: '0.25rem' }} />\n </Tooltip>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,2BAA2B,MAAM;AAC5C,EAAA,MAAM,YAAe,GAAA,sBAClB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,SAAU,EAAA,GAAA,EAAI,KAAM,EAAA,QAAA,EAAA,EAAS,wBACjC,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAE,EAAA,IAAA,EAAA,uCAAqC,CAAI,EAAA,2IAGpE,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,SAAA,EAAU,GAAI,EAAA,KAAA,EAAM,QAAS,EAAA,EAAA,2JAIzD,CACF,CAAA;AAEF,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA;AAAA,QACL,OAAS,EAAA,MAAA;AAAA,QACT,cAAgB,EAAA,QAAA;AAAA,QAChB,UAAY,EAAA;AAAA;AACd,KAAA;AAAA,wCAEC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,SAAA,EAAU,UAAO,sBAE7C,CAAA;AAAA,wCACC,OAAQ,EAAA,EAAA,KAAA,EAAO,YAAa,EAAA,EAAG,WAAU,KACxC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,QAAA,EAAS,WAAU,KAAO,EAAA,EAAE,UAAY,EAAA,SAAA,IAAa,CACxE;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"AddNestedConditionButton.esm.js","sources":["../../../src/components/ConditionalAccess/AddNestedConditionButton.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport HelpOutlineIcon from '@mui/icons-material/HelpOutline';\nimport Box from '@mui/material/Box';\nimport Tooltip from '@mui/material/Tooltip';\nimport Typography from '@mui/material/Typography';\n\nexport const tooltipTitle = () => (\n <div>\n <Typography variant=\"body1\" component=\"p\" align=\"center\">\n Nested conditions are <b>1 layer rules within a main condition</b>. It\n lets you allow appropriate access by using detailed permissions based on\n various conditions. You can add multiple nested conditions.\n </Typography>\n <Typography variant=\"body1\" component=\"p\" align=\"center\">\n For example, you can allow access to all entity types in the main\n condition and use a nested condition to limit the access to entities owned\n by the user.\n </Typography>\n </div>\n);\n\nexport const AddNestedConditionButton = () => {\n return (\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <Typography variant=\"body1\" component=\"span\">\n Add Nested Condition\n </Typography>\n <Tooltip title={tooltipTitle()} placement=\"top\">\n <HelpOutlineIcon fontSize=\"inherit\" style={{ marginLeft: '0.25rem' }} />\n </Tooltip>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBO,MAAM,YAAe,GAAA,sBACzB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,OAAQ,EAAA,OAAA,EAAQ,SAAU,EAAA,GAAA,EAAI,KAAM,EAAA,QAAA,EAAA,EAAS,wBACjC,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAE,EAAA,IAAA,EAAA,uCAAqC,CAAI,EAAA,2IAGpE,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,SAAA,EAAU,GAAI,EAAA,KAAA,EAAM,QAAS,EAAA,EAAA,2JAIzD,CACF;AAGK,MAAM,2BAA2B,MAAM;AAC5C,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,EAAI,EAAA;AAAA,QACF,OAAS,EAAA,MAAA;AAAA,QACT,cAAgB,EAAA,QAAA;AAAA,QAChB,UAAY,EAAA;AAAA;AACd,KAAA;AAAA,wCAEC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,SAAA,EAAU,UAAO,sBAE7C,CAAA;AAAA,wCACC,OAAQ,EAAA,EAAA,KAAA,EAAO,YAAa,EAAA,EAAG,WAAU,KACxC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,EAAA,EAAA,QAAA,EAAS,WAAU,KAAO,EAAA,EAAE,UAAY,EAAA,SAAA,IAAa,CACxE;AAAA,GACF;AAEJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { IconButton } from '@material-ui/core';
3
2
  import RemoveIcon from '@mui/icons-material/Remove';
3
+ import IconButton from '@mui/material/IconButton';
4
4
  import { isSimpleRule, getRowStyle, getRowKey, getSimpleRuleErrors, getNestedRuleErrors } from '../../utils/conditional-access-utils.esm.js';
5
5
  import { ConditionsFormRowFields } from './ConditionsFormRowFields.esm.js';
6
6
  import { criterias } from './const.esm.js';
@@ -15,7 +15,6 @@ const ComplexConditionRow = ({
15
15
  setRemoveAllClicked,
16
16
  conditionRulesData,
17
17
  notConditionType,
18
- classes,
19
18
  currentCondition,
20
19
  ruleIndex,
21
20
  activeCriteria,
@@ -134,7 +133,12 @@ const ComplexConditionRow = ({
134
133
  IconButton,
135
134
  {
136
135
  title: "Remove",
137
- className: classes.removeRuleButton,
136
+ sx: {
137
+ color: (theme) => theme.palette.grey[500],
138
+ flexGrow: 0,
139
+ alignSelf: "baseline",
140
+ marginTop: (theme) => theme.spacing(3.3)
141
+ },
138
142
  disabled: isNestedCondition ? nestedDisabled : disabled,
139
143
  onClick: isNestedCondition && activeNestedCriteria && nestedConditionIndex !== void 0 ? () => handleRemoveNestedConditionRule(activeNestedCriteria) : () => {
140
144
  handleRemoveSimpleConditionRule(ruleIndex, ruleList);
@@ -1 +1 @@
1
- {"version":3,"file":"ComplexConditionRow.esm.js","sources":["../../../src/components/ConditionalAccess/ComplexConditionRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport { PermissionCondition } from '@backstage/plugin-permission-common';\n\nimport { IconButton } from '@material-ui/core';\nimport RemoveIcon from '@mui/icons-material/Remove';\n\nimport {\n getNestedRuleErrors,\n getRowKey,\n getRowStyle,\n getSimpleRuleErrors,\n isSimpleRule,\n} from '../../utils/conditional-access-utils';\nimport { ConditionsFormRowFields } from './ConditionsFormRowFields';\nimport { criterias } from './const';\nimport {\n AccessConditionsErrors,\n ComplexErrors,\n Condition,\n ConditionsData,\n NestedCriteriaErrors,\n NotConditionType,\n RulesData,\n} from './types';\n\ntype ComplexConditionRowProps = {\n conditionRow: ConditionsData;\n nestedConditionRow: Condition[];\n criteria: keyof ConditionsData;\n onRuleChange: (newCondition: ConditionsData) => void;\n updateRules: (updatedNestedConditionRow: Condition[] | Condition) => void;\n setErrors: React.Dispatch<\n React.SetStateAction<AccessConditionsErrors | undefined>\n >;\n setRemoveAllClicked: React.Dispatch<React.SetStateAction<boolean>>;\n conditionRulesData?: RulesData;\n notConditionType?: NotConditionType;\n classes: any;\n currentCondition: Condition;\n ruleIndex: number;\n activeCriteria?: 'allOf' | 'anyOf';\n isNestedCondition?: boolean;\n nestedConditionIndex?: number;\n activeNestedCriteria?: 'allOf' | 'anyOf';\n};\n\nexport const ComplexConditionRow = ({\n conditionRow,\n nestedConditionRow,\n criteria,\n onRuleChange,\n updateRules,\n setErrors,\n setRemoveAllClicked,\n conditionRulesData,\n notConditionType,\n classes,\n currentCondition,\n ruleIndex,\n activeCriteria,\n isNestedCondition = false,\n nestedConditionIndex,\n activeNestedCriteria,\n}: ComplexConditionRowProps) => {\n const handleRemoveSimpleConditionRule = (\n index: number,\n ruleList: PermissionCondition[],\n ) => {\n if (!activeCriteria) {\n return;\n }\n const updatedSimpleRules = ruleList.filter(\n (_r, rindex) => index !== rindex,\n );\n const nestedConditions =\n (conditionRow[criteria] as PermissionCondition[])?.filter(\n (con: PermissionCondition) =>\n criterias.allOf in con ||\n criterias.anyOf in con ||\n criterias.not in con,\n ) || [];\n\n onRuleChange({\n [activeCriteria as keyof ConditionsData]: [\n ...updatedSimpleRules,\n ...nestedConditions,\n ],\n });\n\n setErrors(prevErrors => {\n const updatedErrors = { ...prevErrors };\n\n if (updatedErrors[activeCriteria]) {\n const criteriaErrors = updatedErrors[activeCriteria] as ComplexErrors[];\n const simpleRuleErrors = getSimpleRuleErrors(criteriaErrors);\n\n if (Array.isArray(simpleRuleErrors) && simpleRuleErrors.length > 0) {\n const updatedCriteriaErrors = [\n ...simpleRuleErrors.filter((_, rindex) => rindex !== index),\n ...getNestedRuleErrors(criteriaErrors),\n ];\n\n updatedErrors[activeCriteria] =\n updatedCriteriaErrors.length > 0 ? updatedCriteriaErrors : [];\n } else {\n delete updatedErrors[activeCriteria];\n }\n }\n\n return updatedErrors;\n });\n };\n\n const handleRemoveNestedConditionRule = (nestedConditionCriteria: string) => {\n const updatedNestedConditionRow: Condition[] = [];\n\n nestedConditionRow.forEach((c, index) => {\n if (index === nestedConditionIndex) {\n const updatedRules = (\n (c[\n nestedConditionCriteria as keyof Condition\n ] as PermissionCondition[]) || []\n ).filter((_r, rindex) => rindex !== ruleIndex);\n updatedNestedConditionRow.push({\n [nestedConditionCriteria as keyof Condition]: updatedRules,\n });\n } else {\n updatedNestedConditionRow.push(c);\n }\n });\n\n updateRules(\n criteria === criterias.not\n ? updatedNestedConditionRow[0]\n : updatedNestedConditionRow,\n );\n\n setErrors(prevErrors => {\n const updatedErrors = { ...prevErrors };\n\n if (updatedErrors[criteria] !== undefined) {\n const criteriaErrors = updatedErrors[criteria] as ComplexErrors[];\n\n if (\n criteria === criterias.not &&\n notConditionType === 'nested-condition'\n ) {\n (\n (updatedErrors[criteria] as NestedCriteriaErrors)[\n nestedConditionCriteria\n ] as string[]\n ).splice(ruleIndex, 1);\n return updatedErrors;\n }\n\n const nestedConditionErrors = getNestedRuleErrors(criteriaErrors);\n\n if (\n Array.isArray(nestedConditionErrors) &&\n nestedConditionIndex !== undefined\n ) {\n const nestedErrors = nestedConditionErrors[nestedConditionIndex];\n if (nestedErrors[nestedConditionCriteria]) {\n const updatedNestedErrors = (\n nestedErrors[nestedConditionCriteria] as string[]\n ).filter((_error, index) => index !== ruleIndex);\n\n if (updatedNestedErrors.length > 0) {\n nestedErrors[nestedConditionCriteria] = updatedNestedErrors;\n } else {\n delete nestedErrors[nestedConditionCriteria];\n }\n\n nestedConditionErrors[nestedConditionIndex] = nestedErrors;\n }\n\n updatedErrors[criteria] = [\n ...getSimpleRuleErrors(criteriaErrors),\n ...nestedConditionErrors,\n ];\n }\n }\n\n return updatedErrors;\n });\n };\n\n const ruleList = isNestedCondition\n ? (currentCondition[\n activeCriteria as keyof Condition\n ] as PermissionCondition[])\n : ((conditionRow[activeCriteria as keyof Condition] as Condition[]).filter(\n r => isSimpleRule(r),\n ) as PermissionCondition[]);\n\n const disabled =\n !isNestedCondition &&\n (conditionRow[criteria as keyof Condition] as Condition[]).length === 1 &&\n nestedConditionRow.length === 0 &&\n ruleIndex === 0;\n const nestedDisabled =\n isNestedCondition &&\n (\n nestedConditionRow[nestedConditionIndex ?? 0][\n activeNestedCriteria as keyof Condition\n ] as Condition[]\n ).length === 1 &&\n ruleIndex === 0;\n\n return (\n (currentCondition as PermissionCondition).resourceType && (\n <div\n style={getRowStyle(currentCondition, isNestedCondition)}\n key={getRowKey(isNestedCondition, ruleIndex)}\n >\n <ConditionsFormRowFields\n oldCondition={currentCondition}\n index={isNestedCondition ? undefined : ruleIndex}\n onRuleChange={onRuleChange}\n conditionRow={conditionRow}\n criteria={criteria}\n conditionRulesData={conditionRulesData}\n setErrors={setErrors}\n setRemoveAllClicked={setRemoveAllClicked}\n nestedConditionRow={\n isNestedCondition ? nestedConditionRow : undefined\n }\n nestedConditionCriteria={\n isNestedCondition ? activeNestedCriteria : undefined\n }\n nestedConditionIndex={\n isNestedCondition ? nestedConditionIndex : undefined\n }\n nestedConditionRuleIndex={isNestedCondition ? ruleIndex : undefined}\n updateRules={isNestedCondition ? updateRules : undefined}\n />\n <IconButton\n title=\"Remove\"\n className={classes.removeRuleButton}\n disabled={isNestedCondition ? nestedDisabled : disabled}\n onClick={\n isNestedCondition &&\n activeNestedCriteria &&\n nestedConditionIndex !== undefined\n ? () => handleRemoveNestedConditionRule(activeNestedCriteria)\n : () => {\n handleRemoveSimpleConditionRule(ruleIndex, ruleList);\n }\n }\n >\n <RemoveIcon />\n </IconButton>\n </div>\n )\n );\n};\n"],"names":["ruleList"],"mappings":";;;;;;;AA8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MAAM;AACJ,UAAA,+BAAA,CAAgC,WAAW,QAAQ,CAAA;AAAA;AACrD,OAAA;AAAA,0CAGL,UAAW,EAAA,IAAA;AAAA;AACd,GACF;AAGN;;;;"}
1
+ {"version":3,"file":"ComplexConditionRow.esm.js","sources":["../../../src/components/ConditionalAccess/ComplexConditionRow.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport { PermissionCondition } from '@backstage/plugin-permission-common';\n\nimport RemoveIcon from '@mui/icons-material/Remove';\nimport IconButton from '@mui/material/IconButton';\n\nimport {\n getNestedRuleErrors,\n getRowKey,\n getRowStyle,\n getSimpleRuleErrors,\n isSimpleRule,\n} from '../../utils/conditional-access-utils';\nimport { ConditionsFormRowFields } from './ConditionsFormRowFields';\nimport { criterias } from './const';\nimport {\n AccessConditionsErrors,\n ComplexErrors,\n Condition,\n ConditionsData,\n NestedCriteriaErrors,\n NotConditionType,\n RulesData,\n} from './types';\n\ntype ComplexConditionRowProps = {\n conditionRow: ConditionsData;\n nestedConditionRow: Condition[];\n criteria: keyof ConditionsData;\n onRuleChange: (newCondition: ConditionsData) => void;\n updateRules: (updatedNestedConditionRow: Condition[] | Condition) => void;\n setErrors: React.Dispatch<\n React.SetStateAction<AccessConditionsErrors | undefined>\n >;\n setRemoveAllClicked: React.Dispatch<React.SetStateAction<boolean>>;\n conditionRulesData?: RulesData;\n notConditionType?: NotConditionType;\n currentCondition: Condition;\n ruleIndex: number;\n activeCriteria?: 'allOf' | 'anyOf';\n isNestedCondition?: boolean;\n nestedConditionIndex?: number;\n activeNestedCriteria?: 'allOf' | 'anyOf';\n};\n\nexport const ComplexConditionRow = ({\n conditionRow,\n nestedConditionRow,\n criteria,\n onRuleChange,\n updateRules,\n setErrors,\n setRemoveAllClicked,\n conditionRulesData,\n notConditionType,\n currentCondition,\n ruleIndex,\n activeCriteria,\n isNestedCondition = false,\n nestedConditionIndex,\n activeNestedCriteria,\n}: ComplexConditionRowProps) => {\n const handleRemoveSimpleConditionRule = (\n index: number,\n ruleList: PermissionCondition[],\n ) => {\n if (!activeCriteria) {\n return;\n }\n const updatedSimpleRules = ruleList.filter(\n (_r, rindex) => index !== rindex,\n );\n const nestedConditions =\n (conditionRow[criteria] as PermissionCondition[])?.filter(\n (con: PermissionCondition) =>\n criterias.allOf in con ||\n criterias.anyOf in con ||\n criterias.not in con,\n ) || [];\n\n onRuleChange({\n [activeCriteria as keyof ConditionsData]: [\n ...updatedSimpleRules,\n ...nestedConditions,\n ],\n });\n\n setErrors(prevErrors => {\n const updatedErrors = { ...prevErrors };\n\n if (updatedErrors[activeCriteria]) {\n const criteriaErrors = updatedErrors[activeCriteria] as ComplexErrors[];\n const simpleRuleErrors = getSimpleRuleErrors(criteriaErrors);\n\n if (Array.isArray(simpleRuleErrors) && simpleRuleErrors.length > 0) {\n const updatedCriteriaErrors = [\n ...simpleRuleErrors.filter((_, rindex) => rindex !== index),\n ...getNestedRuleErrors(criteriaErrors),\n ];\n\n updatedErrors[activeCriteria] =\n updatedCriteriaErrors.length > 0 ? updatedCriteriaErrors : [];\n } else {\n delete updatedErrors[activeCriteria];\n }\n }\n\n return updatedErrors;\n });\n };\n\n const handleRemoveNestedConditionRule = (nestedConditionCriteria: string) => {\n const updatedNestedConditionRow: Condition[] = [];\n\n nestedConditionRow.forEach((c, index) => {\n if (index === nestedConditionIndex) {\n const updatedRules = (\n (c[\n nestedConditionCriteria as keyof Condition\n ] as PermissionCondition[]) || []\n ).filter((_r, rindex) => rindex !== ruleIndex);\n updatedNestedConditionRow.push({\n [nestedConditionCriteria as keyof Condition]: updatedRules,\n });\n } else {\n updatedNestedConditionRow.push(c);\n }\n });\n\n updateRules(\n criteria === criterias.not\n ? updatedNestedConditionRow[0]\n : updatedNestedConditionRow,\n );\n\n setErrors(prevErrors => {\n const updatedErrors = { ...prevErrors };\n\n if (updatedErrors[criteria] !== undefined) {\n const criteriaErrors = updatedErrors[criteria] as ComplexErrors[];\n\n if (\n criteria === criterias.not &&\n notConditionType === 'nested-condition'\n ) {\n (\n (updatedErrors[criteria] as NestedCriteriaErrors)[\n nestedConditionCriteria\n ] as string[]\n ).splice(ruleIndex, 1);\n return updatedErrors;\n }\n\n const nestedConditionErrors = getNestedRuleErrors(criteriaErrors);\n\n if (\n Array.isArray(nestedConditionErrors) &&\n nestedConditionIndex !== undefined\n ) {\n const nestedErrors = nestedConditionErrors[nestedConditionIndex];\n if (nestedErrors[nestedConditionCriteria]) {\n const updatedNestedErrors = (\n nestedErrors[nestedConditionCriteria] as string[]\n ).filter((_error, index) => index !== ruleIndex);\n\n if (updatedNestedErrors.length > 0) {\n nestedErrors[nestedConditionCriteria] = updatedNestedErrors;\n } else {\n delete nestedErrors[nestedConditionCriteria];\n }\n\n nestedConditionErrors[nestedConditionIndex] = nestedErrors;\n }\n\n updatedErrors[criteria] = [\n ...getSimpleRuleErrors(criteriaErrors),\n ...nestedConditionErrors,\n ];\n }\n }\n\n return updatedErrors;\n });\n };\n\n const ruleList = isNestedCondition\n ? (currentCondition[\n activeCriteria as keyof Condition\n ] as PermissionCondition[])\n : ((conditionRow[activeCriteria as keyof Condition] as Condition[]).filter(\n r => isSimpleRule(r),\n ) as PermissionCondition[]);\n\n const disabled =\n !isNestedCondition &&\n (conditionRow[criteria as keyof Condition] as Condition[]).length === 1 &&\n nestedConditionRow.length === 0 &&\n ruleIndex === 0;\n const nestedDisabled =\n isNestedCondition &&\n (\n nestedConditionRow[nestedConditionIndex ?? 0][\n activeNestedCriteria as keyof Condition\n ] as Condition[]\n ).length === 1 &&\n ruleIndex === 0;\n\n return (\n (currentCondition as PermissionCondition).resourceType && (\n <div\n style={getRowStyle(currentCondition, isNestedCondition)}\n key={getRowKey(isNestedCondition, ruleIndex)}\n >\n <ConditionsFormRowFields\n oldCondition={currentCondition}\n index={isNestedCondition ? undefined : ruleIndex}\n onRuleChange={onRuleChange}\n conditionRow={conditionRow}\n criteria={criteria}\n conditionRulesData={conditionRulesData}\n setErrors={setErrors}\n setRemoveAllClicked={setRemoveAllClicked}\n nestedConditionRow={\n isNestedCondition ? nestedConditionRow : undefined\n }\n nestedConditionCriteria={\n isNestedCondition ? activeNestedCriteria : undefined\n }\n nestedConditionIndex={\n isNestedCondition ? nestedConditionIndex : undefined\n }\n nestedConditionRuleIndex={isNestedCondition ? ruleIndex : undefined}\n updateRules={isNestedCondition ? updateRules : undefined}\n />\n <IconButton\n title=\"Remove\"\n sx={{\n color: theme => theme.palette.grey[500],\n flexGrow: 0,\n alignSelf: 'baseline',\n marginTop: theme => theme.spacing(3.3),\n }}\n disabled={isNestedCondition ? nestedDisabled : disabled}\n onClick={\n isNestedCondition &&\n activeNestedCriteria &&\n nestedConditionIndex !== undefined\n ? () => handleRemoveNestedConditionRule(activeNestedCriteria)\n : () => {\n handleRemoveSimpleConditionRule(ruleIndex, ruleList);\n }\n }\n >\n <RemoveIcon />\n </IconButton>\n </div>\n )\n );\n};\n"],"names":["ruleList"],"mappings":";;;;;;;AA6DO,MAAM,sBAAsB,CAAC;AAAA,EAClC,YAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,SAAA;AAAA,EACA,mBAAA;AAAA,EACA,kBAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,iBAAoB,GAAA,KAAA;AAAA,EACpB,oBAAA;AAAA,EACA;AACF,CAAgC,KAAA;AAC9B,EAAM,MAAA,+BAAA,GAAkC,CACtC,KAAA,EACAA,SACG,K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con from '@mui/icons-material/Add';
3
+ import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
3
4
  import Box from '@mui/material/Box';
4
5
  import Button from '@mui/material/Button';
6
+ import Tooltip from '@mui/material/Tooltip';
5
7
  import { getDefaultRule } from '../../utils/conditional-access-utils.esm.js';
6
- import { AddNestedConditionButton } from './AddNestedConditionButton.esm.js';
8
+ import { tooltipTitle } from './AddNestedConditionButton.esm.js';
7
9
  import { criterias } from './const.esm.js';
8
10
 
9
11
  const ComplexConditionRowButtons = ({
10
12
  conditionRow,
11
13
  onRuleChange,
12
14
  criteria,
13
- classes,
14
15
  selPluginResourceType,
15
16
  updateErrors,
16
17
  isNestedConditionRule,
@@ -37,25 +38,49 @@ const ComplexConditionRowButtons = ({
37
38
  onRuleChange({ [criteria]: [...updatedRules] });
38
39
  updateErrors(firstNestedConditionIndex);
39
40
  };
40
- return (criteria === criterias.allOf || criteria === criterias.anyOf) && /* @__PURE__ */ React.createElement(Box, { mt: 1, mb: 1 }, /* @__PURE__ */ React.createElement(
41
- Button,
41
+ return (criteria === criterias.allOf || criteria === criterias.anyOf) && /* @__PURE__ */ React.createElement(
42
+ Box,
42
43
  {
43
- className: classes.addRuleButton,
44
- size: "small",
45
- onClick: handleAddRule
44
+ mt: 1,
45
+ mb: 1,
46
+ sx: {
47
+ display: "flex",
48
+ flexDirection: "column",
49
+ alignItems: "flex-start"
50
+ }
46
51
  },
47
- /* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" }),
48
- "Add rule"
49
- ), /* @__PURE__ */ React.createElement(
50
- Button,
51
- {
52
- className: classes.addNestedConditionButton,
53
- size: "small",
54
- onClick: () => handleAddNestedCondition(criteria)
55
- },
56
- /* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" }),
57
- /* @__PURE__ */ React.createElement(AddNestedConditionButton, null)
58
- ));
52
+ /* @__PURE__ */ React.createElement(
53
+ Button,
54
+ {
55
+ sx: {
56
+ color: (theme) => theme.palette.primary.light
57
+ },
58
+ size: "small",
59
+ onClick: handleAddRule,
60
+ startIcon: /* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" })
61
+ },
62
+ "Add rule"
63
+ ),
64
+ /* @__PURE__ */ React.createElement(
65
+ Button,
66
+ {
67
+ sx: {
68
+ color: (theme) => theme.palette.primary.light
69
+ },
70
+ size: "small",
71
+ onClick: () => handleAddNestedCondition(criteria),
72
+ startIcon: /* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" }),
73
+ endIcon: /* @__PURE__ */ React.createElement(Tooltip, { title: tooltipTitle(), placement: "top" }, /* @__PURE__ */ React.createElement(
74
+ HelpOutlineIcon,
75
+ {
76
+ fontSize: "small",
77
+ style: { marginLeft: "0.25rem" }
78
+ }
79
+ ))
80
+ },
81
+ "Add Nested Condition"
82
+ )
83
+ );
59
84
  };
60
85
 
61
86
  export { ComplexConditionRowButtons };
@@ -1 +1 @@
1
- {"version":3,"file":"ComplexConditionRowButtons.esm.js","sources":["../../../src/components/ConditionalAccess/ComplexConditionRowButtons.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport AddIcon from '@mui/icons-material/Add';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\n\nimport { getDefaultRule } from '../../utils/conditional-access-utils';\nimport { AddNestedConditionButton } from './AddNestedConditionButton';\nimport { criterias } from './const';\nimport { Condition, ConditionsData } from './types';\n\ntype ComplexConditionRowButtonsProps = {\n conditionRow: ConditionsData;\n onRuleChange: (newCondition: ConditionsData) => void;\n criteria: string;\n classes: any;\n selPluginResourceType: string;\n updateErrors: (_index: number) => void;\n isNestedConditionRule: (condition: Condition) => boolean;\n handleAddNestedCondition: (criteria: string) => void;\n};\n\nexport const ComplexConditionRowButtons = ({\n conditionRow,\n onRuleChange,\n criteria,\n classes,\n selPluginResourceType,\n updateErrors,\n isNestedConditionRule,\n handleAddNestedCondition,\n}: ComplexConditionRowButtonsProps) => {\n const findFirstNestedConditionIndex = (rules: Condition[]): number => {\n return rules.findIndex(e => isNestedConditionRule(e)) || 0;\n };\n const handleAddRule = () => {\n const updatedRules = [\n ...(conditionRow.allOf ?? []),\n ...(conditionRow.anyOf ?? []),\n ];\n\n const firstNestedConditionIndex =\n findFirstNestedConditionIndex(updatedRules);\n if (firstNestedConditionIndex !== -1) {\n updatedRules.splice(\n firstNestedConditionIndex,\n 0,\n getDefaultRule(selPluginResourceType),\n );\n } else {\n updatedRules.push(getDefaultRule(selPluginResourceType));\n }\n\n onRuleChange({ [criteria]: [...updatedRules] });\n updateErrors(firstNestedConditionIndex);\n };\n\n return (\n (criteria === criterias.allOf || criteria === criterias.anyOf) && (\n <Box mt={1} mb={1}>\n <Button\n className={classes.addRuleButton}\n size=\"small\"\n onClick={handleAddRule}\n >\n <AddIcon fontSize=\"small\" />\n Add rule\n </Button>\n <Button\n className={classes.addNestedConditionButton}\n size=\"small\"\n onClick={() => handleAddNestedCondition(criteria)}\n >\n <AddIcon fontSize=\"small\" />\n <AddNestedConditionButton />\n </Button>\n </Box>\n )\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAqCO,MAAM,6BAA6B,CAAC;AAAA,EACzC,YAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF,CAAuC,KAAA;AACrC,EAAM,MAAA,6BAAA,GAAgC,CAAC,KAA+B,KAAA;AACpE,IAAA,OAAO,MAAM,SAAU,CAAA,CAAA,CAAA,KAAK,qBAAsB,CAAA,C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AAM,wBAAA,CAAyB,QAAQ;AAAA,KAAA;AAAA,oBAEhD,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,wCACzB,wBAAyB,EAAA,IAAA;AAAA,GAE9B,CAAA;AAGN;;;;"}
1
+ {"version":3,"file":"ComplexConditionRowButtons.esm.js","sources":["../../../src/components/ConditionalAccess/ComplexConditionRowButtons.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport AddIcon from '@mui/icons-material/Add';\nimport HelpOutlineIcon from '@mui/icons-material/HelpOutline';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport { getDefaultRule } from '../../utils/conditional-access-utils';\nimport { tooltipTitle } from './AddNestedConditionButton';\nimport { criterias } from './const';\nimport { Condition, ConditionsData } from './types';\n\ntype ComplexConditionRowButtonsProps = {\n conditionRow: ConditionsData;\n onRuleChange: (newCondition: ConditionsData) => void;\n criteria: string;\n selPluginResourceType: string;\n updateErrors: (_index: number) => void;\n isNestedConditionRule: (condition: Condition) => boolean;\n handleAddNestedCondition: (criteria: string) => void;\n};\n\nexport const ComplexConditionRowButtons = ({\n conditionRow,\n onRuleChange,\n criteria,\n selPluginResourceType,\n updateErrors,\n isNestedConditionRule,\n handleAddNestedCondition,\n}: ComplexConditionRowButtonsProps) => {\n const findFirstNestedConditionIndex = (rules: Condition[]): number => {\n return rules.findIndex(e => isNestedConditionRule(e)) || 0;\n };\n const handleAddRule = () => {\n const updatedRules = [\n ...(conditionRow.allOf ?? []),\n ...(conditionRow.anyOf ?? []),\n ];\n\n const firstNestedConditionIndex =\n findFirstNestedConditionIndex(updatedRules);\n if (firstNestedConditionIndex !== -1) {\n updatedRules.splice(\n firstNestedConditionIndex,\n 0,\n getDefaultRule(selPluginResourceType),\n );\n } else {\n updatedRules.push(getDefaultRule(selPluginResourceType));\n }\n\n onRuleChange({ [criteria]: [...updatedRules] });\n updateErrors(firstNestedConditionIndex);\n };\n\n return (\n (criteria === criterias.allOf || criteria === criterias.anyOf) && (\n <Box\n mt={1}\n mb={1}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-start',\n }}\n >\n <Button\n sx={{\n color: theme => theme.palette.primary.light,\n }}\n size=\"small\"\n onClick={handleAddRule}\n startIcon={<AddIcon fontSize=\"small\" />}\n >\n Add rule\n </Button>\n <Button\n sx={{\n color: theme => theme.palette.primary.light,\n }}\n size=\"small\"\n onClick={() => handleAddNestedCondition(criteria)}\n startIcon={<AddIcon fontSize=\"small\" />}\n endIcon={\n <Tooltip title={tooltipTitle()} placement=\"top\">\n <HelpOutlineIcon\n fontSize=\"small\"\n style={{ marginLeft: '0.25rem' }}\n />\n </Tooltip>\n }\n >\n Add Nested Condition\n </Button>\n </Box>\n )\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAsCO,MAAM,6BAA6B,CAAC;AAAA,EACzC,YAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF,CAAuC,KAAA;AACrC,EAAM,MAAA,6BAAA,GAAgC,CAAC,KAA+B,KAAA;AACpE,IAAA,OAAO,MAAM,SAAU,CAAA,CAAA,CAAA,KAAK,qBAAsB,CAAA,CAAC,CAAC,CAAK,IAAA,CAAA;AAAA,GAC3D;AACA,EAAA,MAAM,gBAAgB,MAAM;AAC1B,IAAA,MAAM,YAAe,GAAA;AAAA,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AAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,EAAI,EAAA;AAAA,UACF,KAAO,EAAA,CAAA,KAAA,KAAS,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA;AAAA,SACxC;AAAA,QACA,IAAK,EAAA,OAAA;AAAA,QACL,OAAA,EAAS,MAAM,wBAAA,CAAyB,QAAQ,CAAA;AAAA,QAChD,SAAW,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,CAAA;AAAA,QACrC,yBACG,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,OAAO,YAAa,EAAA,EAAG,WAAU,KACxC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,eAAA;AAAA,UAAA;AAAA,YACC,QAAS,EAAA,OAAA;AAAA,YACT,KAAA,EAAO,EAAE,UAAA,EAAY,SAAU;AAAA;AAAA,SAEnC;AAAA,OAAA;AAAA,MAEH;AAAA;AAED,GACF;AAGN;;;;"}
@@ -1,44 +1,11 @@
1
1
  import React from 'react';
2
- import { makeStyles } from '@material-ui/core';
3
- import Drawer from '@material-ui/core/Drawer';
4
2
  import CloseIcon from '@mui/icons-material/Close';
5
3
  import Box from '@mui/material/Box';
4
+ import Drawer from '@mui/material/Drawer';
6
5
  import IconButton from '@mui/material/IconButton';
7
6
  import Typography from '@mui/material/Typography';
8
7
  import { ConditionsForm } from './ConditionsForm.esm.js';
9
8
 
10
- const useDrawerStyles = makeStyles(() => ({
11
- paper: {
12
- ["@media (max-width: 960px)"]: {
13
- width: "-webkit-fill-available"
14
- },
15
- width: "50vw",
16
- height: "100vh",
17
- gap: "3%",
18
- display: "-webkit-inline-box"
19
- }
20
- }));
21
- const useDrawerContentStyles = makeStyles((theme) => ({
22
- sidebar: {
23
- display: "flex",
24
- flexFlow: "column",
25
- justifyContent: "space-between",
26
- backgroundColor: `${theme.palette.background.default} !important`
27
- },
28
- header: {
29
- display: "flex",
30
- flexDirection: "row",
31
- justifyContent: "space-between",
32
- alignItems: "baseline",
33
- padding: theme.spacing(2.5),
34
- fontFamily: theme.typography.fontFamily
35
- },
36
- headerSubtitle: {
37
- fontWeight: 400,
38
- fontFamily: theme.typography.fontFamily,
39
- paddingTop: theme.spacing(1)
40
- }
41
- }));
42
9
  const ConditionalAccessSidebar = ({
43
10
  open,
44
11
  onClose,
@@ -47,45 +14,80 @@ const ConditionalAccessSidebar = ({
47
14
  conditionRulesData,
48
15
  conditionsFormVal
49
16
  }) => {
50
- const classes = useDrawerStyles();
51
- const contentClasses = useDrawerContentStyles();
52
17
  return /* @__PURE__ */ React.createElement(
53
18
  Drawer,
54
19
  {
55
20
  anchor: "right",
56
21
  open,
57
22
  "data-testid": "rules-sidebar",
58
- classes: {
59
- paper: classes.paper
23
+ PaperProps: {
24
+ sx: {
25
+ ["@media (max-width: 960px)"]: {
26
+ width: "100%"
27
+ },
28
+ width: "50%",
29
+ height: "100%"
30
+ }
60
31
  }
61
32
  },
62
- /* @__PURE__ */ React.createElement(Box, { className: contentClasses.sidebar }, /* @__PURE__ */ React.createElement(Box, { className: contentClasses.header }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, /* @__PURE__ */ React.createElement(Typography, { component: "span", sx: { fontWeight: 500 } }, "Configure access for the"), " ", selPluginResourceType, /* @__PURE__ */ React.createElement(
63
- Typography,
64
- {
65
- variant: "body2",
66
- className: contentClasses.headerSubtitle,
67
- align: "left"
68
- },
69
- "By default, the selected resource type will be visible to the chosen users in step two. If you want to restrict or grant permission to specific plugin resource type rule, select it and add the required parameters."
70
- )), /* @__PURE__ */ React.createElement(
71
- IconButton,
33
+ /* @__PURE__ */ React.createElement(
34
+ Box,
72
35
  {
73
- key: "dismiss",
74
- title: "Close the drawer",
75
- onClick: onClose,
76
- color: "inherit"
36
+ sx: {
37
+ display: "flex",
38
+ flexFlow: "column",
39
+ justifyContent: "space-between",
40
+ height: "100%",
41
+ backgroundColor: (theme) => `${theme.palette.background.paper}`
42
+ }
77
43
  },
78
- /* @__PURE__ */ React.createElement(CloseIcon, { fontSize: "small" })
79
- )), /* @__PURE__ */ React.createElement(
80
- ConditionsForm,
81
- {
82
- conditionRulesData,
83
- selPluginResourceType,
84
- conditionsFormVal,
85
- onClose,
86
- onSave
87
- }
88
- ))
44
+ /* @__PURE__ */ React.createElement(
45
+ Box,
46
+ {
47
+ sx: {
48
+ display: "flex",
49
+ flexDirection: "row",
50
+ justifyContent: "space-between",
51
+ alignItems: "baseline",
52
+ padding: (theme) => theme.spacing(2.5),
53
+ fontFamily: (theme) => theme.typography.fontFamily
54
+ }
55
+ },
56
+ /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex", gap: "5px" } }, /* @__PURE__ */ React.createElement(Typography, { sx: { fontWeight: 500 }, variant: "h5" }, "Configure access for the"), /* @__PURE__ */ React.createElement(Typography, { style: { fontWeight: 600 }, variant: "h5" }, selPluginResourceType)), /* @__PURE__ */ React.createElement(
57
+ Typography,
58
+ {
59
+ variant: "body2",
60
+ sx: {
61
+ fontWeight: 400,
62
+ fontFamily: (theme) => theme.typography.fontFamily,
63
+ paddingTop: (theme) => theme.spacing(1)
64
+ },
65
+ align: "left"
66
+ },
67
+ "By default, the selected resource type will be visible to the chosen users in step two. If you want to restrict or grant permission to specific plugin resource type rule, select it and add the required parameters."
68
+ )),
69
+ /* @__PURE__ */ React.createElement(
70
+ IconButton,
71
+ {
72
+ key: "dismiss",
73
+ title: "Close the drawer",
74
+ onClick: onClose,
75
+ color: "inherit"
76
+ },
77
+ /* @__PURE__ */ React.createElement(CloseIcon, { fontSize: "small" })
78
+ )
79
+ ),
80
+ /* @__PURE__ */ React.createElement(
81
+ ConditionsForm,
82
+ {
83
+ conditionRulesData,
84
+ selPluginResourceType,
85
+ conditionsFormVal,
86
+ onClose,
87
+ onSave
88
+ }
89
+ )
90
+ )
89
91
  );
90
92
  };
91
93
 
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionalAccessSidebar.esm.js","sources":["../../../src/components/ConditionalAccess/ConditionalAccessSidebar.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport { makeStyles } from '@material-ui/core';\nimport Drawer from '@material-ui/core/Drawer';\nimport CloseIcon from '@mui/icons-material/Close';\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport Typography from '@mui/material/Typography';\n\nimport { ConditionsForm } from './ConditionsForm';\nimport { ConditionsData, RulesData } from './types';\n\nconst useDrawerStyles = makeStyles(() => ({\n paper: {\n ['@media (max-width: 960px)']: {\n width: '-webkit-fill-available',\n },\n width: '50vw',\n height: '100vh',\n gap: '3%',\n display: '-webkit-inline-box',\n },\n}));\n\nconst useDrawerContentStyles = makeStyles(theme => ({\n sidebar: {\n display: 'flex',\n flexFlow: 'column',\n justifyContent: 'space-between',\n backgroundColor: `${theme.palette.background.default} !important`,\n },\n header: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'baseline',\n padding: theme.spacing(2.5),\n fontFamily: theme.typography.fontFamily,\n },\n headerSubtitle: {\n fontWeight: 400,\n fontFamily: theme.typography.fontFamily,\n paddingTop: theme.spacing(1),\n },\n}));\n\ntype ConditionalAccessSidebarProps = {\n open: boolean;\n onClose: () => void;\n onSave: (conditions?: ConditionsData) => void;\n selPluginResourceType: string;\n conditionRulesData?: RulesData;\n conditionsFormVal?: ConditionsData;\n};\n\nexport const ConditionalAccessSidebar = ({\n open,\n onClose,\n onSave,\n selPluginResourceType,\n conditionRulesData,\n conditionsFormVal,\n}: ConditionalAccessSidebarProps) => {\n const classes = useDrawerStyles();\n const contentClasses = useDrawerContentStyles();\n return (\n <Drawer\n anchor=\"right\"\n open={open}\n data-testid=\"rules-sidebar\"\n classes={{\n paper: classes.paper,\n }}\n >\n <Box className={contentClasses.sidebar}>\n <Box className={contentClasses.header}>\n <Typography variant=\"h5\">\n <Typography component=\"span\" sx={{ fontWeight: 500 }}>\n Configure access for the\n </Typography>{' '}\n {selPluginResourceType}\n <Typography\n variant=\"body2\"\n className={contentClasses.headerSubtitle}\n align=\"left\"\n >\n By default, the selected resource type will be visible to the\n chosen users in step two. If you want to restrict or grant\n permission to specific plugin resource type rule, select it and\n add the required parameters.\n </Typography>\n </Typography>\n <IconButton\n key=\"dismiss\"\n title=\"Close the drawer\"\n onClick={onClose}\n color=\"inherit\"\n >\n <CloseIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n <ConditionsForm\n conditionRulesData={conditionRulesData}\n selPluginResourceType={selPluginResourceType}\n conditionsFormVal={conditionsFormVal}\n onClose={onClose}\n onSave={onSave}\n />\n </Box>\n </Drawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AA2BA,MAAM,eAAA,GAAkB,WAAW,OAAO;AAAA,EACxC,KAAO,EAAA;AAAA,IACL,CAAC,2BAA2B,GAAG;AAAA,MAC7B,KAAO,EAAA;AAAA,KACT;AAAA,IACA,KAAO,EAAA,MAAA;AAAA,IACP,MAAQ,EAAA,OAAA;AAAA,IACR,GAAK,EAAA,IAAA;AAAA,IACL,OAAS,EAAA;AAAA;AAEb,CAAE,CAAA,CAAA;AAEF,MAAM,sBAAA,GAAyB,WAAW,CAAU,KAAA,MAAA;AAAA,EAClD,OAAS,EAAA;AAAA,IACP,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,QAAA;AAAA,IACV,cAAgB,EAAA,eAAA;AAAA,IAChB,eAAiB,EAAA,CAAA,EAAG,KAAM,CAAA,OAAA,CAAQ,WAAW,OAAO,C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A,EAAE,UAAY,EAAA,GAAA,EAAO,EAAA,EAAA,0BAEtD,CAAc,EAAA,GAAA,EACb,qBACD,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,OAAA;AAAA,QACR,WAAW,cAAe,CAAA,cAAA;AAAA,QAC1B,KAAM,EAAA;AAAA,OAAA;AAAA,MACP;AAAA,KAMH,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,GAAI,EAAA,SAAA;AAAA,QACJ,KAAM,EAAA,kBAAA;AAAA,QACN,OAAS,EAAA,OAAA;AAAA,QACT,KAAM,EAAA;AAAA,OAAA;AAAA,sBAEN,KAAA,CAAA,aAAA,CAAC,SAAU,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA;AAAA,KAEhC,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,kBAAA;AAAA,QACA,qBAAA;AAAA,QACA,iBAAA;AAAA,QACA,OAAA;AAAA,QACA;AAAA;AAAA,KAEJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ConditionalAccessSidebar.esm.js","sources":["../../../src/components/ConditionalAccess/ConditionalAccessSidebar.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\n\nimport CloseIcon from '@mui/icons-material/Close';\nimport Box from '@mui/material/Box';\nimport Drawer from '@mui/material/Drawer';\nimport IconButton from '@mui/material/IconButton';\nimport Typography from '@mui/material/Typography';\n\nimport { ConditionsForm } from './ConditionsForm';\nimport { ConditionsData, RulesData } from './types';\n\ntype ConditionalAccessSidebarProps = {\n open: boolean;\n onClose: () => void;\n onSave: (conditions?: ConditionsData) => void;\n selPluginResourceType: string;\n conditionRulesData?: RulesData;\n conditionsFormVal?: ConditionsData;\n};\n\nexport const ConditionalAccessSidebar = ({\n open,\n onClose,\n onSave,\n selPluginResourceType,\n conditionRulesData,\n conditionsFormVal,\n}: ConditionalAccessSidebarProps) => {\n return (\n <Drawer\n anchor=\"right\"\n open={open}\n data-testid=\"rules-sidebar\"\n PaperProps={{\n sx: {\n ['@media (max-width: 960px)']: {\n width: '100%',\n },\n width: '50%',\n height: '100%',\n },\n }}\n >\n <Box\n sx={{\n display: 'flex',\n flexFlow: 'column',\n justifyContent: 'space-between',\n height: '100%',\n backgroundColor: theme => `${theme.palette.background.paper}`,\n }}\n >\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'baseline',\n padding: theme => theme.spacing(2.5),\n fontFamily: theme => theme.typography.fontFamily,\n }}\n >\n <Box>\n <Box sx={{ display: 'flex', gap: '5px' }}>\n <Typography sx={{ fontWeight: 500 }} variant=\"h5\">\n Configure access for the\n </Typography>\n <Typography style={{ fontWeight: 600 }} variant=\"h5\">\n {selPluginResourceType}\n </Typography>\n </Box>\n <Typography\n variant=\"body2\"\n sx={{\n fontWeight: 400,\n fontFamily: theme => theme.typography.fontFamily,\n paddingTop: theme => theme.spacing(1),\n }}\n align=\"left\"\n >\n By default, the selected resource type will be visible to the\n chosen users in step two. If you want to restrict or grant\n permission to specific plugin resource type rule, select it and\n add the required parameters.\n </Typography>\n </Box>\n <IconButton\n key=\"dismiss\"\n title=\"Close the drawer\"\n onClick={onClose}\n color=\"inherit\"\n >\n <CloseIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n <ConditionsForm\n conditionRulesData={conditionRulesData}\n selPluginResourceType={selPluginResourceType}\n conditionsFormV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