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/470 user panel api token #479

Merged
merged 13 commits into from
Sep 17, 2024
Merged

Conversation

g-saracca
Copy link
Contributor

@g-saracca g-saracca commented Sep 5, 2024

What this PR does / why we need it:

This is the initial work for the user panel in the SPA.
This work will include:

Add links to the user panel in the User dropdown from the application header.
Add routing to the user panel.
Create 4 tabs panel with tab open by default according to url query param.
Only the API Token tab content will be created, the rest of the tabs will remain empty for now, maybe disabling tabs.
Note that this is only UI work, it wont show real info about API token yet.

This part of the documentation Users Token Management could be useful for developing use cases for managing api tokens from the SPA.

Which issue(s) this PR closes:

Special notes for your reviewer:

The rest of the tabs are disabled, only the API Token tab is enabled.
Also the Recreate Token and Revoke Token buttons are disabled.

Suggestions on how to test this:

Step 1: Run the Development Environment

  1. Execute npm i.
  2. Navigate with cd packages/design-system && npm run build.
  3. Return with cd ../../.
  4. Ensure you have a .env file similar to .env.example, with the variable VITE_DATAVERSE_BACKEND_URL=http://localhost:8000.
  5. Navigate with cd dev-env.
  6. Start the environment using ./run-env.sh unstable.
  7. To verify the environment, visit http://localhost:8000 and check your local Dataverse installation.

Step 2: Test the feature
This is only UI work, but couple things could be tested.

  • Check that you navigate successfully to the Account page with the apiToken tab selected by default when clicking on the Api Token item on the user dropdown in the header.
  • Check that the fake api token is correctly being copied to the clipboard

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

Screenshot 2024-09-05 at 13 19 05

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. UI Tasks related to the user interface (UI) or frontend development GREI Re-arch GREI re-architecture-related SPA: User Panel FY25 Sprint 5 FY25 sprint 5 labels Sep 5, 2024
@coveralls
Copy link

coveralls commented Sep 5, 2024

Coverage Status

coverage: 97.331% (-0.1%) from 97.44%
when pulling b31b1ab on feat/470-user-panel-api-token
into dc857c3 on develop.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Quick question about text style.

public/locales/en/account.json Outdated Show resolved Hide resolved
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
Copy link
Contributor

@ekraffmiller ekraffmiller 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! just need small updates and also a Story

src/sections/account/Account.tsx Show resolved Hide resolved
src/sections/account/Account.tsx Show resolved Hide resolved
@g-saracca
Copy link
Contributor Author

I added a basic story, when we integrate with the use cases we will be able to mock responses to show different scenarios.
I think is ready for review now @ekraffmiller

@g-saracca g-saracca assigned g-saracca and ekraffmiller and unassigned g-saracca Sep 13, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller 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, approved!

@ekraffmiller ekraffmiller removed their assignment Sep 13, 2024
@ChengShi-1
Copy link
Contributor

ChengShi-1 commented Sep 17, 2024

Hi German, the ui looks good and works well!

I noticed that even without logging in, I was able to access the API token page by directly navigating to 'http://localhost:8000/spa/account?tab=apiToken'. Should we implement some measures to prevent unauthorized access to this page?

@g-saracca
Copy link
Contributor Author

g-saracca commented Sep 17, 2024

I noticed that even without logging in, I was able to access the API token page by directly navigating to 'http://localhost:8000/spa/account?tab=apiToken'. Should we implement some measures to prevent unauthorized access to this page?

Hi @ChengShi-1, yes, that is going to be solved when me merge the Private Routes Guards PR
But I need first this PR merged in order to have this new page and add it to the protected routes.

@g-saracca g-saracca assigned g-saracca and ChengShi-1 and unassigned g-saracca Sep 17, 2024
Copy link
Contributor

@ChengShi-1 ChengShi-1 left a comment

Choose a reason for hiding this comment

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

Great! Approve.

@g-saracca g-saracca merged commit db18ff9 into develop Sep 17, 2024
10 of 14 checks passed
@GPortas GPortas added SPA.Q3.7 Basic account page Original size: 3 labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 5 FY25 sprint 5 GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Account Page SPA.Q3.7 Basic account page SPA: User Panel UI Tasks related to the user interface (UI) or frontend development
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

User Panel UI + API Token Tab content
6 participants