Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Sort import path #131

Merged
merged 2 commits into from
Aug 18, 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
4 changes: 2 additions & 2 deletions src/components/atoms/AddListItemButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import AddIcon from "@material-ui/icons/Add";
import { makeStyles } from "@material-ui/core/styles";
import { theme as themeInstance } from "@dataware-tools/app-common";
import { makeStyles } from "@material-ui/core/styles";
import AddIcon from "@material-ui/icons/Add";

type Props = {
classes: ReturnType<typeof useStyles>;
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/FileMenuItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sleep } from "@dataware-tools/app-common";
import AddCircleIcon from "@material-ui/icons/AddCircle";
import { Story } from "@storybook/react";
import { FileMenuItem, FileMenuItemProps } from "./FileMenuItem";
import AddCircleIcon from "@material-ui/icons/AddCircle";
import { sleep } from "@dataware-tools/app-common";

export default {
component: FileMenuItem,
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/FileMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MenuItem from "@material-ui/core/MenuItem";
import { ReactNode, useState } from "react";
import { Spacer } from "@dataware-tools/app-common";
import CircularProgress from "@material-ui/core/CircularProgress";
import MenuItem from "@material-ui/core/MenuItem";
import { ReactNode, useState } from "react";

type ComponentProps = {
pending: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/RenderToggleByAction.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from "react";
import { UserActionType } from "utils";
import { useIsActionPermitted } from "globalStates";
import { UserActionType } from "utils";

type ContainerProps = {
required: UserActionType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Breadcrumbs } from ".";
import HomeIcon from "@material-ui/icons/Home";
import WhatshotIcon from "@material-ui/icons/Whatshot";
import { Breadcrumbs } from ".";

export default {
component: Breadcrumbs,
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/Breadcrumbs/BreadcrumbsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
import Typography from "@material-ui/core/Typography";
import Link from "@material-ui/core/Link";
import Typography from "@material-ui/core/Typography";
import { makeStyles, Theme, createStyles } from "@material-ui/core/styles";
import React from "react";
import { useHistory } from "react-router-dom";

type ComponentProps = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/Breadcrumbs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import Breadcrumbs from "@material-ui/core/Breadcrumbs";
import React from "react";

import { BreadcrumbsItem, BreadcrumbsItemProps } from "./BreadcrumbsItem";

Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/DatabaseMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DatabaseMenu } from "./DatabaseMenu";
import { useState, MouseEventHandler } from "react";
import { DatabaseMenu } from "./DatabaseMenu";

export default {
component: DatabaseMenu,
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/DatabaseMenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { MouseEvent, useState } from "react";
import { SquareIconButton } from "@dataware-tools/app-common";
import { MoreHoriz as MoreIcon } from "@material-ui/icons";
import { MouseEvent, useState } from "react";
import {
DatabaseMenu,
DatabaseMenuProps,
} from "components/molecules/DatabaseMenu";
import { SquareIconButton } from "@dataware-tools/app-common";

type Props = {
onOpen: (event: MouseEvent<HTMLDivElement>) => void | Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/FileMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileMenu } from "./FileMenu";
import { useState, MouseEventHandler } from "react";
import { FileMenu } from "./FileMenu";

export default {
component: FileMenu,
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/FileMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import PageviewIcon from "@material-ui/icons/Pageview";
import Menu from "@material-ui/core/Menu";
import DeleteIcon from "@material-ui/icons/Delete";
import FileDownloadIcon from "@material-ui/icons/FileDownload";
import EditIcon from "@material-ui/icons/Edit";
import Menu from "@material-ui/core/Menu";
import FileDownloadIcon from "@material-ui/icons/FileDownload";
import PageviewIcon from "@material-ui/icons/Pageview";
import { FileMenuItem, FileMenuItemProps } from "components/atoms/FileMenuItem";
import { RenderToggleByAction } from "components/atoms/RenderToggleByAction";

Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/FilePreviewer/AudioPreviewer.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useEffect, useRef, useState } from "react";
import Button from "@material-ui/core/Button";
import { floatToTimecodeString } from "utils";
import { ToolBar } from "@dataware-tools/app-common";
import Button from "@material-ui/core/Button";
import { useEffect, useRef, useState } from "react";
import WaveSurfer from "wavesurfer.js";
// @ts-expect-error Type-definitions are missing
import CursorPlugin from "wavesurfer.js/dist/plugin/wavesurfer.cursor.js";
// @ts-expect-error Type-definitions are missing
import TimelinePlugin from "wavesurfer.js/dist/plugin/wavesurfer.timeline.js";
import { floatToTimecodeString } from "utils";

type AudioPreviewerProps = { url: string };
export const AudioPreviewer = ({ url }: AudioPreviewerProps): JSX.Element => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/molecules/FilePreviewer/CsvPreviewer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState, useEffect } from "react";
import Table from "@material-ui/core/Table";
import { parse } from "papaparse";
import TableBody from "@material-ui/core/TableBody";
import TableCell from "@material-ui/core/TableCell";
import TableContainer from "@material-ui/core/TableContainer";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core/TableRow";
import TableCell from "@material-ui/core/TableCell";
import TableBody from "@material-ui/core/TableBody";
import { parse } from "papaparse";
import { useState, useEffect } from "react";

type CsvPreviewerProps = { url: string };
export const CsvPreviewer = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jobStore } from "@dataware-tools/app-common";
import Button from "@material-ui/core/Button";
import { SoloSelect } from "components/molecules/SoloSelect";
import { JobTemplateInfo } from "./JobTemplateInfo";
import { SoloSelect } from "components/molecules/SoloSelect";

type JobSubmitterProps = {
jobTemplateId?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { jobStore } from "@dataware-tools/app-common";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableRow from "@material-ui/core/TableRow";
import TableCell from "@material-ui/core/TableCell";
import TableRow from "@material-ui/core/TableRow";
import React from "react";

type JobInfoViewProps = {
jobTemplate: jobStore.JobTemplateModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
jobStore,
ErrorMessageProps,
} from "@dataware-tools/app-common";
import Button from "@material-ui/core/Button";
import Alert from "@material-ui/core/Alert";
import AlertTitle from "@material-ui/core/AlertTitle";
import Button from "@material-ui/core/Button";
import Popover from "@material-ui/core/Popover";
import { MouseEvent, useState } from "react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { metaStore } from "@dataware-tools/app-common";
import { useState, useEffect } from "react";
import SyntaxHighlighter from "react-syntax-highlighter";
import { metaStore } from "@dataware-tools/app-common";

const languages = {
js: "javascript",
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/FilePreviewer/TextPreviewer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import TextField from "@material-ui/core/TextField";
import { useState, useEffect } from "react";

type TextPreviewerProps = { url: string };
export const TextPreviewer = ({ url }: TextPreviewerProps): JSX.Element => {
Expand Down
14 changes: 7 additions & 7 deletions src/components/molecules/FilePreviewer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { metaStore } from "@dataware-tools/app-common";
import dynamic from "next/dynamic";
import { CsvPreviewer } from "./CsvPreviewer";
import { DefaultPreviewer } from "./DefaultPreviewer";
import { TextPreviewer } from "./TextPreviewer";
import { VideoPreviewer } from "./VideoPreviewer";
import { metaStore } from "@dataware-tools/app-common";
import { FileDownloadURLInjector } from "components/organisms/FileDownloadUrlInjector";
import { ImagePreviewer } from "./ImagePreviewer";
import { MarkdownPreviewer } from "./MarkDownPreviewer";
import { RosbagPreviewer } from "./RosbagPreviewer";
import {
SourceCodePreviewer,
extensions as sourceCodeExtensions,
} from "./SourceCodePreviewer";
import { MarkdownPreviewer } from "./MarkDownPreviewer";
import { ImagePreviewer } from "./ImagePreviewer";
import { CsvPreviewer } from "./CsvPreviewer";
import { TextPreviewer } from "./TextPreviewer";
import { VideoPreviewer } from "./VideoPreviewer";
import { FileDownloadURLInjector } from "components/organisms/FileDownloadUrlInjector";
const AudioPreviewer = dynamic<any>(
() => import("./AudioPreviewer").then((module) => module.AudioPreviewer),
{ ssr: false }
Expand Down
8 changes: 4 additions & 4 deletions src/components/molecules/InputConfigListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { makeStyles } from "@material-ui/core/styles";
import Select from "@material-ui/core/Select";
import MenuItem from "@material-ui/core/MenuItem";
import { Spacer } from "@dataware-tools/app-common";
import IconButton from "@material-ui/core/IconButton";
import MenuItem from "@material-ui/core/MenuItem";
import Select from "@material-ui/core/Select";
import { makeStyles } from "@material-ui/core/styles";
import DeleteIcon from "@material-ui/icons/Delete";
import { ElemCenteringFlexDiv } from "components/atoms/ElemCenteringFlexDiv";
import React, { ReactNode } from "react";
import { ElemCenteringFlexDiv } from "components/atoms/ElemCenteringFlexDiv";
import { DatabaseColumnsConfigType } from "utils";

type ValueType = Required<
Expand Down
8 changes: 4 additions & 4 deletions src/components/molecules/OptionSharingSelectsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Select, { SelectProps } from "@material-ui/core/Select";
import MenuItem, { MenuItemProps } from "@material-ui/core/MenuItem";
import IconButton from "@material-ui/core/IconButton";
import DeleteIcon from "@material-ui/icons/Delete";
import MenuItem, { MenuItemProps } from "@material-ui/core/MenuItem";
import Select, { SelectProps } from "@material-ui/core/Select";
import { makeStyles } from "@material-ui/core/styles";
import { ElemCenteringFlexDiv } from "components/atoms/ElemCenteringFlexDiv";
import DeleteIcon from "@material-ui/icons/Delete";
import React from "react";
import { ElemCenteringFlexDiv } from "components/atoms/ElemCenteringFlexDiv";

type ActionType = "update" | "delete";
type OptionsType = { label: string; value: string }[];
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/SoloSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Select, { SelectProps } from "@material-ui/core/Select";
import MenuItem, { MenuItemProps } from "@material-ui/core/MenuItem";
import React from "react";
import { Spacer, theme as themeInstance } from "@dataware-tools/app-common";
import MenuItem, { MenuItemProps } from "@material-ui/core/MenuItem";
import Select, { SelectProps } from "@material-ui/core/Select";
import { makeStyles } from "@material-ui/core/styles";
import React from "react";

type OptionsType = { label: string; value: string }[];
type Props = { classes: ReturnType<typeof useStyles> } & ContainerProps;
Expand Down
12 changes: 6 additions & 6 deletions src/components/organisms/ControlledDatabaseMenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { useAuth0 } from "@auth0/auth0-react";
import { metaStore, theme as themeInstance } from "@dataware-tools/app-common";
import { makeStyles } from "@material-ui/core/styles";
import { useState } from "react";
import { DatabaseDeleteModal } from "./DatabaseDeleteModal";
import { DatabaseEditModal } from "./DatabaseEditModal";
import {
DatabaseMenuButton,
DatabaseMenuButtonProps,
Expand All @@ -7,14 +13,8 @@ import { ExportMetadataModal } from "components/organisms/ExportMetadataModal";
import { InputConfigEditModal } from "components/organisms/InputConfigEditModal";
import { SearchConfigEditModal } from "components/organisms/SearchConfigEditModal";
import { SecretConfigEditModal } from "components/organisms/SecretConfigEditModal";
import { useState } from "react";
import { useIsActionPermitted } from "globalStates";
import { DatabaseEditModal } from "./DatabaseEditModal";
import { metaStore, theme as themeInstance } from "@dataware-tools/app-common";
import { useGetDatabase } from "utils";
import { useAuth0 } from "@auth0/auth0-react";
import { DatabaseDeleteModal } from "./DatabaseDeleteModal";
import { makeStyles } from "@material-ui/core/styles";

type Props = {
menu: DatabaseMenuButtonProps["menu"];
Expand Down
16 changes: 8 additions & 8 deletions src/components/organisms/DatabaseConfigModal.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {
InputConfigEditModal,
ConfigNameType as InputConfigNameType,
} from "components/organisms/InputConfigEditModal";
import {
DisplayConfigEditModal,
ConfigNameType as DisplayConfigNameType,
} from "components/organisms/DisplayConfigEditModal";
import {
ExportMetadataModal,
ConfigNameType as ExportMetadataNameType,
} from "components/organisms/ExportMetadataModal";
import {
InputConfigEditModal,
ConfigNameType as InputConfigNameType,
} from "components/organisms/InputConfigEditModal";
import {
SearchConfigEditModal,
ConfigNameType as SearchConfigNameType,
Expand All @@ -14,10 +18,6 @@ import {
SecretConfigEditModal,
ConfigNameType as SecretConfigNameType,
} from "components/organisms/SecretConfigEditModal";
import {
ExportMetadataModal,
ConfigNameType as ExportMetadataNameType,
} from "components/organisms/ExportMetadataModal";

type ContainerProps = {
open: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/DatabaseListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { metaStore } from "@dataware-tools/app-common";
import ListItem from "@material-ui/core/ListItem";
import ListItemIcon from "@material-ui/core/ListItemIcon";
import StorageIcon from "@material-ui/icons/Storage";
import ListItemText from "@material-ui/core/ListItemText";
import StorageIcon from "@material-ui/icons/Storage";

type DatabaseType = metaStore.DatabaseModel;
type Props = ContainerProps;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/FileDownloadUrlInjector.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useAuth0 } from "@auth0/auth0-react";
import {
LoadingIndicator,
API_ROUTE,
metaStore,
} from "@dataware-tools/app-common";
import { useAuth0 } from "@auth0/auth0-react";
import { useCreateJwtToDownloadFile } from "utils";

type FileType = metaStore.FileModel;
Expand Down
1 change: 0 additions & 1 deletion src/components/organisms/FileEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
isEditableColumnName,
} from "utils";


type ContainerProps = {
open: boolean;
onClose: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/FileListItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import List from "@material-ui/core/List";
import { Story } from "@storybook/react";
import { FileListItem, FileListItemProps } from "./FileListItem";
import List from "@material-ui/core/List";

export default {
component: FileListItem,
Expand Down
4 changes: 2 additions & 2 deletions src/components/organisms/FileListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { metaStore, theme as themeInstance } from "@dataware-tools/app-common";
import ListItem from "@material-ui/core/ListItem";
import ListItemIcon from "@material-ui/core/ListItemIcon";
import DescriptionIcon from "@material-ui/icons/Description";
import ListItemText from "@material-ui/core/ListItemText";
import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction";
import ListItemText from "@material-ui/core/ListItemText";
import DescriptionIcon from "@material-ui/icons/Description";
import { MouseEvent, useState } from "react";
import { FileMenu } from "components/molecules/FileMenu";
import { getFileName } from "utils";
Expand Down
14 changes: 9 additions & 5 deletions src/components/organisms/FilePreviewModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Dialog, { DialogProps } from "@material-ui/core/Dialog";
import {
DialogBody,
DialogContainer,
Expand All @@ -8,14 +7,15 @@ import {
DialogWrapper,
usePrevious,
} from "@dataware-tools/app-common";
import { FileType } from "components/organisms/FileListItem";
import { FilePreviewer } from "components/molecules/FilePreviewer";
import Button from "@material-ui/core/Button";
import Dialog, { DialogProps } from "@material-ui/core/Dialog";
import { makeStyles } from "@material-ui/core/styles";
import ArrowBack from "@material-ui/icons/ArrowBack";
import ArrowForward from "@material-ui/icons/ArrowForward";
import { useState, useEffect } from "react";
import { FilePreviewer } from "components/molecules/FilePreviewer";
import { FileType } from "components/organisms/FileListItem";
import { getFileName } from "utils";
import { makeStyles } from "@material-ui/core/styles";

export type FilePreviewModalPresentationProps = {
goNextFile: () => void;
Expand All @@ -29,7 +29,11 @@ export type FilePreviewModalProps = DialogProps & {
height?: string;
};

const useStyles = makeStyles({ nonCapitalize: { textTransform: "none", } });
const useStyles = makeStyles({
nonCapitalize: {
textTransform: "none",
},
});

export const FilePreviewModalPresentation = (
props: FilePreviewModalPresentationProps
Expand Down
Loading