mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
refactor: fields for table sorting cannot select sorting fields with scopekey (#3984)
* refactor: fields for table sorting cannot select sorting fields with scopeke y * refactor: sort field * refactor: sort field
This commit is contained in:
parent
b7fc50e47e
commit
e9f0e32a26
@ -1477,14 +1477,18 @@ export const SchemaSettingsSortField = () => {
|
||||
const { t } = useTranslation();
|
||||
const { dn } = useDesignable();
|
||||
const compile = useCompile();
|
||||
const { service } = useTableBlockContext();
|
||||
|
||||
const { service, association } = useTableBlockContext();
|
||||
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
||||
const collectionField = getCollectionJoinField(association);
|
||||
const options = fields
|
||||
.filter((field) => !field?.target && field.interface === 'sort')
|
||||
.map((field) => ({
|
||||
value: field?.name,
|
||||
label: compile(field?.uiSchema?.title) || field?.name,
|
||||
}));
|
||||
.map((field) => {
|
||||
return {
|
||||
value: field?.name,
|
||||
label: compile(field?.uiSchema?.title) || field?.name,
|
||||
disabled: field?.scopeKey && collectionField?.foreignKey !== field.scopeKey,
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<SchemaSettingsSelectItem
|
||||
|
Loading…
x
Reference in New Issue
Block a user