Skip to content
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

Introduces dataType and valueMap to DisplayField #1747

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

KaiVolland
Copy link
Member

This introduces two new optional properties to the DisplayField:

  1. dataType

The dataType allows to force a specific rendering behaviour for the value. e.g. date will try to transform the value into a moment object which then gets rendered with the specified format property:

  1. valueMap

The valueMap allows mapping of values to a new value. This especially useful for enum values. e.g.

  "valueMap": {
    "PENDING": "Ausstehend",
    "REJECTED": "Abgelehnt",
    "FINALIZED": "Abgeschlossen",
    "APPROVED": "Freigegeben"
  }
value rendering
FINALIZED Abgeschlossen
2024-06-12T08:37:46.057Z 12.06.2024

Copy link

null

src/components/DisplayField/index.tsx Outdated Show resolved Hide resolved
Co-authored-by: André Henn <henn@terrestris.de>
@KaiVolland KaiVolland merged commit 411a1e7 into main Sep 11, 2024
1 check passed
@KaiVolland KaiVolland deleted the datatype-valuemap branch September 11, 2024 14:33
Copy link

🎉 This PR is included in version 8.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants