fix(acl): add roles.users field
This commit is contained in:
parent
6cfd586175
commit
7e0ac57057
@ -10,7 +10,8 @@ import { useBlockRequestContext } from '../../../block-provider/BlockProvider';
|
||||
import { mergeFilter } from '../../../block-provider/SharedFilterProvider';
|
||||
import { useCollection, useCollectionManager } from '../../../collection-manager';
|
||||
import { getInnermostKeyAndValue } from '../../common/utils/uitls';
|
||||
import { defaultFieldNames, Select } from '../select';
|
||||
import { useCompile } from '../../hooks';
|
||||
import { Select, defaultFieldNames } from '../select';
|
||||
import { ReadPretty } from './ReadPretty';
|
||||
import { extractFilterfield, extractValuesByPattern, generatePattern, parseVariables } from './utils';
|
||||
const EMPTY = 'N/A';
|
||||
@ -64,13 +65,14 @@ const InternalRemoteSelect = connect(
|
||||
}
|
||||
return '$includes';
|
||||
}, [targetField]);
|
||||
const compile = useCompile();
|
||||
|
||||
const mapOptionsToTags = useCallback(
|
||||
(options) => {
|
||||
try {
|
||||
return options
|
||||
.map((option) => {
|
||||
let label = option[fieldNames.label];
|
||||
let label = compile(option[fieldNames.label]);
|
||||
|
||||
if (targetField?.uiSchema?.enum) {
|
||||
if (Array.isArray(label)) {
|
||||
|
@ -84,6 +84,17 @@ export default {
|
||||
type: 'set',
|
||||
name: 'snippets',
|
||||
defaultValue: ['!ui.*', '!pm', '!pm.*'],
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'belongsToMany',
|
||||
name: 'users',
|
||||
target: 'users',
|
||||
foreignKey: 'roleName',
|
||||
otherKey: 'userId',
|
||||
onDelete: 'CASCADE',
|
||||
sourceKey: 'name',
|
||||
targetKey: 'id',
|
||||
through: 'rolesUsers',
|
||||
},
|
||||
],
|
||||
} as CollectionOptions;
|
||||
|
Loading…
Reference in New Issue
Block a user