-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
refactor: Changes the list views to use the new Select component #16393
refactor: Changes the list views to use the new Select component #16393
Conversation
a3d4c1c
to
f2507f8
Compare
Codecov Report
@@ Coverage Diff @@
## master #16393 +/- ##
==========================================
- Coverage 76.95% 76.89% -0.06%
==========================================
Files 1007 1006 -1
Lines 54149 54145 -4
Branches 7369 7457 +88
==========================================
- Hits 41669 41634 -35
- Misses 12240 12269 +29
- Partials 240 242 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@michael-s-molina Ephemeral environment spinning up at http://35.163.253.132:8080. Credentials are |
I tested in the test environment, I found that there are some fields are not supported typing, is that expected? Dashboards: Charts Database Dataset |
@jinghua-qa Thanks for testing! I added a fix to enable searching for all controls. |
/testenv up |
@michael-s-molina Ephemeral environment spinning up at http://52.12.77.56:8080. Credentials are |
6d23d30
to
79e2d6e
Compare
/testenv up |
@michael-s-molina Ephemeral environment spinning up at http://34.222.251.103: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.
some initial comments
totalCount: 0, | ||
}; | ||
}, | ||
[], // eslint-disable-line react-hooks/exhaustive-deps |
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.
shouldn't we add in the dependencies here?
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.
Yes! Done.
/> | ||
)} | ||
<Select | ||
ariaLabel={typeof Header === 'string' ? Header : emptyLabel} |
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.
since Header
can be a react node too, this would mean we'd have a11y text of None
for a custom rendered header. seems less than ideal
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.
You're right. I changed it to use the header or the name or a generic 'Filter'.
function UIFilters({ | ||
filters, | ||
internalFilters = [], | ||
updateFilterValue, | ||
}: UIFiltersProps) { | ||
return ( | ||
<FilterWrapper> | ||
<> |
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 we need this? i'm a bit rusty, but i thought you could return an array as a react component too
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.
It seems that this feature is not fully supported by Typescript yet.
https://stackoverflow.com/questions/67908439/react-typescript-how-to-fix-return-type-element-is-not-a-valid-jsx-eleme?noredirect=1&lq=1
@ktmud Ephemeral environment spinning up at http://34.215.173.11:8080. Credentials are |
db360f3
to
8ffeaa3
Compare
Thanks for spotting that @ktmud. I fixed and also rebased to get the latest changes. |
/testenv up |
@michael-s-molina Ephemeral environment spinning up at http://35.85.138.206: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.
Code lgtm but are we sure this is the design we want? Currently it jus looks like there are too many "holes" in the header section. Consistency is good for most cases, but there is also context here---IMO a simple dropdown switch used for navigation has a totally different purpose than say a multi-select control in a form intended for collecting information.
This is deviating further and further away from SIP-34 design:
I'm going to stamp as I understand the need to consolidate Select implementation, but I hope we can reconsider the design here.
|
||
export const RangePicker = styled(AntdRangePicker)` | ||
border-radius: ${({ theme }) => theme.gridUnit}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.
Is this change intended?
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.
Yes. The idea is to match the border style of the Select
and Input
components.
PartialThemeConfig, | ||
} from 'src/components/Select'; | ||
import React, { useState, useMemo } from 'react'; | ||
import { withTheme, SupersetThemeProps, t } from '@superset-ui/core'; |
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.
It seems theme variables are not used directly by this component anymore. Can we clean up withTheme
?
On a separate note, I think we should prefer useTheme
in all future refactoring, too---unless for wrapping legacy class-based components. I added an entry in the CSS Styled Guide.
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.
Agreed
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.
withTheme
removed.
@ktmud During our design session we came to the same conclusion. We chose to preserve the Select consistency for now, in order to migrate the component, but @mihir174 and @jess-dillard will analyze the design and propose improvements that will be implemented in the future. |
cef9a0d
to
2a65c11
Compare
Ephemeral environment shutdown and build artifacts deleted. |
…che#16393) * chore: Change the list views to use the new Select component * Fix Cypress tests * Enables search for all controls * Adjusts controls width * Removes 'Me' and keeps the logged user on top * Fixes tests * Uses the borderless version for the filters * Fixes the tests * Reverts the Select theme to the default * Rebases and fixes js error * Fixes failing test * Removes unused withTheme
…che#16393) * chore: Change the list views to use the new Select component * Fix Cypress tests * Enables search for all controls * Adjusts controls width * Removes 'Me' and keeps the logged user on top * Fixes tests * Uses the borderless version for the filters * Fixes the tests * Reverts the Select theme to the default * Rebases and fixes js error * Fixes failing test * Removes unused withTheme
SUMMARY
@junlincc @jinghua-qa @rusackas @mistercrunch
PS: Sorry for the big PR, but everything needs to be tested as a whole.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-08-25.at.3.36.08.PM.mov
Screen.Recording.2021-09-14.at.8.36.40.AM.mov
TESTING INSTRUCTIONS
Check the videos for instructions.
ADDITIONAL INFORMATION