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 2021/03/06 15:40:35 UTC

[GitHub] [superset] pkdotson opened a new pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

pkdotson opened a new pull request #13500:
URL: https://github.com/apache/superset/pull/13500


   ### SUMMARY
   This pr is based off feedback from users with slow loading home page from api calls. The initial setup for page load was to batch call for all data on page load. This pr separates out api calls for recent activity and run mine's api calls in parallel on page load. This should allow some data to show faster on homepage without depending on long api requests.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TEST PLAN
   Unit test will be updated as change are made.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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 #13500: chore(homepage): separate out api calls to make homepage load more dynamically

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


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=h1) Report
   > Merging [#13500](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=desc) (5c73aa2) into [master](https://codecov.io/gh/apache/superset/commit/cfc83c271c7ac11ddf8d0f45a709d2899a130de9?el=desc) (cfc83c2) will **decrease** coverage by `4.09%`.
   > The diff coverage is `43.51%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13500/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13500      +/-   ##
   ==========================================
   - Coverage   77.17%   73.07%   -4.10%     
   ==========================================
     Files         905      608     -297     
     Lines       45675    21688   -23987     
     Branches     5511     5731     +220     
   ==========================================
   - Hits        35248    15848   -19400     
   + Misses      10298     5704    -4594     
   - Partials      129      136       +7     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.42% <31.57%> (-0.22%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `63.12% <37.01%> (-0.30%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `40.24% <0.00%> (+1.30%)` | :arrow_up: |
   | [...src/SqlLab/utils/reduxStateToLocalStorageHelper.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi91dGlscy9yZWR1eFN0YXRlVG9Mb2NhbFN0b3JhZ2VIZWxwZXIuanM=) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `100.00% <ø> (ø)` | |
   | [...nd/src/common/components/CronPicker/CronPicker.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0Nyb25QaWNrZXIvQ3JvblBpY2tlci50c3g=) | `100.00% <ø> (ø)` | |
   | [...ontend/src/common/components/InfoTooltip/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0luZm9Ub29sdGlwL2luZGV4LnRzeA==) | `53.84% <ø> (ø)` | |
   | [...components/AlteredSliceTag/AlteredSliceTagMocks.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL0FsdGVyZWRTbGljZVRhZ01vY2tzLmpz) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/components/AlteredSliceTag/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL2luZGV4LmpzeA==) | `98.66% <ø> (ø)` | |
   | [superset-frontend/src/components/Badge/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQmFkZ2UvaW5kZXgudHN4) | `100.00% <ø> (ø)` | |
   | [...nd/src/components/BootstrapSliderWrapper/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQm9vdHN0cmFwU2xpZGVyV3JhcHBlci9pbmRleC5qc3g=) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/components/Button/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQnV0dG9uL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | ... and [481 more](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=footer). Last update [cfc83c2...f82cf75](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r592771111



##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -27,6 +27,7 @@ import {
   createErrorHandler,
   getRecentAcitivtyObjs,
   mq,
+  getMineObjs,

Review comment:
       Make sense. I originally want to go with that naming




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

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] edited a comment on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-799795273


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=h1) Report
   > Merging [#13500](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=desc) (5c73aa2) into [master](https://codecov.io/gh/apache/superset/commit/cfc83c271c7ac11ddf8d0f45a709d2899a130de9?el=desc) (cfc83c2) will **decrease** coverage by `4.09%`.
   > The diff coverage is `43.51%`.
   
   > :exclamation: Current head 5c73aa2 differs from pull request most recent head 8dfbe71. Consider uploading reports for the commit 8dfbe71 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13500/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13500      +/-   ##
   ==========================================
   - Coverage   77.17%   73.07%   -4.10%     
   ==========================================
     Files         905      608     -297     
     Lines       45675    21688   -23987     
     Branches     5511     5731     +220     
   ==========================================
   - Hits        35248    15848   -19400     
   + Misses      10298     5704    -4594     
   - Partials      129      136       +7     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.42% <31.57%> (-0.22%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `63.12% <37.01%> (-0.30%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `40.24% <0.00%> (+1.30%)` | :arrow_up: |
   | [...src/SqlLab/utils/reduxStateToLocalStorageHelper.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi91dGlscy9yZWR1eFN0YXRlVG9Mb2NhbFN0b3JhZ2VIZWxwZXIuanM=) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `100.00% <ø> (ø)` | |
   | [...nd/src/common/components/CronPicker/CronPicker.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0Nyb25QaWNrZXIvQ3JvblBpY2tlci50c3g=) | `100.00% <ø> (ø)` | |
   | [...ontend/src/common/components/InfoTooltip/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0luZm9Ub29sdGlwL2luZGV4LnRzeA==) | `53.84% <ø> (ø)` | |
   | [...components/AlteredSliceTag/AlteredSliceTagMocks.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL0FsdGVyZWRTbGljZVRhZ01vY2tzLmpz) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/components/AlteredSliceTag/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL2luZGV4LmpzeA==) | `98.66% <ø> (ø)` | |
   | [superset-frontend/src/components/Badge/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQmFkZ2UvaW5kZXgudHN4) | `100.00% <ø> (ø)` | |
   | [...nd/src/components/BootstrapSliderWrapper/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQm9vdHN0cmFwU2xpZGVyV3JhcHBlci9pbmRleC5qc3g=) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/components/Button/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQnV0dG9uL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | ... and [481 more](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=footer). Last update [cfc83c2...8dfbe71](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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] junlincc removed a comment on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
junlincc removed a comment on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-802375593


   not sure what's the best way to test, but compared before and after locally. difference in performance is quite noticeable? 
   Good to go! 🟢
   Before 
   https://user-images.githubusercontent.com/67837651/111709439-d7668900-8804-11eb-9ab4-eadee8fd4b87.mov
   
   After
   https://user-images.githubusercontent.com/67837651/111709477-e816ff00-8804-11eb-98a2-75d01b7e457d.mov
   
   
   
   


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

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] ktmud commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-803439911


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

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] junlincc commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-802375593


   not sure what's the best way to test, but compared before and after locally. difference in performance is quite noticeable? 
   Good to go! 🟢
   Before 
   https://user-images.githubusercontent.com/67837651/111709439-d7668900-8804-11eb-9ab4-eadee8fd4b87.mov
   
   After
   https://user-images.githubusercontent.com/67837651/111709477-e816ff00-8804-11eb-98a2-75d01b7e457d.mov
   
   
   
   


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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r592772497



##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -61,102 +61,92 @@ const createFetchResourceMethod = (method: string) => (
   return [];
 };
 
-export const getRecentAcitivtyObjs = (
-  userId: string | number,
-  recent: string,
-  addDangerToast: (arg1: string, arg2: any) => any,
-) => {
-  const getParams = (filters?: Array<any>) => {
-    const params = {
-      order_column: 'changed_on_delta_humanized',
-      order_direction: 'desc',
-      page: 0,
-      page_size: 3,
-      filters,
-    };
-    if (!filters) delete params.filters;
-    return rison.encode(params);
+const getParams = (filters?: Array<any>) => {
+  const params = {
+    order_column: 'changed_on_delta_humanized',
+    order_direction: 'desc',
+    page: 0,
+    page_size: 3,
+    filters,
   };
+  if (!filters) delete params.filters;
+  return rison.encode(params);
+};
+
+export const getEditedObjs = (userId: string | number) => {
   const filters = {
-    // chart and dashbaord uses same filters
-    // for edited and created
     edited: [
       {
         col: 'changed_by',
         opr: 'rel_o_m',
         value: `${userId}`,
       },
     ],
-    created: [
-      {
-        col: 'created_by',
-        opr: 'rel_o_m',
-        value: `${userId}`,
-      },
-    ],
   };
-  const baseBatch = [
-    SupersetClient.get({ endpoint: recent }),
+  const batch = [
     SupersetClient.get({
       endpoint: `/api/v1/dashboard/?q=${getParams(filters.edited)}`,
     }),
     SupersetClient.get({
       endpoint: `/api/v1/chart/?q=${getParams(filters.edited)}`,
     }),
-    SupersetClient.get({
-      endpoint: `/api/v1/dashboard/?q=${getParams(filters.created)}`,
-    }),
-    SupersetClient.get({
-      endpoint: `/api/v1/chart/?q=${getParams(filters.created)}`,
-    }),
-    SupersetClient.get({
-      endpoint: `/api/v1/saved_query/?q=${getParams(filters.created)}`,
-    }),
   ];
-  return Promise.all(baseBatch).then(
-    ([
-      recentsRes,
-      editedDash,
-      editedChart,
-      createdByDash,
-      createdByChart,
-      createdByQuery,
-    ]) => {
-      const res: any = {
-        editedDash: editedDash.json?.result.slice(0, 3),
-        editedChart: editedChart.json?.result.slice(0, 3),
-        createdByDash: createdByDash.json?.result.slice(0, 3),
-        createdByChart: createdByChart.json?.result.slice(0, 3),
-        createdByQuery: createdByQuery.json?.result.slice(0, 3),
+  return Promise.all(batch)

Review comment:
       these two are need to fill out edited so they should load together when both are finished




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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r597216907



##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -45,11 +46,12 @@ export function useListViewResource<D extends object = any>(
   infoEnable = true,
   defaultCollectionValue: D[] = [],
   baseFilters?: FilterValue[], // must be memoized
+  defaultLoading = true,

Review comment:
       Yep, I'll do the refactoring in a follow up ticket.




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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r596614041



##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -29,6 +29,12 @@ import { getClientErrorObject } from 'src/utils/getClientErrorObject';
 import { FetchDataConfig } from 'src/components/ListView';
 import { Dashboard } from './types';
 
+interface Filters {
+  col: string;
+  opr: string;
+  value: string;
+}

Review comment:
       Makes sense will do!




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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r591851019



##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -61,102 +61,92 @@ const createFetchResourceMethod = (method: string) => (
   return [];
 };
 
-export const getRecentAcitivtyObjs = (
-  userId: string | number,
-  recent: string,
-  addDangerToast: (arg1: string, arg2: any) => any,
-) => {
-  const getParams = (filters?: Array<any>) => {
-    const params = {
-      order_column: 'changed_on_delta_humanized',
-      order_direction: 'desc',
-      page: 0,
-      page_size: 3,
-      filters,
-    };
-    if (!filters) delete params.filters;
-    return rison.encode(params);
+const getParams = (filters?: Array<any>) => {

Review comment:
       yep!
   




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

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 change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r591880729



##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -61,102 +61,92 @@ const createFetchResourceMethod = (method: string) => (
   return [];
 };
 
-export const getRecentAcitivtyObjs = (
-  userId: string | number,
-  recent: string,
-  addDangerToast: (arg1: string, arg2: any) => any,
-) => {
-  const getParams = (filters?: Array<any>) => {
-    const params = {
-      order_column: 'changed_on_delta_humanized',
-      order_direction: 'desc',
-      page: 0,
-      page_size: 3,
-      filters,
-    };
-    if (!filters) delete params.filters;
-    return rison.encode(params);
+const getParams = (filters?: Array<any>) => {
+  const params = {
+    order_column: 'changed_on_delta_humanized',
+    order_direction: 'desc',
+    page: 0,
+    page_size: 3,
+    filters,
   };
+  if (!filters) delete params.filters;
+  return rison.encode(params);
+};
+
+export const getEditedObjs = (userId: string | number) => {
   const filters = {
-    // chart and dashbaord uses same filters
-    // for edited and created
     edited: [
       {
         col: 'changed_by',
         opr: 'rel_o_m',
         value: `${userId}`,
       },
     ],
-    created: [
-      {
-        col: 'created_by',
-        opr: 'rel_o_m',
-        value: `${userId}`,
-      },
-    ],
   };
-  const baseBatch = [
-    SupersetClient.get({ endpoint: recent }),
+  const batch = [
     SupersetClient.get({
       endpoint: `/api/v1/dashboard/?q=${getParams(filters.edited)}`,
     }),
     SupersetClient.get({
       endpoint: `/api/v1/chart/?q=${getParams(filters.edited)}`,
     }),
-    SupersetClient.get({
-      endpoint: `/api/v1/dashboard/?q=${getParams(filters.created)}`,
-    }),
-    SupersetClient.get({
-      endpoint: `/api/v1/chart/?q=${getParams(filters.created)}`,
-    }),
-    SupersetClient.get({
-      endpoint: `/api/v1/saved_query/?q=${getParams(filters.created)}`,
-    }),
   ];
-  return Promise.all(baseBatch).then(
-    ([
-      recentsRes,
-      editedDash,
-      editedChart,
-      createdByDash,
-      createdByChart,
-      createdByQuery,
-    ]) => {
-      const res: any = {
-        editedDash: editedDash.json?.result.slice(0, 3),
-        editedChart: editedChart.json?.result.slice(0, 3),
-        createdByDash: createdByDash.json?.result.slice(0, 3),
-        createdByChart: createdByChart.json?.result.slice(0, 3),
-        createdByQuery: createdByQuery.json?.result.slice(0, 3),
+  return Promise.all(batch)

Review comment:
       Would there be any perceivable benefit to separating/parallelizing these, too?




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

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] ktmud commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r595597689



##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -36,6 +36,7 @@ interface ListViewResourceState<D extends object = any> {
   lastFetchDataConfig: FetchDataConfig | null;
   bulkSelectEnabled: boolean;
   lastFetched?: string;
+  defualtLoading?: boolean;

Review comment:
       ```suggestion
     defaultLoading?: boolean;
   ```
   
   Typo, plus this is probably not needed since the state itself doesn't really use `defaultLoading`.

##########
File path: superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
##########
@@ -25,7 +25,7 @@ import ListViewCard from 'src/components/ListViewCard';
 import SubMenu from 'src/components/Menu/SubMenu';
 import { Chart } from 'src/types/Chart';
 import { Dashboard, SavedQueryObject } from 'src/views/CRUD/types';
-import { mq, CardStyles } from 'src/views/CRUD/utils';
+import { mq, CardStyles, getEditedObjs } from 'src/views/CRUD/utils';

Review comment:
       Nit: maybe it is just me, but I think `getEditedObjects` or `getUserEditedEntities` would be more readable.

##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -45,11 +46,12 @@ export function useListViewResource<D extends object = any>(
   infoEnable = true,
   defaultCollectionValue: D[] = [],
   baseFilters?: FilterValue[], // must be memoized
+  defaultLoading = true,

Review comment:
       Nit: can we call it `initialLoadingState`?  This function also has too many positional arguments. In general, I'd recommend refactoring any function with >=3 arguments to use `options` object.

##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -29,6 +29,12 @@ import { getClientErrorObject } from 'src/utils/getClientErrorObject';
 import { FetchDataConfig } from 'src/components/ListView';
 import { Dashboard } from './types';
 
+interface Filters {
+  col: string;
+  opr: string;
+  value: string;
+}

Review comment:
       Nit: let's make this a shared type with a more specific name (e.g. `CRUDFilterParam`) and put it into `views/CRUD/types.tsx`, as it is obviously used in other components, too.

##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -27,6 +27,7 @@ import {
   createErrorHandler,
   getRecentAcitivtyObjs,
   mq,
+  getMineObjs,

Review comment:
       How about `getUserOwnedObjects`?




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

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 change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r591887042



##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -123,8 +115,50 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
           );
         }),
       );
+
+    // Sets other activity data in parallel with recents api call

Review comment:
       Always appreciate comments like this!




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

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 #13500: chore(homepage): separate out api calls to make homepage load more dynamically

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


   @junlincc Ephemeral environment spinning up at http://34.208.210.86: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.

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 change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r590891630



##########
File path: superset-frontend/src/views/CRUD/utils.tsx
##########
@@ -61,102 +61,92 @@ const createFetchResourceMethod = (method: string) => (
   return [];
 };
 
-export const getRecentAcitivtyObjs = (
-  userId: string | number,
-  recent: string,
-  addDangerToast: (arg1: string, arg2: any) => any,
-) => {
-  const getParams = (filters?: Array<any>) => {
-    const params = {
-      order_column: 'changed_on_delta_humanized',
-      order_direction: 'desc',
-      page: 0,
-      page_size: 3,
-      filters,
-    };
-    if (!filters) delete params.filters;
-    return rison.encode(params);
+const getParams = (filters?: Array<any>) => {

Review comment:
       I wonder if we can type this more specifically.




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

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] junlincc removed a comment on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
junlincc removed a comment on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-802332595


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

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] junlincc commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-802332595


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

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] edited a comment on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-799795273


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=h1) Report
   > Merging [#13500](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=desc) (ff3379c) into [master](https://codecov.io/gh/apache/superset/commit/cfc83c271c7ac11ddf8d0f45a709d2899a130de9?el=desc) (cfc83c2) will **decrease** coverage by `3.99%`.
   > The diff coverage is `50.34%`.
   
   > :exclamation: Current head ff3379c differs from pull request most recent head f3db02b. Consider uploading reports for the commit f3db02b to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13500/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13500      +/-   ##
   ==========================================
   - Coverage   77.17%   73.17%   -4.00%     
   ==========================================
     Files         905      615     -290     
     Lines       45675    21917   -23758     
     Branches     5511     5820     +309     
   ==========================================
   - Hits        35248    16037   -19211     
   + Misses      10298     5737    -4561     
   - Partials      129      143      +14     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.29% <37.99%> (-0.35%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `63.23% <42.81%> (-0.20%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...et-frontend/src/SqlLab/components/TableElement.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC5qc3g=) | `88.37% <ø> (ø)` | |
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `40.24% <0.00%> (+1.30%)` | :arrow_up: |
   | [...src/SqlLab/utils/reduxStateToLocalStorageHelper.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi91dGlscy9yZWR1eFN0YXRlVG9Mb2NhbFN0b3JhZ2VIZWxwZXIuanM=) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/chart/ChartContainer.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NoYXJ0L0NoYXJ0Q29udGFpbmVyLmpzeA==) | `100.00% <ø> (ø)` | |
   | [...ontend/src/common/components/InfoTooltip/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0luZm9Ub29sdGlwL2luZGV4LnRzeA==) | `53.84% <ø> (ø)` | |
   | [...ontend/src/common/hooks/usePrevious/usePrevious.ts](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9ob29rcy91c2VQcmV2aW91cy91c2VQcmV2aW91cy50cw==) | `100.00% <ø> (ø)` | |
   | [...components/AlteredSliceTag/AlteredSliceTagMocks.js](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL0FsdGVyZWRTbGljZVRhZ01vY2tzLmpz) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/components/AlteredSliceTag/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQWx0ZXJlZFNsaWNlVGFnL2luZGV4LmpzeA==) | `98.66% <ø> (ø)` | |
   | [superset-frontend/src/components/Badge/index.tsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQmFkZ2UvaW5kZXgudHN4) | `100.00% <ø> (ø)` | |
   | [...nd/src/components/BootstrapSliderWrapper/index.jsx](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQm9vdHN0cmFwU2xpZGVyV3JhcHBlci9pbmRleC5qc3g=) | `0.00% <ø> (ø)` | |
   | ... and [584 more](https://codecov.io/gh/apache/superset/pull/13500/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=footer). Last update [cfc83c2...f3db02b](https://codecov.io/gh/apache/superset/pull/13500?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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

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 #13500: chore(homepage): separate out api calls to make homepage load more dynamically

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


   @ktmud Ephemeral environment creation is currently limited to committers.


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

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] pkdotson merged pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson merged pull request #13500:
URL: https://github.com/apache/superset/pull/13500


   


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

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 change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r591886760



##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -89,21 +87,15 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
   const recent = `/superset/recent_activity/${user.userId}/?limit=6`;
   const [activeChild, setActiveChild] = useState('Viewed');
   const [activityData, setActivityData] = useState<ActivityData>({});
+  const [chartData, setChartData] = useState<Array<object> | null>(null);
+  const [queryData, setQueryData] = useState<Array<object> | null>(null);
+  const [dashboardData, setDashboardData] = useState<Array<object> | null>(null);
   const [loading, setLoading] = useState(true);
+
   useEffect(() => {
     getRecentAcitivtyObjs(user.userId, recent, addDangerToast)
       .then(res => {
-        const data: any = {
-          Created: [
-            ...res.createdByChart,
-            ...res.createdByDash,
-            ...res.createdByQuery,
-          ],
-          myChart: res.createdByChart,
-          myDash: res.createdByDash,
-          myQuery: res.createdByQuery,
-          Edited: [...res.editedChart, ...res.editedDash],
-        };
+        const data: any = {};

Review comment:
       Not a dealbreaker, since it's not the intent of this PR, but it would be nice to add stronger typing to any `any` or `object` types in this area of the code. Maybe track it for a follow-up PR if it's too much feature creep for this one.




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

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 change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r591884630



##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -27,6 +27,7 @@ import {
   createErrorHandler,
   getRecentAcitivtyObjs,
   mq,
+  getMineObjs,

Review comment:
       This is a stupid nit, but I'll throw it out there... `Mine` makes this explicit about what it's used for (which I like) but there's something in me that wants to rename this to `getMyObjs` since it just _sounds_ better. We should probably leave it alone.... but just it does sound weird to my brain, so I'm just just hemming and hawing about it :P




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

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] ktmud commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-802444273


   
   https://user-images.githubusercontent.com/335541/111718524-4baa2800-8817-11eb-9939-8624c4134d29.mp4
   
   So it seems once other API is returned, "Recents" was rendered with an empty result before its own API response returns, resulting in a flash of the empty state---this is more noticeable if the `/recent_activity` API is slow or user network is slow in general---I tested this with network speed simulator in Chrome Dev Tools.
   
   Can we get this fixed before merging this PR?


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

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] pkdotson commented on a change in pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on a change in pull request #13500:
URL: https://github.com/apache/superset/pull/13500#discussion_r593340115



##########
File path: superset-frontend/src/views/CRUD/welcome/Welcome.tsx
##########
@@ -89,21 +87,15 @@ function Welcome({ user, addDangerToast }: WelcomeProps) {
   const recent = `/superset/recent_activity/${user.userId}/?limit=6`;
   const [activeChild, setActiveChild] = useState('Viewed');
   const [activityData, setActivityData] = useState<ActivityData>({});
+  const [chartData, setChartData] = useState<Array<object> | null>(null);
+  const [queryData, setQueryData] = useState<Array<object> | null>(null);
+  const [dashboardData, setDashboardData] = useState<Array<object> | null>(null);
   const [loading, setLoading] = useState(true);
+
   useEffect(() => {
     getRecentAcitivtyObjs(user.userId, recent, addDangerToast)
       .then(res => {
-        const data: any = {
-          Created: [
-            ...res.createdByChart,
-            ...res.createdByDash,
-            ...res.createdByQuery,
-          ],
-          myChart: res.createdByChart,
-          myDash: res.createdByDash,
-          myQuery: res.createdByQuery,
-          Edited: [...res.editedChart, ...res.editedDash],
-        };
+        const data: any = {};

Review comment:
       done




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

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] pkdotson commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
pkdotson commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-803210672


   @ktmud fixed
   
   https://user-images.githubusercontent.com/17326228/111854284-9e4d1800-88db-11eb-933f-2d6af7312b9d.mov
   
   
   
   


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

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] ktmud commented on pull request #13500: chore(homepage): separate out api calls to make homepage load more dynamically

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #13500:
URL: https://github.com/apache/superset/pull/13500#issuecomment-803439864


   Looks good!


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

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 #13500: chore(homepage): separate out api calls to make homepage load more dynamically

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


   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.

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