Merge branch 'next' into develop

This commit is contained in:
nocobase[bot]
2025-01-10 01:36:03 +00:00
4 changed files with 8 additions and 3 deletions
@@ -29,7 +29,7 @@ export const useLinkageCollectionFieldOptions = (collectionName: string, readPre
{ label: t('Value'), value: ActionType.Value, selected: false, schema: {} },
].filter((v) => {
if (readPretty) {
return [ActionType.Visible, ActionType.None].includes(v.value);
return [ActionType.Visible, ActionType.None, ActionType.Hidden].includes(v.value);
}
return v;
});
+2
View File
@@ -103,6 +103,8 @@ export interface CollectionOptions extends Omit<ModelOptions, 'name' | 'hooks'>
isThrough?: boolean;
filterTargetKey?: string | string[];
fields?: FieldOptions[];
fieldSort?: string[];
model?: string | ModelStatic<Model>;
repository?: string | RepositoryType;
sortable?: CollectionSortable;
@@ -47,7 +47,10 @@ export class FieldModel extends MagicAttributeModel {
const field = await (async () => {
await new Promise((resolve) => setTimeout(resolve, 0));
return collection.setField(name, options);
return collection.setField(name, {
...options,
__sort: this.get('sort'),
});
})();
await this.db.emitAsync('field:loaded', {
@@ -35,7 +35,7 @@ export default {
...field.options,
};
}),
'sort',
'__sort',
);
results.push(obj);