Skip to content
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: icon to icons for controls #15568

Merged
merged 2 commits into from
Jul 8, 2021
Merged

Conversation

pkdotson
Copy link
Member

@pkdotson pkdotson commented Jul 7, 2021

SUMMARY

This pr migrates the old icon components to icons in the datasource panel, datelabel and collection control.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-07-07 at 1 23 19 AM

TESTING INSTRUCTIONS

All three of these controls can be tested in a filterbox chart. The icons that were migrated are labeled above.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@codecov
Copy link

codecov bot commented Jul 7, 2021

Codecov Report

Merging #15568 (2b5886b) into master (83be06d) will decrease coverage by 0.22%.
The diff coverage is 100.00%.

❗ Current head 2b5886b differs from pull request most recent head 6f276cf. Consider uploading reports for the commit 6f276cf to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15568      +/-   ##
==========================================
- Coverage   76.95%   76.72%   -0.23%     
==========================================
  Files         976      976              
  Lines       51290    51296       +6     
  Branches     6907     6907              
==========================================
- Hits        39468    39356     -112     
- Misses      11603    11721     +118     
  Partials      219      219              
Flag Coverage Δ
hive ?
javascript 71.42% <100.00%> (+<0.01%) ⬆️
presto ?

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

Impacted Files Coverage Δ
...re/components/controls/CollectionControl/index.jsx 83.33% <ø> (ø)
superset-frontend/src/components/Tabs/Tabs.tsx 96.77% <100.00%> (+0.22%) ⬆️
.../components/Header/HeaderActionsDropdown/index.jsx 67.50% <100.00%> (+0.41%) ⬆️
...re/components/controls/DatasourceControl/index.jsx 87.17% <100.00%> (+0.33%) ⬆️
...nts/controls/DateFilterControl/DateFilterLabel.tsx 66.93% <100.00%> (+0.26%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.44% <0.00%> (-17.07%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-6.95%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.26% <0.00%> (-1.65%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83be06d...6f276cf. Read the comment docs.

@@ -281,6 +281,8 @@ export default function DateFilterLabel(props: DateFilterControlProps) {
setFrame(option.value as FrameType);
}

const theme = useTheme();
Copy link
Member

Choose a reason for hiding this comment

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

nice catch there

@suddjian
Copy link
Member

suddjian commented Jul 7, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2021

@suddjian Ephemeral environment spinning up at http://54.201.100.239:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@@ -190,7 +195,7 @@ class DatasourceControl extends React.PureComponent {
return (
<Styles data-test="datasource-control" className="DatasourceControl">
<div className="data-container">
<Icon name="dataset-physical" className="dataset-svg" />
<Icons.DatasetPhysical className="dataset-svg" />
Copy link
Member

Choose a reason for hiding this comment

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

conditional render DatasetPhysical or DatasetVirtual from props.datasource.is_sqllab_view

Copy link
Member

Choose a reason for hiding this comment

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

I disagree, I think having a consistent icon here adds clarity. To me the icon is doing the job of communicating "this is the dataset control" rather than "this is the type of this dataset". But that decision should probably be left to design folks.

Copy link
Member

@michael-s-molina michael-s-molina Jul 8, 2021

Choose a reason for hiding this comment

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

I'm fine either way, but I liked @zhaoyongjie suggestion. The icons are similar enough to let the user know that they represent a dataset. With different icons, we have additional information (virtual or physical).

Screen Shot 2021-07-08 at 5 04 54 PM

Copy link
Member

@michael-s-molina michael-s-molina Jul 8, 2021

Choose a reason for hiding this comment

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

One question that we can ask is: In the context of Explore, is important for the user to know if he's working on a physical or virtual dataset? Is there any difference in terms of functionality? @rusackas @betodealmeida

Copy link
Member Author

Choose a reason for hiding this comment

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

The original design for this control was with this specific icon.

Copy link
Member

Choose a reason for hiding this comment

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

@michael-s-molina it shouldn't matter, everything the user does on a physical dataset in Explore they should be able to in a virtual, and vice-versa.

Copy link
Member

Choose a reason for hiding this comment

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

I vote for consistency in design

Copy link
Member

@suddjian suddjian left a comment

Choose a reason for hiding this comment

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

lgtm

@rusackas
Copy link
Member

rusackas commented Jul 8, 2021

I think the question of whether or not we should render the relevant icon for the particular dataset is an interesting one. I can see both sides of the argument. If I were forced to choose a side, I'd say I would personally lean toward making it accurately reflect the dataset.

However this is not the intent of this PR! And it's clearly a bit contentious. We're waging a war to migrate to a new component, and this PR hits the mark. I agree the change we're discussing is worth the discussion... but maybe we should do that on an Issue/slack/zoom/etc, and open a separate PR if we want to pursue it after further discussion.

Merging this one for now... baby steps :D

@rusackas rusackas merged commit 2be52c0 into apache:master Jul 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2021

Ephemeral environment shutdown and build artifacts deleted.

@rusackas rusackas deleted the icons-Controls branch July 9, 2021 03:10
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* initial commit

* Update DateFilterLabel.tsx
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* initial commit

* Update DateFilterLabel.tsx
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* initial commit

* Update DateFilterLabel.tsx
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
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 preset-io size/M 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants