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

205 - Integration dataset user permissions #218

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

MellyGray
Copy link
Contributor

What this PR does / why we need it:

This PR adds the integration of the SPA with the js-dataverse implementation to get the dataset user permissions

Which issue(s) this PR closes:

Special notes for your reviewer:

  1. Not all of the dataset user permissions were integrated since there are still some changes needed in the API to get the canDownloadFiles and canManageFilesPermissions permissions
  2. I added the friendlyType to correctly display the file types in the Files Table although it was not the purpose of this PR, but it was a change so small that it didn't make sense to create a separate issue for it.

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 getFilesTotalDownloadSize

  1. Go to http://localhost:8000
  2. Login as admin using username: dataverseAdmin and password: admin1
  3. Create a new Dataset and publish it
  4. From the dataset view mode copy the search parameters from the url. Ex.: ?persistentId=doi:10.5072/FK2/LHGRHP&version=DRAFT
  5. 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
  6. You are seeing now the same Dataset in the SPA. Try logging in and out to check that the different buttons with different permissions appear or disappear depending on the permissions

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 Nov 6, 2023 that may be closed by this pull request
@MellyGray MellyGray marked this pull request as ready for review November 6, 2023 09:33
@MellyGray MellyGray added the Size: 3 A percentage of a sprint. 2.1 hours. label Nov 6, 2023
@coveralls
Copy link

coveralls commented Nov 6, 2023

Coverage Status

coverage: 98.426%. remained the same
when pulling d77a3ae on feature/205-integration-dataset-user-permissions
into 0c9a2b8 on develop.

@GPortas GPortas self-assigned this Nov 27, 2023
@GPortas
Copy link
Contributor

GPortas commented Nov 27, 2023

@MellyGray Please, can you resolve the conflicts?

…into feature/205-integration-dataset-user-permissions
@MellyGray
Copy link
Contributor Author

@GPortas I fixed the merge conflicts

@MellyGray MellyGray removed their assignment Nov 28, 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.

I'm having the following error while building the docker image, @MellyGray:

errpack

@MellyGray
Copy link
Contributor Author

@GPortas I followed the following steps and the docker image finished successfully:

git checkout feature/205-integration-dataset-user-permissions
npm i
cd packages/design-system && npm run build && cd ../../
cd dev-env
./run-env.sh unstable

I would clear npm cache and try again, I checked and that version exists in the npm registry so it shouldn't send a not found

@MellyGray MellyGray removed their assignment Nov 29, 2023
@GPortas
Copy link
Contributor

GPortas commented Nov 29, 2023

Works great!

Unpublished dataset (Only draft version available):

Logged in user:

draftlog

Guest user:

draftguest

Published dataset:

Logged in user:

publishedlog

Guest user:

publishedguest

@GPortas GPortas merged commit 0576f50 into develop Nov 29, 2023
10 of 12 checks passed
@GPortas GPortas deleted the feature/205-integration-dataset-user-permissions branch November 29, 2023 11:39
jayanthkomarraju pushed a commit to jayanthkomarraju/dataverse-frontend that referenced this pull request May 31, 2024
…-user-permissions

205 - Integration dataset user permissions
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.

Integration - Get dataset user permissions
3 participants