Skip to content
Snippets Groups Projects
Unverified Commit 6233874e authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Remove flow from EE (#19236)

parent 8c611b88
No related branches found
No related tags found
No related merge requests found
Showing
with 40 additions and 73 deletions
...@@ -6,12 +6,6 @@ import { IndexLink } from "react-router"; ...@@ -6,12 +6,6 @@ import { IndexLink } from "react-router";
import Link from "metabase/components/Link"; import Link from "metabase/components/Link";
import cx from "classnames"; import cx from "classnames";
type Props = {
className?: string,
style?: { [key: string]: any },
children?: React.Element,
};
const AuditSidebarSection = ({ title, children }) => ( const AuditSidebarSection = ({ title, children }) => (
<div className="pb2"> <div className="pb2">
{title && <AuditSidebarSectionTitle title={title} />} {title && <AuditSidebarSectionTitle title={title} />}
...@@ -47,13 +41,13 @@ const AuditSidebarItem = ({ title, path }) => ( ...@@ -47,13 +41,13 @@ const AuditSidebarItem = ({ title, path }) => (
</div> </div>
); );
const AuditSidebar = ({ className, style, children }: Props) => ( const AuditSidebar = ({ className, style, children }) => (
<div style={style} className={cx("p4", className)}> <div style={style} className={cx("p4", className)}>
{children} {children}
</div> </div>
); );
const AuditAppSidebar = (props: Props) => ( const AuditAppSidebar = props => (
<AuditSidebar {...props}> <AuditSidebar {...props}>
<AuditSidebarSection title={t`People`}> <AuditSidebarSection title={t`People`}>
<AuditSidebarItem title={t`Team members`} path="/admin/audit/members" /> <AuditSidebarItem title={t`Team members`} path="/admin/audit/members" />
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import Link from "metabase/components/Link"; import Link from "metabase/components/Link";
import Icon from "metabase/components/Icon"; import Icon from "metabase/components/Icon";
type Props = { const OpenInMetabase = ({ ...props }) => (
to: string,
};
const OpenInMetabase = ({ ...props }: Props) => (
<Link {...props} className="link flex align-center" target="_blank"> <Link {...props} className="link flex align-center" target="_blank">
<Icon name="external" className="mr1" /> <Icon name="external" className="mr1" />
Open in Metabase Open in Metabase
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import SidebarLayout from "../components/SidebarLayoutFixedWidth"; import SidebarLayout from "../components/SidebarLayoutFixedWidth";
import AuditSidebar from "../components/AuditSidebar"; import AuditSidebar from "../components/AuditSidebar";
type Props = { const AuditApp = ({ children }) => (
children: React.Element,
};
const AuditApp = ({ children }: Props) => (
<SidebarLayout sidebar={<AuditSidebar />}> <SidebarLayout sidebar={<AuditSidebar />}>
<div>{children}</div> <div>{children}</div>
</SidebarLayout> </SidebarLayout>
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
...@@ -11,15 +12,9 @@ const DashboardWithData = DashboardData(Dashboard); ...@@ -11,15 +12,9 @@ const DashboardWithData = DashboardData(Dashboard);
import { AuditMode } from "../lib/mode"; import { AuditMode } from "../lib/mode";
import type { AuditCard } from "../types";
import { harmony } from "metabase/lib/colors"; import { harmony } from "metabase/lib/colors";
type Props = { const AuditDashboard = ({ cards, ...props }) => (
cards: AuditCard[],
};
const AuditDashboard = ({ cards, ...props }: Props) => (
<DashboardWithData <DashboardWithData
style={{ backgroundColor: "transparent", padding: 0 }} style={{ backgroundColor: "transparent", padding: 0 }}
// HACK: to get inline dashboards working quickly // HACK: to get inline dashboards working quickly
......
export const viewsByTime = (dashboardId: number) => ({ export const viewsByTime = dashboardId => ({
card: { card: {
name: "Views per day", name: "Views per day",
display: "line", display: "line",
...@@ -10,7 +10,7 @@ export const viewsByTime = (dashboardId: number) => ({ ...@@ -10,7 +10,7 @@ export const viewsByTime = (dashboardId: number) => ({
}, },
}); });
export const revisionHistory = (dashboardId: number) => ({ export const revisionHistory = dashboardId => ({
card: { card: {
name: "Revision history", name: "Revision history",
display: "table", display: "table",
...@@ -31,7 +31,7 @@ export const revisionHistory = (dashboardId: number) => ({ ...@@ -31,7 +31,7 @@ export const revisionHistory = (dashboardId: number) => ({
}, },
}); });
export const cards = (dashboardId: number) => ({ export const cards = dashboardId => ({
card: { card: {
name: "Cards", name: "Cards",
display: "table", display: "table",
...@@ -43,7 +43,7 @@ export const cards = (dashboardId: number) => ({ ...@@ -43,7 +43,7 @@ export const cards = (dashboardId: number) => ({
}, },
}); });
export const auditLog = (dashboardId: number) => ({ export const auditLog = dashboardId => ({
card: { card: {
name: "Audit log", name: "Audit log",
display: "table", display: "table",
......
...@@ -40,7 +40,7 @@ export const mostCommonQuestions = () => ({ ...@@ -40,7 +40,7 @@ export const mostCommonQuestions = () => ({
}, },
}); });
export const table = (searchString?: string) => ({ export const table = searchString => ({
card: { card: {
name: "Dashboards", name: "Dashboards",
display: "table", display: "table",
......
export const auditLog = (databaseId: number) => ({ export const auditLog = databaseId => ({
card: { card: {
name: "Audit log", name: "Audit log",
display: "table", display: "table",
......
...@@ -54,7 +54,7 @@ export const queryExecutionsByTime = () => ({ ...@@ -54,7 +54,7 @@ export const queryExecutionsByTime = () => ({
}, },
}); });
export const table = (searchString?: string) => ({ export const table = searchString => ({
card: { card: {
name: "Databases", name: "Databases",
display: "table", display: "table",
......
export const details = (queryHash: string) => ({ export const details = queryHash => ({
card: { card: {
name: "Query details", name: "Query details",
display: "table", display: "table",
......
...@@ -40,7 +40,7 @@ export const averageExecutionTime = questionId => ({ ...@@ -40,7 +40,7 @@ export const averageExecutionTime = questionId => ({
}, },
}); });
export const revisionHistory = (questionId: number) => ({ export const revisionHistory = questionId => ({
card: { card: {
name: "Revision history", name: "Revision history",
display: "table", display: "table",
...@@ -61,7 +61,7 @@ export const revisionHistory = (questionId: number) => ({ ...@@ -61,7 +61,7 @@ export const revisionHistory = (questionId: number) => ({
}, },
}); });
export const auditLog = (questionId: number) => ({ export const auditLog = questionId => ({
card: { card: {
name: "Audit log", name: "Audit log",
display: "table", display: "table",
......
...@@ -22,7 +22,7 @@ export const slowestSchemas = () => ({ ...@@ -22,7 +22,7 @@ export const slowestSchemas = () => ({
}, },
}); });
export const table = (searchString?: string) => ({ export const table = searchString => ({
card: { card: {
name: "Schemas", name: "Schemas",
display: "table", display: "table",
......
export const auditLog = (tableId: number) => ({ export const auditLog = tableId => ({
card: { card: {
name: "Audit log", name: "Audit log",
display: "table", display: "table",
......
...@@ -30,7 +30,7 @@ export const leastQueried = () => ({ ...@@ -30,7 +30,7 @@ export const leastQueried = () => ({
}, },
}); });
export const table = (searchString?: string) => ({ export const table = searchString => ({
card: { card: {
name: "Tables", name: "Tables",
display: "table", display: "table",
......
export const table = (userId: number) => ({ export const table = userId => ({
card: { card: {
name: "Most-viewed Dashboards", name: "Most-viewed Dashboards",
display: "table", display: "table",
...@@ -10,7 +10,7 @@ export const table = (userId: number) => ({ ...@@ -10,7 +10,7 @@ export const table = (userId: number) => ({
}, },
}); });
export const mostViewedDashboards = (userId: number) => ({ export const mostViewedDashboards = userId => ({
card: { card: {
name: "Most-viewed Dashboards", name: "Most-viewed Dashboards",
display: "row", display: "row",
...@@ -27,7 +27,7 @@ export const mostViewedDashboards = (userId: number) => ({ ...@@ -27,7 +27,7 @@ export const mostViewedDashboards = (userId: number) => ({
}, },
}); });
export const mostViewedQuestions = (userId: number) => ({ export const mostViewedQuestions = userId => ({
card: { card: {
name: "Most-viewed Queries", name: "Most-viewed Queries",
display: "row", display: "row",
...@@ -44,7 +44,7 @@ export const mostViewedQuestions = (userId: number) => ({ ...@@ -44,7 +44,7 @@ export const mostViewedQuestions = (userId: number) => ({
}, },
}); });
export const objectViewsByTime = (userId: number) => ({ export const objectViewsByTime = userId => ({
card: { card: {
name: "Query views", name: "Query views",
display: "line", display: "line",
...@@ -69,7 +69,7 @@ export const objectViewsByTime = (userId: number) => ({ ...@@ -69,7 +69,7 @@ export const objectViewsByTime = (userId: number) => ({
], ],
}); });
export const queryViews = (userId: number) => ({ export const queryViews = userId => ({
card: { card: {
name: "Query views", name: "Query views",
display: "table", display: "table",
...@@ -91,7 +91,7 @@ export const queryViews = (userId: number) => ({ ...@@ -91,7 +91,7 @@ export const queryViews = (userId: number) => ({
}, },
}); });
export const dashboardViews = (userId: number) => ({ export const dashboardViews = userId => ({
card: { card: {
name: "Dashboard views", name: "Dashboard views",
display: "table", display: "table",
...@@ -110,7 +110,7 @@ export const dashboardViews = (userId: number) => ({ ...@@ -110,7 +110,7 @@ export const dashboardViews = (userId: number) => ({
}, },
}); });
export const createdDashboards = (userId: number) => ({ export const createdDashboards = userId => ({
card: { card: {
name: "Created dashboards", name: "Created dashboards",
display: "table", display: "table",
...@@ -122,7 +122,7 @@ export const createdDashboards = (userId: number) => ({ ...@@ -122,7 +122,7 @@ export const createdDashboards = (userId: number) => ({
}, },
}); });
export const createdQuestions = (userId: number) => ({ export const createdQuestions = userId => ({
card: { card: {
name: "Created questions", name: "Created questions",
display: "table", display: "table",
...@@ -134,7 +134,7 @@ export const createdQuestions = (userId: number) => ({ ...@@ -134,7 +134,7 @@ export const createdQuestions = (userId: number) => ({
}, },
}); });
export const downloads = (userId: number) => ({ export const downloads = userId => ({
card: { card: {
name: "Downloads", name: "Downloads",
display: "table", display: "table",
......
...@@ -88,7 +88,7 @@ export const queryExecutionTimePerUser = () => ({ ...@@ -88,7 +88,7 @@ export const queryExecutionTimePerUser = () => ({
}, },
}); });
export const table = (searchString?: string) => ({ export const table = searchString => ({
card: { card: {
name: "Users", name: "Users",
display: "table", display: "table",
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import AuditContent from "../components/AuditContent"; import AuditContent from "../components/AuditContent";
...@@ -6,11 +7,7 @@ import AuditTableWithSearch from "../containers/AuditTableWithSearch"; ...@@ -6,11 +7,7 @@ import AuditTableWithSearch from "../containers/AuditTableWithSearch";
import * as DashboardCards from "../lib/cards/dashboards"; import * as DashboardCards from "../lib/cards/dashboards";
type Props = { const AuditDashboards = props => (
params: { [key: string]: string },
};
const AuditDashboards = (props: Props) => (
<AuditContent {...props} title="Dashboards" tabs={AuditDashboards.tabs} /> <AuditContent {...props} title="Dashboards" tabs={AuditDashboards.tabs} />
); );
......
...@@ -8,11 +8,7 @@ import EntityName from "metabase/entities/containers/EntityName"; ...@@ -8,11 +8,7 @@ import EntityName from "metabase/entities/containers/EntityName";
import * as DatabaseDetailCards from "../lib/cards/database_detail"; import * as DatabaseDetailCards from "../lib/cards/database_detail";
type Props = { const AuditDatabaseDetail = ({ params, ...props }) => {
params: { [key: string]: string },
};
const AuditDatabaseDetail = ({ params, ...props }: Props) => {
const databaseId = parseInt(params.databaseId); const databaseId = parseInt(params.databaseId);
return ( return (
<AuditContent <AuditContent
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import AuditContent from "../components/AuditContent"; import AuditContent from "../components/AuditContent";
...@@ -6,11 +7,7 @@ import AuditTableWithSearch from "../containers/AuditTableWithSearch"; ...@@ -6,11 +7,7 @@ import AuditTableWithSearch from "../containers/AuditTableWithSearch";
import * as DatabasesCards from "../lib/cards/databases"; import * as DatabasesCards from "../lib/cards/databases";
type Props = { const AuditDatabases = props => (
params: { [key: string]: string },
};
const AuditDatabases = (props: Props) => (
<AuditContent {...props} title="Databases" tabs={AuditDatabases.tabs} /> <AuditContent {...props} title="Databases" tabs={AuditDatabases.tabs} />
); );
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import AuditContent from "../components/AuditContent"; import AuditContent from "../components/AuditContent";
...@@ -6,11 +7,7 @@ import AuditTable from "../containers/AuditTable"; ...@@ -6,11 +7,7 @@ import AuditTable from "../containers/AuditTable";
import * as DownloadsCards from "../lib/cards/downloads"; import * as DownloadsCards from "../lib/cards/downloads";
type Props = { const AuditDownloads = props => (
params: { [key: string]: string },
};
const AuditDownloads = (props: Props) => (
<AuditContent {...props} title="Downloads" tabs={AuditDownloads.tabs} /> <AuditContent {...props} title="Downloads" tabs={AuditDownloads.tabs} />
); );
......
/* eslint-disable react/prop-types */
import React from "react"; import React from "react";
import AuditContent from "../components/AuditContent"; import AuditContent from "../components/AuditContent";
...@@ -5,11 +6,7 @@ import AuditDashboard from "../containers/AuditDashboard"; ...@@ -5,11 +6,7 @@ import AuditDashboard from "../containers/AuditDashboard";
import * as UsersCards from "../lib/cards/users"; import * as UsersCards from "../lib/cards/users";
type Props = { const AuditOverview = props => (
params: { [key: string]: string },
};
const AuditOverview = (props: Props) => (
<AuditContent {...props} title="Overview"> <AuditContent {...props} title="Overview">
<AuditDashboard <AuditDashboard
cards={[ cards={[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment