You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/27 19:49:22 UTC

[GitHub] [superset] rusackas opened a new pull request, #19873: feat: adds `chartId`-based class to dashboard chart holder

rusackas opened a new pull request, #19873:
URL: https://github.com/apache/superset/pull/19873

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This PR adds a class to all dashboard charts, referencing their `chartID` as `dashboard-chart-id-{X}` as seen here:
   
   <img width="665" alt="Screen_Shot_2022-04-26_at_11_28_15_PM" src="https://user-images.githubusercontent.com/812905/165609687-0edc7129-a13b-45dc-a9b7-ffb7b05a90a3.png">
   
   This allows you to more reliably target a particular chart and do wacky CSS things with it, like so:
   
   <img width="1219" alt="Screen Shot 2022-04-26 at 11 26 10 PM" src="https://user-images.githubusercontent.com/812905/165610573-46ff3a7d-8114-41ef-8baf-733348d6adad.png">
   
   What you do with this new found power is up to you, and at your own risk... but it's easier to do it for a particular chart now, anyway, even if someone moves charts around on a dashboard, which was the main point of fragility in `nth-of-type` selector approaches.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on pull request #19873: feat(css): adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on PR #19873:
URL: https://github.com/apache/superset/pull/19873#issuecomment-1112216297

   Should we add a comment in the code with the reasoning to prevent anyone in the future to delete this class because it's not being used?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on a diff in pull request #19873: feat(css): adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
rusackas commented on code in PR #19873:
URL: https://github.com/apache/superset/pull/19873#discussion_r870511577


##########
superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx:
##########
@@ -344,6 +344,7 @@ class ChartHolder extends React.Component {
               className={cx(
                 'dashboard-component',
                 'dashboard-component-chart-holder',
+                `dashboard-chart-id-${chartId}`,

Review Comment:
   ```suggestion
                   // The following class is added to support custom dashboard styling via the CSS editor
                   `dashboard-chart-id-${chartId}`,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas merged pull request #19873: feat(css): adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
rusackas merged PR #19873:
URL: https://github.com/apache/superset/pull/19873


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on pull request #19873: feat: adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #19873:
URL: https://github.com/apache/superset/pull/19873#issuecomment-1111420837

   @ samtfm you may remember this from ages ago... feel free to review, or request changes/additions


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #19873: feat(css): adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #19873:
URL: https://github.com/apache/superset/pull/19873#issuecomment-1111455207

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#19873](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (79cf5cb) into [master](https://codecov.io/gh/apache/superset/commit/768e4b7a546f7f6abdbc079f117014eac0cec23d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (768e4b7) will **increase** coverage by `12.59%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #19873       +/-   ##
   ===========================================
   + Coverage   53.91%   66.50%   +12.59%     
   ===========================================
     Files        1713     1714        +1     
     Lines       64995    65082       +87     
     Branches     6698     6726       +28     
   ===========================================
   + Hits        35040    43283     +8243     
   + Misses      28248    20089     -8159     
   - Partials     1707     1710        +3     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `52.91% <ø> (ø)` | |
   | javascript | `51.24% <ø> (+0.08%)` | :arrow_up: |
   | mysql | `81.91% <ø> (?)` | |
   | postgres | `81.96% <ø> (?)` | |
   | presto | `52.76% <ø> (ø)` | |
   | python | `82.39% <ø> (+25.61%)` | :arrow_up: |
   | sqlite | `81.73% <ø> (?)` | |
   | unit | `47.99% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `57.95% <ø> (ø)` | |
   | [...-chart-controls/src/sections/advancedAnalytics.tsx](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3NlY3Rpb25zL2FkdmFuY2VkQW5hbHl0aWNzLnRzeA==) | `11.11% <0.00%> (-22.23%)` | :arrow_down: |
   | [...d/packages/superset-ui-chart-controls/src/types.ts](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY2hhcnQtY29udHJvbHMvc3JjL3R5cGVzLnRz) | `100.00% <0.00%> (ø)` | |
   | [...s/plugin-chart-echarts/src/utils/formDataSuffix.ts](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvdXRpbHMvZm9ybURhdGFTdWZmaXgudHM=) | `100.00% <0.00%> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `91.41% <0.00%> (+0.33%)` | :arrow_up: |
   | [...ntend/src/views/CRUD/annotation/AnnotationList.tsx](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvYW5ub3RhdGlvbi9Bbm5vdGF0aW9uTGlzdC50c3g=) | `69.69% <0.00%> (+0.34%)` | :arrow_up: |
   | [superset/views/database/views.py](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2Uvdmlld3MucHk=) | `31.36% <0.00%> (+0.90%)` | :arrow_up: |
   | [superset/sql\_parse.py](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvc3FsX3BhcnNlLnB5) | `97.07% <0.00%> (+1.16%)` | :arrow_up: |
   | [superset/common/utils/query\_cache\_manager.py](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3V0aWxzL3F1ZXJ5X2NhY2hlX21hbmFnZXIucHk=) | `89.41% <0.00%> (+1.17%)` | :arrow_up: |
   | [superset/tables/models.py](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdGFibGVzL21vZGVscy5weQ==) | `67.53% <0.00%> (+1.29%)` | :arrow_up: |
   | ... and [275 more](https://codecov.io/gh/apache/superset/pull/19873/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [768e4b7...79cf5cb](https://codecov.io/gh/apache/superset/pull/19873?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on pull request #19873: feat(css): adds `chartId`-based class to dashboard chart holder

Posted by GitBox <gi...@apache.org>.
rusackas commented on PR #19873:
URL: https://github.com/apache/superset/pull/19873#issuecomment-1123982232

   > Should we add a comment in the code with the reasoning to prevent anyone in the future to delete this class because it's not being used?
   
   Excellent suggestion! Thank you for that. I added one, so if it seems sufficiently explanatory, I'd love a (re)review :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org