-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat: allow partial custom domain #116
feat: allow partial custom domain #116
Conversation
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
==========================================
+ Coverage 90.17% 90.41% +0.23%
==========================================
Files 31 31
Lines 1405 1439 +34
Branches 150 161 +11
==========================================
+ Hits 1267 1301 +34
Misses 125 125
Partials 13 13
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
# [3.4.0](v3.3.1...v3.4.0) (2019-03-25) ### Features * allow partial custom domain ([#116](#116)) ([d0b6b19](d0b6b19))
🎉 This PR is included in version 3.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [3.4.0](elastic/elastic-charts@v3.3.1...v3.4.0) (2019-03-25) ### Features * allow partial custom domain ([opensearch-project#116](elastic/elastic-charts#116)) ([c5b6c19](elastic/elastic-charts@c5b6c19))
Summary
re #111
This PR adds the enhancement to defining partially bounded custom domains. Where
DomainRange
was previously typed as{ min: number, max: number }
, it now is typed as such:This allows us to flexibly extend the interfaces as needed and also enforce that at least one of
max
andmin
are defined (while providing the downstream user with feedback on the type of their config to block{}
as a valid prop). [The other benefit to this type is that internally, we can refer to the individual types of bounded domains and use them in a typeguard; see the updatedmergeDomainsByGroupId
implementation. Additionally, we can use the typeguards when merging X and Y domains.]For a partial custom domain, we also check its validity (for example, a LowerBoundedDomain should not have a min greater than the max of the computed domain). Currently this throws, but per #117, once there is an agreement on error handling, this may change.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11