Skip to content

Commit

Permalink
feat: update findable-ui to latest v21.0.0 (#516) (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
frano-m authored Jan 6, 2025
1 parent 4d719f4 commit c7acf5f
Show file tree
Hide file tree
Showing 20 changed files with 277 additions and 257 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { SORT_DIRECTION } from "@databiosphere/findable-ui/lib/config/entities";
import {
getSortedRowModel,
SortingState,
TableOptions,
} from "@tanstack/react-table";
import { HCAAtlasTrackerSourceDataset } from "../../../../../../../../../../../../../apis/catalog/hca-atlas-tracker/common/entities";
import { COLUMN_VISIBILITY } from "../../../../../../../../../../../../Table/features/constants";

const PUBLICATION_STRING = "publicationString";
const TITLE = "title";
Expand All @@ -25,7 +25,7 @@ export const TABLE_OPTIONS: Partial<
enableSorting: true,
getSortedRowModel: getSortedRowModel(),
initialState: {
columnVisibility: COLUMN_VISIBILITY.ROW_POSITION,
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: true },
sorting: SORTING,
},
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { SORT_DIRECTION } from "@databiosphere/findable-ui/lib/config/entities";
import {
getExpandedRowModel,
Expand All @@ -22,11 +23,13 @@ export const TABLE_OPTIONS: Partial<
> = {
enableGrouping: true,
enableMultiSort: true,
enableRowPosition: false,
enableSorting: true,
getExpandedRowModel: getExpandedRowModel(),
getGroupedRowModel: getGroupedRowModel(),
getSortedRowModel: getSortedRowModel(),
initialState: {
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: false },
expanded: true,
grouping: GROUPING,
sorting: SORTING,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { ListConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerSourceDataset } from "../../../../apis/catalog/hca-atlas-tracker/common/entities";
import { COLUMN_VISIBILITY } from "../../../Table/features/constants";

export const TABLE_OPTIONS: ListConfig<HCAAtlasTrackerSourceDataset>["tableOptions"] =
{
initialState: {
columnVisibility: COLUMN_VISIBILITY.ROW_POSITION,
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: true },
},
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { ListConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerComponentAtlas } from "../../../../apis/catalog/hca-atlas-tracker/common/entities";
import { COLUMN_VISIBILITY } from "../../../Table/features/constants";

export const TABLE_OPTIONS: ListConfig<HCAAtlasTrackerComponentAtlas>["tableOptions"] =
{
initialState: {
columnVisibility: COLUMN_VISIBILITY.ROW_POSITION,
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: true },
},
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { ListConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerSourceDataset } from "../../../../apis/catalog/hca-atlas-tracker/common/entities";
import { COLUMN_VISIBILITY } from "../../../Table/features/constants";

export const TABLE_OPTIONS: ListConfig<HCAAtlasTrackerSourceDataset>["tableOptions"] =
{
initialState: {
columnVisibility: COLUMN_VISIBILITY.ROW_POSITION,
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: true },
},
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { COLUMN_IDENTIFIER } from "@databiosphere/findable-ui/lib/components/Table/common/columnIdentifier";
import { ListConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerSourceStudy } from "../../../../apis/catalog/hca-atlas-tracker/common/entities";
import { COLUMN_VISIBILITY } from "../../../Table/features/constants";

export const TABLE_OPTIONS: ListConfig<HCAAtlasTrackerSourceStudy>["tableOptions"] =
{
initialState: {
columnVisibility: COLUMN_VISIBILITY.ROW_POSITION,
columnVisibility: { [COLUMN_IDENTIFIER.ROW_POSITION]: true },
},
};
6 changes: 0 additions & 6 deletions app/components/Table/features/constants.ts

This file was deleted.

8 changes: 4 additions & 4 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 @@ -16,7 +16,7 @@
"migrate": "ts-node -O '{\"module\": \"commonjs\"}' ./scripts/migration-runner.ts -j ts"
},
"dependencies": {
"@databiosphere/findable-ui": "20.0.0",
"@databiosphere/findable-ui": "21.0.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@hookform/resolvers": "^3.3.4",
Expand Down
4 changes: 2 additions & 2 deletions site-config/hca-atlas-tracker/local/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { ROUTE } from "../../../app/routes/constants";
import { SiteConfig } from "../../common/entities";
import { announcementsConfig } from "./announcements/announcementsConfig";
import { authenticationConfig } from "./authentication/authentication";
import { atlasEntityConfig } from "./index/atlasEntityConfig";
import { atlasEntityConfig } from "./index/atlas/atlasEntityConfig";
import { tasksEntityConfig } from "./index/tasks/tasksEntityConfig";
import { userEntityConfig } from "./index/userEntityConfig";
import { userEntityConfig } from "./index/user/userEntityConfig";

// Template constants
const LOCALHOST = "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { ACCESSOR_KEYS } from "@databiosphere/findable-ui/lib/components/TableCreator/common/constants";
import {
ComponentConfig,
EntityConfig,
ListConfig,
SORT_DIRECTION,
} from "@databiosphere/findable-ui/lib/config/entities";
import { EXPLORE_MODE } from "@databiosphere/findable-ui/lib/hooks/useExploreMode";
import { HCAAtlasTrackerListAtlas } from "../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import { HCAAtlasTrackerListAtlas } from "../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import {
atlasInputMapper,
getAtlasId,
} from "../../../../app/apis/catalog/hca-atlas-tracker/common/utils";
import * as C from "../../../../app/components";
import { mapSelectCategoryValue } from "../../../../app/config/utils";
import { formatDateToQuarterYear } from "../../../../app/utils/date-fns";
import * as V from "../../../../app/viewModelBuilders/catalog/hca-atlas-tracker/common/viewModelBuilders";
} from "../../../../../app/apis/catalog/hca-atlas-tracker/common/utils";
import * as C from "../../../../../app/components";
import { mapSelectCategoryValue } from "../../../../../app/config/utils";
import { formatDateToQuarterYear } from "../../../../../app/utils/date-fns";
import * as V from "../../../../../app/viewModelBuilders/catalog/hca-atlas-tracker/common/viewModelBuilders";
import {
HCA_ATLAS_TRACKER_CATEGORY_KEY,
HCA_ATLAS_TRACKER_CATEGORY_LABEL,
} from "../../category";
import { subTitleHero } from "../viewList/subTitleHero";
} from "../../../category";
import { subTitleHero } from "../../viewList/subTitleHero";
import { TABLE_OPTIONS } from "./tableOptions";

/**
* Entity config object responsible to config anything related to the /atlases route.
Expand Down Expand Up @@ -112,7 +112,6 @@ export const atlasEntityConfig: EntityConfig = {
width: { max: "1fr", min: "212px" },
},
{
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildAtlasVersion,
Expand All @@ -123,7 +122,6 @@ export const atlasEntityConfig: EntityConfig = {
width: { max: "0.5fr", min: "112px" },
},
{
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildWave,
Expand Down Expand Up @@ -163,7 +161,6 @@ export const atlasEntityConfig: EntityConfig = {
width: { max: "0.5fr", min: "112px" },
},
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildIntegrationLead,
Expand Down Expand Up @@ -203,18 +200,7 @@ export const atlasEntityConfig: EntityConfig = {
width: { max: "0.5fr", min: "168px" },
},
],
defaultSort: {
desc: SORT_DIRECTION.ASCENDING,
id: HCA_ATLAS_TRACKER_CATEGORY_KEY.NAME,
},
tableOptions: {
initialState: {
columnVisibility: {
[ACCESSOR_KEYS.ROW_POSITION]: true,
[ACCESSOR_KEYS.SELECT]: false,
},
},
},
tableOptions: TABLE_OPTIONS,
} as ListConfig<HCAAtlasTrackerListAtlas>,
listView: {
disablePagination: true,
Expand Down
24 changes: 24 additions & 0 deletions site-config/hca-atlas-tracker/local/index/atlas/tableOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {
ListConfig,
SORT_DIRECTION,
} from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerListAtlas } from "../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import { HCA_ATLAS_TRACKER_CATEGORY_KEY } from "../../../category";

export const TABLE_OPTIONS: ListConfig<HCAAtlasTrackerListAtlas>["tableOptions"] =
{
enableRowPosition: true,
initialState: {
columnVisibility: {
[HCA_ATLAS_TRACKER_CATEGORY_KEY.VERSION]: false,
[HCA_ATLAS_TRACKER_CATEGORY_KEY.WAVE]: false,
[HCA_ATLAS_TRACKER_CATEGORY_KEY.INTEGRATION_LEAD]: false,
},
sorting: [
{
desc: SORT_DIRECTION.ASCENDING,
id: HCA_ATLAS_TRACKER_CATEGORY_KEY.NAME,
},
],
},
};
18 changes: 0 additions & 18 deletions site-config/hca-atlas-tracker/local/index/common/constants.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {
ColumnConfig,
ComponentConfig,
} from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerListValidationRecord } from "../../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import * as C from "../../../../../../app/components";
import * as V from "../../../../../../app/viewModelBuilders/catalog/hca-atlas-tracker/common/viewModelBuilders";
import { HCAAtlasTrackerListValidationRecord } from "../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import * as C from "../../../../../app/components";
import * as V from "../../../../../app/viewModelBuilders/catalog/hca-atlas-tracker/common/viewModelBuilders";
import {
HCA_ATLAS_TRACKER_CATEGORY_KEY,
HCA_ATLAS_TRACKER_CATEGORY_LABEL,
} from "../../../../category";
} from "../../../category";

export const ATLAS_NAMES: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
componentConfig: {
Expand All @@ -23,7 +23,6 @@ export const ATLAS_NAMES: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {

export const ATLAS_VERSIONS: ColumnConfig<HCAAtlasTrackerListValidationRecord> =
{
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildTaskAtlasVersions,
Expand All @@ -38,7 +37,6 @@ export const ATLAS_VERSIONS: ColumnConfig<HCAAtlasTrackerListValidationRecord> =
};

export const CREATED_AT: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildCreatedAt,
Expand Down Expand Up @@ -76,7 +74,6 @@ export const DOI: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
};

export const ENTITY_TITLE: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildEntityTitle,
Expand All @@ -88,7 +85,6 @@ export const ENTITY_TITLE: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
};

export const ENTITY_TYPE: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildEntityType,
Expand All @@ -100,7 +96,6 @@ export const ENTITY_TYPE: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
};

export const NETWORKS: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.BioNetworkCell,
viewBuilder: V.buildTaskNetworks,
Expand Down Expand Up @@ -191,7 +186,6 @@ export const TASK_STATUS: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
};

export const UPDATED_AT: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildUpdatedAt,
Expand All @@ -203,7 +197,6 @@ export const UPDATED_AT: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
};

export const WAVES: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {
columnVisible: false,
componentConfig: {
component: C.NTagCell,
viewBuilder: V.buildTaskWaves,
Expand All @@ -216,7 +209,6 @@ export const WAVES: ColumnConfig<HCAAtlasTrackerListValidationRecord> = {

export const VALIDATION_TYPE: ColumnConfig<HCAAtlasTrackerListValidationRecord> =
{
columnVisible: false,
componentConfig: {
component: C.BasicCell,
viewBuilder: V.buildValidationType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColumnConfig } from "@databiosphere/findable-ui/lib/config/entities";
import { HCAAtlasTrackerListValidationRecord } from "../../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import { HCAAtlasTrackerListValidationRecord } from "../../../../../app/apis/catalog/hca-atlas-tracker/common/entities";
import * as COLUMN from "./column";

export const COLUMNS: ColumnConfig<HCAAtlasTrackerListValidationRecord>[] = [
Expand Down
Loading

0 comments on commit c7acf5f

Please sign in to comment.