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,6 @@
import { MarkdownCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/MarkdownCell/markdownCell";
import { Attribute } from "@databiosphere/findable-ui/lib/common/entities";
import { ColumnDef } from "@tanstack/react-table";
import { ColumnDef, CellContext } from "@tanstack/react-table";

export const COLUMN_DEFS: ColumnDef<Attribute>[] = [
{
Expand All @@ -21,8 +21,9 @@ export const COLUMN_DEFS: ColumnDef<Attribute>[] = [
},
},
{
accessorFn: (row: Attribute) => ({ values: row.description }),
cell: MarkdownCell,
accessorKey: "description",
cell: (cellContext) =>
MarkdownCell(cellContext as CellContext<Attribute, string>),
Comment on lines +25 to +26
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type casting to CellContext<Attribute, string> may be unsafe. Consider validating that the cellContext actually contains string data or handling the case where description might be undefined/null before passing to MarkdownCell.

Suggested change
cell: (cellContext) =>
MarkdownCell(cellContext as CellContext<Attribute, string>),
cell: (cellContext) => {
const value = cellContext.getValue();
const safeValue = typeof value === "string" ? value : "";
return MarkdownCell({ ...cellContext, getValue: () => safeValue });
},

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving as is... Need to resolve type casting in findable-ui.

enableColumnFilter: false,
header: "Description",
meta: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export const TABLE_OPTIONS: Omit<
> = {
columns: COLUMN_DEFS,
enableColumnFilters: false,
enableExpanding: false,
enableGlobalFilter: false,
getRowCanExpand: () => false,
getRowId: (row) => row.name,
initialState: {
columnVisibility: { classKey: false },
expanded: true,
grouping: ["classKey"],
},
};
78 changes: 40 additions & 38 deletions package-lock.json

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

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
"check-system-status:anvil-cmg": "esrun e2e/anvil/anvil-check-system-status.ts"
},
"dependencies": {
"@databiosphere/findable-ui": "^38.1.1",
"@databiosphere/findable-ui": "^40.0.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@mui/icons-material": "^7.0.1",
"@mui/material": "^7.0.1",
"@next/mdx": "^14.2.28",
"@next/mdx": "^14.2.30",
"@observablehq/plot": "^0.6.17",
"@tanstack/react-table": "^8.19.2",
"@tanstack/react-virtual": "^3.13.12",
Expand All @@ -50,7 +50,7 @@
"jwt-decode": "^3.1.2",
"ky": "^1.7.2",
"match-sorter": "^6.3.1",
"next": "^14.2.28",
"next": "^14.2.30",
"next-auth": "^4.24.7",
"next-compose-plugins": "^2.2.1",
"next-mdx-remote": "^4.2.0",
Expand All @@ -76,7 +76,7 @@
"@commitlint/config-conventional": "^19.6.0",
"@digitak/esrun": "^3.2.26",
"@mui/types": "^7.4.0",
"@next/eslint-plugin-next": "^14.2.28",
"@next/eslint-plugin-next": "^14.2.30",
"@playwright/test": "^1.49.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^16.0.1",
Expand All @@ -90,7 +90,7 @@
"@typescript-eslint/eslint-plugin": "^8.18.1",
"babel-loader": "^9.2.1",
"eslint": "^8.33.0",
"eslint-config-next": "^14.2.28",
"eslint-config-next": "^14.2.30",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^50.6.1",
Expand Down
Loading