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/04 09:44:44 UTC

[GitHub] [superset] villebro opened a new pull request #14981: feat(native-filters): add markers and number formatter + simple tests

villebro opened a new pull request #14981:
URL: https://github.com/apache/superset/pull/14981


   ### SUMMARY
   Small improvements to range filter:
   - Add smart number formatter to make ranges more legible.
   - When lower and upper bounds are at min/max, assume no filter should be emitted. Also when either lower or upper bound is greater/smaller than min/max, only emit single filter.
   - Add custom label using formatter.
   - Add markers that indicate when lower/upper bound is being applied (also using number formatter).
   
   Also:
   - Added story book entry
   - Added simple test case
   
   (both story and test cases can be expanded later)
   
   ### BEFORE
   https://user-images.githubusercontent.com/33317356/120781403-bbd06c00-c531-11eb-898f-5992927ea952.mp4
   
   ### AFTER
   https://user-images.githubusercontent.com/33317356/120781204-80ce3880-c531-11eb-9675-3c18bbd2b32f.mp4
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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

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


[GitHub] [superset] villebro merged pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
villebro merged pull request #14981:
URL: https://github.com/apache/superset/pull/14981


   


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

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


[GitHub] [superset] github-actions[bot] commented on pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14981:
URL: https://github.com/apache/superset/pull/14981#issuecomment-854705332


   @kgabryje Ephemeral environment spinning up at http://34.210.133.131:8080. Credentials are `admin`/`admin`. Please allow several minutes for bootstrapping and startup.


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

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


[GitHub] [superset] kgabryje commented on pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
kgabryje commented on pull request #14981:
URL: https://github.com/apache/superset/pull/14981#issuecomment-854704130


   /testenv up


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

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


[GitHub] [superset] villebro commented on a change in pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #14981:
URL: https://github.com/apache/superset/pull/14981#discussion_r645460092



##########
File path: superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx
##########
@@ -64,12 +106,6 @@ export default function RangeFilterPlugin(props: PluginFilterRangeProps) {
     handleAfterChange(filterState.value ?? [min, max]);
   }, [JSON.stringify(filterState.value)]);
 
-  useEffect(() => {
-    handleAfterChange(defaultValue ?? [min, max]);
-    // I think after Config Modal update some filter it re-creates default value for all other filters
-    // so we can process it like this `JSON.stringify` or start to use `Immer`
-  }, [JSON.stringify(defaultValue)]);
-

Review comment:
       `defaultValue` is now converted into `filterState` by the application, hence don't need to be handled here

##########
File path: superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx
##########
@@ -64,12 +106,6 @@ export default function RangeFilterPlugin(props: PluginFilterRangeProps) {
     handleAfterChange(filterState.value ?? [min, max]);
   }, [JSON.stringify(filterState.value)]);
 
-  useEffect(() => {
-    handleAfterChange(defaultValue ?? [min, max]);
-    // I think after Config Modal update some filter it re-creates default value for all other filters
-    // so we can process it like this `JSON.stringify` or start to use `Immer`
-  }, [JSON.stringify(defaultValue)]);
-

Review comment:
       `defaultValue` is now converted into `filterState` by the application, hence it doesn't need to be handled here




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

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


[GitHub] [superset] codecov[bot] commented on pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #14981:
URL: https://github.com/apache/superset/pull/14981#issuecomment-854600561


   # [Codecov](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#14981](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (be13da5) into [master](https://codecov.io/gh/apache/superset/commit/61a438a0cd6992e7e1fdc32e20062c6a2c8627e2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (61a438a) will **increase** coverage by `0.06%`.
   > The diff coverage is `87.09%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/14981/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #14981      +/-   ##
   ==========================================
   + Coverage   77.53%   77.60%   +0.06%     
   ==========================================
     Files         965      965              
     Lines       49504    49530      +26     
     Branches     6259     6267       +8     
   ==========================================
   + Hits        38384    38438      +54     
   + Misses      10920    10891      -29     
   - Partials      200      201       +1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `72.63% <87.09%> (+0.15%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...src/filters/components/Range/RangeFilterPlugin.tsx](https://codecov.io/gh/apache/superset/pull/14981/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9SYW5nZS9SYW5nZUZpbHRlclBsdWdpbi50c3g=) | `88.67% <87.09%> (+88.67%)` | :arrow_up: |
   | [...end/src/filters/components/Range/transformProps.ts](https://codecov.io/gh/apache/superset/pull/14981/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9SYW5nZS90cmFuc2Zvcm1Qcm9wcy50cw==) | `100.00% <0.00%> (+87.50%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [61a438a...be13da5](https://codecov.io/gh/apache/superset/pull/14981?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


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

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


[GitHub] [superset] villebro commented on a change in pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #14981:
URL: https://github.com/apache/superset/pull/14981#discussion_r645460092



##########
File path: superset-frontend/src/filters/components/Range/RangeFilterPlugin.tsx
##########
@@ -64,12 +106,6 @@ export default function RangeFilterPlugin(props: PluginFilterRangeProps) {
     handleAfterChange(filterState.value ?? [min, max]);
   }, [JSON.stringify(filterState.value)]);
 
-  useEffect(() => {
-    handleAfterChange(defaultValue ?? [min, max]);
-    // I think after Config Modal update some filter it re-creates default value for all other filters
-    // so we can process it like this `JSON.stringify` or start to use `Immer`
-  }, [JSON.stringify(defaultValue)]);
-

Review comment:
       default values are now converted into `filterState` by the application, hence don't need to be handled here




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

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


[GitHub] [superset] github-actions[bot] commented on pull request #14981: feat(native-filters): add markers and number formatter to range filter

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14981:
URL: https://github.com/apache/superset/pull/14981#issuecomment-854720988


   Ephemeral environment shutdown and build artifacts deleted.


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

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