Don't show regex on permissions configuration (#13511)

It's only valid for validation. This makes sure it's only configurable for validation.
This commit is contained in:
Rijk van Zanten
2022-05-24 11:10:21 -04:00
committed by GitHub
parent b855eb7874
commit fb559a09a5
3 changed files with 3 additions and 2 deletions

View File

@@ -332,7 +332,7 @@ function getCompareOptions(name: string) {
type = fieldInfo?.type || 'unknown';
}
return getFilterOperatorsForType(type, { includeValidation: true }).map((type) => ({
return getFilterOperatorsForType(type, { includeValidation: props.includeValidation }).map((type) => ({
text: t(`operators.${type}`),
value: `_${type}`,
}));

View File

@@ -138,7 +138,7 @@ function addNode(key: string) {
} else {
type = field?.type || 'unknown';
}
let filterOperators = getFilterOperatorsForType(type);
let filterOperators = getFilterOperatorsForType(type, { includeValidation: props.includeValidation });
const operator = field?.meta?.options?.choices && filterOperators.includes('eq') ? 'eq' : filterOperators[0];
const node = set({}, key, { ['_' + operator]: null });
innerValue.value = innerValue.value.concat(node);