-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
chore: Improves the native filters UI/UX - iteration 7 #15017
chore: Improves the native filters UI/UX - iteration 7 #15017
Conversation
a1abe9d
to
fbfdadd
Compare
Thank you so much @michael-s-molina for the PR, |
@junlincc has eagle eyes! |
fbfdadd
to
727911a
Compare
727911a
to
1a32faf
Compare
1a32faf
to
6f46673
Compare
Codecov Report
@@ Coverage Diff @@
## master #15017 +/- ##
==========================================
+ Coverage 77.64% 77.69% +0.04%
==========================================
Files 966 966
Lines 49615 49634 +19
Branches 6311 6318 +7
==========================================
+ Hits 38524 38563 +39
+ Misses 10890 10870 -20
Partials 201 201
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=true |
@junlincc Ephemeral environment spinning up at http://34.217.133.137:8080. Credentials are |
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.
LGTM, Product sign-off Thank you for the PR!!
@@ -57,8 +53,25 @@ class MainPreset extends Preset { | |||
} | |||
} | |||
|
|||
fetchMock.get(`glob:*/api/v1/dataset/${datasourceId}`, { | |||
result: [mockDatasource[fullDatasourceId]], | |||
fetchMock.get(`glob:*/api/v1/dataset/1`, { |
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.
Curious why we need to move away from the mockDatasource
- whether it's for simplicity, or if there's something that indicates an incompatibility between the mock data and the test itself.
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.
Right on the money... incompatibility and simplicity!
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.
Followup question - do we need to update the mockDatasource
in any way so that it's not incompatible? Just don't want to carry any tech debt forward.
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.
I can try to update in the next iteration and see if it raises other problems.
@@ -164,6 +164,8 @@ const StyledCollapse = styled(Collapse)` | |||
const StyledTabs = styled(Tabs)` | |||
.ant-tabs-nav { | |||
position: sticky; | |||
margin-left: ${({ theme }) => theme.gridUnit * -4}px; |
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.
I think there's a better way to fix this, rather than resorting to negative margins. We (I?) can address this in a follow-up if needed, but I believe we can do the following:
- Remove these margin left/right styles here.
- In
FilterTabsContainer
:& > .ant-tabs-content-holder
-> remove thepadding-right
&.ant-tabs-left > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane
-> set thepadding-left
to 0 (or remove the line, but then a 24px padding comes into play from somewhere, not sure if we can kill that).- add a selector for
.ant-tabs-content-holder
withpadding: 0 ${({ theme }) => theme.gridUnit * 4}px;
Then we'll have fewer styles that are not fighting each other.
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.
Thanks for the tip! I'll change it in the next iteration.
font-family: SimSun, sans-serif; | ||
margin-right: ${({ theme }) => theme.gridUnit - 1}px; | ||
font-size: ${({ theme }) => theme.typography.sizes.s}px; | ||
margin-left: ${({ theme }) => theme.gridUnit - 1}px; |
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.
nit/question: not sure by looking exactly where this applies, but based on a hunch from the code, it might be a use case for an em
rather than a gridUnit, or perhaps a transform: translateX(-100%);
- just to tie the positioning of the asterisk to the content itself, rather than to the gridUnit, which could change.
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.
I agree. em
will be better here. I'll change it in the next iteration.
@@ -458,6 +460,28 @@ const FiltersConfigForm = ( | |||
forceUpdate(); | |||
}; | |||
|
|||
const validatePreFilter = () => | |||
setTimeout( |
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.
curious: why is the setTimeout needed?
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.
Ahhh, I see the // execute after render
comment - that's fine I guess, but would a useEffect
hook in the CollapsibleControl
component be an option instead?
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.
I can investigate if this is possible in the next iteration.
], | ||
table_name: 'birth_names', | ||
fetchMock.get('glob:*/api/v1/dataset/1', { | ||
description_columns: {}, |
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.
This mock looks an awful lot like the one in Filterbar.test.tsx
- should we recycle/export?
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.
Nice catch. In the next iteration, I'll try to unify all mocks.
}); | ||
|
||
// eslint-disable-next-line jest/no-disabled-tests | ||
test.skip('validates the default value', async () => { |
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.
Curious about the status any test that's both new AND skipped ;) Something to follow up on?
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.
I decided to skip it and tackle it in the next iteration because it's passing locally but failing on Github for no apparent reason.
changes the default value options when the column changes | ||
switches to configuration tab when validation fails | ||
displays cancel message when there are pending operations | ||
do not displays cancel message when there are no pending operations |
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.
do not displays cancel message when there are no pending operations | |
does not display cancel message when there are no pending operations |
obviously just a nit... really appreciate this TODO comment!
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.
I found a few things that might be worth consideration, but I don't think anything should be blocking really, so I'll approve. I'll leave this open for a bit, as I'd love your thoughts on the comments.
@rusackas Thanks for your review. All your points added much value. I'll tackle them all in the next iteration.
|
I agree! I can hardly find a carton of milk in the fridge, let alone spot stuff like this 😆 |
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Improves the native filters UI/UX - iteration 7
FormConfigModal
componentThis work is part of the Native dashboard filter project
The items below will be handled in the next iterations:
The iterations below are optional but recommended:
Split the FiltersConfigForm into smaller components to make it easier to read and remove react warnings
@villebro @rusackas @junlincc
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
120873588-8e96b480-c557-11eb-9a8f-c60cf21f2915.mov
screen-recording-2021-06-07-at-100112-am_M1Srewlk.mov
TESTING INSTRUCTIONS
Check the before and after videos to see all the problems and fixes.
ADDITIONAL INFORMATION