diff --git a/packages/libs/multi-blast/src/index.tsx b/packages/libs/multi-blast/src/index.tsx index a11052b4a0..a8d294da4b 100644 --- a/packages/libs/multi-blast/src/index.tsx +++ b/packages/libs/multi-blast/src/index.tsx @@ -3,11 +3,7 @@ import React, { Suspense } from 'react'; import { Redirect, RouteComponentProps } from 'react-router'; import { RecoilRoot } from 'recoil'; import { initialize } from '@veupathdb/web-common/lib/bootstrap'; -import { - BlastSummaryViewPlugin, - GenomeSummaryViewPlugin, - ResultTableSummaryViewPlugin, -} from '@veupathdb/wdk-client/lib/Plugins'; +import { ResultTableSummaryViewPlugin } from '@veupathdb/wdk-client/lib/Plugins'; import { RouteEntry } from '@veupathdb/wdk-client/lib/Core/RouteEntry'; import { ClientPluginRegistryEntry } from '@veupathdb/wdk-client/lib/Utils/ClientPlugin'; @@ -17,6 +13,9 @@ import { } from '@veupathdb/preferred-organisms/lib/components/OrganismParam'; import { PreferredOrganismsConfigController } from '@veupathdb/preferred-organisms/lib/controllers/PreferredOrganismsConfigController'; +import BlastSummaryViewController from '@veupathdb/blast-summary-view/lib/Controllers/BlastSummaryViewController'; +import * as blastSummaryViewStoreModule from '@veupathdb/blast-summary-view/lib/StoreModules/BlastSummaryViewStoreModule'; + import Header from './Header'; import Home from './Home'; import { endpoint, rootElement, rootUrl } from './constants'; @@ -70,12 +69,11 @@ initialize({ ], componentWrappers: { SiteHeader: () => Header, - Page: (DefaultComponent: React.ComponentType) => (props: any) => - ( - - - - ), + Page: (DefaultComponent: React.ComponentType) => (props: any) => ( + + + + ), }, pluginConfig: [ { @@ -93,15 +91,10 @@ initialize({ name: '_default', component: ResultTableSummaryViewPlugin, }, - { - type: 'summaryView', - name: 'genomic-view', - component: GenomeSummaryViewPlugin, - }, { type: 'summaryView', name: 'blast-view', - component: BlastSummaryViewPlugin, + component: BlastSummaryViewController, }, { type: 'questionFormParameter', @@ -109,6 +102,10 @@ initialize({ component: OrganismParam, }, ] as ClientPluginRegistryEntry[], + wrapStoreModules: (storeModules: any) => ({ + ...storeModules, + [blastSummaryViewStoreModule.key]: blastSummaryViewStoreModule, + }), wrapWdkService, endpoint, } as any); diff --git a/packages/libs/multi-blast/src/lib/components/BlastForm.tsx b/packages/libs/multi-blast/src/lib/components/BlastForm.tsx index 2536fa2a31..c721409a09 100644 --- a/packages/libs/multi-blast/src/lib/components/BlastForm.tsx +++ b/packages/libs/multi-blast/src/lib/components/BlastForm.tsx @@ -53,14 +53,9 @@ import { import { InputErrors } from '../utils/ServiceTypes'; import { ADVANCED_PARAMS_GROUP_NAME, - BLAST_ALGORITHM_PARAM_NAME, - BLAST_DATABASE_ORGANISM_PARAM_NAME, - BLAST_DATABASE_TYPE_PARAM_NAME, - BLAST_QUERY_SEQUENCE_PARAM_NAME, - JOB_DESCRIPTION_PARAM_NAME, + ParamNames, isOmittedParam, organismParamValueToFilenames, - paramValuesToBlastConfig, transformOrganismParameter, } from '../utils/params'; import { fetchOrganismToFilenameMaps } from '../utils/organisms'; @@ -74,6 +69,7 @@ import { AdvancedParamGroup } from './AdvancedParamGroup'; import { BlastFormValidationInfo } from './BlastFormValidationInfo'; import './BlastForm.scss'; +import { paramValuesToBlastQueryConfig } from '../utils/params-to-query-config'; export const blastFormCx = makeClassNameHelper('wdk-QuestionForm'); @@ -87,7 +83,7 @@ export interface Props extends DefaultQuestionFormProps { } export function BlastForm(props: Props) { - const targetType = props.state.paramValues[BLAST_DATABASE_TYPE_PARAM_NAME]; + const targetType = props.state.paramValues[ParamNames.BlastDatabaseType]; const targetMetadataByDataType = useContext(TargetMetadataByDataType); const formPropsWithTransformedQuestion = transformFormQuestion( @@ -104,10 +100,10 @@ export function BlastForm(props: Props) { function BlastFormWithTransformedQuestion(props: Props) { const canChangeRecordType = props.canChangeRecordType ?? false; - const targetType = props.state.paramValues[BLAST_DATABASE_TYPE_PARAM_NAME]; + const targetType = props.state.paramValues[ParamNames.BlastDatabaseType]; const selectedBlastAlgorithm = - props.state.paramValues[BLAST_ALGORITHM_PARAM_NAME]; + props.state.paramValues[ParamNames.BlastAlgorithm]; const restrictedAdvancedParamGroup = useMemo(() => { const fullAdvancedParamGroup = @@ -130,7 +126,7 @@ function BlastFormWithTransformedQuestion(props: Props) { const enabledAlgorithms = useEnabledAlgorithms(targetType); const updateQueryParam = useChangeParamValue( - props.state.question.parametersByName[BLAST_QUERY_SEQUENCE_PARAM_NAME], + props.state.question.parametersByName[ParamNames.BlastQuerySequence], props.state, props.eventHandlers.updateParamValue ); @@ -154,7 +150,7 @@ function BlastFormWithTransformedQuestion(props: Props) { ); const selectedBlastAlgorithmParameter = - props.state.question.parametersByName[BLAST_ALGORITHM_PARAM_NAME]; + props.state.question.parametersByName[ParamNames.BlastAlgorithm]; const searchName = props.state.question.urlSegment; const dispatchAction = props.dispatchAction; @@ -211,13 +207,13 @@ function BlastFormWithTransformedQuestion(props: Props) { const targetParamElement = ( ); const algorithmParamElement = ( ); const sequenceParamElement = ( @@ -229,18 +225,18 @@ function BlastFormWithTransformedQuestion(props: Props) {