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

137 - Files table UI [2/2] - Filters #147

Merged
merged 21 commits into from
Aug 1, 2023

Conversation

MellyGray
Copy link
Contributor

@MellyGray MellyGray commented Jul 13, 2023

What this PR does / why we need it:

This PR adds the UI of the Files Table filters (no backend)

Which issue(s) this PR closes:

Special notes for your reviewer:

This is only the UI, no backend connected yet

I had to do some changes to the design system, in order to apply some styles to the Dropdown component.

In Bootstrap there is no variant for the Dropdown as a Link, so I had to use the "secondary" variant for the filters

image

Suggestions on how to test this:

  1. npm i
  2. cd packages/design-system && npm run build
  3. cd back to the root
  4. npm run storybook
  5. See the filters selectors in the localhost:6006 storybook in the Dataset page, you can select different filters options

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Captura de pantalla 2023-07-13 a las 16 41 14

Is there a release notes update needed for this change?:

Added filters selectors to the Files Table

Additional documentation:

@MellyGray MellyGray linked an issue Jul 13, 2023 that may be closed by this pull request
@MellyGray MellyGray changed the title 137 - files table filters UI 137 - Files table UI [2/2] - Filters Jul 13, 2023
@MellyGray MellyGray changed the base branch from develop to feature/138-file-table-sorting-ui July 13, 2023 14:59
@MellyGray MellyGray marked this pull request as ready for review July 14, 2023 15:14
@MellyGray MellyGray added the Size: 10 A percentage of a sprint. 7 hours. label Jul 14, 2023
@cmbz cmbz added Size: 3 A percentage of a sprint. 2.1 hours. and removed Size: 10 A percentage of a sprint. 7 hours. labels Jul 19, 2023
@GPortas GPortas self-assigned this Jul 26, 2023
@GPortas GPortas self-requested a review July 26, 2023 13:26
@GPortas
Copy link
Contributor

GPortas commented Jul 28, 2023

@MellyGray

I have tested Storybook.

The default option (with files), looks good:

storybook_dataset_filters_files

But the option with no files is showing the filters. If I'm not wrong, when there are no files the filters should not be displayed:

storybook_dataset_filters_no_files

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

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

The code looks really good!

I have left a couple of comments with some details.

{ tag: new FileTag('document'), count: 5 },
{ tag: new FileTag('code'), count: 10 }
]
} // TODO (filesCountInfo) - Get from use case, pending to be discussed if this is going to have its own use case or not
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's discuss about this to decide how to implement the use case logic before accepting this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My personal preference is getting the filesCountInfo from the getDataset use case. Just because I think that having another use case will increase the time for opening a dataset view. But let me know what you think so I can implement it

@MellyGray
Copy link
Contributor Author

The default option (with files), looks good:

But the option with no files is showing the filters. If I'm not wrong, when there are no files the filters should not be displayed:

Yep, I know, the functionality is implemented and there are tests to check that the filters are not shown when there are no files, but since I have the variable const filesCountInfo hardcoded, the functionality cannot be mocked.

We can decide now if we want to get filesCountInfo from its own use case or if we prefer to get it from an existing use case, and then the storybook mock would display correctly the no files state.

My personal preference is getting the filesCountInfo from the getDataset use case. Just because I think that having another use case will increase the time for opening a dataset view. But let me know what you think so I can implement it @GPortas

@MellyGray MellyGray changed the base branch from feature/138-file-table-sorting-ui to develop July 31, 2023 14:44
@MellyGray MellyGray changed the base branch from develop to feature/138-file-table-sorting-ui July 31, 2023 14:44
@GPortas
Copy link
Contributor

GPortas commented Jul 31, 2023

@MellyGray

Let's consider a separate use case for files count (by datasetId and datasetVersionId, just as for the GetDatasetFiles use case).

It's not just counting all the files in the dataset, but we also need to get counts by type, access, and tags. These different counts will end up in different queries, which I don't think is appropriate to run from the getDataset API endpoint and use case, as they would add too much file-specific logic to the operation, which would also worsen performance.

Base automatically changed from feature/138-file-table-sorting-ui to develop July 31, 2023 21:23
@MellyGray MellyGray removed their assignment Aug 1, 2023
@MellyGray
Copy link
Contributor Author

@GPortas new use case implemented!

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kcondon kcondon assigned kcondon and unassigned GPortas Aug 1, 2023
@kcondon kcondon merged commit edd918f into develop Aug 1, 2023
6 checks passed
@kcondon kcondon deleted the feature/137-files-table-filters-ui branch August 1, 2023 18:59
jayanthkomarraju pushed a commit to jayanthkomarraju/dataverse-frontend that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Spike - Frontend] [2/2] Create the File Tab of the Dataset - Filters
4 participants