Skip to content

Fix #350: [Enhancement]: When some fields in UserProfile are NULL, th...#902

Merged
Teingi merged 1 commit into
oceanbase:mainfrom
JiwaniZakir:fix/350-enhancement-when-some-fields-in-userpro
Apr 16, 2026
Merged

Fix #350: [Enhancement]: When some fields in UserProfile are NULL, th...#902
Teingi merged 1 commit into
oceanbase:mainfrom
JiwaniZakir:fix/350-enhancement-when-some-fields-in-userpro

Conversation

@JiwaniZakir
Copy link
Copy Markdown
Contributor

Closes #350

Before

UserProfile.created_at and updated_at were typed as required string fields in dashboard/src/lib/api.ts. When the backend returned NULL for these fields, formatDate() in dashboard/src/routes/user-profile.tsx received undefined and passed it directly to new Date(), producing "Invalid Date" in some cells while other parts of the dashboard rendered nothing — causing visible inconsistency across the UI.

After

created_at and updated_at are now typed as string | undefined (created_at?: string, updated_at?: string), accurately reflecting that these fields can be NULL. formatDate() now accepts string | undefined and returns the nullDisplay sentinel value early when the input is falsy, ensuring a consistent, intentional display for missing timestamps throughout the dashboard.

Changes

  • dashboard/src/lib/api.ts — Marked created_at and updated_at as optional (?) in the UserProfile interface to match actual backend behavior.
  • dashboard/src/routes/user-profile.tsx — Updated the formatDate signature from (dateString: string) to (dateString: string | undefined) and added an early-return guard (if (!dateString) return nullDisplay;) before the new Date() call.

Testing

  1. Seed or locate a UserProfile record with NULL values for created_at and/or updated_at.
  2. Open the dashboard and navigate to the User Profile page.
  3. Verify the affected date cells display the consistent null placeholder (e.g., ) instead of "Invalid Date" or a blank.
  4. Verify that profiles with valid timestamps continue to display correctly formatted dates via toLocaleString().

This PR was created with AI assistance (Claude). The changes were reviewed by quality gates and a critic model before submission.

Copy link
Copy Markdown
Member

@Teingi Teingi left a comment

Choose a reason for hiding this comment

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

LGTM

@Teingi Teingi merged commit 7aed225 into oceanbase:main Apr 16, 2026
7 checks passed
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.

[Enhancement]: When some fields in UserProfile are NULL, the dashboard displays inconsistency

2 participants