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:12 UTC
[incubator-superset] 29/33: more updates..
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 23f5424e88371339d35c5a2d138f781abd8fa6ff
Author: Phillip Kelley-Dotson <pk...@yahoo.com>
AuthorDate: Sun Oct 25 21:38:07 2020 -0700
more updates..
---
superset-frontend/src/components/Menu/SubMenu.tsx | 24 +++++++++++-----------
.../src/views/CRUD/dashboard/DashboardCard.tsx | 18 ++++++++++++++++
.../src/views/CRUD/welcome/ActivityTable.tsx | 2 +-
.../src/views/CRUD/welcome/ChartTable.tsx | 3 +--
.../src/views/CRUD/welcome/DashboardTable.tsx | 4 +---
.../src/views/CRUD/welcome/SavedQueries.tsx | 4 +---
superset/dashboards/api.py | 2 +-
7 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/superset-frontend/src/components/Menu/SubMenu.tsx b/superset-frontend/src/components/Menu/SubMenu.tsx
index e9c7976..f58c2bd 100644
--- a/superset-frontend/src/components/Menu/SubMenu.tsx
+++ b/superset-frontend/src/components/Menu/SubMenu.tsx
@@ -98,7 +98,7 @@ export interface ButtonProps {
export interface SubMenuProps {
buttons?: Array<ButtonProps>;
name?: string;
- children?: MenuChild[];
+ tabs?: MenuChild[];
activeChild?: MenuChild['name'];
/* If usesRouter is true, a react-router <Link> component will be used instead of href.
* ONLY set usesRouter to true if SubMenu is wrapped in a react-router <Router>;
@@ -122,16 +122,16 @@ const SubMenu: React.FunctionComponent<SubMenuProps> = props => {
<Navbar.Brand>{props.name}</Navbar.Brand>
</Navbar.Header>
<Nav>
- {props.children &&
- props.children.map(child => {
- if ((props.usesRouter || hasHistory) && !!child.usesRouter) {
+ {props.tabs &&
+ props.tabs.map(tab => {
+ if ((props.usesRouter || hasHistory) && !!tab.usesRouter) {
return (
<li
- className={child.name === props.activeChild ? 'active' : ''}
- key={`${child.label}`}
+ className={tab.name === props.activeChild ? 'active' : ''}
+ key={`${tab.label}`}
>
<div>
- <Link to={child.url}>{child.label}</Link>
+ <Link to={tab.url}>{tab.label}</Link>
</div>
</li>
);
@@ -140,12 +140,12 @@ const SubMenu: React.FunctionComponent<SubMenuProps> = props => {
return (
<MenuItem
className="no-router"
- active={child.name === props.activeChild}
- key={`${child.label}`}
- href={child.url}
- onClick={child.onClick}
+ active={tab.name === props.activeChild}
+ key={`${tab.label}`}
+ href={tab.url}
+ onClick={tab.onClick}
>
- {child.label}
+ {tab.label}
</MenuItem>
);
})}
diff --git a/superset-frontend/src/views/CRUD/dashboard/DashboardCard.tsx b/superset-frontend/src/views/CRUD/dashboard/DashboardCard.tsx
index 6058563..135246e 100644
--- a/superset-frontend/src/views/CRUD/dashboard/DashboardCard.tsx
+++ b/superset-frontend/src/views/CRUD/dashboard/DashboardCard.tsx
@@ -1,3 +1,21 @@
+/**
+ * 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 { SupersetClient, t } from '@superset-ui/core';
import rison from 'rison';
diff --git a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
index 5d80003..56e5d70 100644
--- a/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/ActivityTable.tsx
@@ -191,7 +191,7 @@ export default function ActivityTable({ user }: ActivityProps) {
<SubMenu
activeChild={activeChild}
// eslint-disable-next-line react/no-children-prop
- children={tabs}
+ tabs={tabs}
/>
<>
{activityData[activeChild]?.length > 0 ? (
diff --git a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx
index e12e204..1979a18 100644
--- a/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/ChartTable.tsx
@@ -107,9 +107,8 @@ function ChartTable({
<SubMenu
activeChild={chartFilter}
- name=""
// eslint-disable-next-line react/no-children-prop
- children={[
+ tabs={[
{
name: 'Favorite',
label: t('Favorite'),
diff --git a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
index 15bc8a3..84ec1c6 100644
--- a/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/DashboardTable.tsx
@@ -123,9 +123,7 @@ function DashboardTable({
<>
<SubMenu
activeChild={dashboardFilter}
- name=""
- // eslint-disable-next-line react/no-children-prop
- children={[
+ tabs={[
{
name: 'Favorite',
label: t('Favorite'),
diff --git a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
index 563ac14..be35192 100644
--- a/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
+++ b/superset-frontend/src/views/CRUD/welcome/SavedQueries.tsx
@@ -170,9 +170,7 @@ const SavedQueries = ({
)}
<SubMenu
activeChild={queryFilter}
- name=""
- // eslint-disable-next-line react/no-children-prop
- children={[
+ tabs={[
{
name: 'Favorite',
label: t('Favorite'),
diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py
index 0e93159..cba494a 100644
--- a/superset/dashboards/api.py
+++ b/superset/dashboards/api.py
@@ -157,7 +157,7 @@ class DashboardRestApi(BaseSupersetModelRestApi):
"owners",
"published",
"slug",
- "changed_by"
+ "changed_by",
)
search_filters = {
"dashboard_title": [DashboardTitleOrSlugFilter],