Skip to content

feat: Refactor user settings #1915

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

Merged
merged 4 commits into from
Mar 21, 2025

Conversation

joachimdalen
Copy link
Contributor

This is hopefully the first of many refactors to improve the UI. This change adds some wrapper code as well as refactors the User Settings section.

API Tokens vs Personal Access Tokens

I did a party rename from "API Tokens" to "Personal Access Tokens" as this is a more standardized term and more known. It is an easy change back if you do not like it.

Summary

Summary of changes

  • Added centralized API wrapper and hook
  • Renamed from "API Tokens" to "Personal Access Tokens"
  • File splitting into smaller and more organized components
  • Updated the design

Design update

This change also updates the design a bit. I moved to use purple as the primary color to match the logo. Loading, empty states and error display was also designed into the components.

Wrapper code

Some wrappers were added to centralize and simplify integrating with the API.

File Description
src/modules/api/apiWrapper.ts Helper to wrap and centralize axios integration
src/modules/api/useApiRequest.ts Hook to wrap API interaction and provide feedback for errors, loading, data response and so on

Feature structure

I added a new root folder called modules to be the new home of the refactored code. This is to have an easy overview over what has been refactored and what is pending.

File Description
src/user/* Contains main files
src/user/components/* Contains shared components / smaller parts of the UI
src/user/modals/* Contains modals
src/user/types.ts Contains types owned by the module / domain
src/user/userService.ts Service responsible for interacting with the API

Screenshots

Loading
image

No tokens
image

Load error
image

Token list
image

@alfespa17
Copy link
Member

Thank you @joachimdalen, I did a quick check and I think it looks good.

@alfespa17 alfespa17 changed the title Refactor user settings feat: Refactor user settings Mar 21, 2025
@alfespa17 alfespa17 merged commit e092c55 into AzBuilder:main Mar 21, 2025
3 checks passed
@joachimdalen joachimdalen deleted the feature/refactor-user-settings branch March 21, 2025 17:33
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.

2 participants