From 987133cc013c3b4045801ea008181f89e6bcb42b Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Sat, 16 Aug 2025 10:19:08 +0200 Subject: [PATCH 1/3] chore: show sync time in CEST/CET --- Website/app/login/page.tsx | 3 ++- Website/components/aboutview/AboutView.tsx | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Website/app/login/page.tsx b/Website/app/login/page.tsx index f35c0d9..3c65678 100644 --- a/Website/app/login/page.tsx +++ b/Website/app/login/page.tsx @@ -102,7 +102,8 @@ export default function LoginPage() { {/* Footer Information */}
- Last Synched: {LastSynched ? LastSynched.toLocaleString(undefined, { + Last synchronization: {LastSynched ? LastSynched.toLocaleString('en-DK', { + timeZone: 'Europe/Copenhagen', timeZoneName: 'short', year: 'numeric', month: 'short', diff --git a/Website/components/aboutview/AboutView.tsx b/Website/components/aboutview/AboutView.tsx index 1565a7c..1253637 100644 --- a/Website/components/aboutview/AboutView.tsx +++ b/Website/components/aboutview/AboutView.tsx @@ -91,7 +91,15 @@ export const AboutView = ({}: IAboutViewProps) => { {/* Data Sync */}
- Last Synched - {LastSynched ? LastSynched.toLocaleString(undefined, { timeZoneName: 'short' }) : '...'} + Last synchronization: {LastSynched ? LastSynched.toLocaleString('en-DK', { + timeZone: 'Europe/Copenhagen', + timeZoneName: 'short', + year: 'numeric', + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit' + }) : '...'}
From 9367b4e75e9cc1e76fdb833f35ce609c5ee6cac0 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Sat, 16 Aug 2025 10:20:00 +0200 Subject: [PATCH 2/3] chore: hide keys when none exists --- Website/components/datamodelview/Section.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Website/components/datamodelview/Section.tsx b/Website/components/datamodelview/Section.tsx index 442560e..56d2cbb 100644 --- a/Website/components/datamodelview/Section.tsx +++ b/Website/components/datamodelview/Section.tsx @@ -74,10 +74,13 @@ export const Section = React.memo( : <> } - - - Keys [{visibleKeyCount}] - + {entity.Keys.length ? + + + Keys [{visibleKeyCount}] + + : <> + } From 34d45b2f86e00ec8af936a417e3ee9488ff01788 Mon Sep 17 00:00:00 2001 From: Lucki2g Date: Sat, 16 Aug 2025 10:32:13 +0200 Subject: [PATCH 3/3] fix: handle state as choice instead of generic --- Generator/DTO/Attributes/ChoiceAttribute.cs | 11 +++++++++++ Generator/DataverseService.cs | 1 + 2 files changed, 12 insertions(+) diff --git a/Generator/DTO/Attributes/ChoiceAttribute.cs b/Generator/DTO/Attributes/ChoiceAttribute.cs index 0b4904a..313095b 100644 --- a/Generator/DTO/Attributes/ChoiceAttribute.cs +++ b/Generator/DTO/Attributes/ChoiceAttribute.cs @@ -21,6 +21,17 @@ public ChoiceAttribute(PicklistAttributeMetadata metadata) : base(metadata) DefaultValue = metadata.DefaultFormValue; } + public ChoiceAttribute(StateAttributeMetadata metadata) : base(metadata) + { + Options = metadata.OptionSet.Options.Select(x => new Option( + x.Label.UserLocalizedLabel?.Label ?? string.Empty, + x.Value, + x.Color, + x.Description.UserLocalizedLabel?.Label.PrettyDescription() ?? string.Empty)); + Type = "Single"; + DefaultValue = metadata.DefaultFormValue; + } + public ChoiceAttribute(MultiSelectPicklistAttributeMetadata metadata) : base(metadata) { Options = metadata.OptionSet.Options.Select(x => new Option( diff --git a/Generator/DataverseService.cs b/Generator/DataverseService.cs index b964a54..54fc132 100644 --- a/Generator/DataverseService.cs +++ b/Generator/DataverseService.cs @@ -220,6 +220,7 @@ private static Attribute GetAttribute(AttributeMetadata metadata, EntityMetadata PicklistAttributeMetadata picklist => new ChoiceAttribute(picklist), MultiSelectPicklistAttributeMetadata multiSelect => new ChoiceAttribute(multiSelect), LookupAttributeMetadata lookup => new LookupAttribute(lookup, logicalToSchema, logger), + StateAttributeMetadata state => new ChoiceAttribute(state), StatusAttributeMetadata status => new StatusAttribute(status, (StateAttributeMetadata)entity.Attributes.First(x => x is StateAttributeMetadata)), StringAttributeMetadata stringMetadata => new StringAttribute(stringMetadata), IntegerAttributeMetadata integer => new IntegerAttribute(integer),