8000 Format Terms and Conditions accepted timestamp by palasht75 · Pull Request #49031 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Format Terms and Conditions accepted timestamp - #49031

Merged
edewit merged 1 commit into
keycloak:mainfrom
palasht75:fix-terms-accepted-date-display
May 28, 2026
Merged

edewit merged 1 commit into
keycloak:mainfrom
palasht75:fix-terms-accepted-date-display

Conversation

@palasht75
Copy link
Copy Markdown
Contributor

Summary

Formats the Terms and Conditions accepted timestamp in the Admin UI user details screen.

Previously, the value was displayed as a raw millisecond timestamp. This change displays it as a readable date/time value while preserving the stored value and backend behavior.

Closes #44591.

Testing

Using Java 21 and the repository-required frontend tooling:

  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui lint - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui build - PASS
  • ./mvnw spotless:check - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test:integration -- --project=chromium test/users/main.spec.ts - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test:integration -- --project=chromium test/realm-settings/userprofile.spec.ts - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test:integration -- --project=chromium --grep "Required actions" test/autentication/flows.spec.ts - PASS

Post-rebase check after rebasing onto latest upstream/main:

  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test - PASS
  • cd js && corepack pnpm --fail-if-no-match --filter @keycloak/keycloak-admin-ui test:integration -- --project=chromium test/users/main.spec.ts - PASS

Risk

The change is scoped to Admin UI display formatting for the Terms and Conditions accepted timestamp.

The stored value, API behavior, Terms and Conditions required action flow, and unrelated user attributes are unchanged.

AI assistance

I used an AI coding agent to assist with preparing this change. I reviewed the implementation and tests and am responsible for the result.

@palasht75
palasht75 force-pushed the fix-terms-accepted-date-display branch from 512a976 to e29f962 Compare May 22, 2026 00:35
@palasht75
palasht75 marked this pull request as ready for review May 22, 2026 02:50
@palasht75
palasht75 requested review from a team as code owners May 22, 2026 02:50
Comment thread js/apps/admin-ui/src/user/UserForm.tsx Outdated
Comment on lines +284 to +289
<TextInput
id={TERMS_AND_CONDITIONS_ATTRIBUTE}
data-testid={TERMS_AND_CONDITIONS_ATTRIBUTE}
value={formatDate(termsAndConditionsAcceptedDate)}
readOnly
/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When it's always readonly it's better to have this as plain text as the user might wonder what would be needed / what would allow to edit this value

Comment thread js/apps/admin-ui/src/user/UserForm.tsx Outdated
Comment on lines +464 to +465
const milliseconds = timestamp > 9999999999 ? timestamp : timestamp * 1000;
const date = new Date(milliseconds);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not needed right it's always in millis

Closes keycloak#44591

Signed-off-by: Palash Thakur <palash@LAPTOP-8OJ5UPT8.localdomain>
@palasht75
palasht75 force-pushed the fix-terms-accepted-date-display branch from e29f962 to 43d1661 Compare May 25, 2026 02:14
@palasht75
palasht75 requested a review from edewit May 27, 2026 13:53
@edewit
edewit merged commit 07d30b6 into keycloak:main May 28, 2026
66 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
Closes keycloak#44591

Signed-off-by: Palash Thakur <palash@LAPTOP-8OJ5UPT8.localdomain>
Co-authored-by: Palash Thakur <palash@LAPTOP-8OJ5UPT8.localdomain>
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.

Terms and Conditions Accepted Timestamp

3 participants

0