diff --git a/website/src/components/DataUseTerms/EditDataUseTermsModal.tsx b/website/src/components/DataUseTerms/EditDataUseTermsModal.tsx index 7d602c0511..d592314e0f 100644 --- a/website/src/components/DataUseTerms/EditDataUseTermsModal.tsx +++ b/website/src/components/DataUseTerms/EditDataUseTermsModal.tsx @@ -12,6 +12,7 @@ import { type DataUseTerms, type DataUseTermsOption, } from '../../types/backend'; +import type { Details } from '../../types/lapis'; import type { ClientConfig } from '../../types/runtimeConfig'; import { createAuthorizationHeader } from '../../utils/createAuthorizationHeader'; import type { SequenceFilter } from '../SearchPage/DownloadDialog/SequenceFilters'; @@ -31,7 +32,7 @@ type LoadingState = { type ErrorState = { type: 'error'; - error: unknown; // not too happy about the 'any' here, but I think it's fine + error: unknown; }; type ResultType = 'allOpen' | 'mixed' | 'allRestricted'; @@ -47,8 +48,7 @@ type LoadedState = { earliestRestrictedUntil: DateTime | null; }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO(#3451) use proper types -function getLoadedState(rows: Record[]): LoadedState { +function getLoadedState(rows: Details[]): LoadedState { const openAccessions: string[] = []; const restrictedAccessions = new Map(); let earliestRestrictedUntil: DateTime | null = null; diff --git a/website/src/utils/search.ts b/website/src/utils/search.ts index ca99667c2e..0b04ecf030 100644 --- a/website/src/utils/search.ts +++ b/website/src/utils/search.ts @@ -3,7 +3,7 @@ import { sentenceCase } from 'change-case'; import { type BaseType } from './sequenceTypeHelpers'; import type { TableSequenceData } from '../components/SearchPage/Table'; import { getReferenceGenomes } from '../config'; -import type { GroupedMetadataFilter, Metadata, MetadataFilter, Schema } from '../types/config'; +import type { FieldValues, GroupedMetadataFilter, Metadata, MetadataFilter, Schema } from '../types/config'; import type { ReferenceGenomesSequenceNames, ReferenceAccession, NamedSequence } from '../types/referencesGenomes'; export const VISIBILITY_PREFIX = 'visibility_'; @@ -187,13 +187,12 @@ export const consolidateGroupedFields = (filters: MetadataFilter[]): Consolidate return fieldList; }; -/* eslint-disable @typescript-eslint/no-explicit-any -- TODO(#3451) use proper types */ export const getFieldValuesFromQuery = ( state: Record, - hiddenFieldValues: Record, + hiddenFieldValues: FieldValues, schema: Schema, -): Record => { - const values: Record = { ...hiddenFieldValues }; +): FieldValues => { + const values: FieldValues = { ...hiddenFieldValues }; const expandedSchema = getMetadataSchemaWithExpandedRanges(schema.metadata); for (const field of expandedSchema) { if (field.name in state) { @@ -229,6 +228,7 @@ const makeCaseInsensitiveLiteralSubstringRegex = (s: string): string => { return `(?i)${s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`; }; +/* eslint-disable @typescript-eslint/no-explicit-any -- TODO(#3451) use proper types */ export const getLapisSearchParameters = ( fieldValues: Record, referenceGenomesSequenceNames: ReferenceGenomesSequenceNames, diff --git a/website/src/utils/serversideSearch.ts b/website/src/utils/serversideSearch.ts index 487f0f9e71..26a61ea406 100644 --- a/website/src/utils/serversideSearch.ts +++ b/website/src/utils/serversideSearch.ts @@ -10,14 +10,14 @@ import { import type { TableSequenceData } from '../components/SearchPage/Table'; import { LapisClient } from '../services/lapisClient'; import { pageSize } from '../settings'; -import type { Schema } from '../types/config'; +import type { FieldValues, Schema } from '../types/config'; import type { ReferenceGenomesSequenceNames } from '../types/referencesGenomes'; export const performLapisSearchQueries = async ( state: Record, schema: Schema, referenceGenomesSequenceNames: ReferenceGenomesSequenceNames, - hiddenFieldValues: Record, // eslint-disable-line @typescript-eslint/no-explicit-any -- TODO(#3451) use `unknown`or proper types + hiddenFieldValues: FieldValues, organism: string, ): Promise => { const fieldValues = getFieldValuesFromQuery(state, hiddenFieldValues, schema);