Skip to content

Commit

Permalink
Merge branch 'main' into PORTALS-3388
Browse files Browse the repository at this point in the history
  • Loading branch information
kianamcc authored Mar 8, 2025
2 parents d6c8458 + 49c7c3a commit 392dc58
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 67 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

name: SonarCloud Code Scan
jobs:
Expand Down
5 changes: 3 additions & 2 deletions apps/SageAccountWeb/src/components/AccountSettingsTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,17 @@ const AccountSettingsTopBar: React.FC<AccountSettingsTopBarProps> = ({
id="menu-appbar"
anchorEl={anchorEl}
anchorOrigin={{
vertical: 'bottom',
vertical: 'top',
horizontal: 'right',
}}
keepMounted
transformOrigin={{
vertical: 'bottom',
vertical: 'top',
horizontal: 'right',
}}
open={isOpen}
onClose={handleClose}
sx={{ mt: '30px' }}
>
{accountSettingsPanelConfig.map((item: any, index: number) => (
<MenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const computationalSchema: GenericCardSchema = {
title: 'name',
description: 'summary',
subTitle: 'softwareType',
secondaryLabels: ['contributor', 'program', 'grants', 'documentation'],
secondaryLabels: ['contributor', 'project', 'toolType', 'documentation'],
link: 'url',
}

Expand Down
2 changes: 1 addition & 1 deletion apps/portals/standards/src/config/resources.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const dataSql = `SELECT id, study, numberParticipants,reportedOutcome,dataCollectionMethod,deviceType,devicePlatform,deviceLocation,sensorType,diagnosis,digitalAssessmentCategory,digitalAssessmentDetails,dataType,dataSubtype,dataDescriptionLocation, dataAccessInstructions FROM syn21994970.10 where dhPortalIndex = 'TRUE'`
export const dataSql = `SELECT * FROM syn64960277`
38 changes: 6 additions & 32 deletions apps/portals/standards/src/config/synapseConfigs/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,10 @@ import { dataSql } from '../resources'
const dataRgbIndex = 0
export const dataColumnLinks: LabelLinkConfig = [
{
matchColumnName: 'dataDescriptionLocation',
isMarkdown: true,
},
{
matchColumnName: 'dataAccessInstructions',
isMarkdown: true,
},
{
matchColumnName: 'study',
matchColumnName: 'Name',
isMarkdown: false,
baseURL: 'Explore/Collections/DetailsPage',
URLColumnName: 'study',
baseURL: 'Explore/Standard/DetailsPage',
URLColumnName: 'Name',
},
]

Expand All @@ -30,34 +22,16 @@ export const dataQueryWrapperPlotNavProps: QueryWrapperPlotNavProps = {
shouldDeepLink: true,
hideDownload: true,
sql: dataSql,
name: 'Data',
name: 'Standards',
columnAliases,
tableConfiguration: {
showDownloadColumn: false,
columnLinks: dataColumnLinks,
},
facetsToPlot: [
'study',
'reportedOutcome',
'dataCollectionMethod',
'deviceType',
'devicePlatform',
'deviceLocation',
'diagnosis',
'digitalAssessmentCategory',
'dataType',
'dataSubtype',
'Data_Topic',
// 'Organizations',
],
searchConfiguration: {
searchable: [
'collection',
'reportedOutcome',
'devicePlatform',
'diagnosis',
'digitalAssessmentCategory',
'digitalAssessmentDetails',
],
},
initialPlotType: 'BAR',
}

Expand Down
56 changes: 31 additions & 25 deletions apps/portals/standards/src/pages/StandardsDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ import { MarkdownSynapseFromColumnData } from '@sage-bionetworks/synapse-portal-
import { useGetPortalComponentSearchParams } from '@sage-bionetworks/synapse-portal-framework/utils/UseGetPortalComponentSearchParams'
import {
ErrorPage,
GenericCardSchema,
SynapseConstants,
SynapseErrorType,
} from 'synapse-react-client'
import { dataSql } from '../config/resources'
import { CardContainerLogic } from 'synapse-react-client'

export const standardsCardSchema: GenericCardSchema = {
type: SynapseConstants.GENERIC_CARD,
title: 'Name',
// subTitle: '',
// description: '',
secondaryLabels: ['Collections', 'Data_Topic', 'Organizations'],
}

export const standardDetailsPageContent: DetailsPageContentType = [
{
Expand Down Expand Up @@ -41,42 +52,37 @@ export const standardDetailsPageContent: DetailsPageContentType = [
title: 'Related Standards',
element: (
<DetailsPageContextConsumer columnName={'id'}>
{({ value }) => (
<>{value}</>
// TODO:
// <CardContainerLogic
// {...standardCardContainerProps}
// searchParams={{ standardId: value! }}
// />
)}
</DetailsPageContextConsumer>

{({ value }) => (
<>{value}</>
// TODO:
// <CardContainerLogic
// {...standardCardContainerProps}
// searchParams={{ standardId: value! }}
// />
)}
</DetailsPageContextConsumer>
),
},
]

export default function StandardsDetailsPage() {
const { study } = useGetPortalComponentSearchParams()
const { Name } = useGetPortalComponentSearchParams()

if (!study) {
if (!Name) {
return <ErrorPage type={SynapseErrorType.NOT_FOUND} gotoPlace={() => {}} />
}
return (
<>
{/* TODO: header card */}
{/* <CardContainerLogic
isHeader
isAlignToLeftNav
{...standardsCardConfiguration}
columnAliases={columnAliases}
genericCardSchema={{
...standardsSchema,
title: 'name',
link: 'id',
}}
sql={studySql}
searchParams={{ study }}
/> */}
<CardContainerLogic
sql={dataSql}
type={SynapseConstants.GENERIC_CARD}
genericCardSchema={standardsCardSchema}
secondaryLabelLimit={6}
isHeader={true}
searchParams={{ Name }}
/>

<DetailsPage sql={dataSql}>
<DetailsPageContent content={standardDetailsPageContent} />
</DetailsPage>
Expand Down
2 changes: 1 addition & 1 deletion packages/synapse-react-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "synapse-react-client",
"version": "3.4.4",
"version": "3.4.5",
"private": false,
"type": "module",
"main": "./dist/index.cjs",
Expand Down
24 changes: 22 additions & 2 deletions packages/synapse-react-client/src/components/IconList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useMemo } from 'react'
import { useCallback, useMemo } from 'react'
import IconSvg, { IconSvgProps } from './IconSvg/IconSvg'
import { merge } from 'lodash-es'
import { useQueryContext } from './QueryContext'
import { UniqueFacetIdentifier } from '../utils'

type IconConfigs = {
[index: string]: IconSvgProps // if the icon option has the "label" set, it will show tooltip in IconSvg
Expand Down Expand Up @@ -29,6 +31,18 @@ function IconList(props: IconListProps) {
let noMatch: boolean = false
const css = useTheme ? 'icon-list themed' : 'icon-list'
const componentCss = useBackground ? `${css} bg-circle` : css
const queryContext = useQueryContext()
const { addValueToSelectedFacet } = queryContext

const handleIconClick = useCallback(
(dataType: 'string') => {
const facet: UniqueFacetIdentifier = {
columnName: 'dataType',
}
addValueToSelectedFacet(facet, dataType)
},
[addValueToSelectedFacet],
)

const mergedIconConfigs: IconConfigs = useMemo(() => {
const mergedIconConfigs: IconConfigs = {}
Expand All @@ -47,7 +61,13 @@ function IconList(props: IconListProps) {
noMatch = true
return
} else {
return <IconSvg key={el} {...iconConfig} />
return (
<IconSvg
key={el}
{...iconConfig}
onClick={() => handleIconClick(el)}
/>
)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export type IconName = (typeof IconStrings)[number]
export type IconSvgProps = {
icon: IconName
// If provided, will be shown in tooltip
onClick?: () => void
label?: string
wrap?: boolean
} & SvgIconProps
Expand Down Expand Up @@ -539,7 +540,7 @@ function IconMapping(props: { icon: string } & SvgIconProps) {
}

function IconSvg(props: IconSvgProps) {
const { icon, label = '', wrap = true, ...svgIconProps } = props
const { icon, label = '', onClick, wrap = true, ...svgIconProps } = props

const Wrapper = wrap ? 'span' : Fragment
const wrapperProps = wrap
Expand All @@ -548,6 +549,8 @@ function IconSvg(props: IconSvgProps) {
className: 'styled-svg-wrapper',
id: `icon-${icon}`,
role: 'img',
onClick,
style: onClick ? { cursor: 'pointer' } : {},
}
: {}

Expand Down

0 comments on commit 392dc58

Please sign in to comment.