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/06/09 18:42:47 UTC

[GitHub] [superset] codyml opened a new pull request, #20337: [WIP] chore(dashboard): update Edit Dashboard side panel tabs

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

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   Reorders/renames tabs for clarity, so Charts is first/default Components is instead named Layout Elements.  Adds tests for `BuilderComponentPane` and relocates component and test files to meet file hierarchy recommendations.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   #### Before
   ![before](https://user-images.githubusercontent.com/13007381/172920739-f5b1c98b-ae16-403d-a89b-9f82985f457d.png)
   
   #### After
   ![after](https://user-images.githubusercontent.com/13007381/172920761-8439fbb5-0593-4029-b829-dfd7dfc138a1.png)
   
   ### TESTING INSTRUCTIONS
   Unit test:
   ```shell
   cd superset-frontend
   npm run test -- src/dashboard/components/BuilderComponentPane/BuilderComponentPane.test.tsx
   ```
   
   **Note: despite passing, running test shows lots of console warning/errors – any idea why?**
   
   Manual check: check that clicking "Edit Dashboard" opens panel with Chart tab first and selected by default and Layout Elements tab second. 
   
   ### 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:
   - [x] 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 a diff in pull request #20337: [WIP] chore(dashboard): update Edit Dashboard side panel tabs

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #20337:
URL: https://github.com/apache/superset/pull/20337#discussion_r893857061


##########
superset-frontend/src/dashboard/components/BuilderComponentPane/BuilderComponentPane.test.tsx:
##########
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import { render, screen } from 'spec/helpers/testing-library';
+import BuilderComponentPane from '.';
+
+jest.mock('src/dashboard/containers/SliceAdder');
+
+describe('BuilderComponentPane', () => {
+  const props = { isStandalone: false, topOffset: 115 };

Review Comment:
   You can move these inside the test. You need to render for each test.



##########
superset-frontend/src/dashboard/components/BuilderComponentPane/index.tsx:
##########
@@ -101,7 +101,18 @@ const BuilderComponentPane: React.FC<BCPProps> = ({
                     className="tabs-components"
                     data-test="dashboard-builder-component-pane-tabs-navigation"
                   >
-                    <Tabs.TabPane key={1} tab={t('Components')}>
+                    <Tabs.TabPane
+                      key={1}
+                      tab={t('Charts')}
+                      className="tab-charts"
+                    >
+                      <SliceAdder
+                        height={
+                          height + (isSticky ? SUPERSET_HEADER_HEIGHT : 0)
+                        }
+                      />
+                    </Tabs.TabPane>
+                    <Tabs.TabPane key={2} tab={t('Layout Elements')}>

Review Comment:
   ```suggestion
                       <Tabs.TabPane key={2} tab={t('Layout elements')}>
   ```
   
   See https://github.com/apache/superset/wiki/Capitalization-Guidelines



##########
superset-frontend/src/dashboard/components/BuilderComponentPane/BuilderComponentPane.test.tsx:
##########
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import React from 'react';
+import { render, screen } from 'spec/helpers/testing-library';
+import BuilderComponentPane from '.';
+
+jest.mock('src/dashboard/containers/SliceAdder');
+
+describe('BuilderComponentPane', () => {

Review Comment:
   [Avoid nesting when you're testing](https://github.com/apache/superset/wiki/Testing-Guidelines-and-Best-Practices#avoid-nesting-when-youre-testing)



-- 
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 #20337: chore(dashboard): update Edit Dashboard side panel tabs

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

   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] github-actions[bot] commented on pull request #20337: [WIP] chore(dashboard): update Edit Dashboard side panel tabs

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

   @michael-s-molina Ephemeral environment spinning up at http://54.185.222.195: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 #20337: [WIP] chore(dashboard): update Edit Dashboard side panel tabs

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/20337?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 [#20337](https://codecov.io/gh/apache/superset/pull/20337?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd557fb) into [master](https://codecov.io/gh/apache/superset/commit/07b4a7159dd293061b83c671ad64cc51c928a199?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (07b4a71) will **increase** coverage by `0.02%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head fd557fb differs from pull request most recent head 73cd940. Consider uploading reports for the commit 73cd940 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #20337      +/-   ##
   ==========================================
   + Coverage   66.64%   66.67%   +0.02%     
   ==========================================
     Files        1738     1738              
     Lines       65056    65056              
     Branches     6885     6885              
   ==========================================
   + Hits        43356    43375      +19     
   + Misses      19953    19935      -18     
   + Partials     1747     1746       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.67% <0.00%> (+0.05%)` | :arrow_up: |
   
   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/20337?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/BuilderComponentPane/index.tsx](https://codecov.io/gh/apache/superset/pull/20337/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0J1aWxkZXJDb21wb25lbnRQYW5lL2luZGV4LnRzeA==) | `78.94% <0.00%> (ø)` | |
   | [...oard/components/gridComponents/new/NewMarkdown.jsx](https://codecov.io/gh/apache/superset/pull/20337/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL25ldy9OZXdNYXJrZG93bi5qc3g=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...c/dashboard/components/dnd/AddSliceDragPreview.jsx](https://codecov.io/gh/apache/superset/pull/20337/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2RuZC9BZGRTbGljZURyYWdQcmV2aWV3LmpzeA==) | `60.00% <0.00%> (+10.00%)` | :arrow_up: |
   | [...t-frontend/src/dashboard/components/SliceAdder.jsx](https://codecov.io/gh/apache/superset/pull/20337/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) | `76.47% <0.00%> (+10.29%)` | :arrow_up: |
   | [...et-frontend/src/dashboard/actions/sliceEntities.js](https://codecov.io/gh/apache/superset/pull/20337/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9hY3Rpb25zL3NsaWNlRW50aXRpZXMuanM=) | `53.84% <0.00%> (+38.46%)` | :arrow_up: |
   | [...t-frontend/src/dashboard/containers/SliceAdder.jsx](https://codecov.io/gh/apache/superset/pull/20337/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) | `100.00% <0.00%> (+100.00%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/20337?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/20337?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 [07b4a71...73cd940](https://codecov.io/gh/apache/superset/pull/20337?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] michael-s-molina commented on pull request #20337: [WIP] chore(dashboard): update Edit Dashboard side panel tabs

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

   /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] michael-s-molina merged pull request #20337: chore(dashboard): update Edit Dashboard side panel tabs

Posted by GitBox <gi...@apache.org>.
michael-s-molina merged PR #20337:
URL: https://github.com/apache/superset/pull/20337


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