fix: fix issue #19532

This commit is contained in:
Alexandre Bodin 2024-03-29 17:45:16 +01:00
parent a8ca9546b7
commit 48671c244d
5 changed files with 7 additions and 14 deletions

View File

@ -66,10 +66,7 @@ export const REVIEW_WORKFLOW_FILTERS = [
type: 'relation',
mainField: {
name: 'name',
schema: {
type: 'string',
},
type: 'string',
},
},
@ -90,10 +87,7 @@ export const REVIEW_WORKFLOW_FILTERS = [
type: 'relation',
mainField: {
name: 'id',
schema: {
type: 'integer',
},
type: 'integer',
},
},

View File

@ -111,8 +111,7 @@ const AttributeTag = ({ attribute, filter, onClick, operator, value }: Attribute
const { fieldSchema } = attribute;
const type =
fieldSchema.type === 'relation' ? fieldSchema?.mainField?.schema?.type : fieldSchema.type;
const type = fieldSchema.type === 'relation' ? fieldSchema?.mainField?.type : fieldSchema.type;
let formattedValue = value;

View File

@ -344,8 +344,8 @@ const DefaultInputs = ({
const getFilterList = (filterSchema: FilterData['fieldSchema']): Operator[] => {
let type = filterSchema.type;
if (filterSchema.type === 'relation' && filterSchema?.mainField?.schema?.type) {
type = filterSchema.mainField.schema.type;
if (filterSchema.type === 'relation' && filterSchema?.mainField?.type) {
type = filterSchema.mainField.type;
}
switch (type) {

View File

@ -50,7 +50,7 @@ describe('FilterListURLQuery', () => {
type: 'relation',
mainField: {
name: 'postal_code',
schema: { type: 'string', pluginOptions: { i18n: { localized: true } } },
type: 'string',
},
},
},

View File

@ -61,7 +61,7 @@ export interface FilterData {
options?: string[];
mainField?: {
name: string;
schema?: Attribute.Any;
type?: Attribute.Any['type'];
};
};
trackedEvent?: TrackingEvent;