From a68d94553d84ec211c89614015d20f566048a787 Mon Sep 17 00:00:00 2001 From: Jay Hodgson Date: Wed, 21 Feb 2024 17:46:31 -0800 Subject: [PATCH 1/2] PORTALS-2934 --- .../synapseConfigs/challenges.ts | 35 ++++++++++++++----- .../ChallengeDetailPageWrapper.tsx | 24 +++++++++++-- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts b/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts index 87c1614f95..97e0758ac8 100644 --- a/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts +++ b/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts @@ -16,7 +16,7 @@ export const challengesSchema: GenericCardSchema = { title: 'name', subTitle: 'Status', description: 'Abstract', - secondaryLabels: ['Difficulty', 'ChallengeType', 'DataType', 'Tags'], + secondaryLabels: ['ChallengeType', 'DataType', 'Tags'], } export const challengeTitleLinkConfig: CardLink = { isMarkdown: false, @@ -54,12 +54,6 @@ const taskTabConfigs = (taskID: string) => { title: 'Description', props: {}, }, - { - name: 'Markdown', - columnName: `${taskID}.Motivation`, - title: 'Motivation', - props: {}, - }, { name: 'Markdown', columnName: `${taskID}.DataWiki`, @@ -69,7 +63,7 @@ const taskTabConfigs = (taskID: string) => { { name: 'ChallengeDataDownload', columnName: `${taskID}.DataFolder`, - title: 'Training Data', + title: 'Data Files', props: { parentContainerId: '', // filled in dynamically by DetailsPage using value from `${taskID}.DataFolder` }, @@ -150,8 +144,14 @@ export const challengeDetailsPageConfig: DetailsPageProps = { props: {}, }, { - name: 'CardContainerLogic', + name: 'Markdown', + columnName: 'OrganizersDescription', + injectMarkdown: true, title: 'Organizers', + props: {}, + }, + { + name: 'CardContainerLogic', columnName: 'Organizers', overrideSqlSourceTable: true, // Instead, modify the sql (SELECT * FROM ) props: { @@ -182,6 +182,17 @@ export const challengeDetailsPageConfig: DetailsPageProps = { type: SynapseConstants.MEDIUM_USER_CARD, }, }, + { + name: 'CardContainerLogic', + title: 'Support', + columnName: 'Support', + overrideSqlSourceTable: true, + props: { + sql: '', + limit: 6, + type: SynapseConstants.MEDIUM_USER_CARD, + }, + }, { name: 'ChallengeParticipantGoogleMap', title: 'Participants', @@ -218,6 +229,12 @@ export const challengeDetailsPageConfig: DetailsPageProps = { title: 'Conduct Rules', props: {}, }, + { + name: 'Markdown', + columnName: 'DataConditionsForUse', + title: 'Data Conditions For Use', + props: {}, + }, ], }, { diff --git a/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx b/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx index 51df9bd5f7..815070caf9 100644 --- a/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx +++ b/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx @@ -1,6 +1,10 @@ import { Box } from '@mui/material' import * as React from 'react' -import { AppUtils, ChallengeDetailPage } from 'synapse-react-client' +import { + AppUtils, + ChallengeDetailPage, + SynapseQueries, +} from 'synapse-react-client' /** * This is the Challenge Registration button. This includes: @@ -11,7 +15,23 @@ import { AppUtils, ChallengeDetailPage } from 'synapse-react-client' */ const ChallengeDetailPageWrapper = () => { const projectId = AppUtils.useQuerySearchParam('id') - if (projectId) { + const { data, isLoading } = SynapseQueries.useGetEntityBundle( + projectId, + undefined, + { + includeAnnotations: true, + }, + { + enabled: !!projectId, + }, + ) + if (isLoading) { + return <> + } + if ( + !!projectId && + data?.annotations.annotations['Status'].value[0] == 'Active' + ) { return (
From 005b1e3a8b0c342d9537b1a5aff7ecb7c24cf285 Mon Sep 17 00:00:00 2001 From: Jay Hodgson Date: Thu, 22 Feb 2024 09:03:58 -0800 Subject: [PATCH 2/2] added another description, and made changes from code review and type test failure --- .../challengeportal/synapseConfigs/challenges.ts | 8 +++++++- .../challengeportal/ChallengeDetailPageWrapper.tsx | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts b/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts index 97e0758ac8..6b96f1ab7e 100644 --- a/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts +++ b/apps/portals/src/configurations/challengeportal/synapseConfigs/challenges.ts @@ -161,8 +161,14 @@ export const challengeDetailsPageConfig: DetailsPageProps = { }, }, { - name: 'CardContainerLogic', + name: 'Markdown', + columnName: 'ContributorsDescription', + injectMarkdown: true, title: 'Contributors', + props: {}, + }, + { + name: 'CardContainerLogic', columnName: 'Contributors', overrideSqlSourceTable: true, props: { diff --git a/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx b/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx index 815070caf9..db51eb1a5d 100644 --- a/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx +++ b/apps/portals/src/portal-components/challengeportal/ChallengeDetailPageWrapper.tsx @@ -16,7 +16,7 @@ import { const ChallengeDetailPageWrapper = () => { const projectId = AppUtils.useQuerySearchParam('id') const { data, isLoading } = SynapseQueries.useGetEntityBundle( - projectId, + projectId ?? '', //fallback for type safety, but should only be enabled when projectId is set undefined, { includeAnnotations: true, @@ -30,7 +30,7 @@ const ChallengeDetailPageWrapper = () => { } if ( !!projectId && - data?.annotations.annotations['Status'].value[0] == 'Active' + data?.annotations.annotations['Status']?.value[0] == 'Active' ) { return (