From 8a271980dc56e5f0d5dc88ba1b308933fd6fd7ce Mon Sep 17 00:00:00 2001 From: Stephanya Casanova Date: Wed, 25 Sep 2024 14:42:59 +0200 Subject: [PATCH] [frontend] fix filter order priority --- .../components/common/queryable/filter/FilterUtils.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openbas-front/src/components/common/queryable/filter/FilterUtils.tsx b/openbas-front/src/components/common/queryable/filter/FilterUtils.tsx index d8464adf3e..b13bcbe0f3 100644 --- a/openbas-front/src/components/common/queryable/filter/FilterUtils.tsx +++ b/openbas-front/src/components/common/queryable/filter/FilterUtils.tsx @@ -91,10 +91,6 @@ export const availableOperators = (propertySchema: PropertySchemaDTO) => { if (propertySchema.schema_property_type.includes('instant')) { return ['gt', 'gte', 'lt', 'lte', 'empty', 'not_empty']; } - // Array - if (propertySchema.schema_property_type_array || propertySchema.schema_property_values) { - return ['contains', 'not_contains', 'empty', 'not_empty']; - } // Enum & not array if (propertySchema.schema_property_values && !propertySchema.schema_property_type_array) { return ['eq']; @@ -103,6 +99,10 @@ export const availableOperators = (propertySchema: PropertySchemaDTO) => { if (propertySchema.schema_property_has_dynamic_value && !propertySchema.schema_property_type_array) { return ['contains', 'not_contains', 'empty', 'not_empty']; } + // Array + if (propertySchema.schema_property_values || propertySchema.schema_property_type_array) { + return ['contains', 'not_contains', 'empty', 'not_empty']; + } return [ 'eq', 'not_eq',