sadpandajoe commented on code in PR #37479:
URL: https://github.com/apache/superset/pull/37479#discussion_r4050901890


##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx:
##########
@@ -508,7 +508,7 @@ export default function PluginFilterSelect(props: 
PluginFilterSelectProps) {
             name={formData.nativeFilterId}
             allowClear
             allowNewOptions={!searchAllOptions && creatable !== false}
-            allowSelectAll={!searchAllOptions}
+            allowSelectAll={multiSelect}

Review Comment:
   This also exposes the shared bulk handler's truthiness check: a dynamically 
searched boolean filter can display `Select all (2)` but emit only `[true]`, 
because `false` (likewise `0` or `null`) is skipped. Should bulk selection 
include every loaded option, or exclude unselectable values from both the 
button count and action?



##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -680,6 +680,53 @@ describe('SelectFilterPlugin', () => {
     expect(options[1]).toHaveTextContent('alpha');
     expect(options[2]).toHaveTextContent('beta');
   });
+
+  test('allowSelectAll is enabled when searchAllOptions is enabled for 
multi-select', () => {
+    const { container } = getWrapper({
+      searchAllOptions: true,
+      multiSelect: true,
+    });
+    // Verify the Select component is rendered with multiSelect mode
+    const selectElement = container.querySelector('.ant-select-multiple');

Review Comment:
   This only proves that the control is in multiple mode; reverting 
`allowSelectAll` to `!searchAllOptions` leaves the assertion green, and the 
third test clicks an ordinary option rather than the bulk action. Could this 
open the dropdown, assert and click `Select all`, and verify the emitted filter 
at the dynamic-search boundary?



-- 
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