From 78dea0dba2159d3f96a356a361e9ba32e65cc06b Mon Sep 17 00:00:00 2001 From: Dnouv Date: Wed, 18 Sep 2024 19:12:31 +0530 Subject: [PATCH 1/2] add new categories --- src/definition/ui/IUIActionButtonDescriptor.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/definition/ui/IUIActionButtonDescriptor.ts b/src/definition/ui/IUIActionButtonDescriptor.ts index 04b87d9ce..f7c7a8082 100644 --- a/src/definition/ui/IUIActionButtonDescriptor.ts +++ b/src/definition/ui/IUIActionButtonDescriptor.ts @@ -28,12 +28,18 @@ export interface IUActionButtonWhen { hasAllRoles?: Array; } +export enum UIActionButtonCategory { + AI = 'ai', + DEFAULT = 'default', +} + export interface IUIActionButtonDescriptor { actionId: string; context: UIActionButtonContext; labelI18n: string; variant?: 'danger'; when?: IUActionButtonWhen; + category?: UIActionButtonCategory; } export interface IUIActionButton extends IUIActionButtonDescriptor { appId: string; From 5aca5749cb5fe6a9b1fd79a05232032f460ba9fb Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Wed, 25 Sep 2024 19:59:27 -0300 Subject: [PATCH 2/2] Use union type instead of enum --- src/definition/ui/IUIActionButtonDescriptor.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/definition/ui/IUIActionButtonDescriptor.ts b/src/definition/ui/IUIActionButtonDescriptor.ts index f7c7a8082..c17bbdb60 100644 --- a/src/definition/ui/IUIActionButtonDescriptor.ts +++ b/src/definition/ui/IUIActionButtonDescriptor.ts @@ -28,18 +28,13 @@ export interface IUActionButtonWhen { hasAllRoles?: Array; } -export enum UIActionButtonCategory { - AI = 'ai', - DEFAULT = 'default', -} - export interface IUIActionButtonDescriptor { actionId: string; context: UIActionButtonContext; labelI18n: string; variant?: 'danger'; when?: IUActionButtonWhen; - category?: UIActionButtonCategory; + category?: 'default' | 'ai'; } export interface IUIActionButton extends IUIActionButtonDescriptor { appId: string;