vcomply-workflow-engine 2.6.3 → 2.6.6

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.
@@ -3428,7 +3428,6 @@
3428
3428
  else {
3429
3429
  _this.responsibilityForm.reviewers.list = [];
3430
3430
  }
3431
- console.log("reviewersListreviewersList", _this.responsibilityForm.program[0], _this.reviewersList, _this.responsibilityForm.reviewers.list, reviewers);
3432
3431
  }
3433
3432
  else {
3434
3433
  _this.responsibilityForm.reviewers.list = [];
@@ -3761,7 +3760,7 @@
3761
3760
  };
3762
3761
  WorkflowComplianceComponent.prototype.saveSelectedList = function (type, selectedItems) {
3763
3762
  var _this = this;
3764
- 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;
3763
+ 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;
3765
3764
  switch (type) {
3766
3765
  case 'assignors':
3767
3766
  if (this.invalidType === 'whom') {
@@ -3833,22 +3832,24 @@
3833
3832
  this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_j = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _j === void 0 ? void 0 : _j.category_id])));
3834
3833
  }
3835
3834
  else {
3836
- ((_l = Object.keys((_k = this.responsibilityForm) === null || _k === void 0 ? void 0 : _k.assessment)) === null || _l === void 0 ? void 0 : _l.length) ? this.getProgramDetails(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program._id) : null;
3835
+ if ((_k = this.responsibilityForm) === null || _k === void 0 ? void 0 : _k.assessment) {
3836
+ ((_m = Object.keys((_l = this.responsibilityForm) === null || _l === void 0 ? void 0 : _l.assessment)) === null || _m === void 0 ? void 0 : _m.length) ? this.getProgramDetails(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program._id) : null;
3837
+ }
3837
3838
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3838
3839
  this.responsibilityForm.program = [];
3839
3840
  this.responsibilityForm.category_id = '';
3840
3841
  this.responsibilityForm.program_selected_ids = [];
3841
3842
  this.responsibilityForm.customTags = [];
3842
3843
  this.responsibilityForm.program = (selectedItems.program) ? [selectedItems.program] : [];
3843
- var categoryId = (_m = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _m === void 0 ? void 0 : _m.toString();
3844
- if ((_o = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _o === void 0 ? void 0 : _o.length) {
3845
- this.responsibilityForm.category_id = ((_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _p === void 0 ? void 0 : _p.category_id) + ',' + categoryId;
3844
+ var categoryId = (_o = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _o === void 0 ? void 0 : _o.toString();
3845
+ if ((_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _p === void 0 ? void 0 : _p.length) {
3846
+ this.responsibilityForm.category_id = ((_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _q === void 0 ? void 0 : _q.category_id) + ',' + categoryId;
3846
3847
  }
3847
3848
  else {
3848
- this.responsibilityForm.category_id = (_r = (_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _q === void 0 ? void 0 : _q.category_id) === null || _r === void 0 ? void 0 : _r.toString();
3849
+ this.responsibilityForm.category_id = (_s = (_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _r === void 0 ? void 0 : _r.category_id) === null || _s === void 0 ? void 0 : _s.toString();
3849
3850
  }
3850
- this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _s === void 0 ? void 0 : _s.category_id])));
3851
- var programCustomTags = ((_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.custom_tags) ? JSON.parse((_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.custom_tags) : [];
3851
+ this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.category_id])));
3852
+ var programCustomTags = ((_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.custom_tags) ? JSON.parse((_v = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _v === void 0 ? void 0 : _v.custom_tags) : [];
3852
3853
  programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach(function (tag) {
3853
3854
  var tagData = JSON === null || JSON === void 0 ? void 0 : JSON.parse(tag);
3854
3855
  var index = _this.responsibilityForm.customTags.findIndex(function (tagElement) { return tagElement.tag_name == tagData.tag_name; });
@@ -3856,12 +3857,12 @@
3856
3857
  _this.responsibilityForm.customTags.push(tagData);
3857
3858
  }
3858
3859
  });
3859
- this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_v = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _v === void 0 ? void 0 : _v.evidence_upload_flag) ? true : false;
3860
- if ((_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.evidence_upload_flag) {
3860
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.evidence_upload_flag) ? true : false;
3861
+ if ((_x = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _x === void 0 ? void 0 : _x.evidence_upload_flag) {
3861
3862
  this.moreOptions.FORMATE_EVIDENCE = true;
3862
3863
  }
3863
- if (!(((_x = this.selectedProgram) === null || _x === void 0 ? void 0 : _x.programType) === 0 && ((_z = (_y = this.selectedProgram) === null || _y === void 0 ? void 0 : _y.name) === null || _z === void 0 ? void 0 : _z.toLowerCase()) === 'uncategorized')) {
3864
- if ((_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _0 === void 0 ? void 0 : _0._id) {
3864
+ if (!(((_y = this.selectedProgram) === null || _y === void 0 ? void 0 : _y.programType) === 0 && ((_0 = (_z = this.selectedProgram) === null || _z === void 0 ? void 0 : _z.name) === null || _0 === void 0 ? void 0 : _0.toLowerCase()) === 'uncategorized')) {
3865
+ if ((_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _1 === void 0 ? void 0 : _1._id) {
3865
3866
  this.filterListsAccordingToProgram(selectedItems.program._id);
3866
3867
  }
3867
3868
  else {
@@ -3913,10 +3914,10 @@
3913
3914
  this.responsibilityForm.riskMatrix = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.riskMatrix;
3914
3915
  break;
3915
3916
  case 'formate_evidence':
3916
- this.responsibilityForm.formatAndEvidence.formatRequired = (_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _1 !== void 0 ? _1 : false;
3917
- this.responsibilityForm.formatAndEvidence.formatFiles = (_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _2 !== void 0 ? _2 : [];
3918
- this.responsibilityForm.formatAndEvidence.formatLinks = (_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _3 !== void 0 ? _3 : [];
3919
- this.responsibilityForm.formatAndEvidence.evidenceRequired = (_4 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _4 !== void 0 ? _4 : false;
3917
+ this.responsibilityForm.formatAndEvidence.formatRequired = (_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _2 !== void 0 ? _2 : false;
3918
+ this.responsibilityForm.formatAndEvidence.formatFiles = (_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _3 !== void 0 ? _3 : [];
3919
+ this.responsibilityForm.formatAndEvidence.formatLinks = (_4 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _4 !== void 0 ? _4 : [];
3920
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = (_5 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _5 !== void 0 ? _5 : false;
3920
3921
  break;
3921
3922
  case 'reviewFrequency':
3922
3923
  this.responsibilityForm.reviewers.reviewFrequency = {
@@ -25661,18 +25662,23 @@
25661
25662
  WorkflowProgramComponent.prototype.fetchUsersAssociatedWithRoles = function () {
25662
25663
  var _this = this;
25663
25664
  var _a, _b;
25665
+ var loggedInUser = this.currentUser();
25664
25666
  var roleIds = (_b = (_a = this.controls.program_roles) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.map(function (ele) { return ele === null || ele === void 0 ? void 0 : ele._id; });
25665
25667
  // if (fetchAll) {
25666
25668
  this.programService.fetchAllRoleUsers(roleIds).subscribe({
25667
25669
  next: function (res) {
25668
- var _a, _b, _c, _d, _e, _f;
25670
+ var _a, _b, _c, _d, _e, _f, _g, _h;
25671
+ var isUserFind = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.some(function (res) { return (res === null || res === void 0 ? void 0 : res.member_id) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.member_id); });
25672
+ if (!isUserFind) {
25673
+ (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.push(loggedInUser);
25674
+ res.total_items = (res === null || res === void 0 ? void 0 : res.total_items) + 1;
25675
+ }
25669
25676
  _this.lists.OWNERS = res;
25670
25677
  _this.lists.APPROVERS = res;
25671
- console.log("resdef", res === null || res === void 0 ? void 0 : res.data);
25672
- if (!((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.map(function (ele) { return ele === null || ele === void 0 ? void 0 : ele.member_id; })) === null || _b === void 0 ? void 0 : _b.includes((_d = (_c = _this.controls.program_approver) === null || _c === void 0 ? void 0 : _c.value[0]) === null || _d === void 0 ? void 0 : _d.member_id))) {
25678
+ if (!((_d = (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.map(function (ele) { return ele === null || ele === void 0 ? void 0 : ele.member_id; })) === null || _d === void 0 ? void 0 : _d.includes((_f = (_e = _this.controls.program_approver) === null || _e === void 0 ? void 0 : _e.value[0]) === null || _f === void 0 ? void 0 : _f.member_id))) {
25673
25679
  _this.setFormField('program_approver', []);
25674
25680
  }
25675
- if ((_f = (_e = _this.controls) === null || _e === void 0 ? void 0 : _e.all_user_in_role) === null || _f === void 0 ? void 0 : _f.value) {
25681
+ if ((_h = (_g = _this.controls) === null || _g === void 0 ? void 0 : _g.all_user_in_role) === null || _h === void 0 ? void 0 : _h.value) {
25676
25682
  _this.setFormField('program_owners', res === null || res === void 0 ? void 0 : res.data);
25677
25683
  }
25678
25684
  else {