Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead code / unused references #370

Merged
merged 2 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions datahub/webapp/__tests__/ui/JsonViewer.test.js

This file was deleted.

21 changes: 0 additions & 21 deletions datahub/webapp/__tests__/ui/__snapshots__/JsonViewer.test.js.snap

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`matches enzyme snapshots matches snapshot - error 1`] = `
<Message
className=""
title="Error"
type="error"
>
Expand Down
2 changes: 1 addition & 1 deletion datahub/webapp/components/AppAdmin/AdminAnnouncement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
border: var(--border);
margin: 8px 0px;
padding: 16px;
.SingleCRUD {
.GenericCRUD {
width: 100%;
}
}
Expand Down
11 changes: 4 additions & 7 deletions datahub/webapp/components/AppAdmin/AdminAnnouncement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useDataFetch } from 'hooks/useDataFetch';

import { Card } from 'ui/Card/Card';
import { Icon } from 'ui/Icon/Icon';
import { SingleCRUD } from 'ui/GenericCRUD/SingleCRUD';
import { GenericCRUD } from 'ui/GenericCRUD/GenericCRUD';
import { Loading } from 'ui/Loading/Loading';
import { SimpleField } from 'ui/FormikField/SimpleField';

Expand Down Expand Up @@ -76,10 +76,7 @@ export const AdminAnnouncement: React.FunctionComponent = () => {
[]
);

const renderAnnouncementItem = (
item: IAdminAnnouncement,
onChange: (fieldName: string, fieldValue: any) => void
) => (
const renderAnnouncementItem = () => (
<div className="AdminForm">
<div className="AdminForm-main">
<div className="AdminForm-left">
Expand Down Expand Up @@ -114,7 +111,7 @@ export const AdminAnnouncement: React.FunctionComponent = () => {
const getCardDOM = () =>
announcements.map((ann) => (
<Card key={ann.id} title="" width="100%" flexRow>
<SingleCRUD
<GenericCRUD
item={ann}
deleteItem={deleteAnnouncement}
updateItem={saveAnnouncement(ann.id)}
Expand All @@ -129,7 +126,7 @@ export const AdminAnnouncement: React.FunctionComponent = () => {
if (displayNewForm) {
return (
<div className="AdminAnnouncement-new-form horizontal-space-between">
<SingleCRUD<Partial<IAdminAnnouncement>>
<GenericCRUD<Partial<IAdminAnnouncement>>
item={{
message: undefined,
url_regex: undefined,
Expand Down
11 changes: 4 additions & 7 deletions datahub/webapp/components/AppAdmin/AdminEnvironment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { UserEnvironmentEditor } from 'components/UserEnvironmentEditor/UserEnvi
import { AdminAuditLogButton } from 'components/AdminAuditLog/AdminAuditLogButton';

import { Card } from 'ui/Card/Card';
import { SingleCRUD } from 'ui/GenericCRUD/SingleCRUD';
import { GenericCRUD } from 'ui/GenericCRUD/GenericCRUD';
import { Level } from 'ui/Level/Level';
import { SimpleField } from 'ui/FormikField/SimpleField';

Expand Down Expand Up @@ -109,10 +109,7 @@ export const AdminEnvironment: React.FunctionComponent<IProps> = ({
return data as IAdminEnvironment;
}, []);

const renderEnvironmentItem = (
item: IAdminEnvironment,
onChange: (fieldName: string, fieldValue: any) => void
) => {
const renderEnvironmentItem = (item: IAdminEnvironment) => {
const logDOM = item.id != null && (
<div className="right-align">
<AdminAuditLogButton itemType="environment" itemId={item.id} />
Expand Down Expand Up @@ -199,7 +196,7 @@ export const AdminEnvironment: React.FunctionComponent<IProps> = ({
return (
<div className="AdminEnvironment">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={newEnvironment}
createItem={createEnvironment}
renderItem={renderEnvironmentItem}
Expand Down Expand Up @@ -248,7 +245,7 @@ export const AdminEnvironment: React.FunctionComponent<IProps> = ({
return (
<div className="AdminEnvironment">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={environmentItem}
deleteItem={deleteEnvironment}
updateItem={saveEnvironment}
Expand Down
11 changes: 3 additions & 8 deletions datahub/webapp/components/AppAdmin/AdminMetastore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Icon } from 'ui/Icon/Icon';
import { Level } from 'ui/Level/Level';
import { Loading } from 'ui/Loading/Loading';
import { SimpleField } from 'ui/FormikField/SimpleField';
import { SingleCRUD } from 'ui/GenericCRUD/SingleCRUD';
import { GenericCRUD } from 'ui/GenericCRUD/GenericCRUD';
import {
TemplatedForm,
getDefaultFormValue,
Expand All @@ -33,11 +33,6 @@ import { Tabs } from 'ui/Tabs/Tabs';

import './AdminMetastore.scss';

const metastoreSchema = Yup.object().shape({
name: Yup.string().min(1).max(255),
loader: Yup.string().required(),
});

interface IAdminACLControl {
type?: 'denylist' | 'allowlist';
tables?: string[];
Expand Down Expand Up @@ -424,7 +419,7 @@ export const AdminMetastore: React.FunctionComponent<IProps> = ({
return (
<div className="AdminMetastore">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={newMetastore}
createItem={createMetastore}
renderItem={renderMetastoreItem}
Expand Down Expand Up @@ -477,7 +472,7 @@ export const AdminMetastore: React.FunctionComponent<IProps> = ({
return (
<div className="AdminMetastore">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={metastoreItem}
deleteItem={deleteMetastore}
onDelete={() => history.push('/admin/metastore/')}
Expand Down
6 changes: 3 additions & 3 deletions datahub/webapp/components/AppAdmin/AdminQueryEngine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AdminAuditLogButton } from 'components/AdminAuditLog/AdminAuditLogButto

import { Card } from 'ui/Card/Card';
import { Loading } from 'ui/Loading/Loading';
import { SingleCRUD } from 'ui/GenericCRUD/SingleCRUD';
import { GenericCRUD } from 'ui/GenericCRUD/GenericCRUD';
import {
SmartForm,
TemplatedForm,
Expand Down Expand Up @@ -383,7 +383,7 @@ export const AdminQueryEngine: React.FunctionComponent<IProps> = ({
return (
<div className="AdminQueryEngine">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={newQueryEngine}
createItem={createQueryEngine}
renderItem={renderQueryEngineItem}
Expand Down Expand Up @@ -436,7 +436,7 @@ export const AdminQueryEngine: React.FunctionComponent<IProps> = ({
return (
<div className="AdminQueryEngine">
<div className="AdminForm">
<SingleCRUD
<GenericCRUD
item={queryEngineItem}
deleteItem={deleteQueryEngine}
updateItem={saveQueryEngine}
Expand Down
2 changes: 1 addition & 1 deletion datahub/webapp/components/AppAdmin/AppAdmin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
}
}

.SingleCRUD-invalid-msg {
.GenericCRUD-invalid-msg {
margin-left: 8px;
}

Expand Down
10 changes: 0 additions & 10 deletions datahub/webapp/components/AppFooterButton/AppFooterButton.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TooltipDirection } from 'const/tooltip';
import { useDataFetch } from 'hooks/useDataFetch';

import { IconButton, IconButtonProps } from 'ui/Button/IconButton';
import { BoardItemType, IBoard, IBoardRaw } from 'const/board';
import { BoardItemType, IBoardRaw } from 'const/board';

import { Popover, PopoverLayout } from 'ui/Popover/Popover';
import { BoardCreateUpdateModal } from 'components/BoardCreateUpdateModal/BoardCreateUpdateModal';
Expand Down
5 changes: 2 additions & 3 deletions datahub/webapp/components/BoardList/BoardList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState, useMemo, useRef } from 'react';
import React, { useEffect, useState, useMemo } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import classNames from 'classnames';

Expand All @@ -9,9 +9,8 @@ import { SearchBar } from 'ui/SearchBar/SearchBar';
import { IconButton } from 'ui/Button/IconButton';
import { BoardCreateUpdateModal } from 'components/BoardCreateUpdateModal/BoardCreateUpdateModal';
import { InfinityScroll } from 'ui/InfinityScroll/InfinityScroll';
import { Icon } from 'ui/Icon/Icon';
import './BoardList.scss';
import { ListLink } from 'ui/Link/ListLink';
import './BoardList.scss';

interface IProps {
onBoardClick: (id: IBoard) => any;
Expand Down
2 changes: 1 addition & 1 deletion datahub/webapp/components/DataDoc/DataDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ function mapStateToProps(state: IStoreState, ownProps: IOwnProps) {
};
}

function mapDispatchToProps(dispatch: Dispatch, ownProps: IOwnProps) {
function mapDispatchToProps(dispatch: Dispatch) {
return {
openDataDoc: (id: number) => dispatch(openDataDoc(id)),
closeDataDoc: (id: number) => dispatch(closeDataDoc(id)),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState, useCallback } from 'react';
import React, { useState, useCallback } from 'react';
import { useResizeObserver } from 'hooks/useResizeObserver';

const isChrome = /chrome/.test(navigator.userAgent.toLowerCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ interface IProps {
onDownKeyPressed?: () => any;
onDeleteKeyPressed?: () => any;
}
interface IState {
queryExecutionId?: number;
statementExecutionId?: number;
showChartComposer: boolean;
}

export const DataDocChartCell: React.FunctionComponent<IProps> = ({
context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useRef, useCallback } from 'react';
import React, { useMemo, useRef } from 'react';

import { scrollToCell } from 'lib/data-doc/data-doc-utils';
import { IDataCell } from 'const/datadoc';
Expand All @@ -8,7 +8,6 @@ import { moveDataDocCell } from 'redux/dataDoc/action';
import { getScrollParent } from 'lib/utils';

import './DataDocContents.scss';
import { IDragItem } from 'ui/DraggableList/types';

const CELL_TEXT_LEN = 50;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import { useDrop } from 'react-dnd';
import { DataDocDraggableType, BoardDraggableType } from './navigatorConst';
import { IDragItem } from 'ui/DraggableList/types';
import { IBoardItem } from 'const/board';

export const DataDocNavigator: React.FC = () => {
const loadedFilterModes = useSelector(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import moment from 'moment';

import { ITaskStatusRecord } from 'const/schedule';
import { generateFormattedDate } from 'lib/utils/datetime';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react';
import React, { useEffect, useMemo } from 'react';

import { StatementExecutionStatus } from 'const/queryExecution';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React, {
useRef,
useEffect,
useCallback,
useMemo,
useContext,
} from 'react';
import classNames from 'classnames';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import classNames from 'classnames';
import { bind } from 'lodash-decorators';
import { connect } from 'react-redux';
import React from 'react';
Expand All @@ -7,7 +6,6 @@ import { IStoreState, Dispatch } from 'redux/store/types';
import * as dataDocActions from 'redux/dataDoc/action';
import * as dataDocSelectors from 'redux/dataDoc/selector';

import { UserAvatar } from 'components/UserBadge/UserAvatar';
import { DataDocViewersList } from 'components/DataDocViewersList/DataDocViewersList';
import './DataDocViewersBadge.scss';
import { Popover } from 'ui/Popover/Popover';
Expand Down
1 change: 0 additions & 1 deletion datahub/webapp/components/DataTableTags/DataTableTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
fetchTableTagItemsIfNeeded,
deleteTableTagItem,
} from 'redux/tag/action';
import * as searchActions from 'redux/search/action';
import { navigateWithinEnv } from 'lib/utils/query-string';

import { CreateDataTableTag } from './CreateDataTableTag';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export interface IDataTableViewColumnProps {
) => any;
}

export interface IDataTableViewColumnState {
filterString: string;
}

export const DataTableViewColumn: React.FunctionComponent<IDataTableViewColumnProps> = ({
updateDataColumnDescription,
table = null,
Expand Down
3 changes: 0 additions & 3 deletions datahub/webapp/components/DataTableViewMini/PanelSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ export interface IPanelSectionProps {
title: string;
hideIfNoContent?: boolean;
}
export interface IPanelSectionState {
isOpen: boolean;
}

const PanelContentWrapper = styled.div`
padding: 5px 32px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export interface IProps {
loadDataJobMetadata: (id: number) => any;
}

export interface IState {
parentTableIds: number[];
}

export const DataTableViewSourceQuery: React.FunctionComponent<IProps> = ({
dataLineages,
table,
Expand Down
Loading