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 */}