Skip to content

Commit

Permalink
Merge pull request Sage-Bionetworks#1472 from kianamcc/PORTALS-3363
Browse files Browse the repository at this point in the history
PORTALS-3363: "Access" column heading not showing
  • Loading branch information
kianamcc authored Jan 2, 2025
2 parents bfe45c0 + e6de061 commit 8efff8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const filesViewQueryWrapperPlotNavProps: QueryWrapperPlotNavProps = {
additionalFiltersSessionStorageKey: 'cohort-builder-files-perspective',
tableConfiguration: {
showAccessColumn: true,
showAccessColumnHeader: true,
showDownloadColumn: true,
columnLinks: [
{
Expand Down
2 changes: 2 additions & 0 deletions apps/portals/elportal/src/pages/StudyDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const studyDetailsPageRoutes: RouteObject[] = [
isRowSelectionUIFloating={false}
tableConfiguration={{
showAccessColumn: true,
showAccessColumnHeader: true,
showDownloadColumn: true,
}}
availableFacets={['metadataType', 'dataType', 'assay']}
Expand Down Expand Up @@ -179,6 +180,7 @@ export const studyDetailsPageRoutes: RouteObject[] = [
isRowSelectionUIFloating={false}
tableConfiguration={{
showAccessColumn: true,
showAccessColumnHeader: true,
showDownloadColumn: true,
columnLinks: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { useGetEntity } from '../../synapse-queries'
export type SynapseTableConfiguration = Pick<
SynapseTableProps,
| 'showAccessColumn'
| 'showAccessColumnHeader'
| 'showDownloadColumn'
| 'hideDownload'
| 'showDirectDownloadColumn'
Expand All @@ -56,6 +57,7 @@ export type SynapseTableProps = {

/** If true and entity is a view or dataset, renders a column that represents if the caller has permission to download the entity represented by the row */
showAccessColumn?: boolean
showAccessColumnHeader?: boolean
/** @deprecated use showDirectDownloadColumn */
showDownloadColumn?: boolean
/** @deprecated use hideAddToDownloadListColumn */
Expand All @@ -76,6 +78,7 @@ export function SynapseTable(props: SynapseTableProps) {
rowSet,
isLoadingNewPage,
showAccessColumn,
showAccessColumnHeader,
showDirectDownloadColumn = showDownloadColumn,
hideAddToDownloadListColumn = hideDownload,
columnLinks,
Expand Down Expand Up @@ -141,7 +144,10 @@ export function SynapseTable(props: SynapseTableProps) {
rowSelectionColumn,
addToDownloadListColumn,
directDownloadColumn,
accessColumn,
{
...accessColumn,
header: showAccessColumn && showAccessColumnHeader ? 'Access' : '',
},
...(selectColumns.map((selectColumn, index) => {
return columnHelper.accessor(row => row.values[index], {
id: selectColumn.name,
Expand All @@ -152,7 +158,7 @@ export function SynapseTable(props: SynapseTableProps) {
})
}) ?? []),
],
[selectColumns],
[selectColumns, showAccessColumn],
)

const prependColumnVisibility: VisibilityState = useMemo(
Expand Down

0 comments on commit 8efff8c

Please sign in to comment.