Skip to content

Commit

Permalink
chore(website): address Combobox nullable breaking change for headles…
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusroemer committed Jun 29, 2024
1 parent 52437b7 commit d9bb432
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions website/src/components/SearchPage/SearchFullUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ import { getLapisUrl } from '../../config.ts';
import { lapisClientHooks } from '../../services/serviceHooks.ts';
import { pageSize } from '../../settings';
import type { Group } from '../../types/backend.ts';
import { type MetadataFilter, type Schema, type GroupedMetadataFilter, type FieldValues } from '../../types/config.ts';
import {
type MetadataFilter,
type Schema,
type GroupedMetadataFilter,
type FieldValues,
type SetAFieldValue,
} from '../../types/config.ts';
import { type OrderBy } from '../../types/lapis.ts';
import type { ReferenceGenomesSequenceNames } from '../../types/referencesGenomes.ts';
import type { ClientConfig } from '../../types/runtimeConfig.ts';
Expand Down Expand Up @@ -160,7 +166,7 @@ export const InnerSearchFullUI = ({
return values;
}, [state, hiddenFieldValues]);

const setAFieldValue = (fieldName: string, value: string | number) => {
const setAFieldValue: SetAFieldValue = (fieldName, value) => {
setState((prev: any) => {
const newState = {
...prev,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type AutoCompleteFieldProps = {
field: MetadataFilter | GroupedMetadataFilter;
setAFieldValue: SetAFieldValue;
lapisUrl: string;
fieldValue?: string | number;
fieldValue?: string | number | null;
lapisSearchParameters: Record<string, any>;
};

Expand Down
4 changes: 2 additions & 2 deletions website/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ export const websiteConfig = z.object({
});
export type WebsiteConfig = z.infer<typeof websiteConfig>;

export type FieldValues = Record<string, string | number>;
export type SetAFieldValue = (fieldName: string, value: string | number) => void;
export type FieldValues = Record<string, string | number | null>;
export type SetAFieldValue = (fieldName: string, value: string | number | null) => void;

0 comments on commit d9bb432

Please sign in to comment.