Skip to content

feat(ux): improve authenticatin field display with properly formatted auth details - DHIS2-20757#37

Merged
kabaros merged 3 commits intodhis2:mainfrom
gassims:auth-display-replace-json
Feb 16, 2026
Merged

feat(ux): improve authenticatin field display with properly formatted auth details - DHIS2-20757#37
kabaros merged 3 commits intodhis2:mainfrom
gassims:auth-display-replace-json

Conversation

@gassims
Copy link
Contributor

@gassims gassims commented Jan 28, 2026

Implements DHIS2-20757

  • Replace the raw JSON authentication display in the DataTableCell with properly formatted authentication type and details:
  • All auth details are visible in the table cell without cluttering the table
  • Display auth type in the main line
  • Sort the additional details (flex-direction: column)
  • Display auth type as primary text (14px)
  • Display additional fields as secondary text below (12px, grey700)

@gassims
Copy link
Contributor Author

gassims commented Jan 28, 2026

Works the same way if additional authentication methods are introduced.

You can find the recording display in the Jira ticket:
https://dhis2.atlassian.net/browse/DHIS2-20757?focusedCommentId=230534 (video/screenshots here aren't working)

Testing deployment locally and no issues appear:
{
"app_name": "Route Manager",
"app_version": "100.6.0",
"dhis2_version": "2.43-SNAPSHOT",
"dhis2_revision": "7176f83"
}

Files Changed Summary

File Change
src/components/route-list/RoutesTable.tsx Replace raw JSON with proper formatting
src/components/route-list/RoutesTable.module.css Add styles
src/components/route-list/RoutesList.spec.tsx Add tests for auth display (AI as a guide here)


.authField {
font-size: 12px;
color: #404b5a; /* colors.grey700 */
Copy link
Collaborator

Choose a reason for hiding this comment

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

you should be able to use the color directly like here:

Suggested change
color: #404b5a; /* colors.grey700 */
color: var(--colors-grey700);

(Same for the line-height, there might be a variable for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! I've updated this one as well as the other CSS line: line-height: var(--spacers-dp16);

</div>
) : (
'n/a'
<div>{i18n.t('No authentication')}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe for the case with no authnetication, use a muted DataTableCell

so the condition has to be outside the cell (I also don't think it's valid to have divs inside td elements), and if no authentication, you'd have something like

<DataTableCell muted>{i18n.t('No authentication')}</DataTableCell>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! The muted one looks nice. I'd accidentally duplicated the DataTableCell but then fixed it. Removed the divs to span.

{route.auth.type}
</div>
{Object.entries(
route.auth as Record<
Copy link
Collaborator

Choose a reason for hiding this comment

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

don you need to cast it with as Record<.... - I wouldn't think that's necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed that, thanks!

// Verify auth type is displayed
expect(await findByText(expectedType)).toBeInTheDocument()
// Verify additional details are visible (no hover needed!)
for (const detail of expectedDetails) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice tests 👏🏿 .. I think you can simplify the tests for exampleDetails to just match the text without being an array, but using exact: false, or using a regex - https://testing-library.com/docs/queries/about/#precision

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the tests.. :D thanks!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@kabaros kabaros merged commit 446c783 into dhis2:main Feb 16, 2026
11 of 16 checks passed
dhis2-bot added a commit that referenced this pull request Feb 16, 2026
# [100.7.0](v100.6.0...v100.7.0) (2026-02-16)

### Features

* **DHIS2-20757:** improve authenticatin field display with properly formatted auth details ([#37](#37)) ([446c783](446c783))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 100.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gassims gassims deleted the auth-display-replace-json branch February 17, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants