You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yj...@apache.org on 2020/10/29 05:45:03 UTC
[incubator-superset] 20/33: add images and update emptystate
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 a363a0fba88bf98596b80acdcc1a20f6367ad2db
Author: Phillip Kelley-Dotson <pk...@yahoo.com>
AuthorDate: Wed Oct 21 08:47:07 2020 -0700
add images and update emptystate
---
superset-frontend/images/empty-charts.png | Bin 0 -> 2274 bytes
superset-frontend/images/empty-dashboard.png | Bin 0 -> 1467 bytes
superset-frontend/images/empty-queries.png | Bin 0 -> 1791 bytes
superset-frontend/images/union.png | Bin 1131 -> 1694 bytes
.../src/views/CRUD/welcome/ActivityTable.tsx | 5 ++--
.../src/views/CRUD/welcome/EmptyState.tsx | 30 +++++++++++++++------
.../src/views/CRUD/welcome/Welcome.tsx | 1 -
7 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/superset-frontend/images/empty-charts.png b/superset-frontend/images/empty-charts.png
new file mode 100644
index 0000000..b814d35
Binary files /dev/null and b/superset-frontend/images/empty-charts.png differ
diff --git a/superset-frontend/images/empty-dashboard.png b/superset-frontend/images/empty-dashboard.png
new file mode 100644
index 0000000..b0d4462
Binary files /dev/null and b/superset-frontend/images/empty-dashboard.png differ
diff --git a/superset-frontend/images/empty-queries.png b/superset-frontend/images/empty-queries.png
new file mode 100644
index 0000000..adc51c0
Binary files /dev/null and b/superset-frontend/images/empty-queries.png differ
diff --git a/superset-frontend/images/union.png b/superset-frontend/images/union.png
index ca1dbe5..af94c07 100644
Binary files a/superset-frontend/images/union.png and b/superset-frontend/images/union.png differ
diff --git a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
index 6c423f0..31dce1c 100644
--- a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
@@ -76,7 +76,7 @@ export default function ActivityTable({ user }: ActivityProps) {
const [activityData, setActivityData] = useState<ActivityData>({});
const [loading, setLoading] = useState(true);
const [activeChild, setActiveChild] = useState('Viewed');
- // this api uses log for data which in some cases is can be empty
+ // this api uses log for data which in some cases can be empty
const recent = `/superset/recent_activity/${user.userId}/?limit=5`;
const getFilterTitle = (e: MapProps) => {
@@ -181,6 +181,7 @@ export default function ActivityTable({ user }: ActivityProps) {
));
};
if (loading) return <>loading ...</>;
+ console.log('activity', activeChild)
return (
<>
<>
@@ -194,7 +195,7 @@ export default function ActivityTable({ user }: ActivityProps) {
{activityData[activeChild]?.length > 0 ? (
<ActivityContainer>{renderActivity()}</ActivityContainer>
) : (
- <EmptyState tableName="RECENTS" tab="Mine" />
+ <EmptyState tableName="RECENTS" tab={activeChild} />
)}
</>
</>
diff --git a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
index fe06a18..00aff9b 100644
--- a/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/EmptyState.tsx
@@ -63,9 +63,19 @@ export default function EmptyState({ tableName, tab }: EmptyStateProps) {
CHARTS: '/chart/list',
SAVED_QUERIES: '/savedqueryview/list/',
};
- const Mine = (
+ const tableIcon = {
+ RECENTS: 'union.png',
+ DASHBOARDS: 'empty-dashboard.png',
+ CHARTS: 'empty-charts.png',
+ SAVED_QUERIES: 'empty-queries.png',
+ };
+ const mine = (
<div>
- <div>{`No ${tableName.toLowerCase()} yet`}</div>
+ <div>{`No ${
+ tableName === 'SAVED_QUERIES'
+ ? 'saved queries'
+ : tableName.toLowerCase()
+ } yet`}</div>
<Button
buttonStyle="primary"
onClick={() => {
@@ -75,7 +85,7 @@ export default function EmptyState({ tableName, tab }: EmptyStateProps) {
<IconContainer>
<Icon name="plus-small" />{' '}
{tableName === 'SAVED_QUERIES'
- ? 'SQL LAB QUERY'
+ ? 'SQL QUERY'
: tableName
.split('')
.slice(0, tableName.length - 1)
@@ -86,15 +96,19 @@ export default function EmptyState({ tableName, tab }: EmptyStateProps) {
);
const span = (
<div className="no-recents">
- Recently viewed charts, dashboards, and saved queries will appear here
+ Recently {tab?.toLowerCase()} charts, dashboards, and saved queries will
+ appear here
</div>
);
- if (tab === 'Mine') {
+ if (tab === 'Mine' || tableName === 'RECENTS') {
return (
<Container>
- <img src="/static/assets/images/union.png" alt="union.png" />
- {tableName === 'RECENTS' ? span : Mine}
+ <img
+ src={`/static/assets/images/${tableIcon[tableName]}`}
+ alt={`${tableName}`}
+ />
+ {tableName === 'RECENTS' ? span : mine}
</Container>
);
}
@@ -111,7 +125,7 @@ export default function EmptyState({ tableName, tab }: EmptyStateProps) {
}}
>
SEE ALL{' '}
- {tableName === 'SAVED_QUERIES' ? 'SQL LAB QUERIES' : tableName }
+ {tableName === 'SAVED_QUERIES' ? 'SQL LAB QUERIES' : tableName}
</Button>
</div>
</Container>
diff --git a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx
index 7f7464b..9e95167 100644
--- a/superset-frontend/src/views/CRUD/welcome/Welcome.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/Welcome.tsx
@@ -20,7 +20,6 @@ import React from 'react';
import { styled, t } from '@superset-ui/core';
import { Collapse } from 'src/common/components';
import { User } from 'src/types/bootstrapTypes';
-import Icon from 'src/components/Icon';
import ActivityTable from './ActivityTable';
import ChartTable from './ChartTable';