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.
@@ -3448,7 +3448,6 @@
3448
3448
  params = params.append('program_ids', program_id);
3449
3449
  }
3450
3450
  this.responsibilityService.getOrganizationPeople(params).subscribe(function (res) {
3451
- console.log("ressss ==>", res, program_id);
3452
3451
  _this.allUsersList = res.map(function (user) {
3453
3452
  user.member_name = user.employee_name;
3454
3453
  return user;
@@ -3630,7 +3629,7 @@
3630
3629
  WorkflowComplianceComponent.prototype.getEditResponsibilityDetails = function (id) {
3631
3630
  var _this = this;
3632
3631
  this.responsibilityService.editResponsibility(id).subscribe(function (res) {
3633
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
3632
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
3634
3633
  _this.isDuplicateEntrust = true;
3635
3634
  if (res) {
3636
3635
  _this.originalAssignee = [Number(res.assigned_to)];
@@ -3702,8 +3701,8 @@
3702
3701
  riskMatrix: res === null || res === void 0 ? void 0 : res.risk_matrix_data
3703
3702
  };
3704
3703
  _this.selectedProgram = ((_t = res === null || res === void 0 ? void 0 : res.programDetails) === null || _t === void 0 ? void 0 : _t.category_id) ? res.programDetails : undefined;
3705
- if ((_u = _this.selectedProgram) === null || _u === void 0 ? void 0 : _u._id) {
3706
- _this.getListsAccordingToProgram((_v = _this.selectedProgram) === null || _v === void 0 ? void 0 : _v._id);
3704
+ if (((_u = _this.selectedProgram) === null || _u === void 0 ? void 0 : _u._id) && ((_v = _this.orgDetails) === null || _v === void 0 ? void 0 : _v.hasProgramFullPermission)) {
3705
+ _this.getListsAccordingToProgram((_w = _this.selectedProgram) === null || _w === void 0 ? void 0 : _w._id);
3707
3706
  }
3708
3707
  _this.isNotificationPending = res.notification_pending;
3709
3708
  if (_this.isNotificationPending) {
@@ -3727,7 +3726,7 @@
3727
3726
  _this.organizationId = _this.authService.getOrganizationId();
3728
3727
  _this.memberId = _this.authService.getMemberId();
3729
3728
  }
3730
- if (((_w = _this.responsibilityForm.assignees.list) === null || _w === void 0 ? void 0 : _w.length) === 0) {
3729
+ if (((_x = _this.responsibilityForm.assignees.list) === null || _x === void 0 ? void 0 : _x.length) === 0) {
3731
3730
  _this.isEntrust = true;
3732
3731
  _this.mode = 'CREATE';
3733
3732
  _this.assigneeRadioSelect = false;
@@ -3756,7 +3755,7 @@
3756
3755
  frequency_time: ''
3757
3756
  };
3758
3757
  }
3759
- if ((_x = res.assessment) === null || _x === void 0 ? void 0 : _x.assessment_id) {
3758
+ if ((_y = res.assessment) === null || _y === void 0 ? void 0 : _y.assessment_id) {
3760
3759
  _this.getAssessmentDetails(res.assessment, res.questionnaire_type);
3761
3760
  }
3762
3761
  if (!_this.responsibilityForm.checkpoints) {
@@ -3862,8 +3861,7 @@
3862
3861
  };
3863
3862
  WorkflowComplianceComponent.prototype.saveSelectedList = function (type, selectedItems) {
3864
3863
  var _this = this;
3865
- 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;
3866
- var refreshWithProgram = ((_a = this.orgDetails) === null || _a === void 0 ? void 0 : _a.hasProgramFullPermission) ? 'refreshListsWhileProgramSelected' : '';
3864
+ 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;
3867
3865
  switch (type) {
3868
3866
  case 'assignors':
3869
3867
  if (this.invalidType === 'whom') {
@@ -3908,9 +3906,9 @@
3908
3906
  });
3909
3907
  break;
3910
3908
  case 'program':
3911
- console.log("selectedItemsselectedItemsselectedItemsselectedItems", selectedItems);
3909
+ debugger;
3912
3910
  this.responsibilityForm.linkedProgram = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.linkedProgram;
3913
- 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')) {
3911
+ 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))) {
3914
3912
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3915
3913
  var categoryId = (_e = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _e === void 0 ? void 0 : _e.toString();
3916
3914
  if ((_f = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _f === void 0 ? void 0 : _f.length) {
@@ -3920,10 +3918,18 @@
3920
3918
  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();
3921
3919
  }
3922
3920
  this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_k = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _k === void 0 ? void 0 : _k.category_id])));
3921
+ var 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) : [];
3922
+ programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach(function (tag) {
3923
+ var tagData = typeof tag === "string" ? JSON.parse(tag) : tag;
3924
+ var index = _this.responsibilityForm.customTags.findIndex(function (tagElement) { return tagElement.tag_name == tagData.tag_name; });
3925
+ if (index == -1) {
3926
+ _this.responsibilityForm.customTags.push(tagData);
3927
+ }
3928
+ });
3923
3929
  }
3924
3930
  else {
3925
- if ((_l = this.responsibilityForm) === null || _l === void 0 ? void 0 : _l.assessment) {
3926
- ((_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;
3931
+ if ((_o = this.responsibilityForm) === null || _o === void 0 ? void 0 : _o.assessment) {
3932
+ ((_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;
3927
3933
  }
3928
3934
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3929
3935
  this.responsibilityForm.program = [];
@@ -3931,15 +3937,15 @@
3931
3937
  this.responsibilityForm.program_selected_ids = [];
3932
3938
  this.responsibilityForm.customTags = [];
3933
3939
  this.responsibilityForm.program = (selectedItems.program) ? [selectedItems.program] : [];
3934
- var categoryId = (_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _p === void 0 ? void 0 : _p.toString();
3935
- if ((_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _q === void 0 ? void 0 : _q.length) {
3936
- this.responsibilityForm.category_id = ((_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _r === void 0 ? void 0 : _r.category_id) + ',' + categoryId;
3940
+ var categoryId = (_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _r === void 0 ? void 0 : _r.toString();
3941
+ if ((_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _s === void 0 ? void 0 : _s.length) {
3942
+ this.responsibilityForm.category_id = ((_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.category_id) + ',' + categoryId;
3937
3943
  }
3938
3944
  else {
3939
- 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();
3945
+ 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();
3940
3946
  }
3941
- this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.category_id])));
3942
- var 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) : [];
3947
+ this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.category_id])));
3948
+ var 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) : [];
3943
3949
  programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach(function (tag) {
3944
3950
  var tagData = typeof tag === "string" ? JSON.parse(tag) : tag;
3945
3951
  var index = _this.responsibilityForm.customTags.findIndex(function (tagElement) { return tagElement.tag_name == tagData.tag_name; });
@@ -3947,17 +3953,16 @@
3947
3953
  _this.responsibilityForm.customTags.push(tagData);
3948
3954
  }
3949
3955
  });
3950
- console.log("this.orgDetails?.hasProgramFullPermission ==>", (_x = this.orgDetails) === null || _x === void 0 ? void 0 : _x.hasProgramFullPermission);
3951
- if ((_y = this.orgDetails) === null || _y === void 0 ? void 0 : _y.hasProgramFullPermission) {
3952
- 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';
3953
- 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;
3954
- 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;
3955
- if ((_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _2 === void 0 ? void 0 : _2.evidence_upload_flag) {
3956
+ if ((_z = this.orgDetails) === null || _z === void 0 ? void 0 : _z.hasProgramFullPermission) {
3957
+ 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';
3958
+ 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;
3959
+ 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;
3960
+ if ((_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _3 === void 0 ? void 0 : _3.evidence_upload_flag) {
3956
3961
  this.moreOptions.FORMATE_EVIDENCE = true;
3957
3962
  }
3958
3963
  }
3959
- 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')) {
3960
- if ((_6 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _6 === void 0 ? void 0 : _6._id) {
3964
+ 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')) {
3965
+ 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)) {
3961
3966
  this.filterListsAccordingToProgram(selectedItems.program._id);
3962
3967
  }
3963
3968
  else {
@@ -3994,10 +3999,10 @@
3994
3999
  this.responsibilityForm.riskMatrix = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.riskMatrix;
3995
4000
  break;
3996
4001
  case 'formate_evidence':
3997
- this.responsibilityForm.formatAndEvidence.formatRequired = (_7 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _7 !== void 0 ? _7 : false;
3998
- this.responsibilityForm.formatAndEvidence.formatFiles = (_8 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _8 !== void 0 ? _8 : [];
3999
- this.responsibilityForm.formatAndEvidence.formatLinks = (_9 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _9 !== void 0 ? _9 : [];
4000
- this.responsibilityForm.formatAndEvidence.evidenceRequired = (_10 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _10 !== void 0 ? _10 : false;
4002
+ this.responsibilityForm.formatAndEvidence.formatRequired = (_9 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _9 !== void 0 ? _9 : false;
4003
+ this.responsibilityForm.formatAndEvidence.formatFiles = (_10 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _10 !== void 0 ? _10 : [];
4004
+ this.responsibilityForm.formatAndEvidence.formatLinks = (_11 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _11 !== void 0 ? _11 : [];
4005
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = (_12 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _12 !== void 0 ? _12 : false;
4001
4006
  break;
4002
4007
  case 'reviewFrequency':
4003
4008
  this.responsibilityForm.reviewers.reviewFrequency = {
@@ -4007,13 +4012,17 @@
4007
4012
  }
4008
4013
  this.activeDeselector();
4009
4014
  };
4015
+ /**
4016
+ * If the program is selected and the user has full permission, refresh the lists while the program
4017
+ * is selected. Otherwise, refresh all lists.
4018
+ * </code>
4019
+ */
4010
4020
  WorkflowComplianceComponent.prototype.callRefreshList = function () {
4011
4021
  var _a;
4012
4022
  if (this.responsibilityForm.program.length && ((_a = this.orgDetails) === null || _a === void 0 ? void 0 : _a.hasProgramFullPermission)) {
4013
4023
  this.refreshListsWhileProgramSelected();
4014
4024
  }
4015
4025
  else {
4016
- console.log(777777);
4017
4026
  this.refreshAllLists();
4018
4027
  }
4019
4028
  };
@@ -4288,10 +4297,8 @@
4288
4297
  this.assigneesList = allUsers.filter(function (user) { return !(reviewersIds.includes(user.my_member_id) || overseerIds.includes(user.my_member_id)); });
4289
4298
  this.reviewersList = allUsers.filter(function (user) { return !(overseerIds.includes(user.my_member_id) || assigneeIds.includes(user.my_member_id)); });
4290
4299
  this.overseersList = allUsers.filter(function (user) { return !(assignorAndAssigneesIds.includes(user.my_member_id) || reviewersIds.includes(user.my_member_id)); });
4291
- console.log("allUsers ===>", this.reviewersList, this.overseersList);
4292
4300
  };
4293
4301
  WorkflowComplianceComponent.prototype.refreshListsWhileProgramSelected = function () {
4294
- debugger;
4295
4302
  var assignorAndAssigneesIds = [];
4296
4303
  var reviewersIds = [];
4297
4304
  var overseerIds = [];