vcomply-workflow-engine 2.9.38 → 2.9.40

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.
@@ -3779,7 +3779,8 @@
3779
3779
  failed: 0,
3780
3780
  time: '11:59 pm',
3781
3781
  failedTime: '',
3782
- continuous_failed_days: 0
3782
+ continuous_failed_days: 0,
3783
+ onCompletionReportDetails: {}
3783
3784
  };
3784
3785
  this.frequencyPlaceholder = 'How often does the responsibility occur?';
3785
3786
  this.shortMonth = [];
@@ -3878,7 +3879,6 @@
3878
3879
  }
3879
3880
  });
3880
3881
  this.hideElementsFromMoreOptions.emit(this.hiddenList);
3881
- console.log("frequencyDetails ===>", this.frequencyDetails);
3882
3882
  };
3883
3883
  WorkflowComplianceComponent.prototype.activateSelector = function (type, event) {
3884
3884
  var _a;
@@ -5839,7 +5839,8 @@
5839
5839
  failed: 0,
5840
5840
  time: '11:59 pm',
5841
5841
  failedTime: '',
5842
- continuous_failed_days: 0
5842
+ continuous_failed_days: 0,
5843
+ onCompletionReportDetails: {}
5843
5844
  };
5844
5845
  this.sampleValue = undefined;
5845
5846
  this.samplePercentage = undefined;
@@ -5903,6 +5904,14 @@
5903
5904
  // this.closeWorkflow.emit(this.responsibilityData);
5904
5905
  this.closeWorkflow.emit({ evt: this.responsibilityData, confirm: false });
5905
5906
  };
5907
+ WorkflowComplianceComponent.prototype.getOnCompletionReportDetails = function (event) {
5908
+ var _a;
5909
+ var frequencyData = (_a = event === null || event === void 0 ? void 0 : event.frequency_details) === null || _a === void 0 ? void 0 : _a.split('~');
5910
+ if (parseInt(frequencyData[0]) == 6) {
5911
+ return event === null || event === void 0 ? void 0 : event.onCompletionReportDetails;
5912
+ }
5913
+ return null;
5914
+ };
5906
5915
  // for edit responsibility
5907
5916
  WorkflowComplianceComponent.prototype.frequencyDataPopulation = function (event) {
5908
5917
  var _a;
@@ -5919,6 +5928,10 @@
5919
5928
  reportId: (_a = event === null || event === void 0 ? void 0 : event.on_completion_of[0]) !== null && _a !== void 0 ? _a : 0,
5920
5929
  timeIn12hr: this.frequencyService.timeIn12(event.frequency_time != '' ? event.frequency_time : '23:59:00')
5921
5930
  };
5931
+ var onCompletionReportDetails = this.getOnCompletionReportDetails(event);
5932
+ if (onCompletionReportDetails != null) {
5933
+ data.onCompletionReportDetails = onCompletionReportDetails;
5934
+ }
5922
5935
  this.frequencyData(data);
5923
5936
  };
5924
5937
  WorkflowComplianceComponent.prototype.frequencyPopulation = function (event) {
@@ -5933,6 +5946,10 @@
5933
5946
  this.frequencyDetails.dateOfModified = event === null || event === void 0 ? void 0 : event.dom_utc;
5934
5947
  this.frequencyDetails.continuous_failed_days = event === null || event === void 0 ? void 0 : event.continuous_failed_days;
5935
5948
  this.frequencyPlaceholder = event === null || event === void 0 ? void 0 : event.placeholder;
5949
+ var onCompletionReportDetails = this.getOnCompletionReportDetails(event);
5950
+ if (onCompletionReportDetails != null) {
5951
+ this.frequencyDetails.onCompletionReportDetails = onCompletionReportDetails;
5952
+ }
5936
5953
  };
5937
5954
  WorkflowComplianceComponent.prototype.frequencyData = function (event) {
5938
5955
  var _a;
@@ -5962,6 +5979,11 @@
5962
5979
  continuous_failed_days: event.continuous_failed_days,
5963
5980
  placeholder: event.placeholder
5964
5981
  };
5982
+ event.frequency_details = event.pattern;
5983
+ var onCompletionReportDetails = this.getOnCompletionReportDetails(event);
5984
+ if (onCompletionReportDetails != null) {
5985
+ payload.onCompletionReportDetails = onCompletionReportDetails;
5986
+ }
5965
5987
  this.frequencyPopulation(payload);
5966
5988
  };
5967
5989
  WorkflowComplianceComponent.prototype.checkBlank = function (data) {
@@ -6019,7 +6041,7 @@
6019
6041
  }
6020
6042
  break;
6021
6043
  case 6:
6022
- this.getOnCompletionOf(frequencyDetails, res === null || res === void 0 ? void 0 : res.on_completion_of[0]);
6044
+ this.getOnCompletionOf(frequencyDetails, res === null || res === void 0 ? void 0 : res.on_completion_of[0], res.onCompletionReportDetails);
6023
6045
  }
6024
6046
  }
6025
6047
  }
@@ -6035,15 +6057,15 @@
6035
6057
  * @param {any} frequencyDetails - [0] => "1"
6036
6058
  * @param {number} reportId - number
6037
6059
  */
6038
- WorkflowComplianceComponent.prototype.getOnCompletionOf = function (frequencyDetails, reportId) {
6039
- var _this = this;
6060
+ WorkflowComplianceComponent.prototype.getOnCompletionOf = function (frequencyDetails, reportId, onCompletionReportDetails) {
6040
6061
  this.frequencyPlaceholder = frequencyDetails[3] + ' ' + (parseInt(frequencyDetails[3]) > 1 ? 'days' : 'day') + ' after completion of ';
6041
- this.frequencyService.getOnCompletionOfResponsibility().subscribe(function (res) {
6042
- var reportDetails = res.find(function (ele) { return ele.ReportId == reportId; });
6043
- _this.frequencyPlaceholder = frequencyDetails[3] + ' ' + (parseInt(frequencyDetails[3]) > 1 ? 'days' : 'day') + ' after completion of ' + (reportDetails ? reportDetails.report_name : '');
6044
- _this.loader = false;
6045
- _this.uiKitService.isLoader = false;
6046
- });
6062
+ if (onCompletionReportDetails) {
6063
+ if (reportId === onCompletionReportDetails.ReportId) {
6064
+ this.frequencyPlaceholder = frequencyDetails[3] + ' ' + (parseInt(frequencyDetails[3]) > 1 ? 'days' : 'day') + ' after completion of ' + (onCompletionReportDetails ? onCompletionReportDetails.report_name : '');
6065
+ }
6066
+ }
6067
+ this.loader = false;
6068
+ this.uiKitService.isLoader = false;
6047
6069
  };
6048
6070
  /**
6049
6071
  * "If the frequencyDetails[3] is 1, then set the frequencyPlaceholder to 'Daily by ' + frequencyTime,
@@ -12908,8 +12930,8 @@
12908
12930
  FrequencyOnCompletionOfComponent.prototype.ngOnInit = function () {
12909
12931
  var _a;
12910
12932
  this.featureFlag_on_completion_of = this.feature.isFeatureEnabled('ff_frequency_on_completion_of');
12911
- this.getCompletionReports();
12912
12933
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
12934
+ this.getCompletionReports();
12913
12935
  this.getOnCompletionFrequency();
12914
12936
  this.isSelectedData = this.selectedResponsibilityDetails ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0 : false;
12915
12937
  };
@@ -12953,16 +12975,16 @@
12953
12975
  this.getOnCompletionFrequency();
12954
12976
  };
12955
12977
  FrequencyOnCompletionOfComponent.prototype.getCompletionReports = function () {
12956
- var _this = this;
12957
- this.selectedResponsibility = -1;
12958
- this.frequencyService.getOnCompletionOfResponsibility().subscribe(function (res) {
12959
- _this.selectedResponsibility = 0;
12960
- _this.placeholder = 'Select a Responsibility';
12961
- _this.onCompletionOfResponsibility = res;
12962
- if (_this.frequencyData.pattern != '' && parseInt(_this.frequencyData.pattern.split('~')[0]) === 6) {
12963
- _this.populateFrequency();
12964
- }
12965
- });
12978
+ var _a, _b;
12979
+ this.selectedResponsibility = 0;
12980
+ this.placeholder = 'Select a Responsibility';
12981
+ this.onCompletionOfResponsibility = [];
12982
+ if ((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.onCompletionReportDetails) {
12983
+ this.onCompletionOfResponsibility.push((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.onCompletionReportDetails);
12984
+ }
12985
+ if (this.frequencyData.pattern != '' && parseInt(this.frequencyData.pattern.split('~')[0]) === 6) {
12986
+ this.populateFrequency();
12987
+ }
12966
12988
  };
12967
12989
  FrequencyOnCompletionOfComponent.prototype.inputValueChange = function (event) {
12968
12990
  this.onCompletionOfInput = Number(event.target.value);