Skip to content

fix(DHIS2-19863): introduced code field in api tokens #1495

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nnkogift
Copy link

@nnkogift nnkogift commented Jul 18, 2025

implements: https://dhis2.atlassian.net/browse/DHIS2-19863

This implementation adds a code field to the PAT generation form and a code display in the token list card, allowing users to label their tokens according to their intended use.

Note: This implementation requires This pull request

Screenshots:

Screenshot 2025-07-18 at 12 25 57 Screenshot 2025-07-18 at 12 27 06

nnkogift added 3 commits July 18, 2025 12:15
implements: https://dhis2.atlassian.net/browse/DHIS2-19863

This implementation adds a code field in the PAT generation form and a code display in the token list card. This is to allow the uset to be able to label their tokens depending on how they are used
implements: https://dhis2.atlassian.net/browse/DHIS2-19863

This implementation adds a code field in the PAT generation form and a code display in the token list card. This is to allow the user to be able to label their tokens depending on how they are used
Copy link
Contributor

@kabaros kabaros left a comment

Choose a reason for hiding this comment

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

nice one! tested that it works nicely with the backend change - as discussed, please try to show the exact error when a code is duplicated, otherwise it's hard to know what happened. (this is a general issue with error handling in this app, but would be good to sort it for this use case at least)

image

@kabaros kabaros requested a review from tomzemp July 18, 2025 10:44
nnkogift added 3 commits July 18, 2025 15:32
implements: https://dhis2.atlassian.net/browse/DHIS2-19863

Added error handling that displays to the user the message `Token name already exists` whenever they try to generate new API token with a code that already exists in the system. I had to display that custom message instead of the default error report message because the report message refers to the field as `code` field but we had changed the field name to `Token name`

This error handling implementation also includes handling of 409 coded errors to display the error report messages instead of the general import summary error.
implements: https://dhis2.atlassian.net/browse/DHIS2-19863

Added error handling that displays to the user the message `Token name already exists` whenever they try to generate new API token with a code that already exists in the system. I had to display that custom message instead of the default error report message because the report message refers to the field as `code` field but we had changed the field name to `Token name`

This error handling implementation also includes handling of 409 coded errors to display the error report messages instead of the general import summary error.

The implemenation also includes addition of a helpText on the Token name code explaining what the field is for.
@nnkogift nnkogift requested a review from kabaros July 18, 2025 12:36
@nnkogift
Copy link
Author

I added error handling that displays to the user the message Token name already exists whenever they try to generate new API token with a code that already exists in the system. I had to display that custom message instead of the default error report message because the report message refers to the field as code field but we had changed the field name to Token name

This error handling implementation also includes handling of 409 coded errors to display the error report messages instead of the general import summary error.

The implemenation also includes addition of a helpText on the Token name code explaining what the field is for.

@nnkogift nnkogift changed the title fix(DHIS2-19863): Introduced code field in Api tokens fix(DHIS2-19863): Introduced code field in api tokens Jul 18, 2025
@nnkogift nnkogift changed the title fix(DHIS2-19863): Introduced code field in api tokens fix(DHIS2-19863): introduced code field in api tokens Jul 18, 2025
nnkogift added 2 commits July 18, 2025 17:55
Applied proper formatting by running `yarn format`
Added the API token display on a newly created API token. Also fixed the label on the existing API token display
Copy link

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