@backstage-community/plugin-rbac 1.32.5 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js +7 -6
- package/dist/components/ConditionalAccess/AddNestedConditionButton.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js +7 -3
- package/dist/components/ConditionalAccess/ComplexConditionRow.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js +44 -19
- package/dist/components/ConditionalAccess/ComplexConditionRowButtons.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js +65 -63
- package/dist/components/ConditionalAccess/ConditionalAccessSidebar.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ConditionsForm.esm.js +94 -85
- package/dist/components/ConditionalAccess/ConditionsForm.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js +155 -101
- package/dist/components/ConditionalAccess/ConditionsFormRow.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js +98 -9
- package/dist/components/ConditionalAccess/ConditionsFormRowFields.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/CriteriaToggleButton.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/CustomArrayField.esm.js +7 -10
- package/dist/components/ConditionalAccess/CustomArrayField.esm.js.map +1 -1
- package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js +30 -14
- package/dist/components/ConditionalAccess/RulesDropdownOption.esm.js.map +1 -1
- package/dist/components/CreateRole/AddMembersForm.esm.js +7 -5
- package/dist/components/CreateRole/AddMembersForm.esm.js.map +1 -1
- package/dist/components/CreateRole/AddedMembersTable.esm.js +2 -10
- package/dist/components/CreateRole/AddedMembersTable.esm.js.map +1 -1
- package/dist/components/CreateRole/AddedMembersTableColumn.esm.js +2 -1
- package/dist/components/CreateRole/AddedMembersTableColumn.esm.js.map +1 -1
- package/dist/components/CreateRole/MembersDropdownOption.esm.js +26 -21
- package/dist/components/CreateRole/MembersDropdownOption.esm.js.map +1 -1
- package/dist/components/CreateRole/PermissionPoliciesForm.esm.js +59 -49
- package/dist/components/CreateRole/PermissionPoliciesForm.esm.js.map +1 -1
- package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js +12 -17
- package/dist/components/CreateRole/PermissionPoliciesFormRow.esm.js.map +1 -1
- package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js +5 -5
- package/dist/components/CreateRole/PoliciesCheckboxGroup.esm.js.map +1 -1
- package/dist/components/CreateRole/RoleDetailsForm.esm.js +1 -1
- package/dist/components/CreateRole/RoleDetailsForm.esm.js.map +1 -1
- package/dist/components/CreateRole/RoleForm.esm.js +8 -2
- package/dist/components/CreateRole/RoleForm.esm.js.map +1 -1
- package/dist/components/DownloadUserStatistics.esm.js +7 -10
- package/dist/components/DownloadUserStatistics.esm.js.map +1 -1
- package/dist/components/EditRole.esm.js +4 -2
- package/dist/components/EditRole.esm.js.map +1 -1
- package/dist/components/RoleOverview/AboutCard.esm.js +55 -49
- package/dist/components/RoleOverview/AboutCard.esm.js.map +1 -1
- package/dist/components/RoleOverview/MembersCard.esm.js +12 -11
- package/dist/components/RoleOverview/MembersCard.esm.js.map +1 -1
- package/dist/components/RoleOverview/PermissionsCard.esm.js +12 -11
- package/dist/components/RoleOverview/PermissionsCard.esm.js.map +1 -1
- package/dist/components/RoleOverview/RoleOverviewPage.esm.js +1 -1
- package/dist/components/RoleOverview/RoleOverviewPage.esm.js.map +1 -1
- package/dist/components/RolesList/DeleteRole.esm.js +2 -1
- package/dist/components/RolesList/DeleteRole.esm.js.map +1 -1
- package/dist/components/RolesList/DeleteRoleDialog.esm.js +45 -38
- package/dist/components/RolesList/DeleteRoleDialog.esm.js.map +1 -1
- package/dist/components/RolesList/RolesList.esm.js +9 -10
- package/dist/components/RolesList/RolesList.esm.js.map +1 -1
- package/dist/components/RolesList/RolesListColumns.esm.js +2 -1
- package/dist/components/RolesList/RolesListColumns.esm.js.map +1 -1
- package/dist/components/RolesList/RolesListToolbar.esm.js +35 -32
- package/dist/components/RolesList/RolesListToolbar.esm.js.map +1 -1
- package/dist/components/SnackbarAlert.esm.js +2 -2
- package/dist/components/SnackbarAlert.esm.js.map +1 -1
- package/dist/utils/conditional-access-utils.esm.js +1 -122
- package/dist/utils/conditional-access-utils.esm.js.map +1 -1
- package/package.json +2 -4
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { makeStyles, Box, Button } from '@material-ui/core';
|
|
3
|
-
import { Alert, AlertTitle } from '@material-ui/lab';
|
|
4
2
|
import WarningIcon from '@mui/icons-material/Warning';
|
|
3
|
+
import Alert from '@mui/material/Alert';
|
|
4
|
+
import AlertTitle from '@mui/material/AlertTitle';
|
|
5
|
+
import Box from '@mui/material/Box';
|
|
6
|
+
import Button from '@mui/material/Button';
|
|
5
7
|
import { initializeErrors, resetErrors, isSimpleRule, hasSimpleConditionOrNotErrors, hasNestedNotErrors, hasAllOfOrAnyOfErrors } from '../../utils/conditional-access-utils.esm.js';
|
|
6
8
|
import { ConditionsFormRow } from './ConditionsFormRow.esm.js';
|
|
7
9
|
import { criterias } from './const.esm.js';
|
|
8
10
|
|
|
9
|
-
const useStyles = makeStyles((theme) => ({
|
|
10
|
-
form: {
|
|
11
|
-
padding: theme.spacing(2.5),
|
|
12
|
-
paddingTop: 0,
|
|
13
|
-
flexGrow: 1,
|
|
14
|
-
overflow: "auto"
|
|
15
|
-
},
|
|
16
|
-
addConditionButton: {
|
|
17
|
-
color: theme.palette.primary.light
|
|
18
|
-
},
|
|
19
|
-
footer: {
|
|
20
|
-
display: "flex",
|
|
21
|
-
flexDirection: "row",
|
|
22
|
-
gap: "15px",
|
|
23
|
-
alignItems: "baseline",
|
|
24
|
-
borderTop: `2px solid ${theme.palette.border}`,
|
|
25
|
-
padding: theme.spacing(2.5),
|
|
26
|
-
"& button": {
|
|
27
|
-
textTransform: "none"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}));
|
|
31
11
|
const ConditionsForm = ({
|
|
32
12
|
conditionRulesData,
|
|
33
13
|
selPluginResourceType,
|
|
@@ -35,7 +15,6 @@ const ConditionsForm = ({
|
|
|
35
15
|
onClose,
|
|
36
16
|
onSave
|
|
37
17
|
}) => {
|
|
38
|
-
const classes = useStyles();
|
|
39
18
|
const [conditions, setConditions] = React.useState(
|
|
40
19
|
conditionsFormVal ?? {
|
|
41
20
|
condition: {
|
|
@@ -131,73 +110,103 @@ const ConditionsForm = ({
|
|
|
131
110
|
).includes("rule");
|
|
132
111
|
});
|
|
133
112
|
};
|
|
134
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
135
|
-
|
|
136
|
-
{
|
|
137
|
-
conditionRulesData,
|
|
138
|
-
conditionRow: conditions,
|
|
139
|
-
criteria,
|
|
140
|
-
selPluginResourceType,
|
|
141
|
-
onRuleChange: (newCondition) => setConditions(newCondition),
|
|
142
|
-
setCriteria,
|
|
143
|
-
setErrors,
|
|
144
|
-
setRemoveAllClicked
|
|
145
|
-
}
|
|
146
|
-
), hasMultiLevelNestedConditions() && /* @__PURE__ */ React.createElement(
|
|
147
|
-
Alert,
|
|
148
|
-
{
|
|
149
|
-
icon: /* @__PURE__ */ React.createElement(WarningIcon, null),
|
|
150
|
-
style: { margin: "1.5rem 0 1rem 0" },
|
|
151
|
-
severity: "warning",
|
|
152
|
-
"data-testid": "multi-level-nested-conditions-warning"
|
|
153
|
-
},
|
|
154
|
-
/* @__PURE__ */ React.createElement(AlertTitle, { "data-testid": "multi-level-nested-conditions-warning-title" }, "Multiple levels of nested conditions are not supported"),
|
|
155
|
-
"Only one level is displayed. Please use the CLI to view all nested conditions."
|
|
156
|
-
)), /* @__PURE__ */ React.createElement(Box, { className: classes.footer }, /* @__PURE__ */ React.createElement(
|
|
157
|
-
Button,
|
|
113
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
114
|
+
Box,
|
|
158
115
|
{
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (removeAllClicked) {
|
|
165
|
-
onSave(void 0);
|
|
166
|
-
} else onSave(conditions);
|
|
116
|
+
sx: {
|
|
117
|
+
padding: (theme) => theme.spacing(2.5),
|
|
118
|
+
paddingTop: 0,
|
|
119
|
+
flexGrow: 1,
|
|
120
|
+
overflow: "auto"
|
|
167
121
|
}
|
|
168
122
|
},
|
|
169
|
-
|
|
123
|
+
/* @__PURE__ */ React.createElement(
|
|
124
|
+
ConditionsFormRow,
|
|
125
|
+
{
|
|
126
|
+
conditionRulesData,
|
|
127
|
+
conditionRow: conditions,
|
|
128
|
+
criteria,
|
|
129
|
+
selPluginResourceType,
|
|
130
|
+
onRuleChange: (newCondition) => setConditions(newCondition),
|
|
131
|
+
setCriteria,
|
|
132
|
+
setErrors,
|
|
133
|
+
setRemoveAllClicked
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
hasMultiLevelNestedConditions() && /* @__PURE__ */ React.createElement(
|
|
137
|
+
Alert,
|
|
138
|
+
{
|
|
139
|
+
icon: /* @__PURE__ */ React.createElement(WarningIcon, null),
|
|
140
|
+
style: { margin: "1.5rem 0 1rem 0" },
|
|
141
|
+
severity: "warning",
|
|
142
|
+
"data-testid": "multi-level-nested-conditions-warning"
|
|
143
|
+
},
|
|
144
|
+
/* @__PURE__ */ React.createElement(AlertTitle, { "data-testid": "multi-level-nested-conditions-warning-title" }, "Multiple levels of nested conditions are not supported"),
|
|
145
|
+
"Only one level is displayed. Please use the CLI to view all nested conditions."
|
|
146
|
+
)
|
|
170
147
|
), /* @__PURE__ */ React.createElement(
|
|
171
|
-
|
|
148
|
+
Box,
|
|
172
149
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
150
|
+
sx: {
|
|
151
|
+
display: "flex",
|
|
152
|
+
flexDirection: "row",
|
|
153
|
+
gap: "15px",
|
|
154
|
+
alignItems: "baseline",
|
|
155
|
+
borderTop: (theme) => `2px solid ${theme.palette.border}`,
|
|
156
|
+
padding: (theme) => theme.spacing(2.5),
|
|
157
|
+
"& button": {
|
|
158
|
+
textTransform: "none"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
177
161
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
rule: "",
|
|
191
|
-
resourceType: selPluginResourceType,
|
|
192
|
-
params: {}
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
setErrors(resetErrors(criterias.condition));
|
|
162
|
+
/* @__PURE__ */ React.createElement(
|
|
163
|
+
Button,
|
|
164
|
+
{
|
|
165
|
+
variant: "contained",
|
|
166
|
+
color: "primary",
|
|
167
|
+
"data-testid": "save-conditions",
|
|
168
|
+
disabled: isSaveDisabled(),
|
|
169
|
+
onClick: () => {
|
|
170
|
+
if (removeAllClicked) {
|
|
171
|
+
onSave(void 0);
|
|
172
|
+
} else onSave(conditions);
|
|
173
|
+
}
|
|
196
174
|
},
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
175
|
+
"Save"
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ React.createElement(
|
|
178
|
+
Button,
|
|
179
|
+
{
|
|
180
|
+
variant: "outlined",
|
|
181
|
+
color: "primary",
|
|
182
|
+
onClick: onClose,
|
|
183
|
+
"data-testid": "cancel-conditions"
|
|
184
|
+
},
|
|
185
|
+
"Cancel"
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ React.createElement(
|
|
188
|
+
Button,
|
|
189
|
+
{
|
|
190
|
+
variant: "text",
|
|
191
|
+
color: "primary",
|
|
192
|
+
disabled: removeAllClicked || isNoRuleSelected(),
|
|
193
|
+
onClick: () => {
|
|
194
|
+
setRemoveAllClicked(true);
|
|
195
|
+
setCriteria(criterias.condition);
|
|
196
|
+
setConditions({
|
|
197
|
+
condition: {
|
|
198
|
+
rule: "",
|
|
199
|
+
resourceType: selPluginResourceType,
|
|
200
|
+
params: {}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
setErrors(resetErrors(criterias.condition));
|
|
204
|
+
},
|
|
205
|
+
"data-testid": "remove-conditions"
|
|
206
|
+
},
|
|
207
|
+
"Remove all"
|
|
208
|
+
)
|
|
209
|
+
));
|
|
201
210
|
};
|
|
202
211
|
|
|
203
212
|
export { ConditionsForm };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionsForm.esm.js","sources":["../../../src/components/ConditionalAccess/ConditionsForm.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 { Box, Button, makeStyles } from '@material-ui/core';\nimport { Alert, AlertTitle } from '@material-ui/lab';\nimport WarningIcon from '@mui/icons-material/Warning';\n\nimport {\n hasAllOfOrAnyOfErrors,\n hasNestedNotErrors,\n hasSimpleConditionOrNotErrors,\n initializeErrors,\n isSimpleRule,\n resetErrors,\n} from '../../utils/conditional-access-utils';\nimport { ConditionsFormRow } from './ConditionsFormRow';\nimport { criterias } from './const';\nimport {\n AccessConditionsErrors,\n Condition,\n ConditionsData,\n RulesData,\n} from './types';\n\nconst useStyles = makeStyles(theme => ({\n form: {\n padding: theme.spacing(2.5),\n paddingTop: 0,\n flexGrow: 1,\n overflow: 'auto',\n },\n addConditionButton: {\n color: theme.palette.primary.light,\n },\n footer: {\n display: 'flex',\n flexDirection: 'row',\n gap: '15px',\n alignItems: 'baseline',\n borderTop: `2px solid ${theme.palette.border}`,\n padding: theme.spacing(2.5),\n '& button': {\n textTransform: 'none',\n },\n },\n}));\n\ntype ConditionFormProps = {\n conditionRulesData?: RulesData;\n conditionsFormVal?: ConditionsData;\n selPluginResourceType: string;\n onClose: () => void;\n onSave: (conditions?: ConditionsData) => void;\n};\n\nexport const ConditionsForm = ({\n conditionRulesData,\n selPluginResourceType,\n conditionsFormVal,\n onClose,\n onSave,\n}: ConditionFormProps) => {\n const classes = useStyles();\n const [conditions, setConditions] = React.useState<ConditionsData>(\n conditionsFormVal ?? {\n condition: {\n rule: '',\n resourceType: selPluginResourceType,\n params: {},\n },\n },\n );\n const [criteria, setCriteria] = React.useState<keyof ConditionsData>(\n (Object.keys(conditions)[0] as keyof ConditionsData) ?? criterias.condition,\n );\n const [errors, setErrors] = React.useState<\n AccessConditionsErrors | undefined\n >(initializeErrors(criteria, conditions));\n\n const [removeAllClicked, setRemoveAllClicked] =\n React.useState<boolean>(false);\n\n const flattenConditions = (\n conditionData: Condition[],\n ): PermissionCondition[] => {\n const flatConditions: PermissionCondition[] = [];\n\n const processCondition = (condition: Condition) => {\n if ('rule' in condition) {\n flatConditions.push(condition);\n } else {\n if (condition.allOf) {\n condition.allOf.forEach(processCondition);\n }\n if (condition.anyOf) {\n condition.anyOf.forEach(processCondition);\n }\n if (condition.not) {\n if ('rule' in condition.not) {\n flatConditions.push(condition.not);\n } else {\n processCondition(condition.not);\n }\n }\n }\n };\n conditionData.forEach(processCondition);\n return flatConditions;\n };\n\n const isNoRuleSelected = () => {\n switch (criteria) {\n case criterias.condition:\n return !conditions.condition?.rule;\n case criterias.not: {\n const flatConditions = flattenConditions([\n conditions.not as PermissionCondition,\n ]);\n return flatConditions.some(c => !c.rule);\n }\n case criterias.allOf: {\n const flatConditions = flattenConditions(conditions.allOf || []);\n return flatConditions.some(c => !c.rule);\n }\n case criterias.anyOf: {\n const flatConditions = flattenConditions(conditions.anyOf || []);\n return flatConditions.some(c => !c.rule);\n }\n default:\n return true;\n }\n };\n\n const hasAnyErrors = (): boolean => {\n if (!errors) return false;\n\n if (\n criteria === criterias.condition ||\n (criteria === criterias.not &&\n isSimpleRule(conditions[criteria] as Condition))\n ) {\n return hasSimpleConditionOrNotErrors(errors, criteria);\n }\n\n if (\n criteria === criterias.not &&\n !isSimpleRule(conditions[criteria] as Condition)\n ) {\n return hasNestedNotErrors(errors, conditions, criteria);\n }\n\n if (criteria === criterias.allOf || criteria === criterias.anyOf) {\n return hasAllOfOrAnyOfErrors(errors, criteria);\n }\n\n return false;\n };\n\n const isSaveDisabled = () => {\n if (removeAllClicked) return false;\n\n return (\n hasAnyErrors() ||\n isNoRuleSelected() ||\n Object.is(conditionsFormVal, conditions)\n );\n };\n\n const hasMultiLevelNestedConditions = (): boolean => {\n if (!Array.isArray(conditions[criteria])) {\n return false;\n }\n\n return (conditions[criteria] as Condition[])\n .filter(condition => !('rule' in condition))\n .some((firstLevelNestedCondition: Condition) => {\n const nestedConditionCriteria = Object.keys(\n firstLevelNestedCondition,\n )[0];\n if (\n Array.isArray(\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ],\n )\n ) {\n return (\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ] as Condition[]\n ).some((con: Condition) => !('rule' in con));\n }\n\n return !Object.keys(\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ] as Condition[],\n ).includes('rule');\n });\n };\n\n return (\n <>\n <Box className={classes.form}>\n <ConditionsFormRow\n conditionRulesData={conditionRulesData}\n conditionRow={conditions}\n criteria={criteria}\n selPluginResourceType={selPluginResourceType}\n onRuleChange={newCondition => setConditions(newCondition)}\n setCriteria={setCriteria}\n setErrors={setErrors}\n setRemoveAllClicked={setRemoveAllClicked}\n />\n {hasMultiLevelNestedConditions() && (\n <Alert\n icon={<WarningIcon />}\n style={{ margin: '1.5rem 0 1rem 0' }}\n severity=\"warning\"\n data-testid=\"multi-level-nested-conditions-warning\"\n >\n <AlertTitle data-testid=\"multi-level-nested-conditions-warning-title\">\n Multiple levels of nested conditions are not supported\n </AlertTitle>\n Only one level is displayed. Please use the CLI to view all nested\n conditions.\n </Alert>\n )}\n </Box>\n <Box className={classes.footer}>\n <Button\n variant=\"contained\"\n color=\"primary\"\n data-testid=\"save-conditions\"\n disabled={isSaveDisabled()}\n onClick={() => {\n if (removeAllClicked) {\n onSave(undefined);\n } else onSave(conditions);\n }}\n >\n Save\n </Button>\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={onClose}\n data-testid=\"cancel-conditions\"\n >\n Cancel\n </Button>\n <Button\n variant=\"text\"\n color=\"primary\"\n disabled={removeAllClicked || isNoRuleSelected()}\n onClick={() => {\n setRemoveAllClicked(true);\n setCriteria(criterias.condition);\n setConditions({\n condition: {\n rule: '',\n resourceType: selPluginResourceType,\n params: {},\n },\n });\n setErrors(resetErrors(criterias.condition));\n }}\n data-testid=\"remove-conditions\"\n >\n Remove all\n </Button>\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC1B,UAAY,EAAA,CAAA;AAAA,IACZ,QAAU,EAAA,CAAA;AAAA,IACV,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,kBAAoB,EAAA;AAAA,IAClB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA;AAAA,GAC/B;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,I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alAccess/ConditionsForm.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 WarningIcon from '@mui/icons-material/Warning';\nimport Alert from '@mui/material/Alert';\nimport AlertTitle from '@mui/material/AlertTitle';\nimport Box from '@mui/material/Box';\nimport Button from '@mui/material/Button';\n\nimport {\n hasAllOfOrAnyOfErrors,\n hasNestedNotErrors,\n hasSimpleConditionOrNotErrors,\n initializeErrors,\n isSimpleRule,\n resetErrors,\n} from '../../utils/conditional-access-utils';\nimport { ConditionsFormRow } from './ConditionsFormRow';\nimport { criterias } from './const';\nimport {\n AccessConditionsErrors,\n Condition,\n ConditionsData,\n RulesData,\n} from './types';\n\ntype ConditionFormProps = {\n conditionRulesData?: RulesData;\n conditionsFormVal?: ConditionsData;\n selPluginResourceType: string;\n onClose: () => void;\n onSave: (conditions?: ConditionsData) => void;\n};\n\nexport const ConditionsForm = ({\n conditionRulesData,\n selPluginResourceType,\n conditionsFormVal,\n onClose,\n onSave,\n}: ConditionFormProps) => {\n const [conditions, setConditions] = React.useState<ConditionsData>(\n conditionsFormVal ?? {\n condition: {\n rule: '',\n resourceType: selPluginResourceType,\n params: {},\n },\n },\n );\n const [criteria, setCriteria] = React.useState<keyof ConditionsData>(\n (Object.keys(conditions)[0] as keyof ConditionsData) ?? criterias.condition,\n );\n const [errors, setErrors] = React.useState<\n AccessConditionsErrors | undefined\n >(initializeErrors(criteria, conditions));\n\n const [removeAllClicked, setRemoveAllClicked] =\n React.useState<boolean>(false);\n\n const flattenConditions = (\n conditionData: Condition[],\n ): PermissionCondition[] => {\n const flatConditions: PermissionCondition[] = [];\n\n const processCondition = (condition: Condition) => {\n if ('rule' in condition) {\n flatConditions.push(condition);\n } else {\n if (condition.allOf) {\n condition.allOf.forEach(processCondition);\n }\n if (condition.anyOf) {\n condition.anyOf.forEach(processCondition);\n }\n if (condition.not) {\n if ('rule' in condition.not) {\n flatConditions.push(condition.not);\n } else {\n processCondition(condition.not);\n }\n }\n }\n };\n conditionData.forEach(processCondition);\n return flatConditions;\n };\n\n const isNoRuleSelected = () => {\n switch (criteria) {\n case criterias.condition:\n return !conditions.condition?.rule;\n case criterias.not: {\n const flatConditions = flattenConditions([\n conditions.not as PermissionCondition,\n ]);\n return flatConditions.some(c => !c.rule);\n }\n case criterias.allOf: {\n const flatConditions = flattenConditions(conditions.allOf || []);\n return flatConditions.some(c => !c.rule);\n }\n case criterias.anyOf: {\n const flatConditions = flattenConditions(conditions.anyOf || []);\n return flatConditions.some(c => !c.rule);\n }\n default:\n return true;\n }\n };\n\n const hasAnyErrors = (): boolean => {\n if (!errors) return false;\n\n if (\n criteria === criterias.condition ||\n (criteria === criterias.not &&\n isSimpleRule(conditions[criteria] as Condition))\n ) {\n return hasSimpleConditionOrNotErrors(errors, criteria);\n }\n\n if (\n criteria === criterias.not &&\n !isSimpleRule(conditions[criteria] as Condition)\n ) {\n return hasNestedNotErrors(errors, conditions, criteria);\n }\n\n if (criteria === criterias.allOf || criteria === criterias.anyOf) {\n return hasAllOfOrAnyOfErrors(errors, criteria);\n }\n\n return false;\n };\n\n const isSaveDisabled = () => {\n if (removeAllClicked) return false;\n\n return (\n hasAnyErrors() ||\n isNoRuleSelected() ||\n Object.is(conditionsFormVal, conditions)\n );\n };\n\n const hasMultiLevelNestedConditions = (): boolean => {\n if (!Array.isArray(conditions[criteria])) {\n return false;\n }\n\n return (conditions[criteria] as Condition[])\n .filter(condition => !('rule' in condition))\n .some((firstLevelNestedCondition: Condition) => {\n const nestedConditionCriteria = Object.keys(\n firstLevelNestedCondition,\n )[0];\n if (\n Array.isArray(\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ],\n )\n ) {\n return (\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ] as Condition[]\n ).some((con: Condition) => !('rule' in con));\n }\n\n return !Object.keys(\n firstLevelNestedCondition[\n nestedConditionCriteria as keyof Condition\n ] as Condition[],\n ).includes('rule');\n });\n };\n\n return (\n <>\n <Box\n sx={{\n padding: theme => theme.spacing(2.5),\n paddingTop: 0,\n flexGrow: 1,\n overflow: 'auto',\n }}\n >\n <ConditionsFormRow\n conditionRulesData={conditionRulesData}\n conditionRow={conditions}\n criteria={criteria}\n selPluginResourceType={selPluginResourceType}\n onRuleChange={newCondition => setConditions(newCondition)}\n setCriteria={setCriteria}\n setErrors={setErrors}\n setRemoveAllClicked={setRemoveAllClicked}\n />\n {hasMultiLevelNestedConditions() && (\n <Alert\n icon={<WarningIcon />}\n style={{ margin: '1.5rem 0 1rem 0' }}\n severity=\"warning\"\n data-testid=\"multi-level-nested-conditions-warning\"\n >\n <AlertTitle data-testid=\"multi-level-nested-conditions-warning-title\">\n Multiple levels of nested conditions are not supported\n </AlertTitle>\n Only one level is displayed. Please use the CLI to view all nested\n conditions.\n </Alert>\n )}\n </Box>\n <Box\n sx={{\n display: 'flex',\n flexDirection: 'row',\n gap: '15px',\n alignItems: 'baseline',\n borderTop: theme => `2px solid ${theme.palette.border}`,\n padding: theme => theme.spacing(2.5),\n '& button': {\n textTransform: 'none',\n },\n }}\n >\n <Button\n variant=\"contained\"\n color=\"primary\"\n data-testid=\"save-conditions\"\n disabled={isSaveDisabled()}\n onClick={() => {\n if (removeAllClicked) {\n onSave(undefined);\n } else onSave(conditions);\n }}\n >\n Save\n </Button>\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={onClose}\n data-testid=\"cancel-conditions\"\n >\n Cancel\n </Button>\n <Button\n variant=\"text\"\n color=\"primary\"\n disabled={removeAllClicked || isNoRuleSelected()}\n onClick={() => {\n setRemoveAllClicked(true);\n setCriteria(criterias.condition);\n setConditions({\n condition: {\n rule: '',\n resourceType: selPluginResourceType,\n params: {},\n },\n });\n setErrors(resetErrors(criterias.condition));\n }}\n data-testid=\"remove-conditions\"\n >\n Remove all\n </Button>\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAkDO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,kBAAA;AAAA,EACA,qBAAA;AAAA,EACA,iBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAA0B,KAAA;AACxB,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,KAAM,CAAA,QAAA;AAAA,IACxC,iBAAqB,IAAA;AAAA,MACnB,SAAW,EAAA;AAAA,QACT,IAAM,EAAA,EAAA;AAAA,QACN,YAAc,EAAA,qBAAA;AAAA,QACd,QAAQ;AAAC;AACX;AACF,GACF;AACA,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,KAAM,CAAA,QAAA;AAAA,IACnC,OAAO,IAAK,CAAA,UAAU,CAAE,CAAA,CAAC,KAA8B,SAAU,CAAA;AAAA,GACpE;AACA,EAAM,MAAA,CAAC,QAAQ,SAAS,CAAA,GAAI,MAAM,QAEhC,CAAA,gBAAA,CAAiB,QAAU,EAAA,UAAU,CAAC,CAAA;AAExC,EAAA,MAAM,CAAC,gBAAkB,EAAA,mBAAmB,CAC1C,GAAA,KAAA,CAAM,SAAkB,KAAK,CAAA;AAE/B,EAAM,MAAA,iBAAA,GAAoB,CACxB,aAC0B,KAAA;AAC1B,IAAA,MAAM,iBAAwC,EAAC;AAE/C,IAAM,MAAA,gBAAA,GAAmB,CAAC,SAAyB,KAAA;AACjD,MAAA,IAAI,UAAU,SAAW,EAAA;AACvB,QAAA,cAAA,CAAe,KAAK,SAAS,CAAA;AAAA,OACxB,MAAA;AACL,QAAA,IAAI,UAAU,KAAO,EAAA;AACnB,UA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AAS,MAAM;AACb,UAAA,mBAAA,CAAoB,IAAI,CAAA;AACxB,UAAA,WAAA,CAAY,UAAU,SAAS,CAAA;AAC/B,UAAc,aAAA,CAAA;AAAA,YACZ,SAAW,EAAA;AAAA,cACT,IAAM,EAAA,EAAA;AAAA,cACN,YAAc,EAAA,qBAAA;AAAA,cACd,QAAQ;AAAC;AACX,WACD,CAAA;AACD,UAAU,SAAA,CAAA,WAAA,CAAY,SAAU,CAAA,SAAS,CAAC,CAAA;AAAA,SAC5C;AAAA,QACA,aAAY,EAAA;AAAA,OAAA;AAAA,MACb;AAAA;AAED,GAEJ,CAAA;AAEJ;;;;"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useTheme, RadioGroup, FormControlLabel, Radio, IconButton } from '@material-ui/core';
|
|
3
2
|
import AddIcon from '@mui/icons-material/Add';
|
|
4
3
|
import RemoveIcon from '@mui/icons-material/Remove';
|
|
5
4
|
import Box from '@mui/material/Box';
|
|
6
5
|
import Button from '@mui/material/Button';
|
|
6
|
+
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
7
|
+
import IconButton from '@mui/material/IconButton';
|
|
8
|
+
import Radio from '@mui/material/Radio';
|
|
9
|
+
import RadioGroup from '@mui/material/RadioGroup';
|
|
10
|
+
import { useTheme } from '@mui/material/styles';
|
|
7
11
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
8
|
-
import {
|
|
12
|
+
import { extractNestedConditions, getDefaultRule, ruleOptionDisabled, isNestedConditionRule, resetErrors, isSimpleRule, getSimpleRulesCount, getNestedConditionSimpleRulesCount, nestedConditionButtons } from '../../utils/conditional-access-utils.esm.js';
|
|
9
13
|
import { AddNestedConditionButton } from './AddNestedConditionButton.esm.js';
|
|
10
14
|
import { ComplexConditionRow } from './ComplexConditionRow.esm.js';
|
|
11
15
|
import { ComplexConditionRowButtons } from './ComplexConditionRowButtons.esm.js';
|
|
@@ -25,7 +29,6 @@ const ConditionsFormRow = ({
|
|
|
25
29
|
setErrors,
|
|
26
30
|
setRemoveAllClicked
|
|
27
31
|
}) => {
|
|
28
|
-
const classes = makeConditionsFormRowStyles();
|
|
29
32
|
const theme = useTheme();
|
|
30
33
|
const [nestedConditionRow, setNestedConditionRow] = React.useState([]);
|
|
31
34
|
const [notConditionType, setNotConditionType] = React.useState(NotConditionType.SimpleCondition);
|
|
@@ -260,8 +263,17 @@ const ConditionsFormRow = ({
|
|
|
260
263
|
Box,
|
|
261
264
|
{
|
|
262
265
|
mt: 2,
|
|
263
|
-
|
|
264
|
-
|
|
266
|
+
key: `nestedCondition-${nestedConditionIndex}`,
|
|
267
|
+
sx: {
|
|
268
|
+
padding: "20px",
|
|
269
|
+
marginLeft: theme.spacing(3),
|
|
270
|
+
border: `1px solid ${theme.palette.border}`,
|
|
271
|
+
borderRadius: "4px",
|
|
272
|
+
backgroundColor: theme.palette.background.default,
|
|
273
|
+
"& input": {
|
|
274
|
+
backgroundColor: `${theme.palette.background.paper}!important`
|
|
275
|
+
}
|
|
276
|
+
}
|
|
265
277
|
},
|
|
266
278
|
/* @__PURE__ */ React.createElement("div", { style: { display: "flex", justifyContent: "space-between" } }, /* @__PURE__ */ React.createElement(
|
|
267
279
|
ToggleButtonGroup,
|
|
@@ -272,7 +284,11 @@ const ConditionsFormRow = ({
|
|
|
272
284
|
newNestedCriteria,
|
|
273
285
|
nestedConditionIndex
|
|
274
286
|
),
|
|
275
|
-
|
|
287
|
+
sx: {
|
|
288
|
+
backgroundColor: theme.palette.background.paper,
|
|
289
|
+
width: "60%",
|
|
290
|
+
height: "100%"
|
|
291
|
+
}
|
|
276
292
|
},
|
|
277
293
|
nestedConditionButtons.map(({ val, label }) => /* @__PURE__ */ React.createElement(
|
|
278
294
|
CriteriaToggleButton,
|
|
@@ -288,7 +304,11 @@ const ConditionsFormRow = ({
|
|
|
288
304
|
IconButton,
|
|
289
305
|
{
|
|
290
306
|
title: "Remove nested condition",
|
|
291
|
-
|
|
307
|
+
sx: {
|
|
308
|
+
color: theme.palette.grey[500],
|
|
309
|
+
flexGrow: 0,
|
|
310
|
+
alignSelf: "baseline"
|
|
311
|
+
},
|
|
292
312
|
disabled: simpleRulesCount === 0 && nestedConditionsCount === 1,
|
|
293
313
|
onClick: () => handleRemoveNestedCondition(nestedConditionIndex)
|
|
294
314
|
},
|
|
@@ -307,7 +327,6 @@ const ConditionsFormRow = ({
|
|
|
307
327
|
setRemoveAllClicked,
|
|
308
328
|
conditionRulesData,
|
|
309
329
|
notConditionType,
|
|
310
|
-
classes,
|
|
311
330
|
currentCondition: c,
|
|
312
331
|
ruleIndex: ncrIndex,
|
|
313
332
|
isNestedCondition: true,
|
|
@@ -336,123 +355,158 @@ const ConditionsFormRow = ({
|
|
|
336
355
|
), selectedNestedConditionCriteria !== criterias.not && /* @__PURE__ */ React.createElement(
|
|
337
356
|
Button,
|
|
338
357
|
{
|
|
339
|
-
|
|
358
|
+
sx: {
|
|
359
|
+
mt: 1,
|
|
360
|
+
color: theme.palette.primary.light
|
|
361
|
+
},
|
|
340
362
|
size: "small",
|
|
341
363
|
onClick: () => handleAddRuleInNestedCondition(
|
|
342
364
|
selectedNestedConditionCriteria,
|
|
343
365
|
nestedConditionIndex
|
|
344
|
-
)
|
|
366
|
+
),
|
|
367
|
+
startIcon: /* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" })
|
|
345
368
|
},
|
|
346
|
-
/* @__PURE__ */ React.createElement(AddIcon, { fontSize: "small" }),
|
|
347
369
|
"Add rule"
|
|
348
370
|
))
|
|
349
371
|
);
|
|
350
372
|
};
|
|
351
|
-
return /* @__PURE__ */ React.createElement(
|
|
352
|
-
|
|
353
|
-
{
|
|
354
|
-
exclusive: true,
|
|
355
|
-
value: criteria,
|
|
356
|
-
onChange: (_event, newCriteria) => handleCriteriaChange(newCriteria),
|
|
357
|
-
className: classes.criteriaButtonGroup
|
|
358
|
-
},
|
|
359
|
-
conditionButtons.map(({ val, label }) => /* @__PURE__ */ React.createElement(
|
|
360
|
-
CriteriaToggleButton,
|
|
361
|
-
{
|
|
362
|
-
key: `criteria-${val}`,
|
|
363
|
-
val,
|
|
364
|
-
label,
|
|
365
|
-
selectedCriteria: criteria,
|
|
366
|
-
theme
|
|
367
|
-
}
|
|
368
|
-
))
|
|
369
|
-
), /* @__PURE__ */ React.createElement(
|
|
370
|
-
ConditionRule,
|
|
371
|
-
{
|
|
372
|
-
conditionRow,
|
|
373
|
-
selPluginResourceType,
|
|
374
|
-
onRuleChange,
|
|
375
|
-
criteria,
|
|
376
|
-
conditionRulesData,
|
|
377
|
-
setErrors,
|
|
378
|
-
setRemoveAllClicked
|
|
379
|
-
}
|
|
380
|
-
), criteria !== criterias.condition && /* @__PURE__ */ React.createElement(Box, null, criteria !== criterias.not && conditionRow[criteria]?.map(
|
|
381
|
-
(c, srIndex) => /* @__PURE__ */ React.createElement(
|
|
382
|
-
ComplexConditionRow,
|
|
383
|
-
{
|
|
384
|
-
key: `${criteria}-simple-condition-${srIndex}`,
|
|
385
|
-
conditionRow,
|
|
386
|
-
nestedConditionRow,
|
|
387
|
-
criteria,
|
|
388
|
-
onRuleChange,
|
|
389
|
-
updateRules,
|
|
390
|
-
setErrors,
|
|
391
|
-
setRemoveAllClicked,
|
|
392
|
-
conditionRulesData,
|
|
393
|
-
notConditionType,
|
|
394
|
-
classes,
|
|
395
|
-
currentCondition: c,
|
|
396
|
-
ruleIndex: srIndex,
|
|
397
|
-
activeCriteria: criteria
|
|
398
|
-
}
|
|
399
|
-
)
|
|
400
|
-
), criteria === criterias.not && /* @__PURE__ */ React.createElement(
|
|
401
|
-
RadioGroup,
|
|
373
|
+
return /* @__PURE__ */ React.createElement(
|
|
374
|
+
Box,
|
|
402
375
|
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
376
|
+
sx: {
|
|
377
|
+
padding: "20px",
|
|
378
|
+
border: `1px solid ${theme.palette.border}`,
|
|
379
|
+
borderRadius: "4px",
|
|
380
|
+
backgroundColor: theme.palette.background.default,
|
|
381
|
+
"& input": {
|
|
382
|
+
color: `${theme.palette.textContrast}!important`,
|
|
383
|
+
"&:-internal-autofill-selected, &:-webkit-autofill, &:-webkit-autofill:hover, &:-webkit-autofill:focus, &:-webkit-autofill:active": {
|
|
384
|
+
WebkitBoxShadow: `0 0 0px 1000px ${theme.palette.background.paper} inset`,
|
|
385
|
+
WebkitTextFillColor: `${theme.palette.textContrast}!important`,
|
|
386
|
+
caretColor: `${theme.palette.textContrast}!important`
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
"& button": {
|
|
390
|
+
textTransform: "none"
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"data-testid": "conditions-row"
|
|
406
394
|
},
|
|
407
395
|
/* @__PURE__ */ React.createElement(
|
|
408
|
-
|
|
396
|
+
ToggleButtonGroup,
|
|
409
397
|
{
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
398
|
+
exclusive: true,
|
|
399
|
+
value: criteria,
|
|
400
|
+
onChange: (_event, newCriteria) => handleCriteriaChange(newCriteria),
|
|
401
|
+
sx: {
|
|
402
|
+
backgroundColor: theme.palette.background.paper,
|
|
403
|
+
width: "80%"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
conditionButtons.map(({ val, label }) => /* @__PURE__ */ React.createElement(
|
|
407
|
+
CriteriaToggleButton,
|
|
408
|
+
{
|
|
409
|
+
key: `criteria-${val}`,
|
|
410
|
+
val,
|
|
411
|
+
label,
|
|
412
|
+
selectedCriteria: criteria,
|
|
413
|
+
theme
|
|
414
|
+
}
|
|
415
|
+
))
|
|
415
416
|
),
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
/* @__PURE__ */ React.createElement(
|
|
418
|
+
ConditionRule,
|
|
418
419
|
{
|
|
419
|
-
oldCondition: conditionRow.not ?? getDefaultRule(selPluginResourceType),
|
|
420
|
-
onRuleChange,
|
|
421
420
|
conditionRow,
|
|
421
|
+
selPluginResourceType,
|
|
422
|
+
onRuleChange,
|
|
422
423
|
criteria,
|
|
423
424
|
conditionRulesData,
|
|
424
425
|
setErrors,
|
|
425
|
-
optionDisabled: (ruleOption) => ruleOptionDisabled(
|
|
426
|
-
ruleOption,
|
|
427
|
-
conditionRow.not ? [conditionRow.not] : void 0
|
|
428
|
-
),
|
|
429
426
|
setRemoveAllClicked
|
|
430
427
|
}
|
|
431
428
|
),
|
|
432
|
-
/* @__PURE__ */ React.createElement(
|
|
433
|
-
|
|
429
|
+
criteria !== criterias.condition && /* @__PURE__ */ React.createElement(Box, null, criteria !== criterias.not && conditionRow[criteria]?.map(
|
|
430
|
+
(c, srIndex) => /* @__PURE__ */ React.createElement(
|
|
431
|
+
ComplexConditionRow,
|
|
432
|
+
{
|
|
433
|
+
key: `${criteria}-simple-condition-${srIndex}`,
|
|
434
|
+
conditionRow,
|
|
435
|
+
nestedConditionRow,
|
|
436
|
+
criteria,
|
|
437
|
+
onRuleChange,
|
|
438
|
+
updateRules,
|
|
439
|
+
setErrors,
|
|
440
|
+
setRemoveAllClicked,
|
|
441
|
+
conditionRulesData,
|
|
442
|
+
notConditionType,
|
|
443
|
+
currentCondition: c,
|
|
444
|
+
ruleIndex: srIndex,
|
|
445
|
+
activeCriteria: criteria
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
), criteria === criterias.not && /* @__PURE__ */ React.createElement(
|
|
449
|
+
RadioGroup,
|
|
434
450
|
{
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
451
|
+
sx: {
|
|
452
|
+
margin: theme.spacing(1)
|
|
453
|
+
},
|
|
454
|
+
value: notConditionType,
|
|
455
|
+
onChange: (_event, value) => handleNotConditionTypeChange(value)
|
|
456
|
+
},
|
|
457
|
+
/* @__PURE__ */ React.createElement(
|
|
458
|
+
FormControlLabel,
|
|
459
|
+
{
|
|
460
|
+
value: NotConditionType.SimpleCondition,
|
|
461
|
+
control: /* @__PURE__ */ React.createElement(Radio, { color: "primary" }),
|
|
462
|
+
label: "Add rule",
|
|
463
|
+
sx: {
|
|
464
|
+
marginTop: theme.spacing(1)
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
),
|
|
468
|
+
notConditionType === NotConditionType.SimpleCondition && /* @__PURE__ */ React.createElement(
|
|
469
|
+
ConditionsFormRowFields,
|
|
470
|
+
{
|
|
471
|
+
oldCondition: conditionRow.not ?? getDefaultRule(selPluginResourceType),
|
|
472
|
+
onRuleChange,
|
|
473
|
+
conditionRow,
|
|
474
|
+
criteria,
|
|
475
|
+
conditionRulesData,
|
|
476
|
+
setErrors,
|
|
477
|
+
optionDisabled: (ruleOption) => ruleOptionDisabled(
|
|
478
|
+
ruleOption,
|
|
479
|
+
conditionRow.not ? [conditionRow.not] : void 0
|
|
480
|
+
),
|
|
481
|
+
setRemoveAllClicked
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
/* @__PURE__ */ React.createElement(
|
|
485
|
+
FormControlLabel,
|
|
486
|
+
{
|
|
487
|
+
value: NotConditionType.NestedCondition,
|
|
488
|
+
control: /* @__PURE__ */ React.createElement(Radio, { color: "primary" }),
|
|
489
|
+
label: /* @__PURE__ */ React.createElement(AddNestedConditionButton, null),
|
|
490
|
+
sx: {
|
|
491
|
+
marginTop: theme.spacing(1)
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
)
|
|
495
|
+
), /* @__PURE__ */ React.createElement(
|
|
496
|
+
ComplexConditionRowButtons,
|
|
497
|
+
{
|
|
498
|
+
conditionRow,
|
|
499
|
+
onRuleChange,
|
|
500
|
+
criteria,
|
|
501
|
+
selPluginResourceType,
|
|
502
|
+
updateErrors,
|
|
503
|
+
isNestedConditionRule,
|
|
504
|
+
handleAddNestedCondition
|
|
439
505
|
}
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
conditionRow,
|
|
445
|
-
onRuleChange,
|
|
446
|
-
criteria,
|
|
447
|
-
classes,
|
|
448
|
-
selPluginResourceType,
|
|
449
|
-
updateErrors,
|
|
450
|
-
isNestedConditionRule,
|
|
451
|
-
handleAddNestedCondition
|
|
452
|
-
}
|
|
453
|
-
), nestedConditionRow?.length > 0 && nestedConditionRow.map(
|
|
454
|
-
(nc, nestedConditionIndex) => renderNestedConditionRow(nc, nestedConditionIndex)
|
|
455
|
-
)));
|
|
506
|
+
), nestedConditionRow?.length > 0 && nestedConditionRow.map(
|
|
507
|
+
(nc, nestedConditionIndex) => renderNestedConditionRow(nc, nestedConditionIndex)
|
|
508
|
+
))
|
|
509
|
+
);
|
|
456
510
|
};
|
|
457
511
|
|
|
458
512
|
export { ConditionsFormRow };
|