Skip to content

Commit

Permalink
Add stubbed question page with custom name
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke committed Feb 3, 2025
1 parent dab2578 commit 76fd220
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { useMemo } from 'react';

import { EbrcDefaultQuestionForm } from '@veupathdb/web-common/lib/components/questions/EbrcDefaultQuestionForm';

import { Props } from '@veupathdb/wdk-client/lib/Views/Question/DefaultQuestionForm';
import { useLocation } from 'react-router-dom';

export function GenesByEdaSubsetting(props: Props) {
const location = useLocation();
const params = new URLSearchParams(location.search);
const datasetId = params.get('datasetId');
const xformProps = useMemo(() => {
return {
...props,
state: {
...props.state,
question: {
...props.state.question,
displayName: `${props.state.question.displayName}: ${datasetId}`,
},
},
};
}, [datasetId, props]);
return (
<>
<pre>{JSON.stringify({ datasetId })}</pre>
<EbrcDefaultQuestionForm {...xformProps} />
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
isOrganismParam,
} from '@veupathdb/preferred-organisms/lib/components/OrganismParam';
import { EdaSubsettingParameter } from './components/questions/EdaSubsettingParameter';
import { GenesByEdaSubsetting } from './components/questions/GenesByEdaSubsetting';

const BlastForm = React.lazy(() => import('./plugins/BlastForm'));
const BlastQuestionController = React.lazy(
Expand Down Expand Up @@ -133,6 +134,11 @@ const apiPluginConfig: ClientPluginRegistryEntry<any>[] = [
</Suspense>
),
},
// {
// type: 'questionForm',
// name: 'GenesByEda',
// component: GenesByEdaSubsetting,
// },
{
type: 'questionForm',
name: 'ByGenotypeNumber',
Expand Down

0 comments on commit 76fd220

Please sign in to comment.