vcomply-workflow-engine 2.6.146 → 2.6.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3062,7 +3062,6 @@ class WorkflowComplianceComponent {
3062
3062
  params = params.append('program_ids', program_id);
3063
3063
  }
3064
3064
  this.responsibilityService.getOrganizationPeople(params).subscribe((res) => {
3065
- console.log("ressss ==>", res, program_id);
3066
3065
  this.allUsersList = res.map((user) => {
3067
3066
  user.member_name = user.employee_name;
3068
3067
  return user;
@@ -3241,7 +3240,7 @@ class WorkflowComplianceComponent {
3241
3240
  }
3242
3241
  getEditResponsibilityDetails(id) {
3243
3242
  this.responsibilityService.editResponsibility(id).subscribe((res) => {
3244
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
3243
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
3245
3244
  this.isDuplicateEntrust = true;
3246
3245
  if (res) {
3247
3246
  this.originalAssignee = [Number(res.assigned_to)];
@@ -3313,8 +3312,8 @@ class WorkflowComplianceComponent {
3313
3312
  riskMatrix: res === null || res === void 0 ? void 0 : res.risk_matrix_data
3314
3313
  };
3315
3314
  this.selectedProgram = ((_t = res === null || res === void 0 ? void 0 : res.programDetails) === null || _t === void 0 ? void 0 : _t.category_id) ? res.programDetails : undefined;
3316
- if ((_u = this.selectedProgram) === null || _u === void 0 ? void 0 : _u._id) {
3317
- this.getListsAccordingToProgram((_v = this.selectedProgram) === null || _v === void 0 ? void 0 : _v._id);
3315
+ if (((_u = this.selectedProgram) === null || _u === void 0 ? void 0 : _u._id) && ((_v = this.orgDetails) === null || _v === void 0 ? void 0 : _v.hasProgramFullPermission)) {
3316
+ this.getListsAccordingToProgram((_w = this.selectedProgram) === null || _w === void 0 ? void 0 : _w._id);
3318
3317
  }
3319
3318
  this.isNotificationPending = res.notification_pending;
3320
3319
  if (this.isNotificationPending) {
@@ -3338,7 +3337,7 @@ class WorkflowComplianceComponent {
3338
3337
  this.organizationId = this.authService.getOrganizationId();
3339
3338
  this.memberId = this.authService.getMemberId();
3340
3339
  }
3341
- if (((_w = this.responsibilityForm.assignees.list) === null || _w === void 0 ? void 0 : _w.length) === 0) {
3340
+ if (((_x = this.responsibilityForm.assignees.list) === null || _x === void 0 ? void 0 : _x.length) === 0) {
3342
3341
  this.isEntrust = true;
3343
3342
  this.mode = 'CREATE';
3344
3343
  this.assigneeRadioSelect = false;
@@ -3367,7 +3366,7 @@ class WorkflowComplianceComponent {
3367
3366
  frequency_time: ''
3368
3367
  };
3369
3368
  }
3370
- if ((_x = res.assessment) === null || _x === void 0 ? void 0 : _x.assessment_id) {
3369
+ if ((_y = res.assessment) === null || _y === void 0 ? void 0 : _y.assessment_id) {
3371
3370
  this.getAssessmentDetails(res.assessment, res.questionnaire_type);
3372
3371
  }
3373
3372
  if (!this.responsibilityForm.checkpoints) {
@@ -3469,8 +3468,7 @@ class WorkflowComplianceComponent {
3469
3468
  }
3470
3469
  }
3471
3470
  saveSelectedList(type, selectedItems) {
3472
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
3473
- let refreshWithProgram = ((_a = this.orgDetails) === null || _a === void 0 ? void 0 : _a.hasProgramFullPermission) ? 'refreshListsWhileProgramSelected' : '';
3471
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
3474
3472
  switch (type) {
3475
3473
  case 'assignors':
3476
3474
  if (this.invalidType === 'whom') {
@@ -3515,9 +3513,9 @@ class WorkflowComplianceComponent {
3515
3513
  });
3516
3514
  break;
3517
3515
  case 'program':
3518
- console.log("selectedItemsselectedItemsselectedItemsselectedItems", selectedItems);
3516
+ debugger;
3519
3517
  this.responsibilityForm.linkedProgram = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.linkedProgram;
3520
- if (this.selectedProgram && !(((_b = this.selectedProgram) === null || _b === void 0 ? void 0 : _b.programType) === 0 && ((_d = (_c = this.selectedProgram) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'uncategorized')) {
3518
+ if (this.selectedProgram && !(((_a = this.selectedProgram) === null || _a === void 0 ? void 0 : _a.programType) === 0 && ((_c = (_b = this.selectedProgram) === null || _b === void 0 ? void 0 : _b.name) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'uncategorized' || !((_d = this.orgDetails) === null || _d === void 0 ? void 0 : _d.hasProgramFullPermission))) {
3521
3519
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3522
3520
  let categoryId = (_e = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _e === void 0 ? void 0 : _e.toString();
3523
3521
  if ((_f = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _f === void 0 ? void 0 : _f.length) {
@@ -3527,10 +3525,18 @@ class WorkflowComplianceComponent {
3527
3525
  this.responsibilityForm.category_id = (_j = (_h = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _h === void 0 ? void 0 : _h.category_id) === null || _j === void 0 ? void 0 : _j.toString();
3528
3526
  }
3529
3527
  this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(_k = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _k === void 0 ? void 0 : _k.category_id])];
3528
+ const programCustomTags = ((_l = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _l === void 0 ? void 0 : _l.custom_tags) ? JSON.parse((_m = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _m === void 0 ? void 0 : _m.custom_tags) : [];
3529
+ programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach((tag) => {
3530
+ const tagData = typeof tag === "string" ? JSON.parse(tag) : tag;
3531
+ const index = this.responsibilityForm.customTags.findIndex((tagElement) => tagElement.tag_name == tagData.tag_name);
3532
+ if (index == -1) {
3533
+ this.responsibilityForm.customTags.push(tagData);
3534
+ }
3535
+ });
3530
3536
  }
3531
3537
  else {
3532
- if ((_l = this.responsibilityForm) === null || _l === void 0 ? void 0 : _l.assessment) {
3533
- ((_o = Object.keys((_m = this.responsibilityForm) === null || _m === void 0 ? void 0 : _m.assessment)) === null || _o === void 0 ? void 0 : _o.length) ? this.getProgramDetails(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program._id) : null;
3538
+ if ((_o = this.responsibilityForm) === null || _o === void 0 ? void 0 : _o.assessment) {
3539
+ ((_q = Object.keys((_p = this.responsibilityForm) === null || _p === void 0 ? void 0 : _p.assessment)) === null || _q === void 0 ? void 0 : _q.length) ? this.getProgramDetails(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program._id) : null;
3534
3540
  }
3535
3541
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3536
3542
  this.responsibilityForm.program = [];
@@ -3538,15 +3544,15 @@ class WorkflowComplianceComponent {
3538
3544
  this.responsibilityForm.program_selected_ids = [];
3539
3545
  this.responsibilityForm.customTags = [];
3540
3546
  this.responsibilityForm.program = (selectedItems.program) ? [selectedItems.program] : [];
3541
- let categoryId = (_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _p === void 0 ? void 0 : _p.toString();
3542
- if ((_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _q === void 0 ? void 0 : _q.length) {
3543
- this.responsibilityForm.category_id = ((_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _r === void 0 ? void 0 : _r.category_id) + ',' + categoryId;
3547
+ let categoryId = (_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _r === void 0 ? void 0 : _r.toString();
3548
+ if ((_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _s === void 0 ? void 0 : _s.length) {
3549
+ this.responsibilityForm.category_id = ((_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.category_id) + ',' + categoryId;
3544
3550
  }
3545
3551
  else {
3546
- this.responsibilityForm.category_id = (_t = (_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _s === void 0 ? void 0 : _s.category_id) === null || _t === void 0 ? void 0 : _t.toString();
3552
+ this.responsibilityForm.category_id = (_v = (_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.category_id) === null || _v === void 0 ? void 0 : _v.toString();
3547
3553
  }
3548
- this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.category_id])];
3549
- const programCustomTags = ((_v = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _v === void 0 ? void 0 : _v.custom_tags) ? JSON.parse((_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.custom_tags) : [];
3554
+ this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.category_id])];
3555
+ const programCustomTags = ((_x = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _x === void 0 ? void 0 : _x.custom_tags) ? JSON.parse((_y = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _y === void 0 ? void 0 : _y.custom_tags) : [];
3550
3556
  programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach((tag) => {
3551
3557
  const tagData = typeof tag === "string" ? JSON.parse(tag) : tag;
3552
3558
  const index = this.responsibilityForm.customTags.findIndex((tagElement) => tagElement.tag_name == tagData.tag_name);
@@ -3554,17 +3560,16 @@ class WorkflowComplianceComponent {
3554
3560
  this.responsibilityForm.customTags.push(tagData);
3555
3561
  }
3556
3562
  });
3557
- console.log("this.orgDetails?.hasProgramFullPermission ==>", (_x = this.orgDetails) === null || _x === void 0 ? void 0 : _x.hasProgramFullPermission);
3558
- if ((_y = this.orgDetails) === null || _y === void 0 ? void 0 : _y.hasProgramFullPermission) {
3559
- this.responsibilityForm.assignees.whoCanComplete = (((_z = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _z === void 0 ? void 0 : _z.default_assignee_type) == 'ANYONE') ? 'ANY_ONE' : 'ALL';
3560
- this.responsibilityForm.reviewers.sequentialWorkflow = (((_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _0 === void 0 ? void 0 : _0.default_reviewers_type) == 'SEQUENTIAL') ? true : false;
3561
- this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _1 === void 0 ? void 0 : _1.evidence_upload_flag) ? true : false;
3562
- if ((_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _2 === void 0 ? void 0 : _2.evidence_upload_flag) {
3563
+ if ((_z = this.orgDetails) === null || _z === void 0 ? void 0 : _z.hasProgramFullPermission) {
3564
+ this.responsibilityForm.assignees.whoCanComplete = (((_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _0 === void 0 ? void 0 : _0.default_assignee_type) == 'ANYONE') ? 'ANY_ONE' : 'ALL';
3565
+ this.responsibilityForm.reviewers.sequentialWorkflow = (((_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _1 === void 0 ? void 0 : _1.default_reviewers_type) == 'SEQUENTIAL') ? true : false;
3566
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _2 === void 0 ? void 0 : _2.evidence_upload_flag) ? true : false;
3567
+ if ((_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _3 === void 0 ? void 0 : _3.evidence_upload_flag) {
3563
3568
  this.moreOptions.FORMATE_EVIDENCE = true;
3564
3569
  }
3565
3570
  }
3566
- if (!(((_3 = this.selectedProgram) === null || _3 === void 0 ? void 0 : _3.programType) === 0 && ((_5 = (_4 = this.selectedProgram) === null || _4 === void 0 ? void 0 : _4.name) === null || _5 === void 0 ? void 0 : _5.toLowerCase()) === 'uncategorized')) {
3567
- if ((_6 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _6 === void 0 ? void 0 : _6._id) {
3571
+ if (!(((_4 = this.selectedProgram) === null || _4 === void 0 ? void 0 : _4.programType) === 0 && ((_6 = (_5 = this.selectedProgram) === null || _5 === void 0 ? void 0 : _5.name) === null || _6 === void 0 ? void 0 : _6.toLowerCase()) === 'uncategorized')) {
3572
+ if (((_7 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _7 === void 0 ? void 0 : _7._id) && ((_8 = this.orgDetails) === null || _8 === void 0 ? void 0 : _8.hasProgramFullPermission)) {
3568
3573
  this.filterListsAccordingToProgram(selectedItems.program._id);
3569
3574
  }
3570
3575
  else {
@@ -3601,10 +3606,10 @@ class WorkflowComplianceComponent {
3601
3606
  this.responsibilityForm.riskMatrix = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.riskMatrix;
3602
3607
  break;
3603
3608
  case 'formate_evidence':
3604
- this.responsibilityForm.formatAndEvidence.formatRequired = (_7 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _7 !== void 0 ? _7 : false;
3605
- this.responsibilityForm.formatAndEvidence.formatFiles = (_8 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _8 !== void 0 ? _8 : [];
3606
- this.responsibilityForm.formatAndEvidence.formatLinks = (_9 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _9 !== void 0 ? _9 : [];
3607
- this.responsibilityForm.formatAndEvidence.evidenceRequired = (_10 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _10 !== void 0 ? _10 : false;
3609
+ this.responsibilityForm.formatAndEvidence.formatRequired = (_9 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _9 !== void 0 ? _9 : false;
3610
+ this.responsibilityForm.formatAndEvidence.formatFiles = (_10 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _10 !== void 0 ? _10 : [];
3611
+ this.responsibilityForm.formatAndEvidence.formatLinks = (_11 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _11 !== void 0 ? _11 : [];
3612
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = (_12 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _12 !== void 0 ? _12 : false;
3608
3613
  break;
3609
3614
  case 'reviewFrequency':
3610
3615
  this.responsibilityForm.reviewers.reviewFrequency = {
@@ -3614,13 +3619,17 @@ class WorkflowComplianceComponent {
3614
3619
  }
3615
3620
  this.activeDeselector();
3616
3621
  }
3622
+ /**
3623
+ * If the program is selected and the user has full permission, refresh the lists while the program
3624
+ * is selected. Otherwise, refresh all lists.
3625
+ * </code>
3626
+ */
3617
3627
  callRefreshList() {
3618
3628
  var _a;
3619
3629
  if (this.responsibilityForm.program.length && ((_a = this.orgDetails) === null || _a === void 0 ? void 0 : _a.hasProgramFullPermission)) {
3620
3630
  this.refreshListsWhileProgramSelected();
3621
3631
  }
3622
3632
  else {
3623
- console.log(777777);
3624
3633
  this.refreshAllLists();
3625
3634
  }
3626
3635
  }
@@ -3894,10 +3903,8 @@ class WorkflowComplianceComponent {
3894
3903
  this.assigneesList = allUsers.filter((user) => !(reviewersIds.includes(user.my_member_id) || overseerIds.includes(user.my_member_id)));
3895
3904
  this.reviewersList = allUsers.filter((user) => !(overseerIds.includes(user.my_member_id) || assigneeIds.includes(user.my_member_id)));
3896
3905
  this.overseersList = allUsers.filter((user) => !(assignorAndAssigneesIds.includes(user.my_member_id) || reviewersIds.includes(user.my_member_id)));
3897
- console.log("allUsers ===>", this.reviewersList, this.overseersList);
3898
3906
  }
3899
3907
  refreshListsWhileProgramSelected() {
3900
- debugger;
3901
3908
  let assignorAndAssigneesIds = [];
3902
3909
  let reviewersIds = [];
3903
3910
  let overseerIds = [];