Skip to content

chore: Remove unecessary code from async and sync select components#20690

Merged
michael-s-molina merged 28 commits into
apache:masterfrom
CybercentreCanada:Remove-Unecessary-Code-from-Async-and-Sync-Select-Components
Jul 28, 2022
Merged

chore: Remove unecessary code from async and sync select components#20690
michael-s-molina merged 28 commits into
apache:masterfrom
CybercentreCanada:Remove-Unecessary-Code-from-Async-and-Sync-Select-Components

Conversation

@cccs-RyanK
Copy link
Copy Markdown
Contributor

SUMMARY

This task was outlined as a part of this PR by @michael-s-molina : #20143

In a previous PR, the code for Select and AsyncSelect was split into two separate components: #20466
The components were left identical, so this PR continues the work and removes the unecessary code that was left in each of the components. Namely, it removes behaviour that had previously been determined by whether the component was in async mode or not.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Changed files to reference AsyncSelect if needed
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
…LDN-1484-Split-Select-Component-into-Async-and-Sync-Components
…ponents' and 'master' of github.com:CybercentreCanada/superset into Remove-Unecessary-Code-from-Async-and-Sync-Select-Components
…emove-Unecessary-Code-from-Async-and-Sync-Select-Components
@cccs-RyanK cccs-RyanK changed the title Remove unecessary code from async and sync select components chore: Remove unecessary code from async and sync select components Jul 12, 2022
@cccs-RyanK cccs-RyanK marked this pull request as ready for review July 13, 2022 12:20
Copy link
Copy Markdown
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR @cccs-RyanK! I left some first-pass comments about the sync version. I'll review the async version later 😉

Comment thread superset-frontend/src/components/Select/Select.tsx Outdated
Comment thread superset-frontend/src/components/Select/Select.tsx Outdated
Comment thread superset-frontend/src/components/Select/Select.tsx Outdated
Comment thread superset-frontend/src/components/Select/Select.tsx
Comment thread superset-frontend/src/components/Select/Select.tsx
Comment thread superset-frontend/src/components/Select/Select.tsx
@michael-s-molina
Copy link
Copy Markdown
Member

@cccs-RyanK About your question on Slack... I think it's a good idea to clean the components first and extract shared behaviors in another PR. It will be easier to check what can be extracted after the cleanup and it will be easier to review the changes.

Copy link
Copy Markdown
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cccs-RyanK Thank you for the test improvements!

Comment thread superset-frontend/src/components/Select/AsyncSelect.tsx Outdated
Comment thread superset-frontend/src/components/Select/AsyncSelect.tsx Outdated
Comment thread superset-frontend/src/components/Select/AsyncSelect.tsx Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 21, 2022

Codecov Report

Merging #20690 (eb04cbb) into master (922b4b8) will decrease coverage by 0.03%.
The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master   #20690      +/-   ##
==========================================
- Coverage   66.29%   66.26%   -0.04%     
==========================================
  Files        1758     1758              
  Lines       66801    66930     +129     
  Branches     7055     7088      +33     
==========================================
+ Hits        44288    44349      +61     
- Misses      20713    20770      +57     
- Partials     1800     1811      +11     
Flag Coverage Δ
javascript 51.94% <77.77%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...frontend/src/components/DatabaseSelector/index.tsx 88.88% <ø> (ø)
...et-frontend/src/components/TableSelector/index.tsx 76.08% <ø> (ø)
...t-frontend/src/filters/components/GroupBy/types.ts 100.00% <ø> (ø)
...rontend/src/filters/components/TimeColumn/types.ts 100.00% <ø> (ø)
...frontend/src/filters/components/TimeGrain/types.ts 100.00% <ø> (ø)
...rontend/src/components/ListView/Filters/Select.tsx 52.38% <33.33%> (-2.62%) ⬇️
...set-frontend/src/components/Select/AsyncSelect.tsx 83.18% <80.00%> (+0.34%) ⬆️
superset-frontend/src/components/Select/Select.tsx 87.07% <100.00%> (+19.29%) ⬆️
...components/DashboardBuilder/DashboardContainer.tsx 40.00% <0.00%> (-32.23%) ⬇️
...nd/src/dashboard/util/activeAllDashboardFilters.ts 60.00% <0.00%> (-26.96%) ⬇️
... and 52 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Copy Markdown
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although showSearch is true by default, it can be disabled.

Comment thread superset-frontend/src/components/Select/AsyncSelect.tsx Outdated
Copy link
Copy Markdown
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for all the hard work @cccs-RyanK!

@michael-s-molina michael-s-molina merged commit fe91974 into apache:master Jul 28, 2022
@mistercrunch mistercrunch added the 🚢 2.1.3 First shipped in 2.1.3 label Feb 18, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 First shipped in 2.1.0 and removed 🚢 2.1.3 First shipped in 2.1.3 labels Mar 13, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
…pache#20690)

* Created AsyncSelect Component
Changed files to reference AsyncSelect if needed

* modified import of AsyncSelect, removed async tests and prefixes from select tests

* fixed various import and lint warnings

* fixing lint errors

* fixed frontend test errors

* fixed alertreportmodel tests

* removed accidental import

* fixed lint errors

* updated async select

* removed code from select component

* fixed select test

* fixed async label value and select initial values

* cleaned up async test

* fixed lint errors

* minor fixes to sync select component

* removed unecessary variables and fixed linting

* fixed npm test errors

* fixed linting issues

* fixed showSearch and storybook

* fixed linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL 🚢 2.1.0 First shipped in 2.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants