simcha90 commented on a change in pull request #15454:
URL: https://github.com/apache/superset/pull/15454#discussion_r661978465



##########
File path: 
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
##########
@@ -101,11 +103,16 @@ export function ColumnSelect({
         endpoint: `/api/v1/dataset/${datasetId}`,
       }).then(
         ({ json: { result } }) => {
-          if (
-            !result.columns.some(
-              (column: Column) => column.column_name === value,
-            )
-          ) {
+          const valueExist =
+            mode === 'multiple'
+              ? result.columns.some((column: Column) =>
+                  value?.includes(column.column_name),
+                )
+              : result.columns.some(
+                  (column: Column) => column.column_name === value,
+                );
+
+          if (!valueExist) {

Review comment:
       may be we can do it shorter:
   ```
   const lookupValue = Array.isArray(value) ? value : [value]
   const valueExist = result.columns.some((column: Column) =>
                     lookupValue?.includes(column.column_name),
                   )
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to