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/05/19 10:49:56 UTC

[GitHub] [superset] kgabryje opened a new pull request, #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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

   ### SUMMARY
   When user enters chart creation flow starting from a dashboard (e.g. with "Create chart" button in empty state or charts list in dashboard edit mode), the chart's save modal should have that dashboard's name prefilled. To achieve that, we pass `dashboard_id` as a url param to `/chart/add` page and from there to `explore`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   https://user-images.githubusercontent.com/15073128/169276098-5a2578a0-7ed4-4029-aa40-2f112e3af13a.mov
   
   
   
   ### TESTING INSTRUCTIONS
   1. Open a dashboard -> edit mode -> charts tab -> click "Create new chart" OR Open a dashboard and create a new chart using the plus icon button in top right corner.
   2. Create a chart and click save
   3. Verify that dashboard's name is prefilled
   4. Create a new dashboard and click "Create new chart" button in empty state. Create a chart and verify that dashboard's name is prefilled in save modal
   5. Create a chart from any other view (for example from Welcome page). Verify that save modal is not prefilled
   
   ### 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
   
   CC @kasiazjc 


-- 
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] kgabryje merged pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


-- 
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] github-actions[bot] commented on pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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

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


-- 
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 #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20129?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 [#20129](https://codecov.io/gh/apache/superset/pull/20129?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (99de199) into [master](https://codecov.io/gh/apache/superset/commit/b2a7fadba951c09fad5867676aaa0470404856df?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b2a7fad) will **decrease** coverage by `0.01%`.
   > The diff coverage is `36.36%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #20129      +/-   ##
   ==========================================
   - Coverage   54.56%   54.55%   -0.02%     
   ==========================================
     Files        1721     1721              
     Lines       64477    64504      +27     
     Branches     6795     6807      +12     
   ==========================================
   + Hits        35185    35191       +6     
   - Misses      27564    27579      +15     
   - Partials     1728     1734       +6     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.33% <36.36%> (-0.03%)` | :arrow_down: |
   
   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/20129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/dashboard/components/DashboardGrid.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEdyaWQuanN4) | `62.50% <0.00%> (ø)` | |
   | [...t-frontend/src/dashboard/components/SliceAdder.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlQWRkZXIuanN4) | `66.17% <0.00%> (-3.18%)` | :arrow_down: |
   | [...nd/src/dashboard/components/gridComponents/Tab.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL1RhYi5qc3g=) | `83.67% <ø> (ø)` | |
   | [...rontend/src/dashboard/containers/DashboardGrid.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZEdyaWQuanN4) | `100.00% <ø> (ø)` | |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL1NsaWNlQWRkZXIuanN4) | `0.00% <ø> (ø)` | |
   | [...rset-frontend/src/explore/components/SaveModal.tsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9TYXZlTW9kYWwudHN4) | `66.19% <ø> (ø)` | |
   | [...perset-frontend/src/views/components/MenuRight.tsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2NvbXBvbmVudHMvTWVudVJpZ2h0LnRzeA==) | `59.79% <33.33%> (-0.85%)` | :arrow_down: |
   | [...perset-frontend/src/addSlice/AddSliceContainer.tsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2FkZFNsaWNlL0FkZFNsaWNlQ29udGFpbmVyLnRzeA==) | `61.11% <50.00%> (-0.66%)` | :arrow_down: |
   | [.../explore/components/ExploreViewContainer/index.jsx](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci9pbmRleC5qc3g=) | `53.10% <66.66%> (+0.53%)` | :arrow_up: |
   | [.../plugin-chart-echarts/src/MixedTimeseries/index.ts](https://codecov.io/gh/apache/superset/pull/20129/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-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvTWl4ZWRUaW1lc2VyaWVzL2luZGV4LnRz) | `25.00% <0.00%> (-25.00%)` | :arrow_down: |
   | ... and [14 more](https://codecov.io/gh/apache/superset/pull/20129/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/20129?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/20129?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 [b2a7fad...99de199](https://codecov.io/gh/apache/superset/pull/20129?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] kgabryje commented on a diff in pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


##########
superset-frontend/src/dashboard/stylesheets/dashboard.less:
##########
@@ -19,6 +19,7 @@
 /* header has mysterious extra margin */
 header.top {
   margin-bottom: 2px;
+  z-index: 10;

Review Comment:
   You can test that by opening dashboard in edit mode and then try to click the "+" icon in top right corner



-- 
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] AAfghahi commented on pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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

   /testenv up


-- 
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] kgabryje commented on a diff in pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


##########
superset-frontend/src/addSlice/AddSliceContainer.tsx:
##########
@@ -195,10 +198,12 @@ export default class AddSliceContainer extends React.PureComponent<
   }
 
   exploreUrl() {
+    const dashboardId = getUrlParam(URL_PARAMS.dashboardId);
     const formData = encodeURIComponent(
       JSON.stringify({
         viz_type: this.state.visType,
         datasource: this.state.datasource?.value,
+        ...(!isNullish(dashboardId) && { dashboardId }),

Review Comment:
   `!dashboardId` would exclude `dashboardId === 0`, which is a valid id 😄 



-- 
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] github-actions[bot] commented on pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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

   Ephemeral environment shutdown and build artifacts deleted.


-- 
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] kgabryje commented on a diff in pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


##########
superset-frontend/src/dashboard/stylesheets/dashboard.less:
##########
@@ -19,6 +19,7 @@
 /* header has mysterious extra margin */
 header.top {
   margin-bottom: 2px;
+  z-index: 10;

Review Comment:
   The main menu items on the right were not clickable because in edit mode the right panel was covering them (they were visible but unclickable because of invisible part of that panel covering them)



-- 
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] AAfghahi commented on a diff in pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


##########
superset-frontend/src/dashboard/stylesheets/dashboard.less:
##########
@@ -19,6 +19,7 @@
 /* header has mysterious extra margin */
 header.top {
   margin-bottom: 2px;
+  z-index: 10;

Review Comment:
   why is this necessary?



##########
superset-frontend/src/addSlice/AddSliceContainer.tsx:
##########
@@ -195,10 +198,12 @@ export default class AddSliceContainer extends React.PureComponent<
   }
 
   exploreUrl() {
+    const dashboardId = getUrlParam(URL_PARAMS.dashboardId);
     const formData = encodeURIComponent(
       JSON.stringify({
         viz_type: this.state.visType,
         datasource: this.state.datasource?.value,
+        ...(!isNullish(dashboardId) && { dashboardId }),

Review Comment:
   this is a cool function, why nullish?
   



-- 
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] kgabryje commented on a diff in pull request #20129: feat(explore): Fill dashboard name when adding new chart from dashboard view

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


##########
superset-frontend/src/explore/components/ExploreViewContainer/index.jsx:
##########
@@ -699,12 +699,17 @@ function mapStateToProps(state) {
   const chartKey = Object.keys(charts)[0];
   const chart = charts[chartKey];
 
+  let dashboardId = Number(explore.form_data?.dashboardId);
+  if (Number.isNaN(dashboardId)) {

Review Comment:
   `??` operator doesn't exclude NaNs. I also don't want to use `||` operator in order not to exclude dashboards with id `0`



-- 
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