+
@@ -167,6 +167,13 @@
}
}
}
+ @case(chatWorkflowBlockTypeEnum.GetCustomerDetails){
+
+
+
+
+
+ }
}
diff --git a/src/app/components/workflow-sidebar/workflow-sidebar.component.ts b/src/app/components/workflow-sidebar/workflow-sidebar.component.ts
index 0227296..381f5de 100644
--- a/src/app/components/workflow-sidebar/workflow-sidebar.component.ts
+++ b/src/app/components/workflow-sidebar/workflow-sidebar.component.ts
@@ -7,13 +7,13 @@ import { FieldDetails, FieldOptionDetail, FieldValidation, MessageDetails, RuleD
import { NodeModel } from '@syncfusion/ej2-angular-diagrams';
import { DropDownListComponent } from '@syncfusion/ej2-angular-dropdowns';
import { DatePickerModule, DateTimePickerModule } from '@syncfusion/ej2-angular-calendars';
-import { ButtonModule } from '@syncfusion/ej2-angular-buttons';
+import { ButtonModule, CheckBoxModule } from '@syncfusion/ej2-angular-buttons';
@Component({
selector: 'app-workflow-sidebar',
standalone: true,
- imports: [SidebarModule, FormsModule, CommonModule, DatePickerModule, DateTimePickerModule, ButtonModule],
+ imports: [SidebarModule, FormsModule, CommonModule, DatePickerModule, DateTimePickerModule, ButtonModule, CheckBoxModule],
templateUrl: './workflow-sidebar.component.html',
styleUrl: './workflow-sidebar.component.scss'
})
@@ -56,6 +56,10 @@ export class WorkflowSidebarComponent {
public newNodeInfo: any;
private updatePending = false;
+ public getEmailInfo: boolean = true;
+ public getNameInfo: boolean = false;
+ public getPhoneNumberInfo: boolean = false;
+
@Input() nodeEditType!: number;
@Input() nodeBlockType!: number;
@Input() sidebarHeader!: string;
@@ -288,6 +292,11 @@ export class WorkflowSidebarComponent {
}
break;
}
+ case (this.chatWorkflowBlockTypeEnum.GetCustomerDetails): {
+ let fieldInfo = this.createCustomerBlockFieldInfo();
+ this.newNodeInfo = this.createNodeInfo(null, this.nodeBlockType, this.selectedWorkFlowId, fieldInfo, null, null);
+ break;
+ }
}
if (this.isEdit) {
this.updateNode.emit([sourceNodeId, this.newNodeInfo]);
@@ -340,6 +349,14 @@ export class WorkflowSidebarComponent {
}
}
+ public createCustomerBlockFieldInfo(): FieldDetails {
+ return {
+ hasEmailDetails: this.getEmailInfo,
+ hasNameDetails: this.getNameInfo,
+ hasPhoneNumberDetails: this.getPhoneNumberInfo,
+ }
+ }
+
public createNode(width: number, height: number, nodeInfo: RuleData2): NodeModel {
return {
id: `node${nodeInfo.id}`,
diff --git a/src/app/data/list-data.ts b/src/app/data/list-data.ts
index 4c189e0..226a7e0 100644
--- a/src/app/data/list-data.ts
+++ b/src/app/data/list-data.ts
@@ -3,42 +3,19 @@ export const LIST_DATA: { [key: string]: any }[] = [
'text': 'Action',
'id': '01',
'category': 'Block Type',
- 'child': [{
- 'text': 'Identity',
+ 'child': [
+ {
+ 'text': 'Customer Block',
'id': '1',
+ 'blockid': 3,
+ 'editerTypeId': null,
'category': 'Action',
- 'child': [{
- 'text': 'Name',
- 'id': '1001',
- 'blockid': 3,
- 'editerTypeId': 18,
- 'category': 'Identity',
- },
- {
- 'text': 'Email',
- 'id': '1002',
- 'blockid': 3,
- 'editerTypeId': 19,
- 'category': 'Identity',
- },
- {
- 'text': 'Phone No',
- 'id': '1003',
- 'blockid': 3,
- 'editerTypeId': 20,
- 'category': 'Identity',
- },
- {
- 'text': 'Requester Linking',
- 'id': '1004',
- 'blockid': 3,
- 'editerTypeId': 21,
- 'category': 'Identity',
- }]
},
{
'text': 'Custom Message',
'id': '2',
+ 'blockid': 6,
+ 'editerTypeId': null,
'category': 'Action',
},
{
diff --git a/src/app/data/rule-data.ts b/src/app/data/rule-data.ts
index 0c97f69..0efbe09 100644
--- a/src/app/data/rule-data.ts
+++ b/src/app/data/rule-data.ts
@@ -1,155 +1,4 @@
-import { RuleData, RuleData2 } from "../models/appModel";
-
-
-export const RULE_DATA: RuleData[] = [
- {
- // identity input request rule
- "id" : 1,
- "workflow_id" : 1,
- "expression" : "Utils.IsValidEmail(input)",
- "success_message" : "Email received",
- "error_message" : "Invalid Email. Provide valid Email",
- "operator" : null,
- "success_action_name" : "EvaluateRule",
- "success_expression" : null,
- "success_workflow_id" : 1,
- "success_rule_id" : 2,
- "failure_action_name" : "OutputExpression",
- "failure_expression" : "false",
- "failure_workflow_id" : 1,
- "failure_rule_id" : 1,
- "child_rules" : null,
- "custom_details" : "{\"Field\": \"visitorEmail\", \"Description\": \"Provide valid email\", \"Placeholder\": \"Enter your email\", \"IsInputStage\": true}",
- "last_modified_on" : "2024-09-26T07:16:07.705Z",
- "is_active" : true
- },
- {
- // identity verification rule
- "id" : 2,
- "workflow_id" : 1,
- "expression" : "Utils.IsUserEmailExists(input)",
- "success_message" : "",
- "error_message" : "",
- "operator" : null,
- "success_action_name" : "EvaluateRule",
- "success_expression" : null,
- "success_workflow_id" : 1,
- "success_rule_id" : 4,
- "failure_action_name" : "EvaluateRule",
- "failure_expression" : null,
- "failure_workflow_id" : 1,
- "failure_rule_id" : 3,
- "child_rules" : null,
- "custom_details" : null,
- "last_modified_on" : "2024-09-16T12:17:20.768Z",
- "is_active" : true
- },
- {
- // requesting and updating name field
- "id" : 3,
- "workflow_id" : 1,
- "expression" : "Utils.SaveField(input)",
- "success_message" : "Name received",
- "error_message" : "Name should not be empty",
- "operator" : null,
- "success_action_name" : "EvaluateRule",
- "success_expression" : null,
- "success_workflow_id" : 1,
- "success_rule_id" : 4,
- "failure_action_name" : "OutputExpression",
- "failure_expression" : "false",
- "failure_workflow_id" : 1,
- "failure_rule_id" : 3,
- "child_rules" : null,
- "custom_details" : "{\"Field\": \"visitorName\", \"Description\": \"Provide valid name\", \"Placeholder\": \"Enter your name\", \"IsInputStage\": true}",
- "last_modified_on" : "2024-09-26T10:05:28.391Z",
- "is_active" : true
- },
- {
- // branching rule cases
- "id" : 4,
- "workflow_id" : 1,
- "expression" : "true",
- "success_message" : "",
- "error_message" : "",
- "operator" : null,
- "success_action_name" : "CustomAction", // validate the selected value in custom method action
- "success_expression" : null,
- "success_workflow_id" : null,
- "success_rule_id" : null,
- "failure_action_name" : null,
- "failure_expression" : null,
- "failure_workflow_id" : null,
- "failure_rule_id" : null,
- "child_rules" : null,
- "custom_details" : "{\"values\":[{\"value\":\"Bolddesk\",\"SuccessWorkflowId\":1,\"SuccessRuleId\":5},{\"value\":\"Boldsign\",\"SuccessWorkflowId\":1,\"SuccessRuleId\":6}]}",
- "last_modified_on" : "2024-09-16T13:10:50.543Z",
- "is_active" : true
- },
- {
- //branch rule from rule id "4"
- "id" : 5,
- "workflow_id" : 1,
- "expression" : "Utils.SendMessage(input)", // send message action for selected item
- "success_message" : "Bold desk product selected",
- "error_message" : "Send message action failed",
- "operator" : null,
- "success_action_name" : "EvaluateRule",
- "success_expression" : null,
- "success_workflow_id" : 1,
- "success_rule_id" : 7,
- "failure_action_name" : null,
- "failure_expression" : null,
- "failure_workflow_id" : null,
- "failure_rule_id" : null,
- "child_rules" : null,
- "custom_details" : "{\"Message\": \"Bolddesk value selected\"}",
- "last_modified_on" : "2024-09-16T13:10:50.543Z",
- "is_active" : true
- },
- {
- //branch rule from rule id "4"
- "id" : 6,
- "workflow_id" : 1,
- "expression" : "Utils.SendMessage(input)", // send message action for selected item
- "success_message" : "Bold sign product selected",
- "error_message" : "Send message action failed",
- "operator" : null,
- "success_action_name" : "EvaluateRule",
- "success_expression" : null,
- "success_workflow_id" : 7,
- "success_rule_id" : 1,
- "failure_action_name" : null,
- "failure_expression" : null,
- "failure_workflow_id" : null,
- "failure_rule_id" : null,
- "child_rules" : null,
- "custom_details" : "{\"Message\": \"Boldsign value selected\"}",
- "last_modified_on" : "2024-09-16T13:10:50.543Z",
- "is_active" : true
- },
- {
- // flow completed
- "id" : 7,
- "workflow_id" : 1,
- "expression" : "true",
- "success_message" : "Flow completed",
- "error_message" : "Flow completed action failed",
- "operator" : null,
- "success_action_name" : "OutputExpression",
- "success_expression" : "true",
- "success_workflow_id" : null,
- "success_rule_id" : null,
- "failure_action_name" : null,
- "failure_expression" : null,
- "failure_workflow_id" : null,
- "failure_rule_id" : null,
- "child_rules" : null,
- "custom_details" : null,
- "last_modified_on" : "2024-09-16T13:10:50.543Z",
- "is_active" : true
- }
-];
+import { RuleData2 } from "../models/appModel";
export const RULE_DATA2: RuleData2[] = [
{
diff --git a/src/app/models/appModel.ts b/src/app/models/appModel.ts
index 3e23f8d..f1b7459 100644
--- a/src/app/models/appModel.ts
+++ b/src/app/models/appModel.ts
@@ -1,26 +1,5 @@
import { TextFormatEnum } from "./enum";
-export interface RuleData {
- id: number;
- workflow_id: number;
- expression: string;
- success_message: string;
- error_message: string;
- operator: any | null; // Use 'any' if the data type is unknown, else specify a more specific type
- success_action_name: string | null;
- success_expression: string | null;
- success_workflow_id: number | null;
- success_rule_id: number | null;
- failure_action_name: string | null;
- failure_expression: string | null;
- failure_workflow_id: number | null;
- failure_rule_id: number | null;
- child_rules: any | null; // If child_rules has a specific type, replace 'any' with it
- custom_details: string | null; // Assuming this is always a JSON string
- last_modified_on: string; // Keep as a string, or use Date if you prefer converting it
- is_active: boolean;
-}
-
// Define FieldOptionDetails interface
export interface FieldOptionDetail {
label: string;
@@ -37,17 +16,20 @@ export interface FieldValidation {
// Define FieldDetails interface
export interface FieldDetails {
- description?: string | null;
- label?: string | null;
- placeholder?: string | null;
- apiName?: string | null;
- maskForAgent?: boolean | null;
- isOptional?: boolean | null;
- useAPI?: boolean | null;
+ description?: string;
+ label?: string;
+ placeholder?: string;
+ apiName?: string;
+ maskForAgent?: boolean;
+ isOptional?: boolean;
+ useAPI?: boolean;
fieldValidation?: FieldValidation | null;
- value?: string | null;
- groupId?: number | null;
- ruleType?: number | null;
+ value?: string;
+ groupId?: number;
+ ruleType?: number;
+ hasEmailDetails?: boolean; // Indicates if the customer block has email details
+ hasNameDetails?: boolean;
+ hasPhoneNumberDetails?: boolean;
}
// Define MessageDetails interface
From 2e3479a1b0f1d0beee05a9983727137e502bda5b Mon Sep 17 00:00:00 2001
From: VijayalakshmiSF4471
<164475295+VijayalakshmirSF4471@users.noreply.github.com>
Date: Mon, 23 Dec 2024 13:19:27 +0530
Subject: [PATCH 2/6] feature(402683): removed commented line
---
.../components/workflow-diagram/workflow-diagram.component.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/app/components/workflow-diagram/workflow-diagram.component.ts b/src/app/components/workflow-diagram/workflow-diagram.component.ts
index e2221df..455f8d2 100644
--- a/src/app/components/workflow-diagram/workflow-diagram.component.ts
+++ b/src/app/components/workflow-diagram/workflow-diagram.component.ts
@@ -318,7 +318,6 @@ export class WorkflowDiagramComponent implements AfterViewInit{
this.isParentListItem = false; // The value is reset here, to handle document click case of dropdown
// Reset ListView to its initial state before opening
if (this.listView) {
- // this.listView.dataSource = this.listdata; // Reset data
while ((this.listView as any).curDSLevel.length > 0) {
this.listView.back();
}
From 26279e5cc913ebed8327d481ed5be67c49a63d49 Mon Sep 17 00:00:00 2001
From: VijayalakshmiSF4471
<164475295+VijayalakshmirSF4471@users.noreply.github.com>
Date: Mon, 23 Dec 2024 18:29:02 +0530
Subject: [PATCH 3/6] feature(402683): made changes as per incoming changes
---
.../workflow-diagram/workflow-diagram.component.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/components/workflow-diagram/workflow-diagram.component.html b/src/app/components/workflow-diagram/workflow-diagram.component.html
index 8b3f5b9..aacb149 100644
--- a/src/app/components/workflow-diagram/workflow-diagram.component.html
+++ b/src/app/components/workflow-diagram/workflow-diagram.component.html
@@ -117,8 +117,8 @@
@case(chatWorkflowBlockTypeEnum.GetCustomerDetails){
-
-
+
+
}
}
From 646d8334c12ac9361128329ae0cbabc826e4c43e Mon Sep 17 00:00:00 2001
From: VijayalakshmiSF4471
<164475295+VijayalakshmirSF4471@users.noreply.github.com>
Date: Fri, 27 Dec 2024 17:17:21 +0530
Subject: [PATCH 4/6] feature(402683): made changes to get customer block
details from API
---
.../workflow-diagram.component.html | 20 +++++---
.../workflow-diagram.component.ts | 1 -
.../workflow-sidebar.component.ts | 49 +++++++++----------
src/app/models/appModel.ts | 12 +++--
4 files changed, 44 insertions(+), 38 deletions(-)
diff --git a/src/app/components/workflow-diagram/workflow-diagram.component.html b/src/app/components/workflow-diagram/workflow-diagram.component.html
index 1a549ce..ea49c8b 100644
--- a/src/app/components/workflow-diagram/workflow-diagram.component.html
+++ b/src/app/components/workflow-diagram/workflow-diagram.component.html
@@ -38,7 +38,7 @@
- @if(data.data.chatWorkflowBlockId !== chatWorkflowBlockTypeEnum.SendTextMessage){
+ @if(data.data.chatWorkflowBlockId !== chatWorkflowBlockTypeEnum.SendTextMessage && data.data.chatWorkflowBlockId !== chatWorkflowBlockTypeEnum.GetCustomerDetails) {
}
@switch (data.data.chatWorkflowBlockId){
@@ -51,6 +51,17 @@
}
+ @case(chatWorkflowBlockTypeEnum.GetCustomerDetails){
+