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

feat: new sort, pagination, spinner and checkbox functionality added to table component #5

Merged

Conversation

JoelJacobStephen
Copy link
Contributor

@JoelJacobStephen JoelJacobStephen commented Jan 31, 2024

Ticket

Closes HFE-418

Description

This PR adds new functionality to the Table UI component.
These include:

  1. Ability to have checkboxes in the table component.
  2. Ability to select multiple rows or select/deselect all rows
  3. Ability to sort the table in ascending or descending order based on the key provided.
  4. Ability to show a spinner for loading
  5. Pagination support

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

@JoelJacobStephen JoelJacobStephen changed the title feat: new sort, search input and checkbox functionality added to table component feat: new sort, searchbar with debouncer and checkbox functionality added to table component Feb 2, 2024
@JoelJacobStephen JoelJacobStephen marked this pull request as ready for review February 2, 2024 05:53
@JoelJacobStephen JoelJacobStephen marked this pull request as draft February 5, 2024 12:58
@JoelJacobStephen JoelJacobStephen marked this pull request as ready for review February 9, 2024 13:09
@JoelJacobStephen JoelJacobStephen changed the title feat: new sort, searchbar with debouncer and checkbox functionality added to table component feat: new sort, searchbar with debouncer, pagination, spinner and checkbox functionality added to table component Feb 15, 2024
Copy link
Member

@nivedin nivedin left a comment

Choose a reason for hiding this comment

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

please look into this comments

src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
Copy link
Member

@nivedin nivedin left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Copy link
Member

@anwarulislam anwarulislam left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
@jamesgeorge007
Copy link
Member

@JoelJacobStephen, I was wondering if we'd need to include search and pagination logic directly in the HoppSmartTable component. Isn't pagination a well-defined pattern that can be reused and qualify as a candidate to be made a dedicated component? Similarly, for search, can't we use HoppSmartInput at the place of usage?

@JoelJacobStephen
Copy link
Contributor Author

JoelJacobStephen commented Feb 28, 2024

@JoelJacobStephen, I was wondering if we'd need to include search and pagination logic directly in the HoppSmartTable component. Isn't pagination a well-defined pattern that can be reused and qualify as a candidate to be made a dedicated component? Similarly, for search, can't we use HoppSmartInput at the place of usage?

@jamesgeorge007 Search and pagination logic aren't implemented into the Table component. Only the UI is provided and events are emitted when the related UI elements are being used. The search and pagination logic will be handled by the parent component using the smart table by handling the events that are triggered from the UI component. I also went through few popular UI libraries and they have given support for pagination and search UI elements within their table component.

I will replace the input element with HoppSmartInput. Thanks for the catch!!

src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/stories/Table.story.vue Outdated Show resolved Hide resolved
@jamesgeorge007
Copy link
Member

jamesgeorge007 commented Feb 28, 2024

@JoelJacobStephen, I was wondering if we'd need to include search and pagination logic directly in the HoppSmartTable component. Isn't pagination a well-defined pattern that can be reused and qualify as a candidate to be made a dedicated component? Similarly, for search, can't we use HoppSmartInput at the place of usage?

@jamesgeorge007 Search and pagination logic aren't implemented into the Table component. Only the UI is provided and events are emitted when the related UI elements are being used. The search and pagination logic will be handled by the parent component using the smart table by handling the events that are triggered from the UI component. I also went through few popular UI libraries and they have given support for pagination and search UI elements within their table component.

I will replace the input element with HoppSmartInput. Thanks for the catch!!

Discussed separately, the search element will be removed in the same PR, and moving the pagination element out into a separate component to be done in a later iteration.

@JoelJacobStephen JoelJacobStephen changed the title feat: new sort, searchbar with debouncer, pagination, spinner and checkbox functionality added to table component feat: new sort, pagination, spinner and checkbox functionality added to table component Feb 29, 2024
@jamesgeorge007 jamesgeorge007 force-pushed the feat/updated-table-functionality branch from 61fccf6 to dba62f1 Compare March 1, 2024 12:28
src/components/smart/Table.vue Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Show resolved Hide resolved
src/components/smart/Table.vue Outdated Show resolved Hide resolved
src/components/smart/Table.vue Show resolved Hide resolved
@jamesgeorge007
Copy link
Member

Preview

Screen.Recording.2024-03-01.at.4.25.26.PM.mov

@AndrewBastin AndrewBastin merged commit dacf0c1 into hoppscotch:main Mar 5, 2024
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.

None yet

5 participants