Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ALERT_PROPS } from "@databiosphere/findable-ui/lib/components/common/Alert/constants";
import { GridPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
import { Table } from "@databiosphere/findable-ui/lib/components/Detail/components/Table/table";
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { Divider } from "@mui/material";
import { ColumnDef } from "@tanstack/react-table";
import { Fragment } from "react";
Expand Down Expand Up @@ -36,6 +37,13 @@ export const GeneratedMatricesTables = <T extends object>({
columns={columns}
gridTemplateColumns={gridTemplateColumns}
items={items}
tableOptions={{
initialState: {
columnVisibility: {
[COLUMN_IDENTIFIER.ROW_POSITION]: false,
},
},
}}
/>
</GridPaper>
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Value,
} from "@databiosphere/findable-ui/lib/components/common/KeyValuePairs/keyValuePairs";
import { ANCHOR_TARGET } from "@databiosphere/findable-ui/lib/components/Links/common/entities";
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { ViewContext } from "@databiosphere/findable-ui/lib/config/entities";
import { ColumnDef } from "@tanstack/react-table";
import React, { ReactElement } from "react";
Expand Down Expand Up @@ -100,8 +101,12 @@ export const buildConsortiumDetailViewStudiesTable = (
items: studies,
noResultsTitle: "No Studies",
tableOptions: {
enableRowPosition: false,
getRowId: (originalRow) =>
(originalRow as AnVILCatalogConsortiumStudy).studyName,
initialState: {
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: false },
},
},
};
};
Expand All @@ -124,6 +129,9 @@ export const buildConsortiumDetailViewWorkspacesTable = (
tableOptions: {
getRowId: (originalRow) =>
(originalRow as AnVILCatalogWorkspace).workspaceName,
initialState: {
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: false },
},
},
};
};
Expand Down Expand Up @@ -326,6 +334,9 @@ export const buildStudyDetailViewWorkspacesTable = (
tableOptions: {
getRowId: (originalRow) =>
(originalRow as AnVILCatalogWorkspace).workspaceName,
initialState: {
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: false },
},
},
};
};
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts"
},
"dependencies": {
"@databiosphere/findable-ui": "20.0.0",
"@databiosphere/findable-ui": "21.0.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mdx-js/loader": "^3.0.1",
Expand Down
20 changes: 13 additions & 7 deletions site-config/anvil-catalog/dev/index/consortiaEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
} from "../../../../app/apis/catalog/anvil-catalog/common/utils";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/catalog/anvil-catalog/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CATALOG_CATEGORY_KEY,
ANVIL_CATALOG_CATEGORY_LABEL,
Expand Down Expand Up @@ -104,7 +103,6 @@ export const consortiaEntityConfig: EntityConfig<AnVILCatalogConsortium> = {
width: { max: "1fr", min: "120px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildStudyNames,
Expand All @@ -123,7 +121,6 @@ export const consortiaEntityConfig: EntityConfig<AnVILCatalogConsortium> = {
width: { max: "1fr", min: "120px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildTerraWorkspaceNames,
Expand Down Expand Up @@ -151,11 +148,20 @@ export const consortiaEntityConfig: EntityConfig<AnVILCatalogConsortium> = {
width: "max-content",
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM,
tableOptions: {
initialState: {
columnVisibility: {
[ANVIL_CATALOG_CATEGORY_KEY.STUDY_NAME]: false,
[ANVIL_CATALOG_CATEGORY_KEY.WORKSPACE_NAME]: false,
},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<AnVILCatalogConsortium>,
listView: {
disablePagination: true,
Expand Down
14 changes: 9 additions & 5 deletions site-config/anvil-catalog/dev/index/studiesEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
} from "../../../../app/apis/catalog/anvil-catalog/common/utils";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/catalog/anvil-catalog/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CATALOG_CATEGORY_KEY,
ANVIL_CATALOG_CATEGORY_LABEL,
Expand Down Expand Up @@ -143,11 +142,16 @@ export const studiesEntityConfig: EntityConfig<AnVILCatalogStudy> = {
width: "max-content",
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.STUDY_NAME,
tableOptions: {
initialState: {
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.STUDY_NAME,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<AnVILCatalogStudy>,
listView: {
disablePagination: true,
Expand Down
14 changes: 9 additions & 5 deletions site-config/anvil-catalog/dev/index/workspaceEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "../../../../app/apis/catalog/anvil-catalog/common/utils";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/catalog/anvil-catalog/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CATALOG_CATEGORY_KEY,
ANVIL_CATALOG_CATEGORY_LABEL,
Expand Down Expand Up @@ -126,11 +125,16 @@ export const workspaceEntityConfig: EntityConfig<AnVILCatalogWorkspace> = {
width: "max-content",
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM,
tableOptions: {
initialState: {
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CATALOG_CATEGORY_KEY.CONSORTIUM,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<AnVILCatalogWorkspace>,
listView: {
disablePagination: true,
Expand Down
22 changes: 14 additions & 8 deletions site-config/anvil-cmg/dev/index/activitiesEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMod
import { ActivitiesResponse } from "../../../../app/apis/azul/anvil-cmg/common/responses";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CMG_CATEGORY_KEY,
ANVIL_CMG_CATEGORY_LABEL,
Expand Down Expand Up @@ -77,7 +76,6 @@ export const activitiesEntityConfig: EntityConfig<ActivitiesResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildPhenotypicSexes,
Expand All @@ -87,7 +85,6 @@ export const activitiesEntityConfig: EntityConfig<ActivitiesResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildReportedEthnicity,
Expand All @@ -97,7 +94,6 @@ export const activitiesEntityConfig: EntityConfig<ActivitiesResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildDiagnoses,
Expand All @@ -116,11 +112,21 @@ export const activitiesEntityConfig: EntityConfig<ActivitiesResponse> = {
width: { max: "1fr", min: "200px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.ACTIVITY_DOCUMENT_ID,
tableOptions: {
initialState: {
columnVisibility: {
[ANVIL_CMG_CATEGORY_LABEL.DONOR_PHENOTYPIC_SEX]: false,
[ANVIL_CMG_CATEGORY_KEY.DONOR_REPORTED_ETHNICITY]: false,
[ANVIL_CMG_CATEGORY_KEY.DIAGNOSE_DISEASE]: false,
},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.ACTIVITY_DOCUMENT_ID,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<ActivitiesResponse>,
listView: {
listHero,
Expand Down
20 changes: 13 additions & 7 deletions site-config/anvil-cmg/dev/index/biosamplesEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMod
import { BioSamplesResponse } from "../../../../app/apis/azul/anvil-cmg/common/responses";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CMG_CATEGORY_KEY,
ANVIL_CMG_CATEGORY_LABEL,
Expand Down Expand Up @@ -68,7 +67,6 @@ export const biosamplesEntityConfig: EntityConfig<BioSamplesResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildPhenotypicSexes,
Expand All @@ -78,7 +76,6 @@ export const biosamplesEntityConfig: EntityConfig<BioSamplesResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildReportedEthnicity,
Expand Down Expand Up @@ -106,11 +103,20 @@ export const biosamplesEntityConfig: EntityConfig<BioSamplesResponse> = {
width: { max: "1fr", min: "200px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.BIOSAMPLE_BIOSAMPLE_ID,
tableOptions: {
initialState: {
columnVisibility: {
[ANVIL_CMG_CATEGORY_KEY.DONOR_PHENOTYPIC_SEX]: false,
[ANVIL_CMG_CATEGORY_KEY.DONOR_REPORTED_ETHNICITY]: false,
},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.BIOSAMPLE_BIOSAMPLE_ID,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<BioSamplesResponse>,
listView: {
listHero,
Expand Down
20 changes: 13 additions & 7 deletions site-config/anvil-cmg/dev/index/datasetsEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { getDatasetEntryId } from "../../../../app/apis/azul/anvil-cmg/common/tr
import { getTitle } from "../../../../app/apis/azul/anvil-cmg/common/utils";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CMG_CATEGORY_KEY,
ANVIL_CMG_CATEGORY_LABEL,
Expand Down Expand Up @@ -104,7 +103,6 @@ export const datasetsEntityConfig: EntityConfig<DatasetsResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildPhenotypicSexes,
Expand All @@ -114,7 +112,6 @@ export const datasetsEntityConfig: EntityConfig<DatasetsResponse> = {
width: { max: "1fr", min: "200px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildReportedEthnicities,
Expand Down Expand Up @@ -142,11 +139,20 @@ export const datasetsEntityConfig: EntityConfig<DatasetsResponse> = {
width: { max: "1fr", min: "148px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.DATASET_TITLE,
tableOptions: {
initialState: {
columnVisibility: {
[ANVIL_CMG_CATEGORY_KEY.DONOR_PHENOTYPIC_SEX]: false,
[ANVIL_CMG_CATEGORY_KEY.DONOR_REPORTED_ETHNICITY]: false,
},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.DATASET_TITLE,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<DatasetsResponse>,
listView: {
listHero,
Expand Down
14 changes: 9 additions & 5 deletions site-config/anvil-cmg/dev/index/donorsEntityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMod
import { DonorsResponse } from "../../../../app/apis/azul/anvil-cmg/common/responses";
import * as C from "../../../../app/components";
import * as V from "../../../../app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders";
import { TABLE_OPTIONS } from "../../../common/tableOptions";
import {
ANVIL_CMG_CATEGORY_KEY,
ANVIL_CMG_CATEGORY_LABEL,
Expand Down Expand Up @@ -86,11 +85,16 @@ export const donorsEntityConfig: EntityConfig<DonorsResponse> = {
width: { max: "1fr", min: "200px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.DONOR_DONOR_ID,
tableOptions: {
initialState: {
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: ANVIL_CMG_CATEGORY_KEY.DONOR_DONOR_ID,
},
],
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<DonorsResponse>,
listView: {
listHero,
Expand Down
Loading
Loading