diff --git a/core/app/common/src/lib/components/button/button.model.ts b/core/app/common/src/lib/components/button/button.model.ts index f761d12666..b09d2efa01 100644 --- a/core/app/common/src/lib/components/button/button.model.ts +++ b/core/app/common/src/lib/components/button/button.model.ts @@ -23,6 +23,7 @@ * feasible for technical reasons, the Appropriate Legal Notices must display * the words "Supercharged by SuiteCRM". */ +import {Observable} from 'rxjs'; export declare type ButtonCallback = (...args) => void; @@ -37,6 +38,7 @@ export interface ButtonInterface { icon?: string; iconKlass?: string; labelModule?: string; + disabled$?: Observable; } export class Button implements ButtonInterface { diff --git a/core/app/common/src/lib/metadata/metadata.model.ts b/core/app/common/src/lib/metadata/metadata.model.ts index ba1134bd33..c0ba3bb0db 100644 --- a/core/app/common/src/lib/metadata/metadata.model.ts +++ b/core/app/common/src/lib/metadata/metadata.model.ts @@ -52,6 +52,7 @@ export interface Panel { displayState: BehaviorSubject; display$: Observable; meta: TabDefinition; + isCollapsed: boolean; } export interface PanelRow { @@ -60,10 +61,11 @@ export interface PanelRow { export interface PanelCell extends ViewFieldDefinition { name?: string; + required_f_submit?: boolean; } export interface ViewFieldDefinitionMap { - [key: string]: ViewFieldDefinition + [key: string]: ViewFieldDefinition; } export interface TabDefinitions { @@ -86,12 +88,12 @@ export interface LogicDefinition { modes: Array; params: { activeOnFields?: { - [key:string]: LogicRuleValues[]; - } + [key: string]: LogicRuleValues[]; + }; displayState?: boolean; fieldDependencies: Array; asyncProcessHandler?: string; - } + }; } export interface LogicRuleValues{ diff --git a/core/app/core/src/lib/components/action-group-menu/action-group-menu.component.ts b/core/app/core/src/lib/components/action-group-menu/action-group-menu.component.ts index f74f3a3e1e..8bd90c51df 100644 --- a/core/app/core/src/lib/components/action-group-menu/action-group-menu.component.ts +++ b/core/app/core/src/lib/components/action-group-menu/action-group-menu.component.ts @@ -52,7 +52,7 @@ export class ActionGroupMenuComponent implements OnInit { @Input() buttonGroupClass = ''; @Input() actionContext: ActionContext; @Input() config: ActionDataSource; - @Input() actionLimitConfig: string = 'recordview_actions_limits'; + @Input() actionLimitConfig = 'recordview_actions_limits'; configState = new BehaviorSubject({buttons: []}); config$ = this.configState.asObservable(); @@ -170,7 +170,7 @@ export class ActionGroupMenuComponent implements OnInit { this.triggerTemporaryLoading(); const callback = (): void => { this.config.runAction(action, this.actionContext); - } + }; this.initInlineConfirmation(action, callback); return; @@ -204,11 +204,16 @@ export class ActionGroupMenuComponent implements OnInit { Button.appendClasses(button, action.klass); } + if(action.disabled$){ + button.disabled$ = action.disabled$; + } + return button; } - protected triggerTemporaryLoading() { + protected triggerTemporaryLoading(): void { this.loading = true; + // eslint-disable-next-line radix const delay = parseInt(this.systemConfigStore.getUi('inline_confirmation_loading_delay')) ?? 200; setTimeout(() => { this.loading = false; @@ -221,8 +226,8 @@ export class ActionGroupMenuComponent implements OnInit { this.confirmationLabel = action?.params?.confirmationLabel ?? ''; this.confirmationDynamicLabel = action?.params?.confirmationDynamicLabel ?? ''; - this.inlineCancelButton = this.buildInlineCancelButton(cancelConfig) - this.inlineConfirmButton = this.buildInlineConfirmButton(confirmConfig, callback) + this.inlineCancelButton = this.buildInlineCancelButton(cancelConfig); + this.inlineConfirmButton = this.buildInlineConfirmButton(confirmConfig, callback); this.inlineConfirmationEnabled = true; } @@ -237,7 +242,7 @@ export class ActionGroupMenuComponent implements OnInit { button.onClick = (): void => { this.triggerTemporaryLoading(); this.resetInlineConfirmation(); - } + }; return button; } @@ -254,7 +259,7 @@ export class ActionGroupMenuComponent implements OnInit { this.triggerTemporaryLoading(); callback(); this.resetInlineConfirmation(); - } + }; return button; } diff --git a/core/app/core/src/lib/components/button/button.component.html b/core/app/core/src/lib/components/button/button.component.html index 6c3a80fd9f..58b8216e16 100644 --- a/core/app/core/src/lib/components/button/button.component.html +++ b/core/app/core/src/lib/components/button/button.component.html @@ -27,7 +27,9 @@ -->