-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: Select component refactoring - SelectControl - Iteration 5 #16510
chore: Select component refactoring - SelectControl - Iteration 5 #16510
Conversation
@@ -48,58 +48,27 @@ describe('SelectControl', () => { | |||
wrapper = shallow(<SelectControl {...defaultProps} />); | |||
}); | |||
|
|||
it('uses Select in onPasteSelect when freeForm=false', () => { |
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.
The OnPasteSelect is not used with the new Select component. These tests are included later checking whether allowNewOptions
is true
or false
based on the SelectControl freeForm
option.
expect(defaultProps.onChange.calledWith(50)).toBe(true); | ||
}); | ||
|
||
it('returns all options on select all', () => { |
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.
The "Select all" option has been removed as agreed with design and all the related tests have been removed as well
@@ -161,16 +130,6 @@ describe('SelectControl', () => { | |||
); | |||
expect(wrapper.html()).not.toContain('add something'); | |||
}); | |||
it('shows numbers of options as a placeholder by default', () => { |
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.
The number of options and remaining options has been removed as agreed with design and all the related tests have been removed as well
}); | ||
}); | ||
|
||
it('returns the correct options when freeform is set to true', () => { |
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 test is not necessary with the new Select component as it is a standard behavior
…e/select-component-refactoring-selectcontrol-iteration-5
Codecov Report
@@ Coverage Diff @@
## master #16510 +/- ##
==========================================
- Coverage 77.00% 76.96% -0.05%
==========================================
Files 1018 1018
Lines 54654 54580 -74
Branches 7454 7427 -27
==========================================
- Hits 42086 42005 -81
- Misses 12324 12328 +4
- Partials 244 247 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/testenv up |
@geido Ephemeral environment spinning up at http://52.25.100.215:8080. Credentials are |
...set-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
Show resolved
Hide resolved
...set-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx
Show resolved
Hide resolved
…yerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
…yerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
/testenv up |
@pkdotson Ephemeral environment spinning up at http://54.187.216.188: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! Tested in eph env and everything works great!
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 is amazing work, comparing the before/after was such a visible improvement! 🎉 LGTM!
const DATA_TYPES = [ | ||
{ value: 'STRING', label: 'STRING' }, | ||
{ value: 'NUMERIC', label: 'NUMERIC' }, | ||
{ value: 'DATETIME', label: 'DATETIME' }, | ||
{ value: 'BOOLEAN', label: 'BOOLEAN' }, | ||
]; |
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.
Not for this PR, but this probably shouldn't be a Select component at all, but rather a text field. These should be raw column types coming from the database, hence a typical STRING
will be VARCHAR(x)
, TEXT
etc.
Ephemeral environment shutdown and build artifacts deleted. |
…ache#16510) * Refactor Select DatasourceEditor * Fire onChange with allowNewOptions * Clean up * Refactor Select in AnnotationLayer * Handle on clear * Update tests * Refactor Select in SpatialControl * Show search * Refactor Select in FilterBox * Remove search where unnecessary * Update SelectControl - WIP * Refactor Controls * Update SelectControl tests * Clean up * Test allowNewOptions false * Use SelectControl AnnotationLayer * Use SelectControl SpatialControl * Clean up * Render custom label * Show search * Implement filterOption * Improve filterOption * Update Cypress * Update Cypress table test * Use value for defaultValue * Merge with latest changes * Reconcile with latest Select changes * Update superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> * Update superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> * Revert changes to test * Call onPopoverClear when v value is undefined Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
…ache#16510) * Refactor Select DatasourceEditor * Fire onChange with allowNewOptions * Clean up * Refactor Select in AnnotationLayer * Handle on clear * Update tests * Refactor Select in SpatialControl * Show search * Refactor Select in FilterBox * Remove search where unnecessary * Update SelectControl - WIP * Refactor Controls * Update SelectControl tests * Clean up * Test allowNewOptions false * Use SelectControl AnnotationLayer * Use SelectControl SpatialControl * Clean up * Render custom label * Show search * Implement filterOption * Improve filterOption * Update Cypress * Update Cypress table test * Use value for defaultValue * Merge with latest changes * Reconcile with latest Select changes * Update superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> * Update superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.test.tsx Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> * Revert changes to test * Call onPopoverClear when v value is undefined Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
SUMMARY
The goal of this PR is to remove the instances of the older
react-select
Selects and replace them with the Antdesign Select component. It removes the SelectControl component where possible OR refactors it by mapping the props to minimize the impact.BEFORE/AFTER FILTER BOX
filterbox_before.mp4
filterbox_after.mp4
BEFORE/AFTER SPATIAL CONTROL
spatialcontrol_before.mp4
spatialcontrol_after.mp4
BEFORE/AFTER ANNOTATION LAYERS
annotation_layers_before.mp4
annotation_layers_after.mp4
BEFORE/AFTER DATASOURCE EDITOR
datasource_editor_before.mp4
datasource_editor_after.mp4
BEFORE/AFTER CONTROLS
controls_before.mp4
controls_after.mp4
TESTING INSTRUCTIONS
Test each component individually and all possible controls
ADDITIONAL INFORMATION