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 3886b4431aa..2c0aafc8e76 100644 --- a/packages/core/client/src/collection-manager/interfaces/properties/operators.ts +++ b/packages/core/client/src/collection-manager/interfaces/properties/operators.ts @@ -183,3 +183,41 @@ export const collection = [ { label: '{{t("is empty")}}', value: '$empty', noValue: true }, { label: '{{t("is not empty")}}', value: '$notEmpty', noValue: true }, ]; + +export const richText = [ + { + label: '{{t("contains")}}', + value: '$includes', + selected: true, + schema: { + type: 'string', + 'x-component': 'Input', + }, + }, + { + label: '{{t("does not contain")}}', + value: '$notIncludes', + schema: { + type: 'string', + 'x-component': 'Input', + }, + }, + { + label: '{{t("is")}}', + value: '$eq', + schema: { + type: 'string', + 'x-component': 'Input', + }, + }, + { + label: '{{t("is not")}}', + value: '$ne', + schema: { + type: 'string', + 'x-component': 'Input', + }, + }, + { label: '{{t("is empty")}}', value: '$empty', noValue: true }, + { label: '{{t("is not empty")}}', value: '$notEmpty', noValue: true }, +]; diff --git a/packages/core/client/src/collection-manager/interfaces/richText.ts b/packages/core/client/src/collection-manager/interfaces/richText.ts index de4493cb3b6..0ab89b21054 100644 --- a/packages/core/client/src/collection-manager/interfaces/richText.ts +++ b/packages/core/client/src/collection-manager/interfaces/richText.ts @@ -79,6 +79,6 @@ export class RichTextFieldInterface extends CollectionFieldInterface { }; }; filterable = { - operators: operators.string, + operators: operators.richText, }; } diff --git a/packages/core/client/src/schema-initializer/utils.ts b/packages/core/client/src/schema-initializer/utils.ts index 5bab0cd2465..9f4661548fc 100644 --- a/packages/core/client/src/schema-initializer/utils.ts +++ b/packages/core/client/src/schema-initializer/utils.ts @@ -30,6 +30,7 @@ import { useDataSourceManager } from '../data-source/data-source/DataSourceManag import { isAssocField } from '../filter-provider/utils'; import { useActionContext, useCompile, useDesignable } from '../schema-component'; import { useSchemaTemplateManager } from '../schema-templates'; + export const itemsMerge = (items1) => { return items1; }; @@ -382,7 +383,9 @@ export const useFilterFormItemInitializerFields = (options?: any) => { 'x-decorator': 'FormItem', 'x-use-decorator-props': 'useFormItemProps', 'x-collection-field': `${name}.${field.name}`, - 'x-component-props': {}, + 'x-component-props': { + component: interfaceConfig?.filterable?.operators?.[0]?.schema?.['x-component'], + }, }; if (isAssocField(field)) { schema = {