From 300d8f4eb3e1cdd632a6f177cc7f7081ac707721 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Thu, 30 Nov 2023 10:22:30 +0800 Subject: [PATCH] refactor: map field support connect as remote table field (#3114) --- .../plugins/@nocobase/plugin-map/src/client/fields/circle.ts | 1 + .../@nocobase/plugin-map/src/client/fields/lineString.ts | 1 + .../plugins/@nocobase/plugin-map/src/client/fields/point.ts | 1 + .../plugins/@nocobase/plugin-map/src/client/fields/polygon.ts | 1 + packages/plugins/@nocobase/plugin-map/src/client/initialize.tsx | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-map/src/client/fields/circle.ts b/packages/plugins/@nocobase/plugin-map/src/client/fields/circle.ts index 29298ef9a..aa98c9fea 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/fields/circle.ts +++ b/packages/plugins/@nocobase/plugin-map/src/client/fields/circle.ts @@ -8,6 +8,7 @@ export const circle: IField = { group: 'map', order: 3, title: generateNTemplate('Circle'), + availableTypes: ['circle'], description: generateNTemplate('Circle'), sortable: true, default: { diff --git a/packages/plugins/@nocobase/plugin-map/src/client/fields/lineString.ts b/packages/plugins/@nocobase/plugin-map/src/client/fields/lineString.ts index 35af95c69..08e561b9a 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/fields/lineString.ts +++ b/packages/plugins/@nocobase/plugin-map/src/client/fields/lineString.ts @@ -9,6 +9,7 @@ export const lineString: IField = { order: 2, title: generateNTemplate('Line'), description: generateNTemplate('Line'), + availableTypes: ['lineString'], sortable: true, default: { type: 'lineString', diff --git a/packages/plugins/@nocobase/plugin-map/src/client/fields/point.ts b/packages/plugins/@nocobase/plugin-map/src/client/fields/point.ts index 8029693d0..e4923482f 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/fields/point.ts +++ b/packages/plugins/@nocobase/plugin-map/src/client/fields/point.ts @@ -9,6 +9,7 @@ export const point: IField = { order: 1, title: generateNTemplate('Point'), description: generateNTemplate('Point'), + availableTypes: ['point'], sortable: true, default: { type: 'point', diff --git a/packages/plugins/@nocobase/plugin-map/src/client/fields/polygon.ts b/packages/plugins/@nocobase/plugin-map/src/client/fields/polygon.ts index 799ad8fb9..58e7ed939 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/fields/polygon.ts +++ b/packages/plugins/@nocobase/plugin-map/src/client/fields/polygon.ts @@ -9,6 +9,7 @@ export const polygon: IField = { order: 4, title: generateNTemplate('Polygon'), description: generateNTemplate('Polygon'), + availableTypes: ['polygon'], sortable: true, default: { type: 'polygon', diff --git a/packages/plugins/@nocobase/plugin-map/src/client/initialize.tsx b/packages/plugins/@nocobase/plugin-map/src/client/initialize.tsx index 00d8aa152..623a3b297 100644 --- a/packages/plugins/@nocobase/plugin-map/src/client/initialize.tsx +++ b/packages/plugins/@nocobase/plugin-map/src/client/initialize.tsx @@ -21,7 +21,7 @@ export const useRegisterInterface = () => { return; } } - registerField(field.group, field.title, field); + registerField(field.group, field.name as string, field); }); }, [data]); };