Skip to content

Commit

Permalink
Fix autofixable linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-stupakov committed Apr 22, 2024
1 parent 3931a3c commit 9423ada
Show file tree
Hide file tree
Showing 51 changed files with 312 additions and 281 deletions.
8 changes: 6 additions & 2 deletions web-app/client/src/atoms/MFDTaskAtom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { atom } from 'jotai';
import { MFDOrderingParameter, OrderDirection, Pagination } from 'types/globalTypes';
import {
MFDOrderingParameter,
OrderDirection,
Pagination,
} from 'types/globalTypes';

export type MFDHighlight = {
index: number;
Expand Down Expand Up @@ -53,7 +57,7 @@ export const MFDAtomDefaultValuesWithParams = (
clusterIndex = 0,
limit = 0,
parameter = MFDOrderingParameter.MAXIMUM_DISTANCE,
orderDirection = OrderDirection.ASC
orderDirection = OrderDirection.ASC,
) => ({
...MFDAtomDefaultValues,
taskID,
Expand Down
8 changes: 4 additions & 4 deletions web-app/client/src/components/DatasetItem/DatasetItem.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { FC, useState } from 'react';
import styles from './DatasetItem.module.scss';
import Button from '@components/Button';
import moment from 'moment';
import { getDatasetsInfo_datasets_data } from '@graphql/operations/queries/__generated__/getDatasetsInfo';
import prettyBytes from 'pretty-bytes';
import { FC, useState } from 'react';
import FileIcon from '@assets/icons/file.svg?component';
import Button from '@components/Button';
import { getDatasetsInfo_datasets_data } from '@graphql/operations/queries/__generated__/getDatasetsInfo';
import FilePropertiesModal from './FilePropertiesModal';
import styles from './DatasetItem.module.scss';

interface Props {
data: getDatasetsInfo_datasets_data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FC } from 'react';
import { FilePropsList } from '@components/FilePropertiesModal/tabs/PropertiesTab';
import ModalContainer, { ModalProps } from '@components/ModalContainer';
import { AllowedDataset } from 'types/algorithms';
import styles from './FilePropertiesModal.module.scss';
import { FilePropsList } from '@components/FilePropertiesModal/tabs/PropertiesTab';

type Props = ModalProps & { data: AllowedDataset };

Expand Down
5 changes: 4 additions & 1 deletion web-app/client/src/components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
PrimitiveType,
} from 'types/globalTypes';

export type Sorting = FDOrderingParameter | CFDOrderingParameter | AROrderingParameter;
export type Sorting =
| FDOrderingParameter
| CFDOrderingParameter
| AROrderingParameter;

export type FiltersFields = {
ordering: Sorting;
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import classNames from 'classnames';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import ListIcon from '@assets/icons/list.svg?component';
import Button from '@components/Button';
import NavBar from '@components/NavBar';
import { useAuthContext } from '@hooks/useAuthContext';
import useModal from '@hooks/useModal';
import styles from './Header.module.scss';
import Link from 'next/link';

const Header = () => {
const { user, signOut } = useAuthContext();
Expand Down
4 changes: 2 additions & 2 deletions web-app/client/src/components/Inputs/DateTime/DateTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
} from 'react';
import ReactDateTime from 'react-datetime';
import 'react-datetime/css/react-datetime.css';
import CalendarIcon from '@assets/icons/calendar.svg?component';
import { InputPropsBase } from '@components/Inputs';
import OutsideClickObserver from '@components/OutsideClickObserver';
import Tooltip from '@components/Tooltip';
import styles from './DateTime.module.scss';
// eslint-disable-next-line import/order
import moment, { Moment } from 'moment';
import CalendarIcon from '@assets/icons/calendar.svg?component';

type Value = [Moment | undefined, Moment | undefined];

Expand All @@ -37,7 +37,7 @@ const formatValue = (value: Value) => {
};

const inferValue = (str: string): Value => {
let parts = str.split(' ~ ');
const parts = str.split(' ~ ');

if (parts.length !== 2) {
throw new Error();
Expand Down
10 changes: 5 additions & 5 deletions web-app/client/src/components/Inputs/NumberRange/NumberRange.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import cn from 'classnames';
import Slider, { SliderProps } from 'rc-slider';
import {
ChangeEventHandler,
FC,
Expand All @@ -7,12 +9,10 @@ import {
useId,
useState,
} from 'react';
import cn from 'classnames';
import { InputPropsBase } from '..';
import styles from './NumberRange.module.scss';
import Tooltip from '@components/Tooltip';
import Slider, { SliderProps } from 'rc-slider';
import colors from '@constants/colors';
import { InputPropsBase } from '..';
import styles from './NumberRange.module.scss';

type Value = [number | undefined, number | undefined];

Expand All @@ -31,7 +31,7 @@ const formatValue = (value: Value): string => {
};

const inferValue = (str: string): Value => {
let parts = str.split(' ~ ');
const parts = str.split(' ~ ');

if (parts.length !== 2) {
throw new Error();
Expand Down
20 changes: 10 additions & 10 deletions web-app/client/src/components/TabLayout/TabLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { FC, ReactNode, useEffect, useMemo, useState } from 'react';
import { Text } from '@components/Inputs';
import styles from './TabLayout.module.scss';
import Button from '@components/Button';
import FilterIcon from '@assets/icons/filter.svg?component';
import OrderingIcon from '@assets/icons/ordering.svg?component';
import { DefaultValues, FormProvider, useForm } from 'react-hook-form';
import { OrderDirection, Pagination } from 'types/globalTypes';
import { DocumentNode, useLazyQuery } from '@apollo/client';
import useFormPersist from '@hooks/useFormPersist';
import _ from 'lodash';
import { useRouter } from 'next/router';
import PaginationComponent from '@components/Pagination';
import { FC, ReactNode, useEffect, useMemo, useState } from 'react';
import { DefaultValues, FormProvider, useForm } from 'react-hook-form';
import { Subscription } from 'react-hook-form/dist/utils/createSubject';
import FilterIcon from '@assets/icons/filter.svg?component';
import OrderingIcon from '@assets/icons/ordering.svg?component';
import Button from '@components/Button';
import { Text } from '@components/Inputs';
import PaginationComponent from '@components/Pagination';
import useFormPersist from '@hooks/useFormPersist';
import { OrderDirection, Pagination } from 'types/globalTypes';
import styles from './TabLayout.module.scss';

type BaseQueryResult<TItem> = {
data: TItem[] | null;
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/TabsLayout/TabsLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import classNames from 'classnames';
import { ReactNode } from 'react';
import Background from '@assets/backgrounds/reports.svg?component';
import { TabConfig } from 'src/routes/UserCabinet/tabs';
import { FCWithChildren } from 'types/react';
import styles from './TabsLayout.module.scss';
import { ReactNode } from 'react';

interface Props {
pageClass?: string;
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/TabsLayout/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './TabsLayout';
export { default } from './TabsLayout';
24 changes: 12 additions & 12 deletions web-app/client/src/components/TaskItem/TaskItem.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import {
getTasksInfo_tasksInfo_data,
getTasksInfo_tasksInfo_data_state,
} from '@graphql/operations/queries/__generated__/getTasksInfo';
import moment from 'moment';
import Link from 'next/link';
import { FC, ReactNode, SVGProps } from 'react';
import CompletedIcon from '@assets/icons/check-fill.svg?component';
import Logo from '@assets/icons/desbordante.svg?component';
import ResourceLimitIcon from '@assets/icons/resources-limit.svg?component';
import ServerErrorIcon from '@assets/icons/server-error.svg?component';
import QueueIcon from '@assets/icons/users-queue.svg?component';
import Logo from '@assets/icons/desbordante.svg?component';
import styles from './TaskItem.module.scss';
import Button from '@components/Button';
import colors from '@constants/colors';
import primitiveInfo from '@constants/primitiveInfoType';
import {
getTasksInfo_tasksInfo_data,
getTasksInfo_tasksInfo_data_state,
} from '@graphql/operations/queries/__generated__/getTasksInfo';
import { showError, showSuccess } from '@utils/toasts';
import {
MainPrimitiveType,
PrimitiveType,
TaskProcessStatusType,
} from 'types/globalTypes';
import Button from '@components/Button';
import { showError, showSuccess } from '@utils/toasts';
import primitiveInfo from '@constants/primitiveInfoType';
import moment from 'moment';
import Link from 'next/link';
import colors from '@constants/colors';
import styles from './TaskItem.module.scss';

const getIcon = (state: getTasksInfo_tasksInfo_data_state): ReactNode => {
const props = {
Expand Down
52 changes: 26 additions & 26 deletions web-app/client/src/graphql/operations/queries/getDatasetsInfo.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { gql } from '@apollo/client';

export const GET_DATASETS_INFO = gql`
query getDatasetsInfo($props: DatasetsQueryProps!) {
datasets(props: $props) {
total
data {
fileID
originalFileName
fileFormat {
inputFormat
tidColumnIndex
itemColumnIndex
hasTid
}
fileSize
createdAt
isBuiltIn
hasHeader
delimiter
fileName
supportedPrimitives
rowsCount
countOfColumns
numberOfUses
user {
fullName
}
}
query getDatasetsInfo($props: DatasetsQueryProps!) {
datasets(props: $props) {
total
data {
fileID
originalFileName
fileFormat {
inputFormat
tidColumnIndex
itemColumnIndex
hasTid
}
fileSize
createdAt
isBuiltIn
hasHeader
delimiter
fileName
supportedPrimitives
rowsCount
countOfColumns
numberOfUses
user {
fullName
}
}
}
}
`;
60 changes: 30 additions & 30 deletions web-app/client/src/graphql/operations/queries/getTasksInfo.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import { gql } from '@apollo/client';

export const GET_TASKS_INFO = gql`
query getTasksInfo($props: TasksQueryProps!) {
tasksInfo(props: $props) {
total
data {
taskID
state {
... on TaskState {
user {
fullName
}
processStatus
phaseName
currentPhase
progress
maxPhase
isExecuted
elapsedTime
createdAt
}
}
query getTasksInfo($props: TasksQueryProps!) {
tasksInfo(props: $props) {
total
data {
taskID
state {
... on TaskState {
user {
fullName
}
processStatus
phaseName
currentPhase
progress
maxPhase
isExecuted
elapsedTime
createdAt
}
}
data {
baseConfig {
algorithmName
type
}
}
data {
baseConfig {
algorithmName
type
}
}
dataset {
originalFileName
}
}
dataset {
originalFileName
}
}
}
}
`;
26 changes: 13 additions & 13 deletions web-app/client/src/graphql/operations/queries/getUsersInfo.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { gql } from '@apollo/client';

export const GET_USERS_INFO = gql`
query getUsersInfo($props: UsersQueryProps!) {
users(props: $props) {
total
data {
userID
createdAt
fullName
email
country
companyOrAffiliation
occupation
}
}
query getUsersInfo($props: UsersQueryProps!) {
users(props: $props) {
total
data {
userID
createdAt
fullName
email
country
companyOrAffiliation
occupation
}
}
}
`;
9 changes: 7 additions & 2 deletions web-app/client/src/hooks/useFormPersist.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { useEffect, useRef } from 'react';
import { FieldValues, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
import {
FieldValues,
UseFormReset,
UseFormSetValue,
UseFormWatch,
} from 'react-hook-form';

const useFormPersist = <TFields extends FieldValues>(
name: string,
Expand Down Expand Up @@ -48,7 +53,7 @@ const useFormPersist = <TFields extends FieldValues>(

useEffect(() => {
initialRender.current = false;
}, [])
}, []);
};

export default useFormPersist;
Loading

0 comments on commit 9423ada

Please sign in to comment.