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

208 - Fix Files table incorrect behavior when changing page size #212

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

MellyGray
Copy link
Contributor

@MellyGray MellyGray commented Oct 31, 2023

What this PR does / why we need it:

This PR fixes an issue in develop where when changing the page size of the Files Table from a bigger size to a smaller size, being the current page the last page of the pagination, the Files Table shows the Files not found message. The expected behaviour is that the Files Table should show the list of files.

Which issue(s) this PR closes:

Special notes for your reviewer:

I didn't add an e2e test because I was able to reproduce the bug with unit tests, so I just added some unit tests.

Suggestions on how to test this:

Step 1: Run the development environment

  1. Run npm i
  2. cd packages/design-system && npm run build
  3. cd ../../
  4. Check that you have a .env file such as the .env.example, with the VITE_DATAVERSE_BACKEND_URL=http://localhost:8000 variable
  5. cd dev-env
  6. ./run-env.sh unstable
  7. To check the environment go to http://localhost:8000 and check your local dataverse installation

Step 2: Test Dataset View mode with the implemented changes for the getDatasetFilesTotalDownloadSize

  1. Go to http://localhost:8000
  2. Login as admin using username: dataverseAdmin and password: admin1
  3. Create a new Dataset
  4. Upload 32 files
  5. From the dataset view mode copy the search parameters from the url. Ex.: ?persistentId=doi:10.5072/FK2/LHGRHP&version=DRAFT
  6. Go to http://localhost:8000/spa/datasets and paste the search parameters. Ex.: http://localhost:8000/spa/datasets?persistentId=doi:10.5072/FK2/LHGRHP&version=DRAFT
  7. You are seeing now the same Dataset in the SPA. Now, follow the steps to reproduce the issue and check that now it's working as expected.
  8. Create a dataset with more than 10 files, around 30
  9. Go to page 2
  10. change the page size to 50
  11. change the page size back to 10
  12. There is a message 'There are no files in this dataset' <- This should not appear

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

No

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

No

Additional documentation:

@MellyGray MellyGray linked an issue Oct 31, 2023 that may be closed by this pull request
@MellyGray MellyGray marked this pull request as ready for review October 31, 2023 11:29
@coveralls
Copy link

coveralls commented Oct 31, 2023

Coverage Status

coverage: 98.426%. remained the same
when pulling 63d69d2 on 208/fix-change-page-size-of-the-files-table
into 0c9a2b8 on develop.

@MellyGray MellyGray added the Size: 3 A percentage of a sprint. 2.1 hours. label Nov 8, 2023
@GPortas GPortas self-assigned this Nov 27, 2023
@GPortas GPortas changed the title 208 - Fix Files table incorrect behaviour when changing page size 208 - Fix Files table incorrect behavior when changing page size Nov 27, 2023
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!

demopagingfix

@GPortas GPortas removed their assignment Nov 27, 2023
…into 208/fix-change-page-size-of-the-files-table
@GPortas GPortas merged commit e24eae4 into develop Nov 29, 2023
10 of 12 checks passed
@GPortas GPortas deleted the 208/fix-change-page-size-of-the-files-table branch November 29, 2023 11:38
jayanthkomarraju pushed a commit to jayanthkomarraju/dataverse-frontend that referenced this pull request May 31, 2024
…-files-table

208 - Fix Files table incorrect behavior when changing page size
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.

Fix - Change page size of the Files Table
3 participants