From 28f9b902e895144ebed978628cb4301b92a4a33e Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 19 Apr 2022 11:19:22 +0800 Subject: [PATCH] fix: id operators --- .../src/collection-manager/interfaces/id.ts | 2 +- .../collection-manager/interfaces/linkTo.ts | 26 +++++++++---------- .../interfaces/properties/operators.ts | 7 +++++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/packages/core/client/src/collection-manager/interfaces/id.ts b/packages/core/client/src/collection-manager/interfaces/id.ts index 671906ac1..19c670f40 100644 --- a/packages/core/client/src/collection-manager/interfaces/id.ts +++ b/packages/core/client/src/collection-manager/interfaces/id.ts @@ -42,6 +42,6 @@ export const id: IField = { }, }, filterable: { - operators: operators.number, + operators: operators.id, }, }; diff --git a/packages/core/client/src/collection-manager/interfaces/linkTo.ts b/packages/core/client/src/collection-manager/interfaces/linkTo.ts index e321491a6..0ea3a9dd5 100644 --- a/packages/core/client/src/collection-manager/interfaces/linkTo.ts +++ b/packages/core/client/src/collection-manager/interfaces/linkTo.ts @@ -116,19 +116,19 @@ export const linkTo: IField = { filterable: { nested: true, children: [ - { - name: 'id', - title: '{{t("Exists")}}', - operators: [ - { label: '{{t("exists")}}', value: '$exists', noValue: true }, - { label: '{{t("not exists")}}', value: '$notExists', noValue: true }, - ], - schema: { - title: '{{t("Exists")}}', - type: 'string', - 'x-component': 'Input', - }, - }, + // { + // name: 'id', + // title: '{{t("Exists")}}', + // operators: [ + // { label: '{{t("exists")}}', value: '$exists', noValue: true }, + // { label: '{{t("not exists")}}', value: '$notExists', noValue: true }, + // ], + // schema: { + // title: '{{t("Exists")}}', + // type: 'string', + // 'x-component': 'Input', + // }, + // }, ], }, }; diff --git a/packages/core/client/src/collection-manager/interfaces/properties/operators.ts b/packages/core/client/src/collection-manager/interfaces/properties/operators.ts index 1eb06ce5c..c0d5265b6 100644 --- a/packages/core/client/src/collection-manager/interfaces/properties/operators.ts +++ b/packages/core/client/src/collection-manager/interfaces/properties/operators.ts @@ -67,6 +67,13 @@ export const number = [ { label: '{{t("is not empty")}}', value: '$notEmpty', noValue: true }, ]; +export const id = [ + { label: '{{t("is")}}', value: '$eq', selected: true }, + { label: '{{t("is not")}}', value: '$ne' }, + { label: '{{t("Exists")}}', value: '$exists', noValue: true }, + { label: '{{t("Not exists")}}', value: '$notExists', noValue: true }, +]; + export const enumType = [ { label: '{{t("is")}}',