Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[front] - feat(data-sources): searchable folders and websites #6601

Merged
merged 9 commits into from
Aug 1, 2024

Conversation

JulesBelveze
Copy link
Contributor

@JulesBelveze JulesBelveze commented Jul 31, 2024

Description

This PR aims at making folders and websites searchable as described in https://github.com/dust-tt/tasks/issues/1073.

It uses the newly introduced Table component from sparkle (see PR #6583).

New UI look:

Screenshot 2024-08-01 at 13 48 58

References:

Risk

Broken UI

Deploy Plan

@JulesBelveze JulesBelveze self-assigned this Jul 31, 2024
@JulesBelveze JulesBelveze changed the title ⚔️ [connectors] - feat: searchable folders and websites [front] - feat(data-sources): searchable folders and websites Aug 1, 2024
Jules and others added 7 commits August 1, 2024 10:55
…reation

 - Implement a search bar to filter data sources by name in the builder UI
 - Update the data source creation flow with a new button and asynchronous interaction
 - Remove the old section headers, replacing them with a flexible row layout containing the search and button components
 - Use React hooks to manage new search bar state and input references
 - Streamline the creation process of public URLs and folders within builder data sources pages
…tItem with Table component for data sources display

 - Replaced the ContextItem component with a more structured Table component to list data sources
 - Added useMemo for creating a list of clickable data sources with associated metadata and actions
 - Implemented getTableColumns helper function to define the columns for the new table layout
 - Updated package-lock.json to use the release candidate 0.2.194-rc2 of @dust-tt/sparkle
 - Adjusted package.json to specifically target the new release candidate version

[front] - fix: correct typo in static data sources table column header

 - Fixed a typo from "Lasted updated" to "Last updated" in the data sources table component

[front] - feat: add filtering feature to static data sources table

 - Enabled width expansion and added filtering by name to the static data sources table
…d improve data sources UI

 - Upgraded @dust-tt/sparkle package to its latest release candidate version.
 - Reworked public and static data sources UI to use a Table component for better data presentation and interaction.
 - Removed unused imports and components to clean up the data sources pages.
 - Introduced useMemo to optimize render performance for clickable data sources list.
 - Enhanced the data sources UI with additional columns and more informative cell components.
 - Introduced a new TypeScript interface to improve type checking for the cell rendering functions in data source tables
 - Added null checks for the `editedByUser` field and fallbacks for missing `imageUrl` and `editedAt` properties to prevent runtime errors
 - Ensured the display of formatted dates accounts for possible null values in `editedAt` field
 - 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
…nent

 - Transition from Table to DataTable for consistent component use across the platform
 - Update corresponding TableData.Cell to DataTable.Cell to align with the new DataTable component usage
@JulesBelveze JulesBelveze force-pushed the feat/connection-search-bar branch from db5a6ae to ce1e147 Compare August 1, 2024 08:58
…ant 'clickable' property

 - Bumped the @dust-tt/sparkle package version from 0.2.197 to 0.2.198
 - Simplified data source items by removing the unnecessary 'clickable' property since all items are intended to be clickable
@JulesBelveze JulesBelveze requested a review from fontanierh August 1, 2024 11:52
icon: ComponentType;
usage: number;
};
interface Info {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't this be a type as well ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why can't the whole thing be a singe type ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You right, on it 👍🏼

</Page.Vertical>
</AppLayout>
);
}

function getTableColumns() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid duplicating this whole thing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kinda feel like you want to have control over the columns and this logic is really dependant on the page you're in. I agree that there are very similar but they will soon differ. (For example the logo in folders is gonna be dependant on the type of file it is and we will add the size of the object, cf Figma)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But totally fine sharing this function between pages if you want.

Copy link
Contributor

Choose a reason for hiding this comment

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

fair 👍

@fontanierh
Copy link
Contributor

LGTM then

 - Changed OriginalType interface to a more concise Info type definition
 - Updated type structure to directly include the original DataSourceType within the row object
@JulesBelveze JulesBelveze merged commit e0a67cf into main Aug 1, 2024
3 checks passed
@JulesBelveze JulesBelveze deleted the feat/connection-search-bar branch August 1, 2024 12:13
albandum pushed a commit that referenced this pull request Aug 28, 2024
* [front] - feature: add search functionality and enhance data-source creation

 - Implement a search bar to filter data sources by name in the builder UI
 - Update the data source creation flow with a new button and asynchronous interaction
 - Remove the old section headers, replacing them with a flexible row layout containing the search and button components
 - Use React hooks to manage new search bar state and input references
 - Streamline the creation process of public URLs and folders within builder data sources pages

* [front/pages/w/[wId]/builder/data-sources] - refactor: replace ContextItem with Table component for data sources display

 - Replaced the ContextItem component with a more structured Table component to list data sources
 - Added useMemo for creating a list of clickable data sources with associated metadata and actions
 - Implemented getTableColumns helper function to define the columns for the new table layout

* [front] - refactor: update @dust-tt/sparkle package to 0.2.194-rc2

 - Updated package-lock.json to use the release candidate 0.2.194-rc2 of @dust-tt/sparkle
 - Adjusted package.json to specifically target the new release candidate version

[front] - fix: correct typo in static data sources table column header

 - Fixed a typo from "Lasted updated" to "Last updated" in the data sources table component

[front] - feat: add filtering feature to static data sources table

 - Enabled width expansion and added filtering by name to the static data sources table

* [front] - refactor: update @dust-tt/sparkle to version 0.2.194-rc3 and improve data sources UI

 - Upgraded @dust-tt/sparkle package to its latest release candidate version.
 - Reworked public and static data sources UI to use a Table component for better data presentation and interaction.
 - Removed unused imports and components to clean up the data sources pages.
 - Introduced useMemo to optimize render performance for clickable data sources list.
 - Enhanced the data sources UI with additional columns and more informative cell components.

* [front] - fix: ensure type safety and null checks in data sources tables

 - Introduced a new TypeScript interface to improve type checking for the cell rendering functions in data source tables
 - Added null checks for the `editedByUser` field and fallbacks for missing `imageUrl` and `editedAt` properties to prevent runtime errors
 - Ensured the display of formatted dates accounts for possible null values in `editedAt` field

* [front] - feature: update @dust-tt/sparkle to version 0.2.197

 - 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

* [front] - refactor: replace Table with DataTable in public-urls component

 - Transition from Table to DataTable for consistent component use across the platform
 - Update corresponding TableData.Cell to DataTable.Cell to align with the new DataTable component usage

* [front] - refactor: update @dust-tt/sparkle package and remove redundant 'clickable' property

 - Bumped the @dust-tt/sparkle package version from 0.2.197 to 0.2.198
 - Simplified data source items by removing the unnecessary 'clickable' property since all items are intended to be clickable

* [front] - refactor: streamline type definitions for data source tables

 - Changed OriginalType interface to a more concise Info type definition
 - Updated type structure to directly include the original DataSourceType within the row object

---------

Co-authored-by: Jules <[email protected]>
Co-authored-by: Jules <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants