Skip to content

Commit

Permalink
[front] - feature: update @dust-tt/sparkle to version 0.2.197
Browse files Browse the repository at this point in the history
 - Upgraded @dust-tt/sparkle from a release candidate to a stable version, ensuring the use of the latest features and fixes
 - Included new dependency @tanstack/react-table to enhance table components within the platform

[front] - refactor: migrate Table to DataTable component

 - Replaced the Table component with the new DataTable component from @dust-tt/sparkle to leverage the latest library updates
 - Adjusted table cell components to align with the DataTable API changes for consistency and improved maintainability
  • Loading branch information
Jules authored and Jules committed Aug 1, 2024
1 parent d7b1fd2 commit aab23e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
9 changes: 5 additions & 4 deletions front/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 front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@amplitude/analytics-browser": "^2.5.2",
"@amplitude/analytics-node": "^1.3.5",
"@auth0/nextjs-auth0": "^3.5.0",
"@dust-tt/sparkle": "0.2.194-rc3",
"@dust-tt/sparkle": "^0.2.197",
"@dust-tt/types": "file:../types",
"@emoji-mart/data": "^1.1.2",
"@emoji-mart/react": "^1.1.1",
Expand Down
20 changes: 9 additions & 11 deletions front/pages/w/[wId]/builder/data-sources/static.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import {
Button,
DataTable,
FolderIcon,
FolderOpenIcon,
Page,
PlusIcon,
Popup,
RobotIcon,
Searchbar,
Table,
TableData,
} from "@dust-tt/sparkle";
import type { DataSourceType, WorkspaceType } from "@dust-tt/types";
import type { PlanType, SubscriptionType } from "@dust-tt/types";
Expand Down Expand Up @@ -176,10 +175,9 @@ export default function DataSourcesView({
/>
)}
{clickableDataSources.length > 0 && (
<Table
<DataTable
data={clickableDataSources}
columns={columns}
width="expanded"
filter={dataSourceSearch}
filterColumn={"name"}
/>
Expand All @@ -203,24 +201,24 @@ function getTableColumns() {
header: "Name",
accessorKey: "name",
cell: (info: Info) => (
<TableData.Cell icon={info.row.original.icon}>
<DataTable.Cell icon={info.row.original.icon}>
{info.row.original.name}
</TableData.Cell>
</DataTable.Cell>
),
},
{
header: "Used by",
accessorKey: "usage",
cell: (info: Info) => (
<TableData.Cell icon={RobotIcon}>
<DataTable.Cell icon={RobotIcon}>
{info.row.original.usage}
</TableData.Cell>
</DataTable.Cell>
),
},
{
header: "Added by",
cell: (info: Info) => (
<TableData.Cell
<DataTable.Cell
avatarUrl={info.row.original.editedByUser?.imageUrl ?? ""}
/>
),
Expand All @@ -229,13 +227,13 @@ function getTableColumns() {
header: "Last updated",
accessorKey: "editedByUser.editedAt",
cell: (info: Info) => (
<TableData.Cell>
<DataTable.Cell>
{info.row.original.editedByUser?.editedAt
? new Date(
info.row.original.editedByUser.editedAt
).toLocaleDateString()
: null}
</TableData.Cell>
</DataTable.Cell>
),
},
];
Expand Down

0 comments on commit aab23e8

Please sign in to comment.