From 153ecd2c173c1c991b38e7b674470799e4182ffa Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 3 Nov 2023 13:00:35 +0100 Subject: [PATCH] added: filter only active or beta action in list --- .../cds-add-action-menu/cds-add-action-menu.component.ts | 6 +++--- .../cds-panel-actions/cds-panel-actions.component.ts | 2 +- src/app/chatbot-design-studio/utils.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/actions/shared/cds-add-action-menu/cds-add-action-menu.component.ts b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/actions/shared/cds-add-action-menu/cds-add-action-menu.component.ts index 3c5dc536..1c4bc142 100644 --- a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/actions/shared/cds-add-action-menu/cds-add-action-menu.component.ts +++ b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/actions/shared/cds-add-action-menu/cds-add-action-menu.component.ts @@ -32,7 +32,7 @@ export class CdsAddActionMenuComponent implements OnInit, OnChanges { type: key, value: ACTIONS_LIST[key] }; - }); + }).filter(el => el.value.status !== 'inactive'); break; case TYPE_OF_MENU.EVENT: this.menuItemsList = []; @@ -57,7 +57,7 @@ export class CdsAddActionMenuComponent implements OnInit, OnChanges { type: key, value: ACTIONS_LIST[key] }; - }); + }).filter(el => el.value.status !== 'inactive'); break; } } @@ -68,7 +68,7 @@ export class CdsAddActionMenuComponent implements OnInit, OnChanges { type: key, value: ACTIONS_LIST[key] }; - }); + }).filter(el => el.value.status !== 'inactive');; // console.log('[CDS-ADD-ACTION-MENU] tdsContainerEleHeight (onchanges): ', this.tdsContainerEleHeight); // this.contentHeight = this.tdsContainerEleHeight - 40; diff --git a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-actions/cds-panel-actions.component.ts b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-actions/cds-panel-actions.component.ts index 7d7873e1..de9ec531 100644 --- a/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-actions/cds-panel-actions.component.ts +++ b/src/app/chatbot-design-studio/cds-dashboard/cds-canvas/cds-panel-elements/cds-panel-actions/cds-panel-actions.component.ts @@ -45,7 +45,7 @@ export class CdsPanelActionsComponent implements OnInit { console.log('cds-panel-actions ngOnChanges:: ', this.pos, this.menuType, this.menuCategory); switch (this.menuType) { case TYPE_OF_MENU.ACTION: - this.menuItemsList = Object.values(ACTIONS_LIST).filter(el => el.category === TYPE_ACTION_CATEGORY[this.menuCategory]).map(element => { + this.menuItemsList = Object.values(ACTIONS_LIST).filter(el => (el.category === TYPE_ACTION_CATEGORY[this.menuCategory] && el.status !== 'inactive')).map(element => { return { type: TYPE_OF_MENU.ACTION, value: element diff --git a/src/app/chatbot-design-studio/utils.ts b/src/app/chatbot-design-studio/utils.ts index 1a0f2498..56cf183f 100644 --- a/src/app/chatbot-design-studio/utils.ts +++ b/src/app/chatbot-design-studio/utils.ts @@ -245,7 +245,7 @@ export const ACTIONS_LIST: {[key: string]: {name: string, category: TYPE_ACTION_ OPEN_HOURS: { name: 'If Operating Hours', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.OPEN_HOURS, src: "assets/images/actions/open_hours.svg", status: "active", description: 'This action moves the flow to different blocks, based on the operating hours status.
During working hours the TRUE block will be triggered.
During offline hours the FALSE block will be triggered.
One of the two options can be unset. The flow will optionally stop only when a block-populated condition is met.
To optionally stop the flow set “Stop on met condition”. To always continue unset the same option.' }, ONLINE_AGENTS: { name: 'If Online Agent', category: TYPE_ACTION_CATEGORY.MOST_USED, type: TYPE_ACTION.ONLINE_AGENTS, src: "assets/images/actions/online_agents.svg", status: "active", description: 'This action moves the flow to different blocks, based on the agents’ availability.
If there are agents available the TRUE block will be triggered.
If there are no agents available the FALSE block will be triggered.
One of the two options can be unset. The flow will optionally stop only when a block-populated condition is met.
To optionally stop the flow set “Stop on met condition”. To always continue unset Stop on met condition.' }, JSON_CONDITION: { name: 'Condition', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.JSON_CONDITION, src: "assets/images/actions/condition.svg", status: "active", }, - INTENT : { name: 'Connect block', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.INTENT, src:"assets/images/actions/connect_intent.svg", status: "active", description: 'This action moves the flow to the specified block.
Keep in mind that if there are other actions in the current block actions-pipeline they will be executed too, generating a parallel-execution of all the branches affering to each block triggered through this Connect-block action.'}, + INTENT : { name: 'Connect block', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.INTENT, src:"assets/images/actions/connect_intent.svg", status: "inactive", description: 'This action moves the flow to the specified block.
Keep in mind that if there are other actions in the current block actions-pipeline they will be executed too, generating a parallel-execution of all the branches affering to each block triggered through this Connect-block action.'}, ASSIGN_VARIABLE: { name: 'Set attribute', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.ASSIGN_VARIABLE, src: "assets/images/actions/assign_var.svg", status: "active", }, DELETE_VARIABLE: { name: 'Delete attribute', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.DELETE_VARIABLE, src: "assets/images/actions/delete_var.svg", status: "active", }, REPLACE_BOT: { name: 'Replace bot', category: TYPE_ACTION_CATEGORY.FLOW, type: TYPE_ACTION.REPLACE_BOT, src: "assets/images/actions/replace_bot.svg", status: "active", description: "Choose a chatbot to replace the current one in the conversation" },