You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/06/29 09:35:34 UTC

[GitHub] [superset] simcha90 commented on a change in pull request #15427: feat(native-filters): add support for preselect filters

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



##########
File path: superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
##########
@@ -195,6 +197,10 @@ const FilterValue: React.FC<FilterProps> = ({
       />
     );
   }
+  const filterState = { ...filter.dataMask?.filterState };
+  if (filterState.value === undefined && preselection) {
+    filterState.value = preselection;

Review comment:
       I think in previous PR someone added regression for validation, but because your changes affect this place also, can you add here like:
   ```
   const isMissingRequiredValue = checkIsMissingRequiredValue(
       filter,
       filter.dataMask?.filterState,
     );
   ...
   filterState={{
               ...filter.dataMask?.filterState,
               validateMessage: isMissingRequiredValue && t('Value is required'),
             }}
   ```
   
   or may be we can create separate PR for it




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org