Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(filters): add min value to input instead of 'or' operator #1462

Merged
merged 2 commits into from
Feb 28, 2022

Conversation

Sync271
Copy link
Contributor

@Sync271 Sync271 commented Feb 26, 2022

Pre requirements:

Reference:

closes: #1452, closes: #1466

Description:

In:

case FilterOperator.IN_THE_PAST:
return (
<MultipleInputsWrapper>
<NumericInput
fill
value={parseInt(filterRule.values?.[0], 10) || 1}
onValueChange={(value) =>
onChange({
...filterRule,
values: [value],
})
}
/>

whenever the field is empty, it defaults to 1, so even if you hit backspace, you can only add the number to 1 as explained in #1452
By adding a minimum value of 1, it allows you to enter any numeric value and not get default to 1.

Preview:

Lightdash - fix-numeric-input - Watch Video

Scope of the changes (select all that apply):

  • Frontend
  • Backend
  • Common
  • E2E tests
  • Docs
  • CI/CD

@netlify
Copy link

netlify bot commented Feb 26, 2022

👷 Deploy request for peaceful-bassi-cbf284 pending review.
Visit the deploys page to approve it

🔨 Explore the source changes: 821087e

@Sync271 Sync271 changed the title fix: add min value to input instead of or operator fix: add min value to input instead of || operator Feb 26, 2022
@Sync271 Sync271 changed the title fix: add min value to input instead of || operator fix: add min value to input instead of 'or' operator Feb 26, 2022
@ZeRego ZeRego self-assigned this Feb 28, 2022
@ZeRego ZeRego changed the title fix: add min value to input instead of 'or' operator fix(filters): add min value to input instead of 'or' operator Feb 28, 2022
@ZeRego
Copy link
Contributor

ZeRego commented Feb 28, 2022

@all-contributors add @Sync271 for code

@allcontributors
Copy link
Contributor

@ZeRego

I've put up a pull request to add @Sync271! 🎉

@ZeRego
Copy link
Contributor

ZeRego commented Feb 28, 2022

Thanks for contributing @Sync271 🥳 I just pushed a commit fixing a related issue #1466 and applying the fix to other numeric inputs.

@ZeRego ZeRego merged commit fb144a9 into lightdash:main Feb 28, 2022
github-actions bot pushed a commit that referenced this pull request Feb 28, 2022
## [0.28.2](0.28.1...0.28.2) (2022-02-28)

### Bug Fixes

* **filters:** add min value to input instead of 'or' operator ([#1462](#1462)) ([fb144a9](fb144a9))
* **filters:** filter by null [skip ci] ([#1459](#1459)) ([64b4a51](64b4a51))
* use dbt target-path value [skip ci]([#1456](#1456)) ([8f14534](8f14534))
@github-actions
Copy link

🎉 This PR is included in version 0.28.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Sync271
Copy link
Contributor Author

Sync271 commented Feb 28, 2022

Thanks for contributing @Sync271 🥳 I just pushed a commit fixing a related issue #1466 and applying the fix to other numeric inputs.

Happy to be a part of it! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when number filter value is undefined You can't delete the default number included in the filters
2 participants