Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson committed Jul 12, 2024
1 parent 6f2274a commit 47cc221
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
6 changes: 3 additions & 3 deletions website/src/components/SearchPage/SearchFullUI.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ function renderSearchFullUI({
primaryKey: 'accession',
} as Schema,
initialData: [],
initialCount : 0
, initialQueryDict : {}

initialCount: 0,
initialQueryDict: {},
};

render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { GROUP_ID_FIELD, VERSION_STATUS_FIELD } from '../../../../settings';
import { siloVersionStatuses } from '../../../../types/lapis';
import { getAccessToken } from '../../../../utils/getAccessToken';
import { getReferenceGenomesSequenceNames } from '../../../../utils/search';
import { getGroupsAndCurrentGroup } from '../../../../utils/submissionPages';
import { performLapisSearchQueries } from '../../../../utils/serversideSearch';
import { getGroupsAndCurrentGroup } from '../../../../utils/submissionPages';
const groupsResult = await getGroupsAndCurrentGroup(Astro.params, Astro.locals.session);
if (groupsResult.isErr()) {
Expand Down Expand Up @@ -63,4 +63,4 @@ const { data, totalCount } = await performLapisSearchQueries(
initialCount={totalCount}
initialQueryDict={initialQueryDict}
/>
</SubmissionPageWrapper>
</SubmissionPageWrapper>
2 changes: 1 addition & 1 deletion website/src/utils/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const getColumnVisibilitiesFromQuery = (schema: Schema, state: Record<str
const initiallyVisibleAccessor: VisibilityAccessor = (field) => schema.tableColumns.includes(field.name);
return getFieldOrColumnVisibilitiesFromQuery(schema, state, COLUMN_VISIBILITY_PREFIX, initiallyVisibleAccessor);
};
export const getMetadataSchemaWithExpandedRanges = (metadataSchema: Metadata []) => {
export const getMetadataSchemaWithExpandedRanges = (metadataSchema: Metadata[]) => {
const result = [];
for (const field of metadataSchema) {
if (field.rangeSearch === true) {
Expand Down
9 changes: 2 additions & 7 deletions website/src/utils/serversideSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ import {
ORDER_KEY,
PAGE_KEY,
getColumnVisibilitiesFromQuery,
type SearchResponse,
} from './search';
import type { TableSequenceData } from '../components/SearchPage/Table';
import { LapisClient } from '../services/lapisClient';
import { pageSize } from '../settings';
import type { Schema } from '../types/config';
import type { ReferenceGenomesSequenceNames } from '../types/referencesGenomes';

// If these types are not already defined in the new file, you'll need to import or define them:
export type SearchResponse = {
data: TableSequenceData[];
totalCount: number;
};

export const performLapisSearchQueries = async (
state: Record<string, string>,
schema: Schema,
Expand Down Expand Up @@ -50,7 +45,7 @@ export const performLapisSearchQueries = async (
orderBy: [
{
field: orderByField,
type: (orderDirection==="ascending" ? "ascending" : "descending"),
type: orderDirection === 'ascending' ? 'ascending' : 'descending',
},
],
}),
Expand Down

0 comments on commit 47cc221

Please sign in to comment.