mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-02 03:39:03 +00:00
fix(policy): Remove all from the resource type choices (#4538)
* Remove all from the resource type choices * Fix empty case * Fix privileges
This commit is contained in:
parent
94890c1e71
commit
3fbc84bb43
@ -290,13 +290,15 @@ export default function PolicyPrivilegeForm({
|
||||
</Tag>
|
||||
)}
|
||||
>
|
||||
{resourcePrivileges.map((resPrivs) => {
|
||||
return (
|
||||
<Select.Option value={resPrivs.resourceType}>
|
||||
{resPrivs.resourceTypeDisplayName}
|
||||
</Select.Option>
|
||||
);
|
||||
})}
|
||||
{resourcePrivileges
|
||||
.filter((privs) => privs.resourceType !== 'all')
|
||||
.map((resPrivs) => {
|
||||
return (
|
||||
<Select.Option value={resPrivs.resourceType}>
|
||||
{resPrivs.resourceTypeDisplayName}
|
||||
</Select.Option>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
||||
@ -121,5 +121,8 @@ export const setFieldValues = (
|
||||
fieldValues: Array<PolicyMatchCriterionValue>,
|
||||
): PolicyMatchFilter => {
|
||||
const restCriteria = filter.criteria?.filter((criterion) => criterion.field !== resourceFieldType) || [];
|
||||
if (fieldValues.length === 0) {
|
||||
return { ...filter, criteria: restCriteria };
|
||||
}
|
||||
return { ...filter, criteria: [...restCriteria, createCriterion(resourceFieldType, fieldValues)] };
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user