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), 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' + }) : '...'}
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}] + + : <> + }