Skip to content

Commit

Permalink
Merge pull request #735 from jay-hodgson/PORTALS-2938
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson authored Feb 22, 2024
2 parents 30e749d + 005b1e3 commit 39c5a97
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -54,12 +54,6 @@ const taskTabConfigs = (taskID: string) => {
title: 'Description',
props: {},
},
{
name: 'Markdown',
columnName: `${taskID}.Motivation`,
title: 'Motivation',
props: {},
},
{
name: 'Markdown',
columnName: `${taskID}.DataWiki`,
Expand All @@ -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`
},
Expand Down Expand Up @@ -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 <column value>)
props: {
Expand All @@ -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: {
Expand All @@ -182,6 +188,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',
Expand Down Expand Up @@ -218,6 +235,12 @@ export const challengeDetailsPageConfig: DetailsPageProps = {
title: 'Conduct Rules',
props: {},
},
{
name: 'Markdown',
columnName: 'DataConditionsForUse',
title: 'Data Conditions For Use',
props: {},
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 ?? '', //fallback for type safety, but should only be enabled when projectId is set
undefined,
{
includeAnnotations: true,
},
{
enabled: !!projectId,
},
)
if (isLoading) {
return <></>
}
if (
!!projectId &&
data?.annotations.annotations['Status']?.value[0] == 'Active'
) {
return (
<div className="container-fluid">
<div className="row">
Expand Down

0 comments on commit 39c5a97

Please sign in to comment.