Skip to content

Commit

Permalink
lint fixed consistent-type-import
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjeevLakhwani committed Aug 26, 2024
1 parent cc7392f commit afc0183
Show file tree
Hide file tree
Showing 57 changed files with 116 additions and 103 deletions.
2 changes: 1 addition & 1 deletion src/js/components/Beacon/AssemblyIdSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Form, Select } from 'antd';
import { FormField, BeaconAssemblyIds } from '@/types/beacon';
import { type FormField, type BeaconAssemblyIds } from '@/types/beacon';
import { DEFAULT_TRANSLATION } from '@/constants/configConstants';

const AssemblyIdSelect = ({ field, beaconAssemblyIds, disabled }: AssemblyIdSelectProps) => {
Expand Down
10 changes: 8 additions & 2 deletions src/js/components/Beacon/BeaconQueryUi.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState, ReactNode, useCallback, useMemo } from 'react';
import React, { useEffect, useState, type ReactNode, useCallback, useMemo } from 'react';
import { useAppSelector, useAppDispatch, useTranslationDefault, useQueryWithAuthIfAllowed } from '@/hooks';
import { Button, Card, Col, Form, Row, Space, Tooltip, Typography } from 'antd';
import { InfoCircleOutlined } from '@ant-design/icons';
Expand All @@ -8,7 +8,13 @@ import BeaconSearchResults from './BeaconSearchResults';
import BeaconErrorMessage from './BeaconErrorMessage';
import VariantsForm from './VariantsForm';
import { makeBeaconQuery } from '@/features/beacon/beaconQuery.store';
import { BeaconQueryPayload, FormFilter, FormValues, PayloadFilter, PayloadVariantsQuery } from '@/types/beacon';
import {
type BeaconQueryPayload,
type FormFilter,
type FormValues,
type PayloadFilter,
type PayloadVariantsQuery,
} from '@/types/beacon';
import {
WRAPPER_STYLE,
FORM_ROW_GUTTERS,
Expand Down
12 changes: 9 additions & 3 deletions src/js/components/Beacon/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import React, { useEffect, useState } from 'react';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { Button, Form, Select, Space } from 'antd';
import { CloseOutlined } from '@ant-design/icons';
import { FormInstance } from 'antd/es/form';
import { FormFilter, FilterOption, FilterPullDownKey, FilterPullDownValue, GenericOptionType } from '@/types/beacon';
import { Section, Field } from '@/types/search';
import { type FormInstance } from 'antd/es/form';
import {
type FormFilter,
type FilterOption,
type FilterPullDownKey,
type FilterPullDownValue,
type GenericOptionType,
} from '@/types/beacon';
import { type Section, type Field } from '@/types/search';

// TODOs:
// any search key (eg "sex") selected in one filter should not available in other
Expand Down
8 changes: 4 additions & 4 deletions src/js/components/Beacon/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Dispatch, SetStateAction } from 'react';
import React, { type Dispatch, type SetStateAction } from 'react';
import { useAppSelector } from '@/hooks';
import { useTranslation } from 'react-i18next';
import { Button, Form, Space, Tooltip } from 'antd';
import { FormInstance } from 'antd/es/form';
import { FormFilter } from '@/types/beacon';
import { SearchFieldResponse } from '@/types/search';
import { type FormInstance } from 'antd/es/form';
import { type FormFilter } from '@/types/beacon';
import { type SearchFieldResponse } from '@/types/search';
import { DEFAULT_TRANSLATION } from '@/constants/configConstants';
import Filter from './Filter';

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Beacon/VariantInput.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Form, Input } from 'antd';
import { FormField } from '@/types/beacon';
import { type FormField } from '@/types/beacon';
import { DEFAULT_TRANSLATION } from '@/constants/configConstants';

const VariantInput = ({ field, disabled }: VariantInputProps) => {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Beacon/VariantsForm.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { CSSProperties } from 'react';
import React, { type CSSProperties } from 'react';
import { useTranslation } from 'react-i18next';
import { Col, Row } from 'antd';
import VariantInput from './VariantInput';
import AssemblyIdSelect from './AssemblyIdSelect';
import { BeaconAssemblyIds } from '@/types/beacon';
import { type BeaconAssemblyIds } from '@/types/beacon';
import { DEFAULT_TRANSLATION } from '@/constants/configConstants';

// form state has to be one of these:
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Overview/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { BarChart, Histogram, PieChart } from 'bento-charts';
import { ChoroplethMap } from 'bento-charts/dist/maps';

import { CHART_HEIGHT, PIE_CHART_HEIGHT } from '@/constants/overviewConstants';
import { ChartData } from '@/types/data';
import { type ChartData } from '@/types/data';
import {
CHART_TYPE_BAR,
CHART_TYPE_HISTOGRAM,
CHART_TYPE_CHOROPLETH,
CHART_TYPE_PIE,
ChartConfig,
type ChartConfig,
} from '@/types/chartConfig';
import { useAppSelector } from '@/hooks';
import { scopeToUrl } from '@/utils/router';
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Overview/ChartCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Chart from './Chart';
import CustomEmpty from '../Util/CustomEmpty';
import { CHART_HEIGHT, BOX_SHADOW } from '@/constants/overviewConstants';
import { useElementWidth, useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ChartDataField } from '@/types/data';
import { type ChartDataField } from '@/types/data';

const CARD_STYLE: React.CSSProperties = { height: '415px', borderRadius: '11px', ...BOX_SHADOW };
const ROW_EMPTY_STYLE: React.CSSProperties = { height: `${CHART_HEIGHT}px` };
Expand Down
6 changes: 3 additions & 3 deletions src/js/components/Overview/Drawer/ChartTree.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { ReactNode, useMemo } from 'react';
import React, { type ReactNode, useMemo } from 'react';
import { useDispatch } from 'react-redux';
import { InputNumber, Tree, TreeProps } from 'antd';
import { InputNumber, Tree, type TreeProps } from 'antd';

import { rearrange, setDisplayedCharts, setChartWidth } from '@/features/data/data.store';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ChartDataField } from '@/types/data';
import { type ChartDataField } from '@/types/data';

interface MappedChartItem {
title: ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Overview/Drawer/ManageChartsDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import { Button, Drawer, DrawerProps, Flex, Space, Typography } from 'antd';
import { Button, Drawer, type DrawerProps, Flex, Space, Typography } from 'antd';
const { Title } = Typography;

import ChartTree from './ChartTree';

import { ChartDataField } from '@/types/data';
import { type ChartDataField } from '@/types/data';
import { useAppSelector, useAppDispatch, useTranslationCustom, useTranslationDefault } from '@/hooks';
import { hideAllSectionCharts, setAllDisplayedCharts, resetLayout } from '@/features/data/data.store';

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Overview/LastIngestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEFAULT_TRANSLATION } from '@/constants/configConstants';
import { useAppSelector } from '@/hooks';
import { getDataTypeLabel } from '@/types/dataTypes';

import { LastIngestionDataTypeResponse } from '@/types/lastIngestionDataTypeResponse';
import { type LastIngestionDataTypeResponse } from '@/types/lastIngestionDataTypeResponse';
import { BOX_SHADOW } from '@/constants/overviewConstants';

const LastIngestionInfo: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Overview/OverviewDisplayData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useCallback, useMemo } from 'react';
import { useDispatch } from 'react-redux';

import { disableChart } from '@/features/data/data.store';
import { ChartDataField } from '@/types/data';
import { type ChartDataField } from '@/types/data';
import ChartCard from './ChartCard';
import { CHART_WIDTH, GRID_GAP } from '@/constants/overviewConstants';

Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Overview/OverviewSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Typography, Space } from 'antd';

import OverviewDisplayData from './OverviewDisplayData';
import { useTranslationCustom } from '@/hooks';
import { ChartDataField } from '@/types/data';
import { type ChartDataField } from '@/types/data';

const OverviewSection = ({ title, chartData }: { title: string; chartData: ChartDataField[] }) => {
const t = useTranslationCustom();
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Provenance/DatasetProvenance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PublicationsTable from './Tables/PublicationsTable';
import CreatedByTable from './Tables/CreatedByTable';
import DownloadDats from './DownloadDats';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ProvenanceStoreDataset } from '@/types/provenance';
import { type ProvenanceStoreDataset } from '@/types/provenance';
import { BOX_SHADOW } from '@/constants/overviewConstants';

const { Item } = Descriptions;
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Provenance/DownloadDats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { Button, Space } from 'antd';
import { DownloadOutlined } from '@ant-design/icons';
import { useTranslationDefault } from '@/hooks';
import { ProvenanceStoreDataset } from '@/types/provenance';
import { type ProvenanceStoreDataset } from '@/types/provenance';

const DownloadDats = ({ metadata }: { metadata: ProvenanceStoreDataset }) => {
const t = useTranslationDefault();
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Provenance/Tables/AcknowledgesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import BaseProvenanceTable from './BaseProvenanceTable';
import LinkIfUrl from '../../Util/LinkIfUrl';
import { Acknowledge } from '@/types/provenance';
import { type Acknowledge } from '@/types/provenance';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';

const AcknowledgesTable = ({ acknowledges }: AcknowledgesTableProps) => {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Provenance/Tables/BaseProvenanceTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Table, TableProps } from 'antd';
import { AnyObject } from 'antd/es/_util/type';
import { Table, type TableProps } from 'antd';
import { type AnyObject } from 'antd/es/_util/type';

const BaseProvenanceTable = <T extends AnyObject>(props: TableProps<T>) => (
<Table bordered={true} pagination={false} size="small" {...props} />
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Provenance/Tables/CreatedByTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Tag } from 'antd';

import BaseProvenanceTable from './BaseProvenanceTable';
import { ProvenanceStoreDataset } from '@/types/provenance';
import { type ProvenanceStoreDataset } from '@/types/provenance';
import { useTranslationDefault, useTranslationCustom } from '@/hooks';

const CreatedByTable = ({ creators }: CreatedByTableProps) => {
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Provenance/Tables/DistributionsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useMemo } from 'react';

import { Tag, Typography } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { type ColumnsType } from 'antd/es/table';
const { Link } = Typography;

import BaseProvenanceTable from './BaseProvenanceTable';
import { useTranslationDefault, useTranslationCustom } from '@/hooks';
import { Distribution, ProvenanceStoreDataset } from '@/types/provenance';
import { type Distribution, type ProvenanceStoreDataset } from '@/types/provenance';

const DistributionsTable = ({ distributions }: DistributionsTableProps) => {
const t = useTranslationCustom();
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Provenance/Tables/ExtraPropertiesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Fragment, useMemo } from 'react';

import { ColumnsType } from 'antd/es/table';
import { type ColumnsType } from 'antd/es/table';

import BaseProvenanceTable from '@/components/Provenance/Tables/BaseProvenanceTable';
import LinkIfUrl from '../../Util/LinkIfUrl';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ExtraProperty, ProvenanceStoreDataset } from '@/types/provenance';
import { type ExtraProperty, type ProvenanceStoreDataset } from '@/types/provenance';

const ExtraPropertiesTable = ({ extraProperties }: ExtraPropertiesTableProps) => {
const t = useTranslationCustom();
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Provenance/Tables/IsAboutTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Tag } from 'antd';
import BaseProvenanceTable from './BaseProvenanceTable';
import LinkIfUrl from '../../Util/LinkIfUrl';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ProvenanceStoreDataset } from '@/types/provenance';
import { type ProvenanceStoreDataset } from '@/types/provenance';

const IsAboutTable = ({ isAbout }: IsAboutTableProps) => {
const t = useTranslationCustom();
Expand Down
6 changes: 3 additions & 3 deletions src/js/components/Provenance/Tables/PublicationsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { ReactNode, useMemo } from 'react';
import React, { type ReactNode, useMemo } from 'react';

import { Typography } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { type ColumnsType } from 'antd/es/table';

import BaseProvenanceTable from './BaseProvenanceTable';
import LinkIfUrl from '../../Util/LinkIfUrl';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { Person, PrimaryPublication, ProvenanceStoreDataset } from '@/types/provenance';
import { type Person, type PrimaryPublication, type ProvenanceStoreDataset } from '@/types/provenance';

import { stringIsDOI, stringIsURL } from '@/utils/strings';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import BaseProvenanceTable from './BaseProvenanceTable';
import { useTranslationCustom, useTranslationDefault } from '@/hooks';
import { ProvenanceStoreDataset } from '@/types/provenance';
import { type ProvenanceStoreDataset } from '@/types/provenance';

const SpatialCoverageTable = ({ spatialCoverage }: SpatialCoverageTableProps) => {
const t = useTranslationCustom();
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Search/MakeQueryOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { addQueryParam, makeGetKatsuPublic, removeQueryParam } from '@/features/
import SelectOption from './SelectOption';

import { useAppDispatch, useAppSelector, useTranslationCustom, useTranslationDefault } from '@/hooks';
import { Field } from '@/types/search';
import { type Field } from '@/types/search';

const MakeQueryOption = ({ queryField }: MakeQueryOptionProps) => {
const t = useTranslationCustom();
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Search/SearchFieldsStack.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import MakeQueryOption from './MakeQueryOption';
import { Space } from 'antd';
import { Field } from '@/types/search';
import { type Field } from '@/types/search';

const SearchFieldsStack = ({ queryFields }: SearchFieldStackProps) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Search/SearchResultsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CustomEmpty from '../Util/CustomEmpty';
import ExpSvg from '../Util/ExpSvg';
import { BOX_SHADOW, COUNTS_FILL, PIE_CHART_HEIGHT } from '@/constants/overviewConstants';
import { useTranslationDefault, useTranslationCustom } from '@/hooks';
import { ChartData } from '@/types/data';
import { type ChartData } from '@/types/data';

const SearchResultsPane = ({
isFetchingData,
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Util/ConditionalWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Space } from 'antd';
import React, { ComponentType, memo, PropsWithChildren } from 'react';
import React, { type ComponentType, memo, type PropsWithChildren } from 'react';

export const VerticalSpaceWrapper = memo(function VerticalSpaceWrapper({ children }: PropsWithChildren) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/js/constants/beaconConstants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties } from 'react';
import { type CSSProperties } from 'react';
import { BOX_SHADOW } from '@/constants/overviewConstants';

export const WRAPPER_STYLE: CSSProperties = {
Expand Down
2 changes: 1 addition & 1 deletion src/js/constants/overviewConstants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HexColor } from 'bento-charts';
import { type HexColor } from 'bento-charts';

export const COUNTS_FILL = '#75787a';

Expand Down
4 changes: 2 additions & 2 deletions src/js/features/beacon/beaconConfig.store.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import axios from 'axios';
import { BeaconConfigResponse, BeaconAssemblyIds } from '@/types/beacon';
import { RootState } from '@/store';
import { type BeaconConfigResponse, type BeaconAssemblyIds } from '@/types/beacon';
import { type RootState } from '@/store';
import { printAPIError } from '@/utils/error.util';
import { BEACON_URL } from '@/config';

Expand Down
6 changes: 3 additions & 3 deletions src/js/features/beacon/beaconQuery.store.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import axios from 'axios';
import { makeAuthorizationHeader } from 'bento-auth-js';
import { RootState } from '@/store';
import { type RootState } from '@/store';
import { serializeChartData } from '@/utils/chart';
import { beaconApiError } from '@/utils/beaconApiError';
import { BeaconQueryPayload, BeaconQueryResponse } from '@/types/beacon';
import { ChartData } from '@/types/data';
import { type BeaconQueryPayload, type BeaconQueryResponse } from '@/types/beacon';
import { type ChartData } from '@/types/data';
import { BEACON_URL } from '@/config';

const beaconIndividualsEndpoint = BEACON_URL + '/individuals';
Expand Down
8 changes: 4 additions & 4 deletions src/js/features/config/config.store.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createSlice, createAsyncThunk, PayloadAction } from '@reduxjs/toolkit';
import { createSlice, createAsyncThunk, type PayloadAction } from '@reduxjs/toolkit';
import axios from 'axios';
import { katsuPublicRulesUrl } from '@/constants/configConstants';
import { printAPIError } from '@/utils/error.util';
import { ServiceInfoStore, ServicesResponse } from '@/types/services';
import { RootState } from '@/store';
import { type ServiceInfoStore, type ServicesResponse } from '@/types/services';
import { type RootState } from '@/store';
import { PUBLIC_URL } from '@/config';
import { DiscoveryRules } from '@/types/configResponse';
import { type DiscoveryRules } from '@/types/configResponse';

export const makeGetConfigRequest = createAsyncThunk<DiscoveryRules, void, { rejectValue: string; state: RootState }>(
'config/getConfigData',
Expand Down
2 changes: 1 addition & 1 deletion src/js/features/content/content.store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';
import { createAsyncThunk, createSlice, type PayloadAction } from '@reduxjs/toolkit';
import axios from 'axios';
import { partialAboutUrl } from '@/constants/contentConstants';
import { printAPIError } from '@/utils/error.util';
Expand Down
8 changes: 4 additions & 4 deletions src/js/features/data/data.store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';
import { createAsyncThunk, createSlice, type PayloadAction } from '@reduxjs/toolkit';

import { makeGetDataRequestThunk } from './makeGetDataRequest.thunk';
import { Sections } from '@/types/data';
import { Counts } from '@/types/overviewResponse';
import { QueryState } from '@/features/search/query.store';
import { type Sections } from '@/types/data';
import { type Counts } from '@/types/overviewResponse';
import { type QueryState } from '@/features/search/query.store';

export const populateClickable = createAsyncThunk<string[], void, { state: { query: QueryState } }>(
'data/populateClickable',
Expand Down
8 changes: 4 additions & 4 deletions src/js/features/data/makeGetDataRequest.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { verifyData, saveValue, getValue, convertSequenceAndDisplayData } from '

import { DEFAULT_CHART_WIDTH, LOCALSTORAGE_CHARTS_KEY } from '@/constants/overviewConstants';
import { serializeChartData } from '@/utils/chart';
import { ChartConfig } from '@/types/chartConfig';
import { ChartDataField, LocalStorageData, Sections } from '@/types/data';
import { Counts, OverviewResponse } from '@/types/overviewResponse';
import { type ChartConfig } from '@/types/chartConfig';
import { type ChartDataField, type LocalStorageData, type Sections } from '@/types/data';
import { type Counts, type OverviewResponse } from '@/types/overviewResponse';
import { printAPIError } from '@/utils/error.util';
import { RootState } from '@/store';
import { type RootState } from '@/store';

export const makeGetDataRequestThunk = createAsyncThunk<
{ sectionData: Sections; counts: Counts; defaultData: Sections },
Expand Down
Loading

0 comments on commit afc0183

Please sign in to comment.