-
Notifications
You must be signed in to change notification settings - Fork 27
Date, timezone and currency support added to field decorators #1805
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for date, timezone, and currency formatting metadata across multiple examples and implements rendering logic in the admin UI.
- Introduces
AdminUiFieldFormatMetadataand adds aformatproperty toAdminUiFieldMetadatain all generated schemas. - Annotates
EmployeeandInvoiceLineschema fields withadminUIOptionsto specify date and currency formats. - Implements
formatValueincolumns.tsxand integrates it intocellForTypefor formatted display.
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/packages/admin-ui-components/src/entity-list/columns.tsx | Added formatValue utility and applied it in cell rendering. |
| src/examples/sqlite/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format to field metadata. |
| src/examples/sqlite/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format to frontend metadata. |
| src/examples/sqlite/src/backend/schema/invoice-line.ts | Added currency format metadata to unitPrice. |
| src/examples/sqlite/src/backend/schema/employee.ts | Added date format and timezone metadata to birthDate and hireDate. |
| src/examples/rest/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/rest/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/rest-with-auth/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/rest-with-auth/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/rest-with-auth/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/okta/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/okta/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/microsoft-entra/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/microsoft-entra/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/federation/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/federation/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/aws-cognito/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/aws-cognito/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/auth-zero/src/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
| src/examples/auth-zero/src/frontend/types.generated.ts | Added AdminUiFieldFormatMetadata and format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach looks good to me, just need to get those tests passing and we're good to go!
^ this is because of the |
Co-authored-by: Kevin Brown <[email protected]>
|
Note for the future, the reason for the duplication is so that there's no dependency between |
|


This pull request introduces the
AdminUiFieldFormatMetadatatype to enhance field formatting options across multiple examples and updates theAdminUiFieldMetadatatype to include a newformatproperty. Additionally, it modifies the admin UI components to support formatting for dates and currencies. Below is a breakdown of the most important changes:Type Enhancements
AdminUiFieldFormatMetadatatype with properties forformat,timezone,type, andvariantacross varioustypes.generated.tsfiles in multiple examples, includingauth-zero,aws-cognito,federation,microsoft-entra,okta,rest-with-auth, andrest. This type enables more granular control over field formatting. [1] [2] [3] [4] [5] [6]Admin UI Updates
AdminUiFieldMetadatatype to include a newformatproperty, linking it to theAdminUiFieldFormatMetadatatype. This change ensures fields can specify formatting metadata for display purposes. [1] [2] [3] [4] [5] [6]Backend Schema Changes
Employeeclass insqliteschema to includeadminUIOptionsforbirthDateandhireDatefields, specifying date formats and timezones.InvoiceLineclass insqliteschema to includeadminUIOptionsfor theunitPricefield, enabling currency formatting.Admin UI Component Enhancements
formatValuefunction insrc/packages/admin-ui-components/src/entity-list/columns.tsxto handle field formatting for dates and currencies using theluxonlibrary.cellForTypefunction to apply formatting for array values and simple values using theformatValuefunction. [1] [2]