mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-08 15:30:55 +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,7 +290,9 @@ export default function PolicyPrivilegeForm({
|
|||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{resourcePrivileges.map((resPrivs) => {
|
{resourcePrivileges
|
||||||
|
.filter((privs) => privs.resourceType !== 'all')
|
||||||
|
.map((resPrivs) => {
|
||||||
return (
|
return (
|
||||||
<Select.Option value={resPrivs.resourceType}>
|
<Select.Option value={resPrivs.resourceType}>
|
||||||
{resPrivs.resourceTypeDisplayName}
|
{resPrivs.resourceTypeDisplayName}
|
||||||
|
|||||||
@ -121,5 +121,8 @@ export const setFieldValues = (
|
|||||||
fieldValues: Array<PolicyMatchCriterionValue>,
|
fieldValues: Array<PolicyMatchCriterionValue>,
|
||||||
): PolicyMatchFilter => {
|
): PolicyMatchFilter => {
|
||||||
const restCriteria = filter.criteria?.filter((criterion) => criterion.field !== resourceFieldType) || [];
|
const restCriteria = filter.criteria?.filter((criterion) => criterion.field !== resourceFieldType) || [];
|
||||||
|
if (fieldValues.length === 0) {
|
||||||
|
return { ...filter, criteria: restCriteria };
|
||||||
|
}
|
||||||
return { ...filter, criteria: [...restCriteria, createCriterion(resourceFieldType, fieldValues)] };
|
return { ...filter, criteria: [...restCriteria, createCriterion(resourceFieldType, fieldValues)] };
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user