feat: compatible with old kanban (#553)
* feat: compatible with old kanban * feat: replace KanbanV2 to Kanban
This commit is contained in:
parent
dbcbe6aea7
commit
44f23ca920
@ -83,14 +83,17 @@ const useAssociationNames = (collection) => {
|
|||||||
}
|
}
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const kanbanSchema = fieldSchema.reduceProperties((buf, schema) => {
|
const kanbanSchema = fieldSchema.reduceProperties((buf, schema) => {
|
||||||
if (schema['x-component'] === 'KanbanV2') {
|
if (schema['x-component'].startsWith('Kanban')) {
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
}, new Schema({}));
|
}, new Schema({}));
|
||||||
const gridSchema: any = kanbanSchema?.properties?.card?.properties?.grid;
|
const gridSchema: any = kanbanSchema?.properties?.card?.properties?.grid;
|
||||||
const appends = [];
|
const appends = [];
|
||||||
|
if (gridSchema) {
|
||||||
recursiveProperties(gridSchema, 'CollectionField', associationFields, appends);
|
recursiveProperties(gridSchema, 'CollectionField', associationFields, appends);
|
||||||
|
}
|
||||||
|
|
||||||
return uniq(appends);
|
return uniq(appends);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ export const KanbanCardDesigner = (props: any) => {
|
|||||||
{
|
{
|
||||||
type: 'itemGroup',
|
type: 'itemGroup',
|
||||||
title: t('Display association fields'),
|
title: t('Display association fields'),
|
||||||
children: useAssociatedFormItemInitializerFields({readPretty: true, block: 'KanbanV2'}),
|
children: useAssociatedFormItemInitializerFields({readPretty: true, block: 'Kanban'}),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
component={<MenuOutlined style={{ cursor: 'pointer', fontSize: 12 }} />}
|
component={<MenuOutlined style={{ cursor: 'pointer', fontSize: 12 }} />}
|
||||||
|
Loading…
Reference in New Issue
Block a user