This is an automated email from the ASF dual-hosted git repository.

yjc pushed a commit to branch home-screen-mvp
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 9655b48e826a602c17fad10780d0c196d5e5d68f
Author: Phillip Kelley-Dotson <[email protected]>
AuthorDate: Wed Oct 21 15:11:06 2020 -0700

    add changes
---
 .../javascripts/views/CRUD/welcome/ChartTable_spec.tsx    | 10 +++-------
 superset-frontend/src/views/CRUD/utils.tsx                |  2 +-
 .../src/views/CRUD/welcome/ActivityTable.tsx              | 15 ++++++++++++---
 superset-frontend/src/views/CRUD/welcome/EmptyState.tsx   |  6 ++++--
 superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx |  7 ++++---
 5 files changed, 24 insertions(+), 16 deletions(-)

diff --git 
a/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx 
b/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx
index a631a78..7a39e9f 100644
--- a/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx
+++ b/superset-frontend/spec/javascripts/views/CRUD/welcome/ChartTable_spec.tsx
@@ -24,6 +24,7 @@ import fetchMock from 'fetch-mock';
 import configureStore from 'redux-mock-store';
 import ChartTable from 'src/views/CRUD/welcome/ChartTable';
 import ChartCard from 'src/views/CRUD/chart/ChartCard';
+import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
 
 // store needed for withToasts(DashboardTable)
 const mockStore = configureStore([thunk]);
@@ -59,20 +60,15 @@ describe('DashboardTable', () => {
     context: { store },
   });
 
-  /*beforeAll(async () => {
+  beforeAll(async () => {
     await waitForComponentToPaint(wrapper);
-  });*/
+  });
 
   it('it renders', () => {
     expect(wrapper.find(ChartTable)).toExist();
   });
   it('fetches chart favorites and renders chart cards ', () => {
-      console.log('mock call', fetchMock.calls(/chart\/\?q/))
     expect(fetchMock.calls(chartsEndpoint)).toHaveLength(1);
-    console.log('wrapper', wrapper.dive());
-    // there's a delay between response and updating state, so manually set it
-    // rather than adding a timeout which could introduce flakiness
-    // wrapper.setState({ dashboards: mockDashboards });
     expect(wrapper.find(ChartCard)).toExist();
   });
 });
diff --git a/superset-frontend/src/views/CRUD/utils.tsx 
b/superset-frontend/src/views/CRUD/utils.tsx
index cf4c9ec..449d57f 100644
--- a/superset-frontend/src/views/CRUD/utils.tsx
+++ b/superset-frontend/src/views/CRUD/utils.tsx
@@ -164,7 +164,7 @@ export const CardContainer = styled.div`
   }
 
   ${[mq[1]]} {
-    grid-template-columns: repeat(auto-fit, minmax(48%, max-content));
+    grid-template-columns: repeat(auto-fit, minmax(50%, max-content));
   }
   grid-gap: ${({ theme }) => theme.gridUnit * 8}px;
   justify-content: left;
diff --git a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx 
b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
index 31dce1c..a198717 100644
--- a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
@@ -24,7 +24,7 @@ import ListViewCard from 'src/components/ListViewCard';
 import { addDangerToast } from 'src/messageToasts/actions';
 import SubMenu from 'src/components/Menu/SubMenu';
 import { reject } from 'lodash';
-import { getBatchData } from '../utils';
+import { getBatchData, mq } from '../utils';
 import EmptyState from './EmptyState';
 
 interface MapProps {
@@ -60,12 +60,22 @@ const ActivityContainer = styled.div`
   margin-top: -15px;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(31%, max-content));
+  ${[mq[3]]} {
+    grid-template-columns: repeat(auto-fit, minmax(31%, max-content));
+  }
+  ${[mq[2]]} {
+    grid-template-columns: repeat(auto-fit, minmax(42%, max-content));
+  }
+  ${[mq[1]]} {
+    grid-template-columns: repeat(auto-fit, minmax(63%, max-content));
+  }
   grid-gap: ${({ theme }) => theme.gridUnit * 8}px;
   justify-content: left;
   padding: ${({ theme }) => theme.gridUnit * 2}px
     ${({ theme }) => theme.gridUnit * 4}px;
   .ant-card-meta-avatar {
-    margin-top: 5px;
+    margin-top: 10px;
+    margin-left: 5px;
   }
   .ant-card-meta-title {
     font-weight: 700;
@@ -181,7 +191,6 @@ export default function ActivityTable({ user }: 
ActivityProps) {
     ));
   };
   if (loading) return <>loading ...</>;
-  console.log('activity', activeChild)
   return (
     <>
       <>
diff --git a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx 
b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
index 00aff9b..67bed3c 100644
--- a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
@@ -31,10 +31,12 @@ const Container = styled.div`
   display: flex;
   flex-direction: column;
   justify-content: center;
+  margin-top: 20px;
   img {
     width: 114px;
     display: block;
     margin: 0 auto;
+    margin-bottom: 15px;
   }
   div:nth-child(2) {
     text-align: center;
@@ -100,7 +102,7 @@ export default function EmptyState({ tableName, tab }: 
EmptyStateProps) {
       appear here
     </div>
   );
-
+  // Mine and Recent Activity(all tabs) tab empty state
   if (tab === 'Mine' || tableName === 'RECENTS') {
     return (
       <Container>
@@ -112,7 +114,7 @@ export default function EmptyState({ tableName, tab }: 
EmptyStateProps) {
       </Container>
     );
   }
-
+  // Favorite tab empty state
   return (
     <Container>
       <img src="/static/assets/images/star-circle.png" alt="star.png" />
diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx 
b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
index 82de6a3..d2aae27 100644
--- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
@@ -150,7 +150,6 @@ const SavedQueries = ({
       )}
     </Menu>
   );
-
   return (
     <>
       {queryDeleteModal && (
@@ -211,13 +210,15 @@ const SavedQueries = ({
       />
       {queries.length > 0 ? (
         <CardContainer>
-          {queries.map(q => (
+          {queries.map((q, i) => (
             <ListViewCard
+              key={`${i}`}
               imgFallbackURL=""
               imgURL=""
+              url={`/superset/sqllab?savedQueryId=${q.id}`}
               title={q.label}
               rows={q.rows}
-              tableName={q?.sql_tables && q.sql_tables[0].table}
+              tableName={q?.sql_tables && q.sql_tables[0]?.table}
               tables={q?.sql_tables?.length}
               loading={loading}
               description={t('Last run ', q.end_time)}

Reply via email to