pkdotson commented on a change in pull request #11206: URL: https://github.com/apache/incubator-superset/pull/11206#discussion_r509788611
########## File path: superset-frontend/src/views/CRUD/welcome/EmptyState.tsx ########## @@ -0,0 +1,119 @@ +/** + * 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 Button from 'src/components/Button'; +import { styled } from '@superset-ui/core'; +import Icon from 'src/components/Icon'; +import { IconContainer } from '../utils'; + +interface EmptyStateProps { + tableName: string; + tab?: string; +} + +const Container = styled.div` + display: flex; + flex-direction: column; + justify-content: center; + img { + width: 114px; + display: block; + margin: 0 auto; + } + div:nth-child(2) { + text-align: center; + margin-top: 15px; + color: ${({ theme }) => theme.colors.grayscale.dark1}; + font-weight: 400; + } + button { + margin: 0 auto; + padding: 6px 27px; + margin-top: 10px; + svg { + color: white; + } + } +`; + +export default function EmptyState({ tableName, tab }: EmptyStateProps) { + const mineRedirects = { + DASHBOARDS: '/dashboard/new', + CHARTS: '/chart/add', + SAVED_QUERIES: '/superset/sqllab', + }; + const favRedirects = { + DASHBOARDS: '/dashboard/list/', + CHARTS: '/chart/list', + SAVED_QUERIES: '/savedqueryview/list/', + }; + const Mine = ( + <div> + <div>{`No ${tableName.toLowerCase()} yet`}</div> + <Button + buttonStyle="primary" + onClick={() => { + window.location = mineRedirects[tableName]; + }} + > + <IconContainer> + <Icon name="plus-small" />{' '} + {tableName === 'SAVED_QUERIES' + ? 'SQL LAB QUERY' + : tableName + .split('') + .slice(0, tableName.length - 1) + .join('')}{' '} + </IconContainer> + </Button> + </div> + ); + const span = ( + <div className="no-recents"> + Recently viewed charts, dashboards, and saved queries will appear here + </div> + ); + + if (tab === 'Mine') { + return ( + <Container> + <img src="/static/assets/images/union.png" alt="union.png" /> Review comment: Yes REUSE! I'll change over to <Empty>! ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
