vcomply-workflow-engine 3.0.278 → 3.0.279

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.
Files changed (32) hide show
  1. package/esm2020/lib/add-multiple-responsibility/add-multiple-responsibility.component.mjs +2 -2
  2. package/esm2020/lib/add-multiple-responsibility-with-tab/add-multiple-responsibility-with-tab.component.mjs +310 -123
  3. package/esm2020/lib/add-multiple-risk/add-multiple-risk.component.mjs +128 -64
  4. package/esm2020/lib/log-an-issue/log-an-issue.component.mjs +2 -2
  5. package/esm2020/lib/sharedComponents/frequency/frequency-annual/frequency-annual.component.mjs +2 -2
  6. package/esm2020/lib/sharedComponents/frequency/frequency-biannual/frequency-biannual.component.mjs +2 -2
  7. package/esm2020/lib/sharedComponents/frequency/frequency-container/frequency-container.component.mjs +2 -2
  8. package/esm2020/lib/sharedComponents/frequency/frequency-daily/frequency-daily.component.mjs +2 -2
  9. package/esm2020/lib/sharedComponents/frequency/frequency-lifecycle/frequency-lifecycle.component.mjs +2 -2
  10. package/esm2020/lib/sharedComponents/frequency/frequency-monthly/frequency-monthly.component.mjs +2 -2
  11. package/esm2020/lib/sharedComponents/frequency/frequency-on-completion-of/frequency-on-completion-of.component.mjs +26 -11
  12. package/esm2020/lib/sharedComponents/frequency/frequency-one-time/frequency-one-time.component.mjs +2 -2
  13. package/esm2020/lib/sharedComponents/frequency/frequency-quarterly/frequency-quarterly.component.mjs +2 -2
  14. package/esm2020/lib/sharedComponents/frequency/frequency-top/frequency-top.component.mjs +21 -8
  15. package/esm2020/lib/sharedComponents/frequency/frequency-weekly/frequency-weekly.component.mjs +2 -2
  16. package/esm2020/lib/sharedComponents/frequency/frequency.service.mjs +5 -3
  17. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-annual/frequency-dialog-annual.component.mjs +113 -23
  18. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-biannual/frequency-dialog-biannual.component.mjs +60 -21
  19. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-container/frequency-dialog-container.component.mjs +53 -43
  20. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-monthly/frequency-dialog-monthly.component.mjs +64 -25
  21. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-one-time/frequency-dialog-one-time.component.mjs +63 -20
  22. package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-quarterly/frequency-dialog-quarterly.component.mjs +65 -23
  23. package/esm2020/lib/workflow-compliance/workflow-compliance.component.mjs +2 -2
  24. package/esm2020/lib/workflow-policy/workflow-policy.component.mjs +2 -2
  25. package/esm2020/lib/workflow-risk/workflow-risk.component.mjs +365 -131
  26. package/fesm2015/vcomply-workflow-engine.mjs +1304 -537
  27. package/fesm2015/vcomply-workflow-engine.mjs.map +1 -1
  28. package/fesm2020/vcomply-workflow-engine.mjs +1320 -541
  29. package/fesm2020/vcomply-workflow-engine.mjs.map +1 -1
  30. package/lib/sharedComponents/frequency/frequency-lifecycle/frequency-lifecycle.component.d.ts +1 -1
  31. package/lib/sharedComponents/frequency/frequency-on-completion-of/frequency-on-completion-of.component.d.ts +1 -1
  32. package/package.json +1 -1
@@ -12,9 +12,10 @@ import { FormsModule, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from
12
12
  import * as i3 from 'vcomply-editor';
13
13
  import { MarxEditorModule } from 'vcomply-editor';
14
14
  import { cloneDeep, shuffle, some, uniqBy, isEqual } from 'lodash';
15
- import * as moment from 'moment';
15
+ import moment$1 from 'moment/moment';
16
16
  import { nanoid } from 'nanoid';
17
17
  import { cloneDeep as cloneDeep$1 } from 'lodash-es';
18
+ import * as moment from 'moment';
18
19
  import * as i4 from 'ngx-material-timepicker';
19
20
  import { NgxMaterialTimepickerModule } from 'ngx-material-timepicker';
20
21
  import * as i4$1 from 'ng2-date-picker';
@@ -2288,7 +2289,7 @@ class FrequencyService {
2288
2289
  row.frequency_template === 'every 2 weeks' ||
2289
2290
  row.frequency_template === 'every 3 weeks') &&
2290
2291
  row.frequency_template !== 'every day') {
2291
- const momentUnix = moment(getDate +
2292
+ const momentUnix = moment$1(getDate +
2292
2293
  '-' +
2293
2294
  (new Date().getMonth() + 1) +
2294
2295
  '-' +
@@ -2686,7 +2687,9 @@ class FrequencyService {
2686
2687
  }
2687
2688
  getResponsibilitiesCount(payload) {
2688
2689
  const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
2689
- return this.http.post(this.env.responsibilityPost + 'manage_responsibilities_reports_count', payload, { headers }).pipe(retry(1));
2690
+ return this.http
2691
+ .post(this.env.responsibilityPost + 'manage_responsibilities_reports_count', payload, { headers })
2692
+ .pipe(retry(1));
2690
2693
  }
2691
2694
  }
2692
2695
  FrequencyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FrequencyService, deps: [{ token: i1.HttpClient }, { token: AuthService }, { token: Configurations, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -4627,9 +4630,10 @@ class FrequencyDialogMonthlyComponent {
4627
4630
  var _a, _b, _c, _d, _e;
4628
4631
  this.frequencyInfo = Object.assign((_a = this.frequencyService) === null || _a === void 0 ? void 0 : _a.frequencyInfo);
4629
4632
  this.monthNameArray = [...new Set((_b = this.frequencyService) === null || _b === void 0 ? void 0 : _b.monthArray)];
4630
- this.shortMonth = (_c = this.frequencyService) === null || _c === void 0 ? void 0 : _c.monthArray.map(month => month.substring(0, 3));
4631
- console.log("this.frequencyData ==>", this.frequencyData);
4632
- if (((_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.pattern) != '' && parseInt((_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.pattern.split('~')[0]) === 3) {
4633
+ this.shortMonth = (_c = this.frequencyService) === null || _c === void 0 ? void 0 : _c.monthArray.map((month) => month.substring(0, 3));
4634
+ console.log('this.frequencyData ==>', this.frequencyData);
4635
+ if (((_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.pattern) != '' &&
4636
+ parseInt((_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.pattern.split('~')[0]) === 3) {
4633
4637
  this.populateFrequency();
4634
4638
  }
4635
4639
  this.getMonthlyFrequency();
@@ -4637,8 +4641,10 @@ class FrequencyDialogMonthlyComponent {
4637
4641
  populateFrequency() {
4638
4642
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4639
4643
  const patternInfo = (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern.split('~');
4640
- console.log("patternInfo ==>", patternInfo, this.frequencyData);
4641
- this.selectedMonthly = patternInfo[2].split(',').map((ele) => Number(ele) - 1);
4644
+ console.log('patternInfo ==>', patternInfo, this.frequencyData);
4645
+ this.selectedMonthly = patternInfo[2]
4646
+ .split(',')
4647
+ .map((ele) => Number(ele) - 1);
4642
4648
  // const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
4643
4649
  this.monthlyInterval = (_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.failedTime;
4644
4650
  this.monthlyWindow = (_c = this.frequencyData) === null || _c === void 0 ? void 0 : _c.window;
@@ -4672,12 +4678,12 @@ class FrequencyDialogMonthlyComponent {
4672
4678
  this.getMonthlyFrequency();
4673
4679
  }
4674
4680
  onTimeChanged(event) {
4675
- console.log("time event =>", event);
4681
+ console.log('time event =>', event);
4676
4682
  this.monthlyInterval = event;
4677
4683
  this.getMonthlyFrequency();
4678
4684
  }
4679
4685
  onMonthSelected(event) {
4680
- console.log("evnet", event);
4686
+ console.log('evnet', event);
4681
4687
  if (event.checked) {
4682
4688
  this.selectedMonthly.push(event.index);
4683
4689
  }
@@ -4701,18 +4707,21 @@ class FrequencyDialogMonthlyComponent {
4701
4707
  break;
4702
4708
  }
4703
4709
  if (event.startFrom.toString().length > 10) {
4704
- console.log("start 1111");
4710
+ console.log('start 1111');
4705
4711
  this.startDate = Math.floor(event.startFrom / 1000);
4706
4712
  }
4707
4713
  else {
4708
- console.log("start 11112222");
4714
+ console.log('start 11112222');
4709
4715
  this.startDate = Math.floor(event.startFrom);
4710
4716
  }
4711
- let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 + 86400000);
4717
+ let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 +
4718
+ 86400000);
4712
4719
  console.log('strat date ====>', this.startDate);
4713
4720
  console.log('end date', endByDate);
4714
4721
  if (event.type === 0) {
4715
- endByDate = event.endsBy ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix() : endByDate;
4722
+ endByDate = event.endsBy
4723
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
4724
+ : endByDate;
4716
4725
  console.log('endByDate', endByDate);
4717
4726
  }
4718
4727
  this.monthlyLifeCycleStart = new Date(this.startDate * 1000);
@@ -4735,7 +4744,8 @@ class FrequencyDialogMonthlyComponent {
4735
4744
  this.selectedMonthly = this.selectedMonthly.sort((n1, n2) => n1 - n2);
4736
4745
  const monthIndex = this.selectedMonthly.map((ele) => ele + 1);
4737
4746
  this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.monthlyInput));
4738
- this.frequencyInfo.pattern = 3 + '~' + this.monthlyInput + '~' + monthIndex + '~' + '0';
4747
+ this.frequencyInfo.pattern =
4748
+ 3 + '~' + this.monthlyInput + '~' + monthIndex + '~' + '0';
4739
4749
  this.frequencyInfo.case = 'month';
4740
4750
  this.frequencyInfo.failedAfter = this.monthlyFailed;
4741
4751
  this.frequencyInfo.window = this.monthlyWindow;
@@ -4746,36 +4756,68 @@ class FrequencyDialogMonthlyComponent {
4746
4756
  this.frequencyInfo.reportId = 0;
4747
4757
  this.frequencyInfo.continuous_failed_days = this.monthlyDeactivatedValue;
4748
4758
  this.frequencyDetails.emit(this.frequencyInfo);
4749
- console.log(" this.frequencyInfo ==>", this.frequencyInfo);
4759
+ console.log(' this.frequencyInfo ==>', this.frequencyInfo);
4750
4760
  }
4751
4761
  getFrequencyPlaceholder(monthlyInput) {
4752
- console.log("monthlyInput ==>", monthlyInput);
4762
+ console.log('monthlyInput ==>', monthlyInput);
4753
4763
  const selectedMonth = this.selectedMonthly.map((ele) => {
4754
4764
  return this.shortMonth[ele];
4755
4765
  });
4756
4766
  let placeholder = '';
4757
4767
  if (monthlyInput === 1) {
4758
- placeholder = '1st of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4768
+ placeholder =
4769
+ '1st of every ' +
4770
+ selectedMonth.join(', ') +
4771
+ ' by ' +
4772
+ this.monthlyInterval;
4759
4773
  }
4760
4774
  else if (monthlyInput === 2) {
4761
- placeholder = '2nd of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4775
+ placeholder =
4776
+ '2nd of every ' +
4777
+ selectedMonth.join(', ') +
4778
+ ' by ' +
4779
+ this.monthlyInterval;
4762
4780
  }
4763
4781
  else if (monthlyInput === 3) {
4764
- placeholder = '3rd of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4782
+ placeholder =
4783
+ '3rd of every ' +
4784
+ selectedMonth.join(', ') +
4785
+ ' by ' +
4786
+ this.monthlyInterval;
4765
4787
  }
4766
4788
  else if (monthlyInput === 21 || monthlyInput === 31) {
4767
- placeholder = monthlyInput + 'st of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4789
+ placeholder =
4790
+ monthlyInput +
4791
+ 'st of every ' +
4792
+ selectedMonth.join(', ') +
4793
+ ' by ' +
4794
+ this.monthlyInterval;
4768
4795
  }
4769
4796
  else if (monthlyInput === 22) {
4770
- placeholder = monthlyInput + 'nd of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4797
+ placeholder =
4798
+ monthlyInput +
4799
+ 'nd of every ' +
4800
+ selectedMonth.join(', ') +
4801
+ ' by ' +
4802
+ this.monthlyInterval;
4771
4803
  }
4772
4804
  else if (monthlyInput === 23) {
4773
- placeholder = monthlyInput + 'rd of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4805
+ placeholder =
4806
+ monthlyInput +
4807
+ 'rd of every ' +
4808
+ selectedMonth.join(', ') +
4809
+ ' by ' +
4810
+ this.monthlyInterval;
4774
4811
  }
4775
4812
  else if (monthlyInput > 3) {
4776
- placeholder = monthlyInput + 'th of every ' + selectedMonth.join(', ') + ' by ' + this.monthlyInterval;
4813
+ placeholder =
4814
+ monthlyInput +
4815
+ 'th of every ' +
4816
+ selectedMonth.join(', ') +
4817
+ ' by ' +
4818
+ this.monthlyInterval;
4777
4819
  }
4778
- console.log("placeholder ==>", placeholder);
4820
+ console.log('placeholder ==>', placeholder);
4779
4821
  return placeholder;
4780
4822
  }
4781
4823
  }
@@ -4849,9 +4891,11 @@ class FrequencyDialogQuarterlyComponent {
4849
4891
  this.frequencyInfo = Object.assign((_a = this.frequencyService) === null || _a === void 0 ? void 0 : _a.frequencyInfo);
4850
4892
  this.quarterlyArray = [...new Set(this.frequencyService.quarterlyMonth)];
4851
4893
  const indexOfMonth = this.quarterlyGroup.indexOf((_b = this.frequencyService.changeTimeZone(new Date())) === null || _b === void 0 ? void 0 : _b.getMonth());
4852
- this.selectedQuarterly = indexOfMonth < 4 ? 0 : indexOfMonth > 3 && indexOfMonth < 8 ? 1 : 2;
4853
- console.log("this.frequencyData ==>", this.frequencyData);
4854
- if (((_c = this.frequencyData) === null || _c === void 0 ? void 0 : _c.pattern) != '' && parseInt((_e = (_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.pattern) === null || _e === void 0 ? void 0 : _e.split('~')[0]) === 7) {
4894
+ this.selectedQuarterly =
4895
+ indexOfMonth < 4 ? 0 : indexOfMonth > 3 && indexOfMonth < 8 ? 1 : 2;
4896
+ console.log('this.frequencyData ==>', this.frequencyData);
4897
+ if (((_c = this.frequencyData) === null || _c === void 0 ? void 0 : _c.pattern) != '' &&
4898
+ parseInt((_e = (_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.pattern) === null || _e === void 0 ? void 0 : _e.split('~')[0]) === 7) {
4855
4899
  this.populateFrequency();
4856
4900
  }
4857
4901
  this.getQuarterlyFrequency();
@@ -4859,9 +4903,9 @@ class FrequencyDialogQuarterlyComponent {
4859
4903
  populateFrequency() {
4860
4904
  var _a, _b, _c, _d, _e, _f, _g;
4861
4905
  const patternInfo = (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern.split('~');
4862
- console.log("patternInfo ==>", patternInfo);
4906
+ console.log('patternInfo ==>', patternInfo);
4863
4907
  const month = parseInt(patternInfo[2].split(',').map(Number)[0]);
4864
- console.log("monte ", month);
4908
+ console.log('monte ', month);
4865
4909
  const index = this.quarterlyGroup.indexOf(month - 1);
4866
4910
  this.selectedQuarterly = index < 4 ? 0 : index > 3 && index < 8 ? 1 : 2;
4867
4911
  // const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
@@ -4894,12 +4938,12 @@ class FrequencyDialogQuarterlyComponent {
4894
4938
  this.getQuarterlyFrequency();
4895
4939
  }
4896
4940
  onTimeChanged(event) {
4897
- console.log("time event =>", event);
4941
+ console.log('time event =>', event);
4898
4942
  this.quarterlyInterval = event;
4899
4943
  this.getQuarterlyFrequency();
4900
4944
  }
4901
4945
  selectedMonth(event) {
4902
- console.log("event ==>", event);
4946
+ console.log('event ==>', event);
4903
4947
  this.selectedQuarterly = parseInt(event.target.value);
4904
4948
  this.getQuarterlyFrequency();
4905
4949
  }
@@ -4923,10 +4967,13 @@ class FrequencyDialogQuarterlyComponent {
4923
4967
  else {
4924
4968
  this.startDate = Math.floor(event.startFrom);
4925
4969
  }
4926
- let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 + 86400000);
4970
+ let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 +
4971
+ 86400000);
4927
4972
  console.log('end date', endByDate);
4928
4973
  if (event.type === 0) {
4929
- endByDate = event.endsBy ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix() : endByDate;
4974
+ endByDate = event.endsBy
4975
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
4976
+ : endByDate;
4930
4977
  console.log('endByDate', endByDate);
4931
4978
  }
4932
4979
  this.frequencyInfo.failed_time_utc = endByDate;
@@ -4942,9 +4989,14 @@ class FrequencyDialogQuarterlyComponent {
4942
4989
  this.getQuarterlyFrequency();
4943
4990
  }
4944
4991
  getQuarterlyFrequency() {
4945
- let monthSequence = this.selectedQuarterly === 0 ? this.quarterlyGroup.slice(0, 4) : this.selectedQuarterly === 1 ? this.quarterlyGroup.slice(4, 8) : this.quarterlyGroup.slice(8);
4992
+ let monthSequence = this.selectedQuarterly === 0
4993
+ ? this.quarterlyGroup.slice(0, 4)
4994
+ : this.selectedQuarterly === 1
4995
+ ? this.quarterlyGroup.slice(4, 8)
4996
+ : this.quarterlyGroup.slice(8);
4946
4997
  monthSequence = monthSequence.map((ele) => ele + 1);
4947
- this.frequencyInfo.pattern = 7 + '~' + this.quarterlyInput + '~' + monthSequence + '~' + '0';
4998
+ this.frequencyInfo.pattern =
4999
+ 7 + '~' + this.quarterlyInput + '~' + monthSequence + '~' + '0';
4948
5000
  this.frequencyInfo.case = 'quarterly';
4949
5001
  this.frequencyInfo.failedAfter = this.quarterlyFailed;
4950
5002
  this.frequencyInfo.window = this.quarterlyWindow;
@@ -4955,33 +5007,65 @@ class FrequencyDialogQuarterlyComponent {
4955
5007
  this.frequencyInfo.reportId = 0;
4956
5008
  this.frequencyInfo.placeholder = this.getPlaceholder(Number(this.quarterlyInput));
4957
5009
  this.frequencyDetails.emit(this.frequencyInfo);
4958
- console.log(" this.frequencyInfo ==>", this.frequencyInfo);
5010
+ console.log(' this.frequencyInfo ==>', this.frequencyInfo);
4959
5011
  }
4960
5012
  getPlaceholder(quarterlyInput) {
4961
- console.log(" this.placeholder ==>", quarterlyInput, quarterlyInput === 2, typeof quarterlyInput);
5013
+ console.log(' this.placeholder ==>', quarterlyInput, quarterlyInput === 2, typeof quarterlyInput);
4962
5014
  let placeholder = '';
4963
5015
  if (quarterlyInput === 1) {
4964
- placeholder = '1st of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5016
+ placeholder =
5017
+ '1st of every ' +
5018
+ this.quarterlyArray[this.selectedQuarterly] +
5019
+ ' by ' +
5020
+ this.quarterlyInterval;
4965
5021
  }
4966
5022
  else if (quarterlyInput === 2) {
4967
- placeholder = '2nd of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5023
+ placeholder =
5024
+ '2nd of every ' +
5025
+ this.quarterlyArray[this.selectedQuarterly] +
5026
+ ' by ' +
5027
+ this.quarterlyInterval;
4968
5028
  }
4969
5029
  else if (quarterlyInput === 3) {
4970
- placeholder = '3rd of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5030
+ placeholder =
5031
+ '3rd of every ' +
5032
+ this.quarterlyArray[this.selectedQuarterly] +
5033
+ ' by ' +
5034
+ this.quarterlyInterval;
4971
5035
  }
4972
5036
  else if (quarterlyInput === 21 || quarterlyInput === 31) {
4973
- placeholder = quarterlyInput + 'st of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5037
+ placeholder =
5038
+ quarterlyInput +
5039
+ 'st of every ' +
5040
+ this.quarterlyArray[this.selectedQuarterly] +
5041
+ ' by ' +
5042
+ this.quarterlyInterval;
4974
5043
  }
4975
5044
  else if (quarterlyInput === 22) {
4976
- placeholder = quarterlyInput + 'nd of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5045
+ placeholder =
5046
+ quarterlyInput +
5047
+ 'nd of every ' +
5048
+ this.quarterlyArray[this.selectedQuarterly] +
5049
+ ' by ' +
5050
+ this.quarterlyInterval;
4977
5051
  }
4978
5052
  else if (quarterlyInput === 23) {
4979
- placeholder = quarterlyInput + 'rd of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5053
+ placeholder =
5054
+ quarterlyInput +
5055
+ 'rd of every ' +
5056
+ this.quarterlyArray[this.selectedQuarterly] +
5057
+ ' by ' +
5058
+ this.quarterlyInterval;
4980
5059
  }
4981
5060
  else if (quarterlyInput > 3) {
4982
- placeholder = quarterlyInput + 'th of every ' + this.quarterlyArray[this.selectedQuarterly] + ' by ' + this.quarterlyInterval;
5061
+ placeholder =
5062
+ quarterlyInput +
5063
+ 'th of every ' +
5064
+ this.quarterlyArray[this.selectedQuarterly] +
5065
+ ' by ' +
5066
+ this.quarterlyInterval;
4983
5067
  }
4984
- console.log(" this.placeholderede ==>", placeholder);
5068
+ console.log(' this.placeholderede ==>', placeholder);
4985
5069
  return placeholder;
4986
5070
  }
4987
5071
  }
@@ -5027,9 +5111,10 @@ class FrequencyDialogBiannualComponent {
5027
5111
  var _a, _b;
5028
5112
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
5029
5113
  this.monthNameArray = [...new Set(this.frequencyService.monthArray)];
5030
- this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
5031
- console.log("this.frequencyData ==>", this.frequencyData);
5032
- if (((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern) != '' && parseInt((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.pattern.split('~')[0]) === 9) {
5114
+ this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
5115
+ console.log('this.frequencyData ==>', this.frequencyData);
5116
+ if (((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern) != '' &&
5117
+ parseInt((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.pattern.split('~')[0]) === 9) {
5033
5118
  this.populateFrequency();
5034
5119
  }
5035
5120
  this.getBiannualFrequency();
@@ -5037,7 +5122,9 @@ class FrequencyDialogBiannualComponent {
5037
5122
  populateFrequency() {
5038
5123
  var _a, _b, _c, _d, _e, _f;
5039
5124
  const patternInfo = (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern.split('~');
5040
- this.biannualSelected = patternInfo[2].split(',').map((ele) => Number(ele) - 1);
5125
+ this.biannualSelected = patternInfo[2]
5126
+ .split(',')
5127
+ .map((ele) => Number(ele) - 1);
5041
5128
  // const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
5042
5129
  this.biannualInterval = (_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.failedTime;
5043
5130
  this.biannualWindow = (_c = this.frequencyData) === null || _c === void 0 ? void 0 : _c.window;
@@ -5062,7 +5149,7 @@ class FrequencyDialogBiannualComponent {
5062
5149
  // }
5063
5150
  }
5064
5151
  onMonthSelected(event) {
5065
- console.log("event", event);
5152
+ console.log('event', event);
5066
5153
  if (event.checked) {
5067
5154
  this.biannualSelected.push(event.index);
5068
5155
  }
@@ -5077,7 +5164,7 @@ class FrequencyDialogBiannualComponent {
5077
5164
  this.getBiannualFrequency();
5078
5165
  }
5079
5166
  onTimeChanged(event) {
5080
- console.log("time event =>", event);
5167
+ console.log('time event =>', event);
5081
5168
  this.biannualInterval = event;
5082
5169
  this.getBiannualFrequency();
5083
5170
  }
@@ -5105,18 +5192,21 @@ class FrequencyDialogBiannualComponent {
5105
5192
  break;
5106
5193
  }
5107
5194
  if (event.startFrom.toString().length > 10) {
5108
- console.log("start 1111");
5195
+ console.log('start 1111');
5109
5196
  this.startDate = Math.floor(event.startFrom / 1000);
5110
5197
  }
5111
5198
  else {
5112
- console.log("start 11112222");
5199
+ console.log('start 11112222');
5113
5200
  this.startDate = Math.floor(event.startFrom);
5114
5201
  }
5115
- let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 + 86400000);
5202
+ let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 +
5203
+ 86400000);
5116
5204
  console.log('strat date ====>', this.startDate);
5117
5205
  console.log('end date', endByDate);
5118
5206
  if (event.type === 0) {
5119
- endByDate = event.endsBy ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix() : endByDate;
5207
+ endByDate = event.endsBy
5208
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
5209
+ : endByDate;
5120
5210
  console.log('endByDate', endByDate);
5121
5211
  }
5122
5212
  this.frequencyInfo.failed_time_utc = endByDate;
@@ -5125,7 +5215,8 @@ class FrequencyDialogBiannualComponent {
5125
5215
  getBiannualFrequency() {
5126
5216
  this.biannualSelected = this.biannualSelected.sort((n1, n2) => n1 - n2);
5127
5217
  const monthIndex = this.biannualSelected.map((ele) => ele + 1);
5128
- this.frequencyInfo.pattern = 9 + '~' + this.biannualInput + '~' + monthIndex.join(',') + '~0';
5218
+ this.frequencyInfo.pattern =
5219
+ 9 + '~' + this.biannualInput + '~' + monthIndex.join(',') + '~0';
5129
5220
  this.frequencyInfo.case = 'biannual';
5130
5221
  this.frequencyInfo.failedAfter = this.biannualFailed;
5131
5222
  this.frequencyInfo.window = this.biannualWindow;
@@ -5136,7 +5227,7 @@ class FrequencyDialogBiannualComponent {
5136
5227
  this.frequencyInfo.reportId = 0;
5137
5228
  this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.biannualInput));
5138
5229
  this.frequencyDetails.emit(this.frequencyInfo);
5139
- console.log(" this.frequencyInfo ==>", this.frequencyInfo);
5230
+ console.log(' this.frequencyInfo ==>', this.frequencyInfo);
5140
5231
  }
5141
5232
  getFrequencyPlaceholder(biannualInput) {
5142
5233
  let placeholder = '';
@@ -5144,25 +5235,57 @@ class FrequencyDialogBiannualComponent {
5144
5235
  return this.shortMonth[ele];
5145
5236
  });
5146
5237
  if (biannualInput === 1) {
5147
- placeholder = '1st of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5238
+ placeholder =
5239
+ '1st of every ' +
5240
+ selectedMonth.join(', ') +
5241
+ ' by ' +
5242
+ this.biannualInterval;
5148
5243
  }
5149
5244
  else if (biannualInput === 2) {
5150
- placeholder = '2nd of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5245
+ placeholder =
5246
+ '2nd of every ' +
5247
+ selectedMonth.join(', ') +
5248
+ ' by ' +
5249
+ this.biannualInterval;
5151
5250
  }
5152
5251
  else if (biannualInput === 3) {
5153
- placeholder = '3rd of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5252
+ placeholder =
5253
+ '3rd of every ' +
5254
+ selectedMonth.join(', ') +
5255
+ ' by ' +
5256
+ this.biannualInterval;
5154
5257
  }
5155
5258
  else if (biannualInput === 21 || biannualInput === 31) {
5156
- placeholder = biannualInput + 'st of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5259
+ placeholder =
5260
+ biannualInput +
5261
+ 'st of every ' +
5262
+ selectedMonth.join(', ') +
5263
+ ' by ' +
5264
+ this.biannualInterval;
5157
5265
  }
5158
5266
  else if (biannualInput === 22) {
5159
- placeholder = biannualInput + 'nd of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5267
+ placeholder =
5268
+ biannualInput +
5269
+ 'nd of every ' +
5270
+ selectedMonth.join(', ') +
5271
+ ' by ' +
5272
+ this.biannualInterval;
5160
5273
  }
5161
5274
  else if (biannualInput === 23) {
5162
- placeholder = biannualInput + 'rd of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5275
+ placeholder =
5276
+ biannualInput +
5277
+ 'rd of every ' +
5278
+ selectedMonth.join(', ') +
5279
+ ' by ' +
5280
+ this.biannualInterval;
5163
5281
  }
5164
5282
  else if (biannualInput > 3) {
5165
- placeholder = biannualInput + 'th of every ' + selectedMonth.join(', ') + ' by ' + this.biannualInterval;
5283
+ placeholder =
5284
+ biannualInput +
5285
+ 'th of every ' +
5286
+ selectedMonth.join(', ') +
5287
+ ' by ' +
5288
+ this.biannualInterval;
5166
5289
  }
5167
5290
  return placeholder;
5168
5291
  }
@@ -5208,8 +5331,9 @@ class FrequencyDialogAnnualComponent {
5208
5331
  var _a, _b;
5209
5332
  this.monthList = this.frequencyService.monthArray;
5210
5333
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
5211
- this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
5212
- if (((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern) != '' && parseInt((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.pattern.split('~')[0]) === 4) {
5334
+ this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
5335
+ if (((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern) != '' &&
5336
+ parseInt((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.pattern.split('~')[0]) === 4) {
5213
5337
  this.populateFrequency();
5214
5338
  }
5215
5339
  this.getAnnualFrequency();
@@ -5228,7 +5352,8 @@ class FrequencyDialogAnnualComponent {
5228
5352
  // }
5229
5353
  this.yearlyLifecycleOccurance = Number(patternInfo[1]);
5230
5354
  this.yearlyLifeCycleStart = new Date(((_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.startDate) * 1000);
5231
- this.startDate = (_f = (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.startFrom) !== null && _f !== void 0 ? _f : (_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.startDate;
5355
+ this.startDate =
5356
+ (_f = (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.startFrom) !== null && _f !== void 0 ? _f : (_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.startDate;
5232
5357
  this.yearlyFailed = (_h = this.frequencyData) === null || _h === void 0 ? void 0 : _h.failed;
5233
5358
  // if( lifecycleInfo[0] !== '0000-00-00') {
5234
5359
  // const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix()
@@ -5278,9 +5403,12 @@ class FrequencyDialogAnnualComponent {
5278
5403
  else {
5279
5404
  this.startDate = Math.floor(event.startFrom);
5280
5405
  }
5281
- let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 + 86400000);
5406
+ let endByDate = Math.floor(((_a = this.frequencyService.changeTimeZone(new Date())) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000 +
5407
+ 86400000);
5282
5408
  if (event.type === 0) {
5283
- endByDate = event.endsBy ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix() : endByDate;
5409
+ endByDate = event.endsBy
5410
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
5411
+ : endByDate;
5284
5412
  }
5285
5413
  this.frequencyInfo.failed_time_utc = endByDate;
5286
5414
  this.getAnnualFrequency();
@@ -5297,7 +5425,14 @@ class FrequencyDialogAnnualComponent {
5297
5425
  // frequency pattern and details info
5298
5426
  getAnnualFrequency() {
5299
5427
  this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.yearlyInput));
5300
- this.frequencyInfo.pattern = 4 + '~' + this.yearlyDay + '~' + (this.yearlySelected + 1) + '~' + this.yearlyInput;
5428
+ this.frequencyInfo.pattern =
5429
+ 4 +
5430
+ '~' +
5431
+ this.yearlyDay +
5432
+ '~' +
5433
+ (this.yearlySelected + 1) +
5434
+ '~' +
5435
+ this.yearlyInput;
5301
5436
  this.frequencyInfo.case = 'yearly';
5302
5437
  this.frequencyInfo.failedAfter = this.yearlyFailed;
5303
5438
  this.frequencyInfo.window = this.yearlyWindow;
@@ -5306,7 +5441,7 @@ class FrequencyDialogAnnualComponent {
5306
5441
  this.frequencyInfo.lifecycleDetails = this.lifecycleDetails;
5307
5442
  this.frequencyInfo.startFrom = this.startDate;
5308
5443
  this.frequencyInfo.reportId = 0;
5309
- console.log(" this.frequencyInfo ==>", this.frequencyInfo);
5444
+ console.log(' this.frequencyInfo ==>', this.frequencyInfo);
5310
5445
  this.frequencyDetails.emit(this.frequencyInfo);
5311
5446
  }
5312
5447
  getFrequencyPlaceholder(yearlyInput) {
@@ -5323,25 +5458,57 @@ class FrequencyDialogAnnualComponent {
5323
5458
  getPlaceholderForSt2() {
5324
5459
  let placeholder = '';
5325
5460
  if (this.yearlyDay === 1) {
5326
- placeholder = '1st of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5461
+ placeholder =
5462
+ '1st of every ' +
5463
+ this.shortMonth[this.yearlySelected] +
5464
+ ' by ' +
5465
+ this.yearlyInterval;
5327
5466
  }
5328
5467
  if (this.yearlyDay === 2) {
5329
- placeholder = '2nd of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5468
+ placeholder =
5469
+ '2nd of every ' +
5470
+ this.shortMonth[this.yearlySelected] +
5471
+ ' by ' +
5472
+ this.yearlyInterval;
5330
5473
  }
5331
5474
  if (this.yearlyDay === 3) {
5332
- placeholder = '3rd of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5475
+ placeholder =
5476
+ '3rd of every ' +
5477
+ this.shortMonth[this.yearlySelected] +
5478
+ ' by ' +
5479
+ this.yearlyInterval;
5333
5480
  }
5334
5481
  if (this.yearlyDay > 3) {
5335
- placeholder = this.yearlyDay + 'th of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5482
+ placeholder =
5483
+ this.yearlyDay +
5484
+ 'th of every ' +
5485
+ this.shortMonth[this.yearlySelected] +
5486
+ ' by ' +
5487
+ this.yearlyInterval;
5336
5488
  }
5337
5489
  if (this.yearlyDay === 31 || this.yearlyDay === 21) {
5338
- placeholder = this.yearlyDay + 'st of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5490
+ placeholder =
5491
+ this.yearlyDay +
5492
+ 'st of every ' +
5493
+ this.shortMonth[this.yearlySelected] +
5494
+ ' by ' +
5495
+ this.yearlyInterval;
5339
5496
  }
5340
5497
  if (this.yearlyDay === 22) {
5341
- placeholder = this.yearlyDay + 'nd of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5498
+ placeholder =
5499
+ this.yearlyDay +
5500
+ 'nd of every ' +
5501
+ this.shortMonth[this.yearlySelected] +
5502
+ ' by ' +
5503
+ this.yearlyInterval;
5342
5504
  }
5343
5505
  if (this.yearlyDay === 23) {
5344
- placeholder = this.yearlyDay + 'rd of every ' + this.shortMonth[this.yearlySelected] + ' by ' + this.yearlyInterval;
5506
+ placeholder =
5507
+ this.yearlyDay +
5508
+ 'rd of every ' +
5509
+ this.shortMonth[this.yearlySelected] +
5510
+ ' by ' +
5511
+ this.yearlyInterval;
5345
5512
  }
5346
5513
  return placeholder;
5347
5514
  }
@@ -5349,25 +5516,71 @@ class FrequencyDialogAnnualComponent {
5349
5516
  getPlaceholderForGt1() {
5350
5517
  let placeholder = '';
5351
5518
  if (this.yearlyDay === 1) {
5352
- placeholder = '1st of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5519
+ placeholder =
5520
+ '1st of ' +
5521
+ this.shortMonth[this.yearlySelected] +
5522
+ ', Interval: every ' +
5523
+ this.yearlyInput +
5524
+ ' years by ' +
5525
+ this.yearlyInterval;
5353
5526
  }
5354
5527
  if (this.yearlyDay === 2) {
5355
- placeholder = '2nd of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5528
+ placeholder =
5529
+ '2nd of ' +
5530
+ this.shortMonth[this.yearlySelected] +
5531
+ ', Interval: every ' +
5532
+ this.yearlyInput +
5533
+ ' years by ' +
5534
+ this.yearlyInterval;
5356
5535
  }
5357
5536
  if (this.yearlyDay === 3) {
5358
- placeholder = '3rd of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5537
+ placeholder =
5538
+ '3rd of ' +
5539
+ this.shortMonth[this.yearlySelected] +
5540
+ ', Interval: every ' +
5541
+ this.yearlyInput +
5542
+ ' years by ' +
5543
+ this.yearlyInterval;
5359
5544
  }
5360
5545
  if (this.yearlyDay > 3) {
5361
- placeholder = this.yearlyDay + 'th of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5546
+ placeholder =
5547
+ this.yearlyDay +
5548
+ 'th of ' +
5549
+ this.shortMonth[this.yearlySelected] +
5550
+ ', Interval: every ' +
5551
+ this.yearlyInput +
5552
+ ' years by ' +
5553
+ this.yearlyInterval;
5362
5554
  }
5363
5555
  if (this.yearlyDay === 31 || this.yearlyDay === 21) {
5364
- placeholder = this.yearlyDay + 'st of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5556
+ placeholder =
5557
+ this.yearlyDay +
5558
+ 'st of ' +
5559
+ this.shortMonth[this.yearlySelected] +
5560
+ ', Interval: every ' +
5561
+ this.yearlyInput +
5562
+ ' years by ' +
5563
+ this.yearlyInterval;
5365
5564
  }
5366
5565
  if (this.yearlyDay === 22) {
5367
- placeholder = this.yearlyDay + 'nd of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5566
+ placeholder =
5567
+ this.yearlyDay +
5568
+ 'nd of ' +
5569
+ this.shortMonth[this.yearlySelected] +
5570
+ ', Interval: every ' +
5571
+ this.yearlyInput +
5572
+ ' years by ' +
5573
+ this.yearlyInterval;
5368
5574
  }
5369
5575
  if (this.yearlyDay === 23) {
5370
- placeholder = this.yearlyDay + 'rd of ' + this.shortMonth[this.yearlySelected] + ', Interval: every ' + this.yearlyInput + ' years by ' + this.yearlyInterval;
5576
+ placeholder =
5577
+ this.yearlyDay +
5578
+ 'rd of ' +
5579
+ this.shortMonth[this.yearlySelected] +
5580
+ ', Interval: every ' +
5581
+ this.yearlyInput +
5582
+ ' years by ' +
5583
+ this.yearlyInterval;
5371
5584
  }
5372
5585
  return placeholder;
5373
5586
  }
@@ -5400,20 +5613,22 @@ class FrequencyDialogOneTimeComponent {
5400
5613
  this.todayDate = this.frequencyService.changeTimeZone((_a = new Date()) === null || _a === void 0 ? void 0 : _a.setDate(((_b = new Date()) === null || _b === void 0 ? void 0 : _b.getDate()) + 1));
5401
5614
  this.shortMonth = [];
5402
5615
  this.dateObjectData = this.frequencyService.changeTimeZone((_c = new Date()) === null || _c === void 0 ? void 0 : _c.setDate(((_d = new Date()) === null || _d === void 0 ? void 0 : _d.getDate()) + 1));
5403
- this.minDate = (_e = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _e === void 0 ? void 0 : _e.split(' ')[0];
5616
+ this.minDate = (_e = moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _e === void 0 ? void 0 : _e.split(' ')[0];
5404
5617
  this.mode = '';
5405
5618
  this.frequencyDetails = new EventEmitter();
5406
5619
  }
5407
5620
  ngOnInit() {
5408
5621
  var _a, _b, _c, _d, _e, _f, _g;
5409
5622
  this.dateConfig = this.frequencyService.dateConfig;
5410
- this.dateConfig['min'] = (_d = (_c = this.frequencyService.changeTimeZone((_a = new Date()) === null || _a === void 0 ? void 0 : _a.setDate(((_b = new Date()) === null || _b === void 0 ? void 0 : _b.getDate()) + 1))) === null || _c === void 0 ? void 0 : _c.getDate()) === null || _d === void 0 ? void 0 : _d.toString();
5623
+ this.dateConfig['min'] = (_d = (_c = this.frequencyService
5624
+ .changeTimeZone((_a = new Date()) === null || _a === void 0 ? void 0 : _a.setDate(((_b = new Date()) === null || _b === void 0 ? void 0 : _b.getDate()) + 1))) === null || _c === void 0 ? void 0 : _c.getDate()) === null || _d === void 0 ? void 0 : _d.toString();
5411
5625
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
5412
- this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
5413
- this.selectedDate = moment(this.todayDate);
5414
- console.log("this.dateConfig ", this.dateConfig, this.todayDate);
5415
- console.log("this.frequencyData ==>", this.frequencyData, (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.pattern.split('~'));
5416
- if (((_f = this.frequencyData) === null || _f === void 0 ? void 0 : _f.pattern) != '' && ((_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.pattern.split('~')[0]) === '0') {
5626
+ this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
5627
+ this.selectedDate = moment$1(this.todayDate);
5628
+ console.log('this.dateConfig ', this.dateConfig, this.todayDate);
5629
+ console.log('this.frequencyData ==>', this.frequencyData, (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.pattern.split('~'));
5630
+ if (((_f = this.frequencyData) === null || _f === void 0 ? void 0 : _f.pattern) != '' &&
5631
+ ((_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.pattern.split('~')[0]) === '0') {
5417
5632
  this.populateFrequency();
5418
5633
  }
5419
5634
  else {
@@ -5423,21 +5638,22 @@ class FrequencyDialogOneTimeComponent {
5423
5638
  populateFrequency() {
5424
5639
  var _a, _b, _c, _d, _e;
5425
5640
  const patternInfo = (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern.split('~');
5426
- console.log("patternInfo ==>", patternInfo);
5427
- const timeStamp = moment(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${(_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.failedTime}`, "DD-MM-YYYY HH:mm a").unix();
5428
- console.log("timeStamp -->", timeStamp);
5641
+ console.log('patternInfo ==>', patternInfo);
5642
+ const timeStamp = moment$1(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${(_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
5643
+ console.log('timeStamp -->', timeStamp);
5429
5644
  this.todayDate = new Date(timeStamp * 1000);
5430
- this.selectedDate = moment(this.todayDate);
5645
+ this.selectedDate = moment$1(this.todayDate);
5431
5646
  this.oneTimeFailed = (_c = this.frequencyData) === null || _c === void 0 ? void 0 : _c.failed;
5432
5647
  this.oneTimeWindow = (_d = this.frequencyData) === null || _d === void 0 ? void 0 : _d.window;
5433
5648
  this.oneTimeStartTime = (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.failedTime;
5434
- this.oneTimeSelected = patternInfo[1] + '~' + patternInfo[2] + '~' + patternInfo[3];
5435
- this.dateObjectData = new Date(moment(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
5649
+ this.oneTimeSelected =
5650
+ patternInfo[1] + '~' + patternInfo[2] + '~' + patternInfo[3];
5651
+ this.dateObjectData = new Date(moment$1(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
5436
5652
  this.getOneTimeFrequency();
5437
5653
  }
5438
5654
  openDatePicker() {
5439
5655
  var _a, _b, _c, _d;
5440
- const newDate = moment(this.todayDate);
5656
+ const newDate = moment$1(this.todayDate);
5441
5657
  (_b = (_a = this.datePicker) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.moveCalendarTo(newDate);
5442
5658
  (_d = (_c = this.datePicker) === null || _c === void 0 ? void 0 : _c.api) === null || _d === void 0 ? void 0 : _d.open();
5443
5659
  this.datepickerOverlay = true;
@@ -5457,27 +5673,43 @@ class FrequencyDialogOneTimeComponent {
5457
5673
  this.getOneTimeFrequency();
5458
5674
  }
5459
5675
  onTimeChanged(event) {
5460
- console.log("event sring", event);
5676
+ console.log('event sring', event);
5461
5677
  console.log(this.dateObjectData);
5462
5678
  this.oneTimeStartTime = event;
5463
5679
  if (typeof this.dateObjectData == 'object') {
5464
- this.dateObjectData = moment(this.dateObjectData).toDate();
5680
+ this.dateObjectData = moment$1(this.dateObjectData).toDate();
5465
5681
  }
5466
5682
  console.log(this.dateObjectData);
5467
- let timeStamp = moment(this.dateObjectData.getDate() + '-' + (this.dateObjectData.getMonth() + 1) + '-' + this.dateObjectData.getFullYear() + ' ' + this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
5468
- this.oneTimeSelected = moment(timeStamp * 1000).format('YYYY~MM~DDTHH:mm:ssZ').split('T')[0];
5683
+ let timeStamp = moment$1(this.dateObjectData.getDate() +
5684
+ '-' +
5685
+ (this.dateObjectData.getMonth() + 1) +
5686
+ '-' +
5687
+ this.dateObjectData.getFullYear() +
5688
+ ' ' +
5689
+ this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
5690
+ this.oneTimeSelected = moment$1(timeStamp * 1000)
5691
+ .format('YYYY~MM~DDTHH:mm:ssZ')
5692
+ .split('T')[0];
5469
5693
  console.log('timeStamp', timeStamp, this.oneTimeSelected);
5470
5694
  this.getOneTimeFrequency();
5471
5695
  }
5472
5696
  dateChange(event) {
5473
5697
  this.selectedDate = event.date;
5474
- const newDate = moment(event.date).unix();
5698
+ const newDate = moment$1(event.date).unix();
5475
5699
  this.dateObjectData = new Date(newDate * 1000);
5476
5700
  this.todayDate = this.dateObjectData;
5477
- let timeStamp = moment(this.dateObjectData.getDate() + '-' + (this.dateObjectData.getMonth() + 1) + '-' + this.dateObjectData.getFullYear() + ' ' + this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
5701
+ let timeStamp = moment$1(this.dateObjectData.getDate() +
5702
+ '-' +
5703
+ (this.dateObjectData.getMonth() + 1) +
5704
+ '-' +
5705
+ this.dateObjectData.getFullYear() +
5706
+ ' ' +
5707
+ this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
5478
5708
  // tslint:disable-next-line: no-console
5479
5709
  console.log('timeStamp', timeStamp, Date.now() / 1000, Date.now() / 1000 > timeStamp);
5480
- this.oneTimeSelected = event.date.format('YYYY~MM~DDTHH:mm:ssZ').split('T')[0];
5710
+ this.oneTimeSelected = event.date
5711
+ .format('YYYY~MM~DDTHH:mm:ssZ')
5712
+ .split('T')[0];
5481
5713
  // tslint:disable-next-line: no-console
5482
5714
  console.log(event.date.format('YYYY~MM~DDTHH:mm:ssZ'));
5483
5715
  this.getOneTimeFrequency();
@@ -5485,14 +5717,33 @@ class FrequencyDialogOneTimeComponent {
5485
5717
  getOneTimeFrequency() {
5486
5718
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5487
5719
  if (this.oneTimeSelected !== '') {
5488
- this.todayDate = moment(this.todayDate).toDate();
5720
+ this.todayDate = moment$1(this.todayDate).toDate();
5489
5721
  }
5490
- this.selectedDate = moment(this.todayDate);
5722
+ this.selectedDate = moment$1(this.todayDate);
5491
5723
  // tslint:disable-next-line: max-line-length
5492
5724
  this.frequencyInfo.placeholder =
5493
- 'One Time ' + this.todayDate.getDate() + ' ' + this.shortMonth[this.todayDate.getMonth()] + ' ' + this.todayDate.getFullYear() + ' by ' + this.oneTimeStartTime;
5725
+ 'One Time ' +
5726
+ this.todayDate.getDate() +
5727
+ ' ' +
5728
+ this.shortMonth[this.todayDate.getMonth()] +
5729
+ ' ' +
5730
+ this.todayDate.getFullYear() +
5731
+ ' by ' +
5732
+ this.oneTimeStartTime;
5494
5733
  this.frequencyInfo.pattern =
5495
- 0 + '~' + (this.oneTimeSelected === '' ? ((_c = this.frequencyService.changeTimeZone((_a = new Date()) === null || _a === void 0 ? void 0 : _a.setDate(((_b = new Date()) === null || _b === void 0 ? void 0 : _b.getDate()) + 1))) === null || _c === void 0 ? void 0 : _c.getFullYear()) + '~' + (((_f = this.frequencyService.changeTimeZone((_d = new Date()) === null || _d === void 0 ? void 0 : _d.setDate(((_e = new Date()) === null || _e === void 0 ? void 0 : _e.getDate()) + 1))) === null || _f === void 0 ? void 0 : _f.getMonth()) + 1) + '~' + ((_j = this.frequencyService.changeTimeZone((_g = new Date()) === null || _g === void 0 ? void 0 : _g.setDate(((_h = new Date()) === null || _h === void 0 ? void 0 : _h.getDate()) + 1))) === null || _j === void 0 ? void 0 : _j.getDate()) : this.oneTimeSelected);
5734
+ 0 +
5735
+ '~' +
5736
+ (this.oneTimeSelected === ''
5737
+ ? ((_c = this.frequencyService
5738
+ .changeTimeZone((_a = new Date()) === null || _a === void 0 ? void 0 : _a.setDate(((_b = new Date()) === null || _b === void 0 ? void 0 : _b.getDate()) + 1))) === null || _c === void 0 ? void 0 : _c.getFullYear()) +
5739
+ '~' +
5740
+ (((_f = this.frequencyService
5741
+ .changeTimeZone((_d = new Date()) === null || _d === void 0 ? void 0 : _d.setDate(((_e = new Date()) === null || _e === void 0 ? void 0 : _e.getDate()) + 1))) === null || _f === void 0 ? void 0 : _f.getMonth()) +
5742
+ 1) +
5743
+ '~' +
5744
+ ((_j = this.frequencyService
5745
+ .changeTimeZone((_g = new Date()) === null || _g === void 0 ? void 0 : _g.setDate(((_h = new Date()) === null || _h === void 0 ? void 0 : _h.getDate()) + 1))) === null || _j === void 0 ? void 0 : _j.getDate())
5746
+ : this.oneTimeSelected);
5496
5747
  this.frequencyInfo.case = 'oneTime';
5497
5748
  this.frequencyInfo.failedAfter = this.oneTimeFailed;
5498
5749
  this.frequencyInfo.window = this.oneTimeWindow;
@@ -5501,7 +5752,7 @@ class FrequencyDialogOneTimeComponent {
5501
5752
  this.frequencyInfo.failed_time_utc = 0;
5502
5753
  this.frequencyInfo.reportId = 0;
5503
5754
  this.frequencyDetails.emit(this.frequencyInfo);
5504
- console.log(" this.frequencyInfo ==>", this.frequencyInfo);
5755
+ console.log(' this.frequencyInfo ==>', this.frequencyInfo);
5505
5756
  }
5506
5757
  }
5507
5758
  FrequencyDialogOneTimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FrequencyDialogOneTimeComponent, deps: [{ token: FrequencyService }], target: i0.ɵɵFactoryTarget.Component });
@@ -5550,39 +5801,39 @@ class FrequencyDialogContainerComponent {
5550
5801
  },
5551
5802
  {
5552
5803
  name: 'Weekly',
5553
- type: 'weekly'
5804
+ type: 'weekly',
5554
5805
  },
5555
5806
  {
5556
5807
  name: 'Monthly',
5557
- type: 'monthly'
5808
+ type: 'monthly',
5558
5809
  },
5559
5810
  {
5560
5811
  name: 'Quarterly',
5561
- type: 'quarterly'
5812
+ type: 'quarterly',
5562
5813
  },
5563
5814
  {
5564
5815
  name: 'Biannual',
5565
- type: 'biannual'
5816
+ type: 'biannual',
5566
5817
  },
5567
5818
  {
5568
5819
  name: 'Annual',
5569
- type: 'annual'
5820
+ type: 'annual',
5570
5821
  },
5571
5822
  {
5572
5823
  name: 'One Time',
5573
- type: 'oneTime'
5824
+ type: 'oneTime',
5574
5825
  },
5575
5826
  {
5576
5827
  name: 'Random',
5577
- type: 'random'
5828
+ type: 'random',
5578
5829
  },
5579
5830
  {
5580
5831
  name: 'On Completion Of',
5581
- type: 'onCompletionOf'
5832
+ type: 'onCompletionOf',
5582
5833
  },
5583
5834
  {
5584
5835
  name: 'Ongoing',
5585
- type: 'ongoing'
5836
+ type: 'ongoing',
5586
5837
  },
5587
5838
  ];
5588
5839
  }
@@ -5590,7 +5841,7 @@ class FrequencyDialogContainerComponent {
5590
5841
  this.frequencyDetails['pattern'] = frequency === null || frequency === void 0 ? void 0 : frequency.frequency;
5591
5842
  this.frequencyDetails['window'] = frequency === null || frequency === void 0 ? void 0 : frequency.remind_before_days;
5592
5843
  this.frequencyDetails['failedTime'] = frequency === null || frequency === void 0 ? void 0 : frequency.frequency_time;
5593
- console.log("frequencyDetailsfrequencyDetailsfrequencyDetails", this.frequencyDetails);
5844
+ console.log('frequencyDetailsfrequencyDetailsfrequencyDetails', this.frequencyDetails);
5594
5845
  }
5595
5846
  ngOnInit() {
5596
5847
  var _a;
@@ -5606,7 +5857,7 @@ class FrequencyDialogContainerComponent {
5606
5857
  this.closeFrequency.emit();
5607
5858
  }
5608
5859
  onFrequencySelected(event) {
5609
- console.log("event.....", event);
5860
+ console.log('event.....', event);
5610
5861
  this.frequencyData = event;
5611
5862
  this.isNextDisabled = this.isInvalid();
5612
5863
  }
@@ -5616,48 +5867,48 @@ class FrequencyDialogContainerComponent {
5616
5867
  switch (frequencyPattern) {
5617
5868
  case 0:
5618
5869
  this.frequencyTab = 'oneTime';
5619
- this.currentTabName = "a one time";
5870
+ this.currentTabName = 'a one time';
5620
5871
  break;
5621
5872
  case 1:
5622
5873
  this.frequencyTab = 'daily';
5623
- this.currentTabName = "a daily";
5874
+ this.currentTabName = 'a daily';
5624
5875
  break;
5625
5876
  case 2:
5626
5877
  this.frequencyTab = 'weekly';
5627
- this.currentTabName = "a weekly";
5878
+ this.currentTabName = 'a weekly';
5628
5879
  break;
5629
5880
  case 3:
5630
5881
  this.frequencyTab = 'monthly';
5631
- this.currentTabName = "a monthly";
5882
+ this.currentTabName = 'a monthly';
5632
5883
  break;
5633
5884
  case 4:
5634
5885
  this.frequencyTab = 'annual';
5635
- this.currentTabName = "an annual ";
5886
+ this.currentTabName = 'an annual ';
5636
5887
  break;
5637
5888
  case 5:
5638
5889
  this.frequencyTab = 'daily';
5639
- this.currentTabName = "a daily";
5890
+ this.currentTabName = 'a daily';
5640
5891
  break;
5641
5892
  case 6:
5642
5893
  this.frequencyTab = 'onCompletionOf';
5643
- this.currentTabName = "an on completion of";
5894
+ this.currentTabName = 'an on completion of';
5644
5895
  this.frequencyData.report_id = this.frequencyDetails.selectedReport;
5645
5896
  break;
5646
5897
  case 7:
5647
5898
  this.frequencyTab = 'quarterly';
5648
- this.currentTabName = "a quarterly";
5899
+ this.currentTabName = 'a quarterly';
5649
5900
  break;
5650
5901
  case 8:
5651
5902
  this.frequencyTab = 'random';
5652
- this.currentTabName = "a random";
5903
+ this.currentTabName = 'a random';
5653
5904
  break;
5654
5905
  case 9:
5655
5906
  this.frequencyTab = 'biannual';
5656
- this.currentTabName = "a biannual";
5907
+ this.currentTabName = 'a biannual';
5657
5908
  break;
5658
5909
  case 10:
5659
5910
  this.frequencyTab = 'ongoing';
5660
- this.currentTabName = "an ongoing";
5911
+ this.currentTabName = 'an ongoing';
5661
5912
  break;
5662
5913
  }
5663
5914
  this.isNextDisabled = false;
@@ -5668,7 +5919,10 @@ class FrequencyDialogContainerComponent {
5668
5919
  this.currentTabName = 'a one time';
5669
5920
  }
5670
5921
  else {
5671
- this.currentTabName = (frequency.startsWith('On') || frequency.toLowerCase() === 'annual') ? 'an ' + frequency : 'a ' + frequency;
5922
+ this.currentTabName =
5923
+ frequency.startsWith('On') || frequency.toLowerCase() === 'annual'
5924
+ ? 'an ' + frequency
5925
+ : 'a ' + frequency;
5672
5926
  }
5673
5927
  }
5674
5928
  isInvalid() {
@@ -5685,7 +5939,6 @@ class FrequencyDialogContainerComponent {
5685
5939
  isInvalid = false;
5686
5940
  this.isNextDisabled = false;
5687
5941
  }
5688
- ;
5689
5942
  break;
5690
5943
  case 'weekly':
5691
5944
  if (this.frequencyData.continuous_failed_days < 2) {
@@ -5697,14 +5950,14 @@ class FrequencyDialogContainerComponent {
5697
5950
  isInvalid = false;
5698
5951
  this.isNextDisabled = false;
5699
5952
  }
5700
- ;
5701
- if (frequencyDetails[1] == '' || !frequencyDetails[1] || frequencyDetails.length < 4) {
5953
+ if (frequencyDetails[1] == '' ||
5954
+ !frequencyDetails[1] ||
5955
+ frequencyDetails.length < 4) {
5702
5956
  isInvalid = true;
5703
5957
  }
5704
5958
  else {
5705
5959
  isInvalid = false;
5706
5960
  }
5707
- ;
5708
5961
  break;
5709
5962
  case 'monthly':
5710
5963
  if (this.frequencyData.continuous_failed_days < 2) {
@@ -5716,17 +5969,19 @@ class FrequencyDialogContainerComponent {
5716
5969
  isInvalid = false;
5717
5970
  this.isNextDisabled = false;
5718
5971
  }
5719
- ;
5720
- if (frequencyDetails[2] == '' || !frequencyDetails[2] || frequencyDetails.length < 4) {
5972
+ if (frequencyDetails[2] == '' ||
5973
+ !frequencyDetails[2] ||
5974
+ frequencyDetails.length < 4) {
5721
5975
  isInvalid = true;
5722
5976
  }
5723
5977
  else {
5724
5978
  isInvalid = false;
5725
5979
  }
5726
- ;
5727
5980
  break;
5728
5981
  case 'biannual':
5729
- if (frequencyDetails.length === 0 || frequencyDetails[2] === '' || ((_c = frequencyDetails[2].split(',')) === null || _c === void 0 ? void 0 : _c.length) < 2) {
5982
+ if (frequencyDetails.length === 0 ||
5983
+ frequencyDetails[2] === '' ||
5984
+ ((_c = frequencyDetails[2].split(',')) === null || _c === void 0 ? void 0 : _c.length) < 2) {
5730
5985
  isInvalid = true;
5731
5986
  }
5732
5987
  else {
@@ -5735,8 +5990,9 @@ class FrequencyDialogContainerComponent {
5735
5990
  break;
5736
5991
  case 'oneTime':
5737
5992
  if ((frequencyDetails === null || frequencyDetails === void 0 ? void 0 : frequencyDetails.length) > 0) {
5738
- const selectedTime = moment(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
5739
- if (((_d = this.frequencyService.changeTimeZone(new Date())) === null || _d === void 0 ? void 0 : _d.getTime()) / 1000 > selectedTime) {
5993
+ const selectedTime = moment$1(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
5994
+ if (((_d = this.frequencyService.changeTimeZone(new Date())) === null || _d === void 0 ? void 0 : _d.getTime()) / 1000 >
5995
+ selectedTime) {
5740
5996
  this.snackbar.show('Please set a future date.', 'alert');
5741
5997
  isInvalid = true;
5742
5998
  break;
@@ -5759,28 +6015,33 @@ class FrequencyDialogContainerComponent {
5759
6015
  }
5760
6016
  break;
5761
6017
  case 'random':
5762
- if (parseInt(frequencyDetails[1]) == 2 && (frequencyDetails[2] == '' || !frequencyDetails[2] || frequencyDetails.length < 4)) {
6018
+ if (parseInt(frequencyDetails[1]) == 2 &&
6019
+ (frequencyDetails[2] == '' ||
6020
+ !frequencyDetails[2] ||
6021
+ frequencyDetails.length < 4)) {
5763
6022
  isInvalid = true;
5764
6023
  }
5765
6024
  else {
5766
6025
  isInvalid = false;
5767
6026
  }
5768
- ;
5769
6027
  break;
5770
- default: isInvalid = false;
6028
+ default:
6029
+ isInvalid = false;
5771
6030
  }
5772
6031
  return isInvalid;
5773
6032
  }
5774
6033
  save() {
5775
6034
  var _a, _b, _c, _d, _e, _f, _g;
5776
6035
  let frequency_details = {
5777
- "frequency": (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern,
5778
- "started_at": ((_b = this.frequencyService) === null || _b === void 0 ? void 0 : _b.changeTimeZone(new Date)) ? (_d = moment((_c = this.frequencyService) === null || _c === void 0 ? void 0 : _c.changeTimeZone(new Date))) === null || _d === void 0 ? void 0 : _d.format("YYYY-MM-DD") : moment().format("YYYY-MM-DD"),
5779
- "frequency_time": (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.timeIn12hr,
5780
- "remind_before_days": (_f = this.frequencyData) === null || _f === void 0 ? void 0 : _f.window,
5781
- "placeholder": (_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.placeholder
6036
+ frequency: (_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.pattern,
6037
+ started_at: ((_b = this.frequencyService) === null || _b === void 0 ? void 0 : _b.changeTimeZone(new Date()))
6038
+ ? (_d = moment$1((_c = this.frequencyService) === null || _c === void 0 ? void 0 : _c.changeTimeZone(new Date()))) === null || _d === void 0 ? void 0 : _d.format('YYYY-MM-DD')
6039
+ : moment$1().format('YYYY-MM-DD'),
6040
+ frequency_time: (_e = this.frequencyData) === null || _e === void 0 ? void 0 : _e.timeIn12hr,
6041
+ remind_before_days: (_f = this.frequencyData) === null || _f === void 0 ? void 0 : _f.window,
6042
+ placeholder: (_g = this.frequencyData) === null || _g === void 0 ? void 0 : _g.placeholder,
5782
6043
  };
5783
- console.log("frequency_detailsfrequency_details", frequency_details);
6044
+ console.log('frequency_detailsfrequency_details', frequency_details);
5784
6045
  this.selectedFrequency.emit(frequency_details);
5785
6046
  this.closeFrequency.emit();
5786
6047
  }
@@ -5834,7 +6095,13 @@ class WorkflowRiskComponent {
5834
6095
  { buttonText: 'Add More Risks', class: 'white-btn', id: 'addMore' },
5835
6096
  { buttonText: 'View Risk', class: 'blue-btn', id: 'viewRisks' },
5836
6097
  ];
5837
- this.sideSelectorElements = ['rc', 'owner', 'overseer', 'category', 'frequency'];
6098
+ this.sideSelectorElements = [
6099
+ 'rc',
6100
+ 'owner',
6101
+ 'overseer',
6102
+ 'category',
6103
+ 'frequency',
6104
+ ];
5838
6105
  this.showSmiley = false;
5839
6106
  this.mode = 'EDIT';
5840
6107
  this.riskId = '';
@@ -5853,19 +6120,19 @@ class WorkflowRiskComponent {
5853
6120
  this.categoryList = {
5854
6121
  strategic: {
5855
6122
  name: 'STRATEGIC',
5856
- data: []
6123
+ data: [],
5857
6124
  },
5858
6125
  operational: {
5859
6126
  name: 'OPERATIONAL',
5860
- data: []
6127
+ data: [],
5861
6128
  },
5862
6129
  compliance: {
5863
6130
  name: 'COMPLIANCE',
5864
- data: []
6131
+ data: [],
5865
6132
  },
5866
6133
  others: {
5867
6134
  name: 'OTHERS',
5868
- data: []
6135
+ data: [],
5869
6136
  },
5870
6137
  };
5871
6138
  this.overseersList = [];
@@ -5897,10 +6164,10 @@ class WorkflowRiskComponent {
5897
6164
  addMitigationPlan: false,
5898
6165
  mitigationDescriptionPlan: '',
5899
6166
  frequency_details: {
5900
- "frequency": '',
5901
- "started_at": '',
5902
- "frequency_time": '',
5903
- "remind_before_days": 0,
6167
+ frequency: '',
6168
+ started_at: '',
6169
+ frequency_time: '',
6170
+ remind_before_days: 0,
5904
6171
  },
5905
6172
  addRiskLabel: false,
5906
6173
  riskLabelValue: 1,
@@ -5920,10 +6187,10 @@ class WorkflowRiskComponent {
5920
6187
  // annual: 4~28~9~3
5921
6188
  // oneTime: 0~2022~12~28
5922
6189
  this.frequencyDetails = {
5923
- "frequency": "",
5924
- "started_at": "",
5925
- "frequency_time": "",
5926
- "remind_before_days": 0
6190
+ frequency: '',
6191
+ started_at: '',
6192
+ frequency_time: '',
6193
+ remind_before_days: 0,
5927
6194
  };
5928
6195
  this.frequencyPlaceholder = 'Set a Reassessment Frequency';
5929
6196
  this.shortMonth = [];
@@ -5936,7 +6203,7 @@ class WorkflowRiskComponent {
5936
6203
  /* Creating an array for risk label with it's value. */
5937
6204
  this.riskLabelList = [
5938
6205
  { name: 'Newly Identified Risk', value: 1 },
5939
- { name: 'Rapidly Changing Risk', value: 2 }
6206
+ { name: 'Rapidly Changing Risk', value: 2 },
5940
6207
  ];
5941
6208
  this.description = {
5942
6209
  mode: 'prime',
@@ -5948,7 +6215,7 @@ class WorkflowRiskComponent {
5948
6215
  mode: 'prime',
5949
6216
  colorPalette: true,
5950
6217
  link: true,
5951
- placeholder: 'Describe the recommended mitigation plans'
6218
+ placeholder: 'Describe the recommended mitigation plans',
5952
6219
  };
5953
6220
  // if (config) {
5954
6221
  // this.apiUrl = config.apiUrl;
@@ -5956,7 +6223,7 @@ class WorkflowRiskComponent {
5956
6223
  this.timezone = this.authService.getUserTimeZone();
5957
6224
  }
5958
6225
  ngOnInit() {
5959
- this.featureflag_groups = this.feature.isFeatureEnabled("ff_risk_groups");
6226
+ this.featureflag_groups = this.feature.isFeatureEnabled('ff_risk_groups');
5960
6227
  this.pickerChanged.emit(false);
5961
6228
  this.loader = true;
5962
6229
  this.uiKitService.isLoader = true;
@@ -5968,12 +6235,12 @@ class WorkflowRiskComponent {
5968
6235
  }
5969
6236
  this.getCategoryList();
5970
6237
  this.getSettingsInfo();
5971
- this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
6238
+ this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
5972
6239
  if (this.mode === 'CREATE') {
5973
6240
  this.organizationId = this.authService.getOrganizationId();
5974
6241
  }
5975
6242
  this.memberId = this.authService.getMemberId();
5976
- console.log("member id of logged in user", this.memberId);
6243
+ console.log('member id of logged in user', this.memberId);
5977
6244
  if (this.secondaryOpenPortal !== 'OTHER' && this.mode !== 'EDIT') {
5978
6245
  this.nonRemovableUsersList.push(this.memberId);
5979
6246
  }
@@ -5994,7 +6261,7 @@ class WorkflowRiskComponent {
5994
6261
  getGroupList() {
5995
6262
  this.riskService.getGroupsList().subscribe((res) => {
5996
6263
  this.groupsList = res === null || res === void 0 ? void 0 : res.data;
5997
- }, err => {
6264
+ }, (err) => {
5998
6265
  console.error(err);
5999
6266
  });
6000
6267
  }
@@ -6029,7 +6296,7 @@ class WorkflowRiskComponent {
6029
6296
  this.riskForm.riskType = 'REPORTED';
6030
6297
  }
6031
6298
  if (res && (res === null || res === void 0 ? void 0 : res.roleActions)) {
6032
- const moduleIndex = res.roleActions.findIndex((element) => element.moduleName == "risk");
6299
+ const moduleIndex = res.roleActions.findIndex((element) => element.moduleName == 'risk');
6033
6300
  const riskPermissions = res.roleActions[moduleIndex].subModule[1].permissions;
6034
6301
  riskPermissions.forEach((permission) => {
6035
6302
  if (permission.name == 'manage risks' && permission.enable) {
@@ -6042,7 +6309,7 @@ class WorkflowRiskComponent {
6042
6309
  this.riskForm.riskType = 'NORMAL';
6043
6310
  this.riskTypeChangeAllowed = false;
6044
6311
  }
6045
- }
6312
+ },
6046
6313
  });
6047
6314
  }
6048
6315
  changeRisk(type) {
@@ -6071,7 +6338,11 @@ class WorkflowRiskComponent {
6071
6338
  if (this.riskForm.riskType === 'REPORTED') {
6072
6339
  this.actionButtons = [
6073
6340
  { buttonText: 'Add More Risks', class: 'white-btn', id: 'addMore' },
6074
- { buttonText: 'View Reported Risks', class: 'blue-btn', id: 'manageReportedRisk' },
6341
+ {
6342
+ buttonText: 'View Reported Risks',
6343
+ class: 'blue-btn',
6344
+ id: 'manageReportedRisk',
6345
+ },
6075
6346
  ];
6076
6347
  }
6077
6348
  else {
@@ -6111,16 +6382,23 @@ class WorkflowRiskComponent {
6111
6382
  }
6112
6383
  this.riskForm.overseersList = this.setList(this.ownersList, res.manage_oversight, 'member_id');
6113
6384
  this.riskForm.overseersGroupList = this.setList(this.groupsList, res === null || res === void 0 ? void 0 : res.overseergroup_ids, '_id');
6114
- this.riskForm.mitigation = (res === null || res === void 0 ? void 0 : res.mitigation) ? res === null || res === void 0 ? void 0 : res.mitigation : (_d = this.riskForm) === null || _d === void 0 ? void 0 : _d.mitigation;
6385
+ this.riskForm.mitigation = (res === null || res === void 0 ? void 0 : res.mitigation)
6386
+ ? res === null || res === void 0 ? void 0 : res.mitigation
6387
+ : (_d = this.riskForm) === null || _d === void 0 ? void 0 : _d.mitigation;
6115
6388
  this.riskForm.assessment_deadline_days = res.assessment_deadline_days;
6116
- this.riskForm.addOverseer = (res.manage_oversight.length > 0 || ((_e = res === null || res === void 0 ? void 0 : res.overseergroup_ids) === null || _e === void 0 ? void 0 : _e.length) > 0) ? true : false;
6117
- this.riskForm.addMitigation = (res.mitigation) ? true : false;
6389
+ this.riskForm.addOverseer =
6390
+ res.manage_oversight.length > 0 || ((_e = res === null || res === void 0 ? void 0 : res.overseergroup_ids) === null || _e === void 0 ? void 0 : _e.length) > 0
6391
+ ? true
6392
+ : false;
6393
+ this.riskForm.addMitigation = res.mitigation ? true : false;
6118
6394
  // this.memberId = res.member_id;
6119
6395
  this.organizationId = res.organisation_id;
6120
6396
  this.riskForm.head_ids = (res === null || res === void 0 ? void 0 : res.head_ids) ? res === null || res === void 0 ? void 0 : res.head_ids : [];
6121
- this.riskForm.mitigationDescriptionPlan = (_f = res === null || res === void 0 ? void 0 : res.mitigation_plan_recommendation) !== null && _f !== void 0 ? _f : '';
6122
- this.riskForm.addMitigationPlan = ((_g = res === null || res === void 0 ? void 0 : res.mitigation_plan_recommendation.trim()) === null || _g === void 0 ? void 0 : _g.length) ? true : false;
6123
- this.riskForm.addRiskLabel = (res.risk_label) ? true : false;
6397
+ this.riskForm.mitigationDescriptionPlan =
6398
+ (_f = res === null || res === void 0 ? void 0 : res.mitigation_plan_recommendation) !== null && _f !== void 0 ? _f : '';
6399
+ this.riskForm.addMitigationPlan =
6400
+ ((_g = res === null || res === void 0 ? void 0 : res.mitigation_plan_recommendation.trim()) === null || _g === void 0 ? void 0 : _g.length) ? true : false;
6401
+ this.riskForm.addRiskLabel = res.risk_label ? true : false;
6124
6402
  if (res.assessment_date_timestamp) {
6125
6403
  this.date = new Date(res.assessment_date);
6126
6404
  }
@@ -6135,17 +6413,23 @@ class WorkflowRiskComponent {
6135
6413
  this.nonRemovableUsersList = Array.from(new Set([...this.nonRemovableUsersList, ...res === null || res === void 0 ? void 0 : res.owner]));
6136
6414
  }
6137
6415
  if (this.secondaryOpenPortal !== 'OTHER' && this.mode === 'EDIT') {
6138
- this.nonRemovableUsersList = Array.from(new Set([...this.nonRemovableUsersList, ...this.getCurrentlyLoggedInUser()]));
6416
+ this.nonRemovableUsersList = Array.from(new Set([
6417
+ ...this.nonRemovableUsersList,
6418
+ ...this.getCurrentlyLoggedInUser(),
6419
+ ]));
6139
6420
  }
6140
6421
  if ((res === null || res === void 0 ? void 0 : res.risk_type) === 'NORMAL') {
6141
- this.nonRemovableUsersList = Array.from(new Set([...this.nonRemovableUsersList, ...this.getCurrentlyLoggedInUser()]));
6422
+ this.nonRemovableUsersList = Array.from(new Set([
6423
+ ...this.nonRemovableUsersList,
6424
+ ...this.getCurrentlyLoggedInUser(),
6425
+ ]));
6142
6426
  }
6143
6427
  this.populateOptionalFields();
6144
6428
  this.frequencyDataPopulate(res === null || res === void 0 ? void 0 : res.frequency_details);
6145
6429
  this.riskForm.frequency_details = res === null || res === void 0 ? void 0 : res.frequency_details;
6146
6430
  this.getFrequencyPlaceholder(res.frequency_details);
6147
6431
  this.setOverseersList();
6148
- }, err => {
6432
+ }, (err) => {
6149
6433
  console.log(err);
6150
6434
  this.loader = false;
6151
6435
  this.uiKitService.isLoader = false;
@@ -6186,10 +6470,12 @@ class WorkflowRiskComponent {
6186
6470
  }
6187
6471
  getRCList() {
6188
6472
  const rcArray = [];
6189
- this.riskService.getResponsibilityCenterList(rcArray, this.mode === "EDIT" ? this.riskId : "").subscribe(res => {
6473
+ this.riskService
6474
+ .getResponsibilityCenterList(rcArray, this.mode === 'EDIT' ? this.riskId : '')
6475
+ .subscribe((res) => {
6190
6476
  this.responsibilityCentersList = res;
6191
6477
  this.rcListLoaded = true;
6192
- }, err => {
6478
+ }, (err) => {
6193
6479
  console.error(err);
6194
6480
  this.rcListLoaded = true;
6195
6481
  });
@@ -6201,7 +6487,7 @@ class WorkflowRiskComponent {
6201
6487
  this.categoryList.compliance.data = res.compliance_arr;
6202
6488
  this.categoryList.others.data = res.others_arr;
6203
6489
  this.categoryListLoaded = true;
6204
- }, err => {
6490
+ }, (err) => {
6205
6491
  console.error(err);
6206
6492
  this.categoryListLoaded = true;
6207
6493
  });
@@ -6216,31 +6502,31 @@ class WorkflowRiskComponent {
6216
6502
  this.riskForm.ownersList.push(res[index]);
6217
6503
  }
6218
6504
  }
6219
- }, err => {
6505
+ }, (err) => {
6220
6506
  console.error(err);
6221
6507
  this.usersListLoaded = true;
6222
6508
  });
6223
6509
  }
6224
6510
  getAdminsList() {
6225
- this.riskService.getAdminKeyAdminList().subscribe(res => {
6511
+ this.riskService.getAdminKeyAdminList().subscribe((res) => {
6226
6512
  this.adminsList = res;
6227
6513
  this.adminsListLoaded = true;
6228
- }, err => {
6514
+ }, (err) => {
6229
6515
  console.error(err);
6230
6516
  this.adminsListLoaded = true;
6231
6517
  });
6232
6518
  }
6233
6519
  getSettingsInfo() {
6234
- this.riskService.getRiskSettingDetails().subscribe(res => {
6520
+ this.riskService.getRiskSettingDetails().subscribe((res) => {
6235
6521
  var _a, _b, _c;
6236
6522
  this.settingsInfo = res;
6237
6523
  this.hideOptionalFields(res);
6238
6524
  this.mitigationDetails = (_a = res === null || res === void 0 ? void 0 : res.risk_mitigation_priority) === null || _a === void 0 ? void 0 : _a.mitigation_data;
6239
- let defaultMitigation = (_b = this.mitigationDetails) === null || _b === void 0 ? void 0 : _b.filter((ele) => (ele === null || ele === void 0 ? void 0 : ele.mitigation_name) === "LOW");
6525
+ let defaultMitigation = (_b = this.mitigationDetails) === null || _b === void 0 ? void 0 : _b.filter((ele) => (ele === null || ele === void 0 ? void 0 : ele.mitigation_name) === 'LOW');
6240
6526
  if (defaultMitigation === null || defaultMitigation === void 0 ? void 0 : defaultMitigation.length) {
6241
6527
  this.riskForm.mitigation = (_c = defaultMitigation[0]) === null || _c === void 0 ? void 0 : _c.mitigation_id;
6242
6528
  }
6243
- }, err => {
6529
+ }, (err) => {
6244
6530
  console.error(err);
6245
6531
  });
6246
6532
  }
@@ -6250,7 +6536,10 @@ class WorkflowRiskComponent {
6250
6536
  }
6251
6537
  }
6252
6538
  checkWhetherAllListsLoaded() {
6253
- if (this.rcListLoaded && this.usersListLoaded && this.adminsListLoaded && this.categoryListLoaded) {
6539
+ if (this.rcListLoaded &&
6540
+ this.usersListLoaded &&
6541
+ this.adminsListLoaded &&
6542
+ this.categoryListLoaded) {
6254
6543
  this.setOverseersList();
6255
6544
  if (this.mode === 'EDIT') {
6256
6545
  this.getRiskDetails(this.riskId);
@@ -6289,7 +6578,7 @@ class WorkflowRiskComponent {
6289
6578
  rcOwnerIds = [...new Set(rcOwnerIds)];
6290
6579
  this.riskForm.head_ids = rcOwnerIds;
6291
6580
  this.overseersList = allUsers.filter((user) => !ids.includes(user.member_id));
6292
- console.log("overseer list", this.overseersList);
6581
+ console.log('overseer list', this.overseersList);
6293
6582
  this.riskForm.overseersList = this.riskForm.overseersList.filter((user) => !ids.includes(user.member_id));
6294
6583
  //Groups which are selected in Owners field should not be visible Overseer
6295
6584
  let groupids = [];
@@ -6303,7 +6592,7 @@ class WorkflowRiskComponent {
6303
6592
  this.riskForm.overseersGroupList = this.riskForm.overseersGroupList.filter((user) => !groupids.includes(user.group_id));
6304
6593
  }
6305
6594
  activateSelector(type, event) {
6306
- console.log("typetypetypetype==>", type, event);
6595
+ console.log('typetypetypetype==>', type, event);
6307
6596
  this.activeSelector = event ? type : '';
6308
6597
  if (['rc', 'owner', 'overseer', 'category', 'frequency'].includes(type)) {
6309
6598
  this.pickerChanged.emit(event);
@@ -6340,7 +6629,7 @@ class WorkflowRiskComponent {
6340
6629
  case 'category':
6341
6630
  this.riskForm.category = {
6342
6631
  type: 'strategic',
6343
- selectedCategory: ''
6632
+ selectedCategory: '',
6344
6633
  };
6345
6634
  this.riskForm.categoryCustomTags = [];
6346
6635
  break;
@@ -6360,7 +6649,7 @@ class WorkflowRiskComponent {
6360
6649
  category.selectedCategory.custom_tag.forEach((element) => {
6361
6650
  const tag = {
6362
6651
  custom_tag_name: element.tagName,
6363
- custom_tag_value: ''
6652
+ custom_tag_value: '',
6364
6653
  };
6365
6654
  customTags.push(tag);
6366
6655
  });
@@ -6372,7 +6661,7 @@ class WorkflowRiskComponent {
6372
6661
  if (this.featureflag_groups) {
6373
6662
  let ownerids;
6374
6663
  let groupIds;
6375
- ownerids = this.returnIds(ids.users, "member_id");
6664
+ ownerids = this.returnIds(ids.users, 'member_id');
6376
6665
  groupIds = this.returnIds(ids.groups, 'group_id');
6377
6666
  const selectedOwners = this.setList(this.ownersList, ownerids, 'member_id');
6378
6667
  const selectedGroups = this.setList(this.groupsList, groupIds, 'group_id');
@@ -6396,7 +6685,7 @@ class WorkflowRiskComponent {
6396
6685
  else {
6397
6686
  let overseerids;
6398
6687
  let overseerGroupIds;
6399
- overseerids = this.returnIds(ids.users, "member_id");
6688
+ overseerids = this.returnIds(ids.users, 'member_id');
6400
6689
  overseerGroupIds = this.returnIds(ids.groups, 'group_id');
6401
6690
  const selectedOverseers = this.setList(this.overseersList, overseerids, 'member_id');
6402
6691
  const selectedOverseerGroups = this.setList(this.overseersGroupList, overseerGroupIds, 'group_id');
@@ -6446,7 +6735,7 @@ class WorkflowRiskComponent {
6446
6735
  return data;
6447
6736
  }
6448
6737
  returnIds(list, key) {
6449
- return list.map(ele => {
6738
+ return list.map((ele) => {
6450
6739
  if (ele[key]) {
6451
6740
  return ele[key];
6452
6741
  }
@@ -6461,7 +6750,10 @@ class WorkflowRiskComponent {
6461
6750
  else if (this.mode === 'EDIT' && this.editDetails.IfAssessmentDone > 0) {
6462
6751
  const prevRCArr = this.editDetails.rc_id;
6463
6752
  const currRCArr = this.returnIds(this.riskForm.responsibilityCentersList, 'rc_id');
6464
- if (prevRCArr.length === currRCArr.length && prevRCArr.sort().every((value, index) => value === currRCArr.sort()[index])) {
6753
+ if (prevRCArr.length === currRCArr.length &&
6754
+ prevRCArr
6755
+ .sort()
6756
+ .every((value, index) => value === currRCArr.sort()[index])) {
6465
6757
  this.createRisk(this.riskForm);
6466
6758
  }
6467
6759
  else {
@@ -6502,10 +6794,14 @@ class WorkflowRiskComponent {
6502
6794
  const re = /&nbsp;|<br>/g;
6503
6795
  this.riskForm.title = event.replace(re, '').trim();
6504
6796
  // ((!this.settingsInfo.assessment_deadline_enable) && (this.riskForm?.assessment_deadline_days < 1) && this.riskForm?.riskType !== 'REPORTED') ||
6505
- if (!this.riskForm.title || this.riskForm.responsibilityCentersList.length == 0
6506
- || this.riskForm.ownersList.length == 0 ||
6507
- (this.riskForm.riskType === 'REPORTED' && !((_c = (_b = (_a = this.riskForm) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.length)) ||
6508
- (((_d = this.riskForm) === null || _d === void 0 ? void 0 : _d.riskType) !== 'REPORTED' && (!((_f = (_e = this.riskForm) === null || _e === void 0 ? void 0 : _e.frequency_details) === null || _f === void 0 ? void 0 : _f.frequency) || ((_h = (_g = this.riskForm) === null || _g === void 0 ? void 0 : _g.frequency_details) === null || _h === void 0 ? void 0 : _h.frequency) === ''))) {
6797
+ if (!this.riskForm.title ||
6798
+ this.riskForm.responsibilityCentersList.length == 0 ||
6799
+ this.riskForm.ownersList.length == 0 ||
6800
+ (this.riskForm.riskType === 'REPORTED' &&
6801
+ !((_c = (_b = (_a = this.riskForm) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.length)) ||
6802
+ (((_d = this.riskForm) === null || _d === void 0 ? void 0 : _d.riskType) !== 'REPORTED' &&
6803
+ (!((_f = (_e = this.riskForm) === null || _e === void 0 ? void 0 : _e.frequency_details) === null || _f === void 0 ? void 0 : _f.frequency) ||
6804
+ ((_h = (_g = this.riskForm) === null || _g === void 0 ? void 0 : _g.frequency_details) === null || _h === void 0 ? void 0 : _h.frequency) === ''))) {
6509
6805
  return false;
6510
6806
  }
6511
6807
  else {
@@ -6523,19 +6819,23 @@ class WorkflowRiskComponent {
6523
6819
  assessment_deadline_enable: this.settingsInfo.assessment_deadline_enable,
6524
6820
  owner: this.returnIds(riskForm.ownersList, 'member_id'),
6525
6821
  // usergroup_ids: this.returnIds(riskForm.groupsList,'_id'),
6526
- category: ((_b = (_a = riskForm.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_id) ? [riskForm.category.selectedCategory.category_id] : [],
6527
- manage_oversight: riskForm.addOverseer ? this.returnIds(riskForm.overseersList, 'member_id') : [],
6822
+ category: ((_b = (_a = riskForm.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_id)
6823
+ ? [riskForm.category.selectedCategory.category_id]
6824
+ : [],
6825
+ manage_oversight: riskForm.addOverseer
6826
+ ? this.returnIds(riskForm.overseersList, 'member_id')
6827
+ : [],
6528
6828
  // overseergroup_ids : riskForm.addOverseer ? this.returnIds(riskForm.overseersGroupList,'_id') :[] ,
6529
6829
  rc_id: this.returnIds(riskForm.responsibilityCentersList, 'item_id'),
6530
6830
  head_ids: riskForm.head_ids,
6531
6831
  rating_arr: [],
6532
6832
  member_id: this.memberId,
6533
6833
  organisation_id: this.organizationId,
6534
- risk_progress_flag: (this.mode === 'EDIT') ? this.editDetails.risk_progress_flag : 1,
6535
- IfAssessmentDone: (this.mode == 'EDIT') ? this.editDetails.IfAssessmentDone : 0,
6536
- workshop_id: (this.mode == 'EDIT') ? this.editDetails.workshop_id : 0,
6834
+ risk_progress_flag: this.mode === 'EDIT' ? this.editDetails.risk_progress_flag : 1,
6835
+ IfAssessmentDone: this.mode == 'EDIT' ? this.editDetails.IfAssessmentDone : 0,
6836
+ workshop_id: this.mode == 'EDIT' ? this.editDetails.workshop_id : 0,
6537
6837
  complete_assessment: 0,
6538
- mitigation: (riskForm.addMitigation) ? riskForm.mitigation : 0,
6838
+ mitigation: riskForm.addMitigation ? riskForm.mitigation : 0,
6539
6839
  weightage_enable: this.settingsInfo.weightage_enable,
6540
6840
  treatment_type: this.settingsInfo.treatment_criteria,
6541
6841
  weightage_details: this.settingsInfo.weightage_details,
@@ -6549,15 +6849,19 @@ class WorkflowRiskComponent {
6549
6849
  assessment_deadline_set_by: this.settingsInfo.assessment_deadline_set_by,
6550
6850
  // assessment_deadline_days: (this.settingsInfo.assessment_deadline_enable) ? this.settingsInfo.assessment_deadline_days : riskForm.assessment_deadline_days,
6551
6851
  risk_type: (_d = (_c = this.riskForm) === null || _c === void 0 ? void 0 : _c.riskType) !== null && _d !== void 0 ? _d : 'NORMAL',
6552
- mitigation_plan_recommendation: ((_e = this.riskForm) === null || _e === void 0 ? void 0 : _e.addMitigationPlan) ? (_g = (_f = this.riskForm) === null || _f === void 0 ? void 0 : _f.mitigationDescriptionPlan) !== null && _g !== void 0 ? _g : '' : '',
6852
+ mitigation_plan_recommendation: ((_e = this.riskForm) === null || _e === void 0 ? void 0 : _e.addMitigationPlan)
6853
+ ? (_g = (_f = this.riskForm) === null || _f === void 0 ? void 0 : _f.mitigationDescriptionPlan) !== null && _g !== void 0 ? _g : ''
6854
+ : '',
6553
6855
  frequency_details: (_h = this.riskForm) === null || _h === void 0 ? void 0 : _h.frequency_details,
6554
6856
  risk_label: (riskForm === null || riskForm === void 0 ? void 0 : riskForm.addRiskLabel) ? riskForm === null || riskForm === void 0 ? void 0 : riskForm.riskLabelValue : 1,
6555
6857
  };
6556
6858
  if (this.featureflag_groups) {
6557
6859
  payload['usergroup_ids'] = this.returnIds(riskForm.groupsList, '_id');
6558
- payload['overseergroup_ids'] = riskForm.addOverseer ? this.returnIds(riskForm.overseersGroupList, '_id') : [];
6860
+ payload['overseergroup_ids'] = riskForm.addOverseer
6861
+ ? this.returnIds(riskForm.overseersGroupList, '_id')
6862
+ : [];
6559
6863
  }
6560
- console.log("payloadpayloadpayloadpayload", payload);
6864
+ console.log('payloadpayloadpayloadpayload', payload);
6561
6865
  if (this.mode == 'CREATE') {
6562
6866
  this.riskService.addRisk(payload).subscribe((res) => {
6563
6867
  console.log(res);
@@ -6568,7 +6872,7 @@ class WorkflowRiskComponent {
6568
6872
  this.showSmiley = true;
6569
6873
  this.uiKitService.isSmileyOn = true;
6570
6874
  // this.resetForm();
6571
- }, err => {
6875
+ }, (err) => {
6572
6876
  console.log(err);
6573
6877
  this.loader = false;
6574
6878
  this.uiKitService.isLoader = false;
@@ -6583,7 +6887,7 @@ class WorkflowRiskComponent {
6583
6887
  this.uiKitService.isSmileyOn = true;
6584
6888
  this.loader = false;
6585
6889
  this.uiKitService.isLoader = false;
6586
- }, err => {
6890
+ }, (err) => {
6587
6891
  console.log(err);
6588
6892
  this.loader = false;
6589
6893
  this.uiKitService.isLoader = false;
@@ -6591,7 +6895,10 @@ class WorkflowRiskComponent {
6591
6895
  });
6592
6896
  }
6593
6897
  if (this.openedFrom === 'MOVE_TO_REGISTER') {
6594
- this.closeWorkflow.emit({ evt: { action: 'MOVE_TO_REGISTER', payload }, confirm: false });
6898
+ this.closeWorkflow.emit({
6899
+ evt: { action: 'MOVE_TO_REGISTER', payload },
6900
+ confirm: false,
6901
+ });
6595
6902
  }
6596
6903
  }
6597
6904
  resetForm() {
@@ -6620,13 +6927,13 @@ class WorkflowRiskComponent {
6620
6927
  addOverseer: false,
6621
6928
  addMitigation: false,
6622
6929
  frequency_details: {
6623
- "frequency": '',
6624
- "started_at": '',
6625
- "frequency_time": '',
6626
- "remind_before_days": 0,
6930
+ frequency: '',
6931
+ started_at: '',
6932
+ frequency_time: '',
6933
+ remind_before_days: 0,
6627
6934
  },
6628
6935
  riskLabelValue: 1,
6629
- addRiskLabel: false
6936
+ addRiskLabel: false,
6630
6937
  };
6631
6938
  this.nonRemovableUsersList = [];
6632
6939
  this.organizationId = this.authService.getOrganizationId();
@@ -6724,10 +7031,10 @@ class WorkflowRiskComponent {
6724
7031
  this.activeDeselector();
6725
7032
  this.frequencyDataPopulate(event);
6726
7033
  this.riskForm.frequency_details = {
6727
- "frequency": event === null || event === void 0 ? void 0 : event.frequency,
6728
- "started_at": event === null || event === void 0 ? void 0 : event.started_at,
6729
- "frequency_time": event === null || event === void 0 ? void 0 : event.frequency_time,
6730
- "remind_before_days": event === null || event === void 0 ? void 0 : event.remind_before_days
7034
+ frequency: event === null || event === void 0 ? void 0 : event.frequency,
7035
+ started_at: event === null || event === void 0 ? void 0 : event.started_at,
7036
+ frequency_time: event === null || event === void 0 ? void 0 : event.frequency_time,
7037
+ remind_before_days: event === null || event === void 0 ? void 0 : event.remind_before_days,
6731
7038
  };
6732
7039
  this.frequencyPlaceholder = event === null || event === void 0 ? void 0 : event.placeholder;
6733
7040
  this.pickerChanged.emit(false);
@@ -6755,10 +7062,22 @@ class WorkflowRiskComponent {
6755
7062
  break;
6756
7063
  case 0:
6757
7064
  {
6758
- const dateObject = new Date(moment(frequencyDetails[1] + '-' + frequencyDetails[2] + '-' + frequencyDetails[3] + ' 00:00:00', 'YYYY-MM-DD HH:mm:ss').unix() * 1000);
7065
+ const dateObject = new Date(moment$1(frequencyDetails[1] +
7066
+ '-' +
7067
+ frequencyDetails[2] +
7068
+ '-' +
7069
+ frequencyDetails[3] +
7070
+ ' 00:00:00', 'YYYY-MM-DD HH:mm:ss').unix() * 1000);
6759
7071
  // tslint:disable-next-line: max-line-length
6760
7072
  this.frequencyPlaceholder =
6761
- 'One Time ' + dateObject.getDate() + ' ' + this.shortMonth[dateObject.getMonth()] + ' ' + dateObject.getFullYear() + ' by ' + frequencyTime;
7073
+ 'One Time ' +
7074
+ dateObject.getDate() +
7075
+ ' ' +
7076
+ this.shortMonth[dateObject.getMonth()] +
7077
+ ' ' +
7078
+ dateObject.getFullYear() +
7079
+ ' by ' +
7080
+ frequencyTime;
6762
7081
  }
6763
7082
  break;
6764
7083
  }
@@ -6782,16 +7101,25 @@ class WorkflowRiskComponent {
6782
7101
  return this.frequencyService.dayName[parseInt(ele) - 1];
6783
7102
  });
6784
7103
  if (parseInt(frequencyDetails[3]) === 1) {
6785
- this.frequencyPlaceholder = 'Every ' + selectedDay.join() + ' by ' + frequencyTime;
7104
+ this.frequencyPlaceholder =
7105
+ 'Every ' + selectedDay.join() + ' by ' + frequencyTime;
6786
7106
  }
6787
7107
  if (parseInt(frequencyDetails[3]) === 2) {
6788
- this.frequencyPlaceholder = 'Every alternate ' + selectedDay.join() + ' by ' + frequencyTime;
7108
+ this.frequencyPlaceholder =
7109
+ 'Every alternate ' + selectedDay.join() + ' by ' + frequencyTime;
6789
7110
  }
6790
7111
  if (parseInt(frequencyDetails[3]) === 3) {
6791
- this.frequencyPlaceholder = 'Every 3rd ' + selectedDay.join() + ' by ' + frequencyTime;
7112
+ this.frequencyPlaceholder =
7113
+ 'Every 3rd ' + selectedDay.join() + ' by ' + frequencyTime;
6792
7114
  }
6793
7115
  if (parseInt(frequencyDetails[3]) > 3) {
6794
- this.frequencyPlaceholder = 'Every ' + parseInt(frequencyDetails[3]) + 'th ' + selectedDay.join() + ' by ' + frequencyTime;
7116
+ this.frequencyPlaceholder =
7117
+ 'Every ' +
7118
+ parseInt(frequencyDetails[3]) +
7119
+ 'th ' +
7120
+ selectedDay.join() +
7121
+ ' by ' +
7122
+ frequencyTime;
6795
7123
  }
6796
7124
  }
6797
7125
  }
@@ -6806,25 +7134,49 @@ class WorkflowRiskComponent {
6806
7134
  return this.shortMonth[parseInt(ele) - 1];
6807
7135
  });
6808
7136
  if (parseInt(frequencyDetails[1]) === 1) {
6809
- this.frequencyPlaceholder = '1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7137
+ this.frequencyPlaceholder =
7138
+ '1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6810
7139
  }
6811
7140
  else if (parseInt(frequencyDetails[1]) === 2) {
6812
- this.frequencyPlaceholder = '2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7141
+ this.frequencyPlaceholder =
7142
+ '2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6813
7143
  }
6814
7144
  else if (parseInt(frequencyDetails[1]) === 3) {
6815
- this.frequencyPlaceholder = '3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7145
+ this.frequencyPlaceholder =
7146
+ '3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6816
7147
  }
6817
- else if (parseInt(frequencyDetails[1]) === 21 || parseInt(frequencyDetails[1]) === 31) {
6818
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7148
+ else if (parseInt(frequencyDetails[1]) === 21 ||
7149
+ parseInt(frequencyDetails[1]) === 31) {
7150
+ this.frequencyPlaceholder =
7151
+ parseInt(frequencyDetails[1]) +
7152
+ 'st of every ' +
7153
+ selectedMonth.join(', ') +
7154
+ ' by ' +
7155
+ frequencyTime;
6819
7156
  }
6820
7157
  else if (parseInt(frequencyDetails[1]) === 22) {
6821
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7158
+ this.frequencyPlaceholder =
7159
+ parseInt(frequencyDetails[1]) +
7160
+ 'nd of every ' +
7161
+ selectedMonth.join(', ') +
7162
+ ' by ' +
7163
+ frequencyTime;
6822
7164
  }
6823
7165
  else if (parseInt(frequencyDetails[1]) === 23) {
6824
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7166
+ this.frequencyPlaceholder =
7167
+ parseInt(frequencyDetails[1]) +
7168
+ 'rd of every ' +
7169
+ selectedMonth.join(', ') +
7170
+ ' by ' +
7171
+ frequencyTime;
6825
7172
  }
6826
7173
  else if (parseInt(frequencyDetails[1]) > 3) {
6827
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'th of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7174
+ this.frequencyPlaceholder =
7175
+ parseInt(frequencyDetails[1]) +
7176
+ 'th of every ' +
7177
+ selectedMonth.join(', ') +
7178
+ ' by ' +
7179
+ frequencyTime;
6828
7180
  }
6829
7181
  }
6830
7182
  }
@@ -6846,52 +7198,132 @@ class WorkflowRiskComponent {
6846
7198
  const yearSequence = parseInt(frequencyDetails[3]) > 0 ? parseInt(frequencyDetails[3]) : 1;
6847
7199
  if (yearSequence < 2) {
6848
7200
  if (parseInt(frequencyDetails[1]) === 1) {
6849
- this.frequencyPlaceholder = '1st of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7201
+ this.frequencyPlaceholder =
7202
+ '1st of every ' +
7203
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7204
+ ' by ' +
7205
+ frequencyTime;
6850
7206
  }
6851
7207
  if (parseInt(frequencyDetails[1]) === 2) {
6852
- this.frequencyPlaceholder = '2nd of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7208
+ this.frequencyPlaceholder =
7209
+ '2nd of every ' +
7210
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7211
+ ' by ' +
7212
+ frequencyTime;
6853
7213
  }
6854
7214
  if (parseInt(frequencyDetails[1]) === 3) {
6855
- this.frequencyPlaceholder = '3rd of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7215
+ this.frequencyPlaceholder =
7216
+ '3rd of every ' +
7217
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7218
+ ' by ' +
7219
+ frequencyTime;
6856
7220
  }
6857
7221
  if (parseInt(frequencyDetails[1]) > 3) {
6858
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'th of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7222
+ this.frequencyPlaceholder =
7223
+ parseInt(frequencyDetails[1]) +
7224
+ 'th of every ' +
7225
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7226
+ ' by ' +
7227
+ frequencyTime;
6859
7228
  }
6860
- if (parseInt(frequencyDetails[1]) === 31 || parseInt(frequencyDetails[1]) === 21) {
6861
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'st of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7229
+ if (parseInt(frequencyDetails[1]) === 31 ||
7230
+ parseInt(frequencyDetails[1]) === 21) {
7231
+ this.frequencyPlaceholder =
7232
+ parseInt(frequencyDetails[1]) +
7233
+ 'st of every ' +
7234
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7235
+ ' by ' +
7236
+ frequencyTime;
6862
7237
  }
6863
7238
  if (parseInt(frequencyDetails[1]) === 22) {
6864
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'nd of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7239
+ this.frequencyPlaceholder =
7240
+ parseInt(frequencyDetails[1]) +
7241
+ 'nd of every ' +
7242
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7243
+ ' by ' +
7244
+ frequencyTime;
6865
7245
  }
6866
7246
  if (parseInt(frequencyDetails[1]) === 23) {
6867
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'rd of every ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ' by ' + frequencyTime;
7247
+ this.frequencyPlaceholder =
7248
+ parseInt(frequencyDetails[1]) +
7249
+ 'rd of every ' +
7250
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7251
+ ' by ' +
7252
+ frequencyTime;
6868
7253
  }
6869
7254
  }
6870
7255
  if (yearSequence > 1) {
6871
7256
  if (parseInt(frequencyDetails[1]) === 1) {
6872
7257
  // tslint:disable-next-line: max-line-length
6873
- this.frequencyPlaceholder = '1st of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7258
+ this.frequencyPlaceholder =
7259
+ '1st of ' +
7260
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7261
+ ', Interval: every ' +
7262
+ yearSequence +
7263
+ ' years by ' +
7264
+ frequencyTime;
6874
7265
  }
6875
7266
  if (parseInt(frequencyDetails[1]) === 2) {
6876
7267
  // tslint:disable-next-line: max-line-length
6877
- this.frequencyPlaceholder = '2nd of' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7268
+ this.frequencyPlaceholder =
7269
+ '2nd of' +
7270
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7271
+ ', Interval: every ' +
7272
+ yearSequence +
7273
+ ' years by ' +
7274
+ frequencyTime;
6878
7275
  }
6879
7276
  if (parseInt(frequencyDetails[1]) === 3) {
6880
7277
  // tslint:disable-next-line: max-line-length
6881
- this.frequencyPlaceholder = '3rd of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7278
+ this.frequencyPlaceholder =
7279
+ '3rd of ' +
7280
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7281
+ ', Interval: every ' +
7282
+ yearSequence +
7283
+ ' years by ' +
7284
+ frequencyTime;
6882
7285
  }
6883
7286
  if (parseInt(frequencyDetails[1]) > 3) {
6884
7287
  // tslint:disable-next-line: max-line-length
6885
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'th of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7288
+ this.frequencyPlaceholder =
7289
+ parseInt(frequencyDetails[1]) +
7290
+ 'th of ' +
7291
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7292
+ ', Interval: every ' +
7293
+ yearSequence +
7294
+ ' years by ' +
7295
+ frequencyTime;
6886
7296
  }
6887
- if (parseInt(frequencyDetails[1]) === 31 || parseInt(frequencyDetails[1]) === 21) {
6888
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'st of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7297
+ if (parseInt(frequencyDetails[1]) === 31 ||
7298
+ parseInt(frequencyDetails[1]) === 21) {
7299
+ this.frequencyPlaceholder =
7300
+ parseInt(frequencyDetails[1]) +
7301
+ 'st of ' +
7302
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7303
+ ', Interval: every ' +
7304
+ yearSequence +
7305
+ ' years by ' +
7306
+ frequencyTime;
6889
7307
  }
6890
7308
  if (parseInt(frequencyDetails[1]) === 22) {
6891
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'nd of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7309
+ this.frequencyPlaceholder =
7310
+ parseInt(frequencyDetails[1]) +
7311
+ 'nd of ' +
7312
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7313
+ ', Interval: every ' +
7314
+ yearSequence +
7315
+ ' years by ' +
7316
+ frequencyTime;
6892
7317
  }
6893
7318
  if (parseInt(frequencyDetails[1]) === 23) {
6894
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'rd of ' + this.shortMonth[parseInt(frequencyDetails[2]) - 1] + ', Interval: every ' + yearSequence + ' years by ' + frequencyTime;
7319
+ this.frequencyPlaceholder =
7320
+ parseInt(frequencyDetails[1]) +
7321
+ 'rd of ' +
7322
+ this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
7323
+ ', Interval: every ' +
7324
+ yearSequence +
7325
+ ' years by ' +
7326
+ frequencyTime;
6895
7327
  }
6896
7328
  }
6897
7329
  }
@@ -6904,27 +7336,64 @@ class WorkflowRiskComponent {
6904
7336
  */
6905
7337
  getQuarterlyPlaceholder(frequencyDetails, frequencyTime) {
6906
7338
  {
6907
- const quarterly = ['January, April, July, October', 'February, May, August, November', ' March, June, September, December'];
7339
+ const quarterly = [
7340
+ 'January, April, July, October',
7341
+ 'February, May, August, November',
7342
+ ' March, June, September, December',
7343
+ ];
6908
7344
  if (parseInt(frequencyDetails[1]) === 1) {
6909
- this.frequencyPlaceholder = '1st of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7345
+ this.frequencyPlaceholder =
7346
+ '1st of every ' +
7347
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7348
+ ' by ' +
7349
+ frequencyTime;
6910
7350
  }
6911
7351
  else if (parseInt(frequencyDetails[1]) === 2) {
6912
- this.frequencyPlaceholder = '2nd of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7352
+ this.frequencyPlaceholder =
7353
+ '2nd of every ' +
7354
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7355
+ ' by ' +
7356
+ frequencyTime;
6913
7357
  }
6914
7358
  else if (parseInt(frequencyDetails[1]) === 3) {
6915
- this.frequencyPlaceholder = '3rd of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7359
+ this.frequencyPlaceholder =
7360
+ '3rd of every ' +
7361
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7362
+ ' by ' +
7363
+ frequencyTime;
6916
7364
  }
6917
- else if (parseInt(frequencyDetails[1]) === 21 || parseInt(frequencyDetails[1]) === 31) {
6918
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'st of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7365
+ else if (parseInt(frequencyDetails[1]) === 21 ||
7366
+ parseInt(frequencyDetails[1]) === 31) {
7367
+ this.frequencyPlaceholder =
7368
+ parseInt(frequencyDetails[1]) +
7369
+ 'st of every ' +
7370
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7371
+ ' by ' +
7372
+ frequencyTime;
6919
7373
  }
6920
7374
  else if (parseInt(frequencyDetails[1]) === 22) {
6921
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'nd of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7375
+ this.frequencyPlaceholder =
7376
+ parseInt(frequencyDetails[1]) +
7377
+ 'nd of every ' +
7378
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7379
+ ' by ' +
7380
+ frequencyTime;
6922
7381
  }
6923
7382
  else if (parseInt(frequencyDetails[1]) === 23) {
6924
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'rd of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7383
+ this.frequencyPlaceholder =
7384
+ parseInt(frequencyDetails[1]) +
7385
+ 'rd of every ' +
7386
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7387
+ ' by ' +
7388
+ frequencyTime;
6925
7389
  }
6926
7390
  else if (parseInt(frequencyDetails[1]) > 3) {
6927
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'th of every ' + quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] + ' by ' + frequencyTime;
7391
+ this.frequencyPlaceholder =
7392
+ parseInt(frequencyDetails[1]) +
7393
+ 'th of every ' +
7394
+ quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
7395
+ ' by ' +
7396
+ frequencyTime;
6928
7397
  }
6929
7398
  }
6930
7399
  }
@@ -6939,25 +7408,49 @@ class WorkflowRiskComponent {
6939
7408
  return this.shortMonth[parseInt(ele) - 1];
6940
7409
  });
6941
7410
  if (parseInt(frequencyDetails[1]) === 1) {
6942
- this.frequencyPlaceholder = '1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7411
+ this.frequencyPlaceholder =
7412
+ '1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6943
7413
  }
6944
7414
  else if (parseInt(frequencyDetails[1]) === 2) {
6945
- this.frequencyPlaceholder = '2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7415
+ this.frequencyPlaceholder =
7416
+ '2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6946
7417
  }
6947
7418
  else if (parseInt(frequencyDetails[1]) === 3) {
6948
- this.frequencyPlaceholder = '3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7419
+ this.frequencyPlaceholder =
7420
+ '3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
6949
7421
  }
6950
- else if (parseInt(frequencyDetails[1]) === 21 || parseInt(frequencyDetails[1]) === 31) {
6951
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7422
+ else if (parseInt(frequencyDetails[1]) === 21 ||
7423
+ parseInt(frequencyDetails[1]) === 31) {
7424
+ this.frequencyPlaceholder =
7425
+ parseInt(frequencyDetails[1]) +
7426
+ 'st of every ' +
7427
+ selectedMonth.join(', ') +
7428
+ ' by ' +
7429
+ frequencyTime;
6952
7430
  }
6953
7431
  else if (parseInt(frequencyDetails[1]) === 22) {
6954
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7432
+ this.frequencyPlaceholder =
7433
+ parseInt(frequencyDetails[1]) +
7434
+ 'nd of every ' +
7435
+ selectedMonth.join(', ') +
7436
+ ' by ' +
7437
+ frequencyTime;
6955
7438
  }
6956
7439
  else if (parseInt(frequencyDetails[1]) === 23) {
6957
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7440
+ this.frequencyPlaceholder =
7441
+ parseInt(frequencyDetails[1]) +
7442
+ 'rd of every ' +
7443
+ selectedMonth.join(', ') +
7444
+ ' by ' +
7445
+ frequencyTime;
6958
7446
  }
6959
7447
  else if (parseInt(frequencyDetails[1]) > 3) {
6960
- this.frequencyPlaceholder = parseInt(frequencyDetails[1]) + 'th of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
7448
+ this.frequencyPlaceholder =
7449
+ parseInt(frequencyDetails[1]) +
7450
+ 'th of every ' +
7451
+ selectedMonth.join(', ') +
7452
+ ' by ' +
7453
+ frequencyTime;
6961
7454
  }
6962
7455
  }
6963
7456
  }
@@ -6984,10 +7477,10 @@ class WorkflowRiskComponent {
6984
7477
  */
6985
7478
  frequencyDataPopulate(event) {
6986
7479
  let data = {
6987
- "frequency": event === null || event === void 0 ? void 0 : event.frequency,
6988
- "started_at": event === null || event === void 0 ? void 0 : event.started_at,
6989
- "frequency_time": event === null || event === void 0 ? void 0 : event.frequency_time,
6990
- "remind_before_days": event === null || event === void 0 ? void 0 : event.remind_before_days,
7480
+ frequency: event === null || event === void 0 ? void 0 : event.frequency,
7481
+ started_at: event === null || event === void 0 ? void 0 : event.started_at,
7482
+ frequency_time: event === null || event === void 0 ? void 0 : event.frequency_time,
7483
+ remind_before_days: event === null || event === void 0 ? void 0 : event.remind_before_days,
6991
7484
  };
6992
7485
  this.frequencyDetails = data;
6993
7486
  }
@@ -12928,14 +13421,15 @@ class FrequencyTopComponent {
12928
13421
  this.dateObjectData = new Date();
12929
13422
  this.timeData = '11:59 PM';
12930
13423
  }
12931
- ngOnInit() {
12932
- }
13424
+ ngOnInit() { }
12933
13425
  enterValueFirst(event, actionType) {
12934
13426
  if (this.id !== 0 && this.id !== 1 && this.id !== 5) {
12935
13427
  this.enterValue(this.occurrenceFirst, actionType);
12936
13428
  return;
12937
13429
  }
12938
- if (!Number.isNaN(Number(this.occurrenceFirst)) && this.occurrenceFirst !== 0 && Number(this.occurrenceFirst) > 0) {
13430
+ if (!Number.isNaN(Number(this.occurrenceFirst)) &&
13431
+ this.occurrenceFirst !== 0 &&
13432
+ Number(this.occurrenceFirst) > 0) {
12939
13433
  this.occurrenceFirst = Number(this.occurrenceFirst);
12940
13434
  this.valueChangedFirst.emit({
12941
13435
  type: actionType,
@@ -12948,7 +13442,10 @@ class FrequencyTopComponent {
12948
13442
  }
12949
13443
  }
12950
13444
  enterValue(event, actionType) {
12951
- if (!Number.isNaN(Number(event)) && event !== 0 && Number(event) > 0 && Number(event) < 32) {
13445
+ if (!Number.isNaN(Number(event)) &&
13446
+ event !== 0 &&
13447
+ Number(event) > 0 &&
13448
+ Number(event) < 32) {
12952
13449
  this.occurrenceFirst = Number(event);
12953
13450
  this.valueChangedFirst.emit({
12954
13451
  type: actionType,
@@ -12962,15 +13459,21 @@ class FrequencyTopComponent {
12962
13459
  }
12963
13460
  getToday() {
12964
13461
  var _a;
12965
- return (_a = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _a === void 0 ? void 0 : _a.split(' ')[0];
13462
+ return (_a = moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _a === void 0 ? void 0 : _a.split(' ')[0];
12966
13463
  }
12967
13464
  onTimeChanged(event) {
12968
13465
  try {
12969
13466
  this.timeData = event;
12970
13467
  if (typeof this.dateObjectData == 'object') {
12971
- this.dateObjectData = moment(this.dateObjectData).toDate();
13468
+ this.dateObjectData = moment$1(this.dateObjectData).toDate();
12972
13469
  }
12973
- let timeStamp = moment(this.dateObjectData.getDate() + '-' + (this.dateObjectData.getMonth() + 1) + '-' + this.dateObjectData.getFullYear() + ' ' + this.timeData, 'DD-MM-YYYY hh:mm a').unix();
13470
+ let timeStamp = moment$1(this.dateObjectData.getDate() +
13471
+ '-' +
13472
+ (this.dateObjectData.getMonth() + 1) +
13473
+ '-' +
13474
+ this.dateObjectData.getFullYear() +
13475
+ ' ' +
13476
+ this.timeData, 'DD-MM-YYYY hh:mm a').unix();
12974
13477
  if (Date.now() / 1000 > timeStamp) {
12975
13478
  this.nextDisable.emit(true);
12976
13479
  }
@@ -12984,7 +13487,10 @@ class FrequencyTopComponent {
12984
13487
  }
12985
13488
  }
12986
13489
  enterYearDay(event) {
12987
- if (!Number.isNaN(Number(this.yearlyDay)) && this.yearlyDay !== 0 && Number(this.yearlyDay) > 0 && Number(this.yearlyDay) < 32) {
13490
+ if (!Number.isNaN(Number(this.yearlyDay)) &&
13491
+ this.yearlyDay !== 0 &&
13492
+ Number(this.yearlyDay) > 0 &&
13493
+ Number(this.yearlyDay) < 32) {
12988
13494
  //this.yearlyDay = Number(event.target.value);
12989
13495
  this.yearlyDateChanged.emit(this.yearlyDay);
12990
13496
  }
@@ -13040,7 +13546,7 @@ class FrequencyLifecycleComponent {
13040
13546
  this.startDateUnix = Date.now();
13041
13547
  // All input variable
13042
13548
  this.startDate = new Date();
13043
- this.endDate = moment(new Date(this.startDate).getTime() + 86400000);
13549
+ this.endDate = moment$1(new Date(this.startDate).getTime() + 86400000);
13044
13550
  this.occurrance = 10;
13045
13551
  this.selectedLifecycleType = 2; // 0 = End by , End After, 2 = perpetual
13046
13552
  this.id = 0;
@@ -13053,30 +13559,30 @@ class FrequencyLifecycleComponent {
13053
13559
  this.endDateConfig = Object.assign(Object.assign({}, this.frequencyService.dateConfig));
13054
13560
  this.startDateConfig['min'] = new Date().getDate().toString();
13055
13561
  //this.startDateUnix = this.startDate.getDate().toString()
13056
- this.endDateConfig['min'] = moment(new Date(new Date(this.startDate).getTime() + 86400000));
13562
+ this.endDateConfig['min'] = moment$1(new Date(new Date(this.startDate).getTime() + 86400000));
13057
13563
  this.getEndDate(this.startDate);
13058
13564
  this.changeEndDateObj(this.endDate);
13059
13565
  console.log('endDate ==>', this.endDate);
13060
13566
  }
13061
13567
  getEndDate(event) {
13062
- const time = moment(this.endDate).format('DD-MM-YYYY HH:mm:ss');
13063
- const getUnixTime = moment(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
13568
+ const time = moment$1(this.endDate).format('DD-MM-YYYY HH:mm:ss');
13569
+ const getUnixTime = moment$1(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
13064
13570
  console.log('end date ==>time', time, getUnixTime);
13065
- this.startDateUnix = moment(event).unix();
13571
+ this.startDateUnix = moment$1(event).unix();
13066
13572
  console.log(' this.startDateUnix ==>', this.startDate, this.startDateUnix);
13067
13573
  if (this.startDateUnix >= getUnixTime) {
13068
- this.endDate = moment(new Date(this.startDate).getTime() + 86400000);
13574
+ this.endDate = moment$1(new Date(this.startDate).getTime() + 86400000);
13069
13575
  }
13070
13576
  else {
13071
- this.endDate = moment(this.endDate);
13577
+ this.endDate = moment$1(this.endDate);
13072
13578
  }
13073
13579
  }
13074
13580
  changeEndDateObj(date) {
13075
- this.endDateObject = new Date(moment(date).unix() * 1000);
13581
+ this.endDateObject = new Date(moment$1(date).unix() * 1000);
13076
13582
  }
13077
13583
  ngOnChanges(change) {
13078
13584
  console.log('changes ==>', change, this.selectedLifecycleType);
13079
- this.endBy = moment(this.endDate)
13585
+ this.endBy = moment$1(this.endDate)
13080
13586
  .format('DD-MMMM-YYYYTHH:mm:ssZ')
13081
13587
  .split('T')[0];
13082
13588
  }
@@ -13084,7 +13590,7 @@ class FrequencyLifecycleComponent {
13084
13590
  // console.log("this.endDate ==> DoCcheck", this.endDate, this.startDate)
13085
13591
  }
13086
13592
  openDatePicker() {
13087
- const newDate = moment(this.startDate);
13593
+ const newDate = moment$1(this.startDate);
13088
13594
  console.log('newDate ==>', newDate);
13089
13595
  this.datePicker.api.moveCalendarTo(newDate);
13090
13596
  this.datePicker.api.open();
@@ -13140,7 +13646,7 @@ class FrequencyLifecycleComponent {
13140
13646
  this.endDate = event.date;
13141
13647
  this.changeEndDateObj(this.endDate);
13142
13648
  // console.log(event, );
13143
- this.endBy = moment(event.date).format('DD-MMMM-YYYY');
13649
+ this.endBy = moment$1(event.date).format('DD-MMMM-YYYY');
13144
13650
  // console.log(this.endBy);
13145
13651
  const dateObject = {
13146
13652
  type: this.selectedLifecycleType,
@@ -13155,20 +13661,20 @@ class FrequencyLifecycleComponent {
13155
13661
  // start from change event
13156
13662
  startFromChange(event) {
13157
13663
  console.log(' start date change', event, this.endDate);
13158
- const time = moment(this.endDate).format('DD-MM-YYYY HH:mm:ss');
13159
- const getUnixTime = moment(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
13664
+ const time = moment$1(this.endDate).format('DD-MM-YYYY HH:mm:ss');
13665
+ const getUnixTime = moment$1(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
13160
13666
  console.log('end date ==>time', time, getUnixTime);
13161
- this.startDateUnix = moment(event.date).unix();
13667
+ this.startDateUnix = moment$1(event.date).unix();
13162
13668
  console.log(' this.startDateUnix ==>', this.startDate, this.startDateUnix);
13163
13669
  if (this.startDateUnix >= getUnixTime) {
13164
- this.endDate = moment(this.startDateUnix * 1000 + 86400000);
13670
+ this.endDate = moment$1(this.startDateUnix * 1000 + 86400000);
13165
13671
  this.changeEndDateObj(this.endDate);
13166
13672
  console.log('this.endDate ==>', this.endDate, this.startDate);
13167
- this.endBy = moment(this.endDate)
13673
+ this.endBy = moment$1(this.endDate)
13168
13674
  .format('DD-MMMM-YYYYTHH:mm:ssZ')
13169
13675
  .split('T')[0];
13170
13676
  }
13171
- this.endDateConfig['min'] = Object.assign(moment(new Date(new Date(event.date).getTime() + 86400000)));
13677
+ this.endDateConfig['min'] = Object.assign(moment$1(new Date(new Date(event.date).getTime() + 86400000)));
13172
13678
  console.log('this.endDateConfig ==>', this.endDateConfig);
13173
13679
  this.selectedOccurance.emit({
13174
13680
  type: this.selectedLifecycleType,
@@ -13356,7 +13862,7 @@ class FrequencyDailyComponent {
13356
13862
  this.dailyFailed = this.frequencyData.failed;
13357
13863
  this.dailyDeactivatedValue = this.frequencyData.continuous_failed_days;
13358
13864
  if (lifecycleInfo[0] !== '0000-00-00') {
13359
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
13865
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
13360
13866
  this.dailyLifeCycleEndTime = new Date(dateSelected * 1000);
13361
13867
  }
13362
13868
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -13417,7 +13923,7 @@ class FrequencyDailyComponent {
13417
13923
  console.log('end date', endByDate);
13418
13924
  if (event.type === 0) {
13419
13925
  endByDate = event.endsBy
13420
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
13926
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
13421
13927
  : endByDate;
13422
13928
  console.log('endByDate', endByDate);
13423
13929
  }
@@ -13551,7 +14057,7 @@ class FrequencyWeeklyComponent {
13551
14057
  this.weeklyFailed = this.frequencyData.failed;
13552
14058
  this.weeklyDeactivatedValue = this.frequencyData.continuous_failed_days;
13553
14059
  if (lifecycleInfo[0] !== '0000-00-00') {
13554
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14060
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
13555
14061
  this.weeklyLifeCycleEndTime = new Date(dateSelected * 1000);
13556
14062
  }
13557
14063
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -13611,7 +14117,7 @@ class FrequencyWeeklyComponent {
13611
14117
  console.log('end date', endByDate);
13612
14118
  if (event.type === 0) {
13613
14119
  endByDate = event.endsBy
13614
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14120
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
13615
14121
  : endByDate;
13616
14122
  console.log('endByDate', endByDate);
13617
14123
  }
@@ -13756,7 +14262,7 @@ class FrequencyMonthlyComponent {
13756
14262
  this.monthlyFailed = this.frequencyData.failed;
13757
14263
  this.monthlyDeactivatedValue = this.frequencyData.continuous_failed_days;
13758
14264
  if (lifecycleInfo[0] !== '0000-00-00') {
13759
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14265
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
13760
14266
  this.monthlyLifeCycleEndTime = new Date(dateSelected * 1000);
13761
14267
  }
13762
14268
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -13816,7 +14322,7 @@ class FrequencyMonthlyComponent {
13816
14322
  console.log('end date', endByDate);
13817
14323
  if (event.type === 0) {
13818
14324
  endByDate = event.endsBy
13819
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14325
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
13820
14326
  : endByDate;
13821
14327
  console.log('endByDate', endByDate);
13822
14328
  }
@@ -14018,7 +14524,7 @@ class FrequencyQuarterlyComponent {
14018
14524
  this.quarterlyLifeCycleStart = new Date(this.frequencyData.startDate * 1000);
14019
14525
  this.quarterlyFailed = this.frequencyData.failed;
14020
14526
  if (lifecycleInfo[0] !== '0000-00-00') {
14021
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14527
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14022
14528
  this.quarterlyLifeCycleEndTime = new Date(dateSelected * 1000);
14023
14529
  }
14024
14530
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -14070,7 +14576,7 @@ class FrequencyQuarterlyComponent {
14070
14576
  console.log('end date', endByDate);
14071
14577
  if (event.type === 0) {
14072
14578
  endByDate = event.endsBy
14073
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14579
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14074
14580
  : endByDate;
14075
14581
  console.log('endByDate', endByDate);
14076
14582
  }
@@ -14233,7 +14739,7 @@ class FrequencyBiannualComponent {
14233
14739
  this.biannualLifeCycleStart = new Date(this.frequencyData.startDate * 1000);
14234
14740
  this.biannualFailed = this.frequencyData.failed;
14235
14741
  if (lifecycleInfo[0] !== '0000-00-00') {
14236
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14742
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14237
14743
  this.biannualLifeCycleEndTime = new Date(dateSelected * 1000);
14238
14744
  }
14239
14745
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -14302,7 +14808,7 @@ class FrequencyBiannualComponent {
14302
14808
  console.log('end date', endByDate);
14303
14809
  if (event.type === 0) {
14304
14810
  endByDate = event.endsBy
14305
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14811
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14306
14812
  : endByDate;
14307
14813
  console.log('endByDate', endByDate);
14308
14814
  }
@@ -14453,7 +14959,7 @@ class FrequencyAnnualComponent {
14453
14959
  (_a = this.frequencyData.startFrom) !== null && _a !== void 0 ? _a : this.frequencyData.startDate;
14454
14960
  this.yearlyFailed = this.frequencyData.failed;
14455
14961
  if (lifecycleInfo[0] !== '0000-00-00') {
14456
- const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14962
+ const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
14457
14963
  this.yearlyLifeCycleEndTime = new Date(dateSelected * 1000);
14458
14964
  }
14459
14965
  this.lifecycleDetails = this.frequencyData.lifecycle;
@@ -14504,7 +15010,7 @@ class FrequencyAnnualComponent {
14504
15010
  let endByDate = Math.floor(new Date().getTime() / 1000 + 86400000);
14505
15011
  if (event.type === 0) {
14506
15012
  endByDate = event.endsBy
14507
- ? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
15013
+ ? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
14508
15014
  : endByDate;
14509
15015
  }
14510
15016
  this.frequencyInfo.failed_time_utc = endByDate;
@@ -14706,7 +15212,7 @@ class FrequencyOneTimeComponent {
14706
15212
  this.todayDate = new Date();
14707
15213
  this.shortMonth = [];
14708
15214
  this.dateObjectData = new Date();
14709
- this.minDate = (_a = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _a === void 0 ? void 0 : _a.split(' ')[0];
15215
+ this.minDate = (_a = moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')) === null || _a === void 0 ? void 0 : _a.split(' ')[0];
14710
15216
  this.pageType = 'responsibility';
14711
15217
  this.mode = '';
14712
15218
  this.frequencyDetails = new EventEmitter();
@@ -14716,7 +15222,7 @@ class FrequencyOneTimeComponent {
14716
15222
  this.dateConfig['min'] = new Date().getDate().toString();
14717
15223
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
14718
15224
  this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
14719
- this.selectedDate = moment(this.todayDate);
15225
+ this.selectedDate = moment$1(this.todayDate);
14720
15226
  console.log('this.dateConfig ', this.dateConfig, this.todayDate);
14721
15227
  console.log('this.frequencyData ==>', this.frequencyData, this.frequencyData.pattern.split('~'));
14722
15228
  if (this.frequencyData.pattern != '' &&
@@ -14730,20 +15236,20 @@ class FrequencyOneTimeComponent {
14730
15236
  populateFrequency() {
14731
15237
  const patternInfo = this.frequencyData.pattern.split('~');
14732
15238
  console.log('patternInfo ==>', patternInfo);
14733
- const timeStamp = moment(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
15239
+ const timeStamp = moment$1(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
14734
15240
  console.log('timeStamp -->', timeStamp);
14735
15241
  this.todayDate = new Date(timeStamp * 1000);
14736
- this.selectedDate = moment(this.todayDate);
15242
+ this.selectedDate = moment$1(this.todayDate);
14737
15243
  this.oneTimeFailed = this.frequencyData.failed;
14738
15244
  this.oneTimeWindow = this.frequencyData.window;
14739
15245
  this.oneTimeStartTime = this.frequencyData.failedTime;
14740
15246
  this.oneTimeSelected =
14741
15247
  patternInfo[1] + '~' + patternInfo[2] + '~' + patternInfo[3];
14742
- this.dateObjectData = new Date(moment(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
15248
+ this.dateObjectData = new Date(moment$1(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
14743
15249
  this.getOneTimeFrequency();
14744
15250
  }
14745
15251
  openDatePicker() {
14746
- const newDate = moment(this.todayDate);
15252
+ const newDate = moment$1(this.todayDate);
14747
15253
  this.datePicker.api.moveCalendarTo(newDate);
14748
15254
  this.datePicker.api.open();
14749
15255
  this.datepickerOverlay = true;
@@ -14767,17 +15273,17 @@ class FrequencyOneTimeComponent {
14767
15273
  console.log(this.dateObjectData);
14768
15274
  this.oneTimeStartTime = event;
14769
15275
  if (typeof this.dateObjectData == 'object') {
14770
- this.dateObjectData = moment(this.dateObjectData).toDate();
15276
+ this.dateObjectData = moment$1(this.dateObjectData).toDate();
14771
15277
  }
14772
15278
  console.log(this.dateObjectData);
14773
- let timeStamp = moment(this.dateObjectData.getDate() +
15279
+ let timeStamp = moment$1(this.dateObjectData.getDate() +
14774
15280
  '-' +
14775
15281
  (this.dateObjectData.getMonth() + 1) +
14776
15282
  '-' +
14777
15283
  this.dateObjectData.getFullYear() +
14778
15284
  ' ' +
14779
15285
  this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
14780
- this.oneTimeSelected = moment(timeStamp * 1000)
15286
+ this.oneTimeSelected = moment$1(timeStamp * 1000)
14781
15287
  .format('YYYY~MM~DDTHH:mm:ssZ')
14782
15288
  .split('T')[0];
14783
15289
  console.log('timeStamp', timeStamp, this.oneTimeSelected);
@@ -14785,10 +15291,10 @@ class FrequencyOneTimeComponent {
14785
15291
  }
14786
15292
  dateChange(event) {
14787
15293
  this.selectedDate = event.date;
14788
- const newDate = moment(event.date).unix();
15294
+ const newDate = moment$1(event.date).unix();
14789
15295
  this.dateObjectData = new Date(newDate * 1000);
14790
15296
  this.todayDate = this.dateObjectData;
14791
- let timeStamp = moment(this.dateObjectData.getDate() +
15297
+ let timeStamp = moment$1(this.dateObjectData.getDate() +
14792
15298
  '-' +
14793
15299
  (this.dateObjectData.getMonth() + 1) +
14794
15300
  '-' +
@@ -14806,9 +15312,9 @@ class FrequencyOneTimeComponent {
14806
15312
  }
14807
15313
  getOneTimeFrequency() {
14808
15314
  if (this.oneTimeSelected !== '') {
14809
- this.todayDate = moment(this.todayDate).toDate();
15315
+ this.todayDate = moment$1(this.todayDate).toDate();
14810
15316
  }
14811
- this.selectedDate = moment(this.todayDate);
15317
+ this.selectedDate = moment$1(this.todayDate);
14812
15318
  // tslint:disable-next-line: max-line-length
14813
15319
  this.frequencyInfo.placeholder =
14814
15320
  'One Time ' +
@@ -15460,7 +15966,9 @@ class FrequencyOnCompletionOfComponent {
15460
15966
  this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
15461
15967
  this.getCompletionReports();
15462
15968
  this.getOnCompletionFrequency();
15463
- this.isSelectedData = this.selectedResponsibilityDetails ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0 : false;
15969
+ this.isSelectedData = this.selectedResponsibilityDetails
15970
+ ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0
15971
+ : false;
15464
15972
  }
15465
15973
  populateFrequency() {
15466
15974
  var _a;
@@ -15471,7 +15979,9 @@ class FrequencyOnCompletionOfComponent {
15471
15979
  this.onCompletionOfTime = this.frequencyData.failedTime;
15472
15980
  this.selectedResponsibilityDetails = this.onCompletionOfResponsibility.find((res) => res.ReportId === this.frequencyData.selectedReport);
15473
15981
  this.getOnCompletionFrequency();
15474
- this.isSelectedData = this.selectedResponsibilityDetails ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0 : false;
15982
+ this.isSelectedData = this.selectedResponsibilityDetails
15983
+ ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0
15984
+ : false;
15475
15985
  }
15476
15986
  onTimeChanged(event) {
15477
15987
  this.onCompletionOfTime = event;
@@ -15490,10 +16000,13 @@ class FrequencyOnCompletionOfComponent {
15490
16000
  var _a, _b;
15491
16001
  if (this.featureFlag_on_completion_of) {
15492
16002
  this.selectedResponsibilityDetails = event;
15493
- this.isSelectedData = this.selectedResponsibilityDetails ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0 : false;
16003
+ this.isSelectedData = this.selectedResponsibilityDetails
16004
+ ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0
16005
+ : false;
15494
16006
  }
15495
- if (typeof (this.selectedResponsibilityDetails) === 'object') {
15496
- this.frequencyInfo.reportId = (_b = this.selectedResponsibilityDetails) === null || _b === void 0 ? void 0 : _b.ReportId;
16007
+ if (typeof this.selectedResponsibilityDetails === 'object') {
16008
+ this.frequencyInfo.reportId =
16009
+ (_b = this.selectedResponsibilityDetails) === null || _b === void 0 ? void 0 : _b.ReportId;
15497
16010
  }
15498
16011
  else {
15499
16012
  this.frequencyInfo.reportId = 0;
@@ -15508,7 +16021,8 @@ class FrequencyOnCompletionOfComponent {
15508
16021
  if ((_a = this.frequencyData) === null || _a === void 0 ? void 0 : _a.onCompletionReportDetails) {
15509
16022
  this.onCompletionOfResponsibility.push((_b = this.frequencyData) === null || _b === void 0 ? void 0 : _b.onCompletionReportDetails);
15510
16023
  }
15511
- if (this.frequencyData.pattern != '' && parseInt(this.frequencyData.pattern.split('~')[0]) === 6) {
16024
+ if (this.frequencyData.pattern != '' &&
16025
+ parseInt(this.frequencyData.pattern.split('~')[0]) === 6) {
15512
16026
  this.populateFrequency();
15513
16027
  }
15514
16028
  }
@@ -15526,15 +16040,20 @@ class FrequencyOnCompletionOfComponent {
15526
16040
  ' ' +
15527
16041
  (this.onCompletionOfInput > 1 ? 'days' : 'day') +
15528
16042
  ' after completion of ' +
15529
- (this.onCompletionOfResponsibility && ((_a = this.selectedResponsibilityDetails) === null || _a === void 0 ? void 0 : _a.report_name) ? ((_b = this.selectedResponsibilityDetails) === null || _b === void 0 ? void 0 : _b.report_name) : '');
15530
- this.frequencyInfo.pattern = 6 + '~' + '0' + '~' + '0' + '~' + this.onCompletionOfInput;
16043
+ (this.onCompletionOfResponsibility &&
16044
+ ((_a = this.selectedResponsibilityDetails) === null || _a === void 0 ? void 0 : _a.report_name)
16045
+ ? (_b = this.selectedResponsibilityDetails) === null || _b === void 0 ? void 0 : _b.report_name
16046
+ : '');
16047
+ this.frequencyInfo.pattern =
16048
+ 6 + '~' + '0' + '~' + '0' + '~' + this.onCompletionOfInput;
15531
16049
  this.frequencyInfo.case = 'onCompletionOf';
15532
16050
  this.frequencyInfo.failedAfter = this.onCompletionOfFailed;
15533
16051
  this.frequencyInfo.window = this.onCompletionOfWindow;
15534
16052
  this.frequencyInfo.timeIn12hr = this.onCompletionOfTime;
15535
16053
  this.frequencyInfo.timeIn24Hr = this.frequencyService.timeFrom12hTo24h(this.onCompletionOfTime);
15536
16054
  this.frequencyInfo.failed_time_utc = 0;
15537
- this.frequencyInfo.reportId = (_d = (_c = this.selectedResponsibilityDetails) === null || _c === void 0 ? void 0 : _c.ReportId) !== null && _d !== void 0 ? _d : 0;
16055
+ this.frequencyInfo.reportId =
16056
+ (_d = (_c = this.selectedResponsibilityDetails) === null || _c === void 0 ? void 0 : _c.ReportId) !== null && _d !== void 0 ? _d : 0;
15538
16057
  this.frequencyDetails.emit(this.frequencyInfo);
15539
16058
  }
15540
16059
  openRadioResponsibility(event) {
@@ -15551,7 +16070,9 @@ class FrequencyOnCompletionOfComponent {
15551
16070
  remove() {
15552
16071
  var _a;
15553
16072
  this.selectedResponsibilityDetails = {};
15554
- this.isSelectedData = this.selectedResponsibilityDetails ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0 : false;
16073
+ this.isSelectedData = this.selectedResponsibilityDetails
16074
+ ? ((_a = Object.keys(this.selectedResponsibilityDetails)) === null || _a === void 0 ? void 0 : _a.length) > 0
16075
+ : false;
15555
16076
  this.frequencyInfo.reportId = 0;
15556
16077
  this.frequencyDetails.emit(this.frequencyInfo);
15557
16078
  }
@@ -15852,7 +16373,7 @@ class FrequencyContainerComponent {
15852
16373
  break;
15853
16374
  case 'oneTime':
15854
16375
  if ((frequencyDetails === null || frequencyDetails === void 0 ? void 0 : frequencyDetails.length) > 0) {
15855
- const selectedTime = moment(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
16376
+ const selectedTime = moment$1(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
15856
16377
  if (Date.now() / 1000 > selectedTime) {
15857
16378
  this.snackbar.show('Please set a future date.', 'alert');
15858
16379
  isInvalid = true;
@@ -20946,8 +21467,8 @@ class WorkflowComplianceComponent {
20946
21467
  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, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23;
20947
21468
  this.loader = true;
20948
21469
  this.uiKitService.isLoader = true;
20949
- let startDate = moment(parseInt(entrustForm.startDate) * 1000).format('YYYY-MM-DD HH:mm:ss');
20950
- startDate = moment(startDate.split(' ')[0] + ' 00:00:00').format('YYYY-MM-DD HH:mm:ss');
21470
+ let startDate = moment$1(parseInt(entrustForm.startDate) * 1000).format('YYYY-MM-DD HH:mm:ss');
21471
+ startDate = moment$1(startDate.split(' ')[0] + ' 00:00:00').format('YYYY-MM-DD HH:mm:ss');
20951
21472
  const rcDetails = ((_a = entrustForm.rc) === null || _a === void 0 ? void 0 : _a.length) > 0
20952
21473
  ? entrustForm.rc.map((rc) => {
20953
21474
  if (rc) {
@@ -21165,7 +21686,7 @@ class WorkflowComplianceComponent {
21165
21686
  sample: this.selectedSample === 0 ? this.sampleValue : 0,
21166
21687
  percentage: this.selectedSample === 1 ? this.samplePercentage : 0,
21167
21688
  frequency_pattern: `1~0~${this.sendAuditRemindersValue}~1`,
21168
- frequency_time: moment(this.auditTime, 'HH:mm a').format('HH:mm:ss'),
21689
+ frequency_time: moment$1(this.auditTime, 'HH:mm a').format('HH:mm:ss'),
21169
21690
  }
21170
21691
  : {
21171
21692
  category_id: 0,
@@ -21574,7 +22095,7 @@ class WorkflowComplianceComponent {
21574
22095
  break;
21575
22096
  case 0:
21576
22097
  {
21577
- const dateObject = new Date(moment(frequencyDetails[1] +
22098
+ const dateObject = new Date(moment$1(frequencyDetails[1] +
21578
22099
  '-' +
21579
22100
  frequencyDetails[2] +
21580
22101
  '-' +
@@ -22189,7 +22710,7 @@ class WorkflowComplianceComponent {
22189
22710
  this.sendAuditRemindersValue = testPlanCategory.frequency_pattern
22190
22711
  ? parseInt(testPlanCategory.frequency_pattern.split('~')[2])
22191
22712
  : 2;
22192
- this.auditTime = moment(testPlanCategory === null || testPlanCategory === void 0 ? void 0 : testPlanCategory.frequency_time, 'HH:mm:ss').format('HH:mm a');
22713
+ this.auditTime = moment$1(testPlanCategory === null || testPlanCategory === void 0 ? void 0 : testPlanCategory.frequency_time, 'HH:mm:ss').format('HH:mm a');
22193
22714
  }
22194
22715
  //on sample toggle on/off
22195
22716
  checkInputValue(event) {
@@ -24274,7 +24795,7 @@ class WorkflowPolicyComponent {
24274
24795
  associatedDocuments: {
24275
24796
  formatFiles: [],
24276
24797
  },
24277
- policyDueDate: moment(),
24798
+ policyDueDate: moment$1(),
24278
24799
  customTags: [],
24279
24800
  checkpointDetails: [],
24280
24801
  totalQuestion: 0,
@@ -25091,7 +25612,7 @@ class WorkflowPolicyComponent {
25091
25612
  (this.policyForm.mark_failed_after = event.failedAfter);
25092
25613
  this.policyForm.remind_days_before_due_date = event.window;
25093
25614
  this.policyForm.failed_time = event.timeIn24Hr;
25094
- this.policyForm.assignee_start_date = moment(event.startFrom * 1000).format('ddd MMM DD YYYY');
25615
+ this.policyForm.assignee_start_date = moment$1(event.startFrom * 1000).format('ddd MMM DD YYYY');
25095
25616
  this.activateSelector('frequency', false);
25096
25617
  const payload = {
25097
25618
  frequency_details: event.pattern,
@@ -25178,7 +25699,7 @@ class WorkflowPolicyComponent {
25178
25699
  this.policyForm.review_frequency_type = event.pattern.split('~')[0];
25179
25700
  this.policyForm.review_remind_days_before_due_date = event.window;
25180
25701
  this.policyForm.reviewFailedTime = event.timeIn24Hr;
25181
- this.policyForm.reviewer_start_date = moment(event.startFrom * 1000).format('ddd MMM DD YYYY');
25702
+ this.policyForm.reviewer_start_date = moment$1(event.startFrom * 1000).format('ddd MMM DD YYYY');
25182
25703
  this.activateSelector('reviewerFrequency', false);
25183
25704
  const payload = {
25184
25705
  frequency_details: event.pattern,
@@ -25328,7 +25849,7 @@ class WorkflowPolicyComponent {
25328
25849
  ? policy.mark_failed_after
25329
25850
  : '',
25330
25851
  // startDate: policy.policyDueDate.toDateString(),
25331
- startDate: moment(policy.policyDueDate).format('ddd MMM DD YYYY'),
25852
+ startDate: moment$1(policy.policyDueDate).format('ddd MMM DD YYYY'),
25332
25853
  ReviewerAttachments: policy.addReviewers && policy.documentsAndLinks.formatFiles
25333
25854
  ? reviewerFiles
25334
25855
  : [],
@@ -25644,8 +26165,8 @@ class WorkflowPolicyComponent {
25644
26165
  }
25645
26166
  : { formatFiles: [] };
25646
26167
  this.policyForm.policyDueDate = data.startDate
25647
- ? moment(data.startDate)
25648
- : moment();
26168
+ ? moment$1(data.startDate)
26169
+ : moment$1();
25649
26170
  this.policyForm.checkpointDetails = data.checkpoints
25650
26171
  ? data.checkpoints
25651
26172
  : [];
@@ -27035,19 +27556,19 @@ class AddMultipleRiskComponent {
27035
27556
  this.categoryList = {
27036
27557
  strategic: {
27037
27558
  name: 'STRATEGIC',
27038
- data: []
27559
+ data: [],
27039
27560
  },
27040
27561
  operational: {
27041
27562
  name: 'OPERATIONAL',
27042
- data: []
27563
+ data: [],
27043
27564
  },
27044
27565
  compliance: {
27045
27566
  name: 'COMPLIANCE',
27046
- data: []
27567
+ data: [],
27047
27568
  },
27048
27569
  others: {
27049
27570
  name: 'OTHERS',
27050
- data: []
27571
+ data: [],
27051
27572
  },
27052
27573
  };
27053
27574
  this.category = {
@@ -27068,7 +27589,7 @@ class AddMultipleRiskComponent {
27068
27589
  likelihood: [],
27069
27590
  impact: [],
27070
27591
  velocity: [],
27071
- vulnerability: []
27592
+ vulnerability: [],
27072
27593
  };
27073
27594
  this.isLoader = false;
27074
27595
  this.showCategoryList = false;
@@ -27081,7 +27602,7 @@ class AddMultipleRiskComponent {
27081
27602
  this.showExcel = false;
27082
27603
  this.memberId = 0;
27083
27604
  this.organizationId = 0;
27084
- this.errorMessage = " invalid file error";
27605
+ this.errorMessage = ' invalid file error';
27085
27606
  this.downloadStatus = 'NOT_DOWNLOADING';
27086
27607
  this.downloadPercent = 0;
27087
27608
  this.smileyMessage = `You're All Set! We're uploading the risks. The risk owners will be notified once the risks have been uploaded.`;
@@ -27092,10 +27613,16 @@ class AddMultipleRiskComponent {
27092
27613
  this.showSmiley = false;
27093
27614
  this.member_obj_id = '';
27094
27615
  this.defaultOwner = '';
27095
- this.frequencyType = ['weekly', 'monthly', 'quarterly', 'biannual', 'annual', 'one time'];
27096
- }
27097
- ngOnChanges(changes) {
27616
+ this.frequencyType = [
27617
+ 'weekly',
27618
+ 'monthly',
27619
+ 'quarterly',
27620
+ 'biannual',
27621
+ 'annual',
27622
+ 'one time',
27623
+ ];
27098
27624
  }
27625
+ ngOnChanges(changes) { }
27099
27626
  ngOnInit() {
27100
27627
  this.pickerChanged.emit(false);
27101
27628
  this.getCategoryList();
@@ -27112,14 +27639,15 @@ class AddMultipleRiskComponent {
27112
27639
  this.categoryList.operational.data = res.operational_arr;
27113
27640
  this.categoryList.compliance.data = res.compliance_arr;
27114
27641
  this.categoryList.others.data = res.others_arr;
27115
- }, err => {
27642
+ }, (err) => {
27116
27643
  console.error(err);
27117
27644
  this.isLoader = false;
27118
27645
  });
27119
27646
  }
27120
27647
  saveSelectedCategory(category) {
27121
27648
  var _a, _b, _c;
27122
- if (((_b = (_a = this.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_id) != ((_c = category === null || category === void 0 ? void 0 : category.selectedCategory) === null || _c === void 0 ? void 0 : _c.category_id)) {
27649
+ if (((_b = (_a = this.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_id) !=
27650
+ ((_c = category === null || category === void 0 ? void 0 : category.selectedCategory) === null || _c === void 0 ? void 0 : _c.category_id)) {
27123
27651
  this.downloadStatus = 'NOT_DOWNLOADING';
27124
27652
  }
27125
27653
  this.showCategoryList = false;
@@ -27133,14 +27661,14 @@ class AddMultipleRiskComponent {
27133
27661
  removeCategory() {
27134
27662
  this.category = {
27135
27663
  type: 'strategic',
27136
- selectedCategory: ''
27664
+ selectedCategory: '',
27137
27665
  };
27138
27666
  this.reset();
27139
27667
  }
27140
27668
  getSettingsInfo() {
27141
- this.riskService.getRiskSettingDetails().subscribe(res => {
27669
+ this.riskService.getRiskSettingDetails().subscribe((res) => {
27142
27670
  this.settingsInfo = res;
27143
- }, err => {
27671
+ }, (err) => {
27144
27672
  console.error(err);
27145
27673
  });
27146
27674
  }
@@ -27155,7 +27683,7 @@ class AddMultipleRiskComponent {
27155
27683
  this.riskBulkUpload = {
27156
27684
  header: [],
27157
27685
  weightFactors: [],
27158
- risks: []
27686
+ risks: [],
27159
27687
  };
27160
27688
  this.templateInfo = {
27161
27689
  memberId: '',
@@ -27166,7 +27694,7 @@ class AddMultipleRiskComponent {
27166
27694
  likelihood: [],
27167
27695
  impact: [],
27168
27696
  velocity: [],
27169
- vulnerability: []
27697
+ vulnerability: [],
27170
27698
  };
27171
27699
  const reference = document.querySelector('#scrollReference');
27172
27700
  if (reference) {
@@ -27203,14 +27731,14 @@ class AddMultipleRiskComponent {
27203
27731
  if (element[8]) {
27204
27732
  const member = {
27205
27733
  name: element[8],
27206
- member_id: element[9]
27734
+ member_id: element[9],
27207
27735
  };
27208
27736
  this.templateInfo.ownerList.push(member);
27209
27737
  }
27210
27738
  if (element[2]) {
27211
27739
  const mitigation = {
27212
27740
  mitigationName: element[2],
27213
- mitigation_id: element[3]
27741
+ mitigation_id: element[3],
27214
27742
  };
27215
27743
  this.templateInfo.mitigationList.push(mitigation);
27216
27744
  }
@@ -27218,7 +27746,7 @@ class AddMultipleRiskComponent {
27218
27746
  const rc = {
27219
27747
  rcName: element[6],
27220
27748
  rc_id: element[7],
27221
- owner_ids: element[11]
27749
+ owner_ids: element[11],
27222
27750
  };
27223
27751
  this.templateInfo.rcList.push(rc);
27224
27752
  }
@@ -27228,20 +27756,29 @@ class AddMultipleRiskComponent {
27228
27756
  if (element[13]) {
27229
27757
  (_b = this.templateInfo) === null || _b === void 0 ? void 0 : _b.impact.push(element[13]);
27230
27758
  }
27231
- if (((_d = (_c = this.riskBulkUpload) === null || _c === void 0 ? void 0 : _c.weightFactors) === null || _d === void 0 ? void 0 : _d.includes('Velocity')) && element[14]) {
27759
+ if (((_d = (_c = this.riskBulkUpload) === null || _c === void 0 ? void 0 : _c.weightFactors) === null || _d === void 0 ? void 0 : _d.includes('Velocity')) &&
27760
+ element[14]) {
27232
27761
  this.templateInfo.velocity.push(element[14]);
27233
27762
  }
27234
- if (((_f = (_e = this.riskBulkUpload) === null || _e === void 0 ? void 0 : _e.weightFactors) === null || _f === void 0 ? void 0 : _f.includes('Vulnerability')) && element[15]) {
27763
+ if (((_f = (_e = this.riskBulkUpload) === null || _e === void 0 ? void 0 : _e.weightFactors) === null || _f === void 0 ? void 0 : _f.includes('Vulnerability')) &&
27764
+ element[15]) {
27235
27765
  this.templateInfo.vulnerability.push(element[15]);
27236
27766
  }
27237
27767
  });
27238
27768
  if (this.fileName.substr(-5) !== '.xlsx') {
27239
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' + this.category.selectedCategory.category_name + ' RETRY';
27769
+ this.errorMessage =
27770
+ 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
27771
+ this.category.selectedCategory.category_name +
27772
+ ' RETRY';
27240
27773
  this.isWrongFile = true;
27241
27774
  return;
27242
27775
  }
27243
- if (this.riskBulkUpload.header[0] !== 'What risk would you like to manage?*') {
27244
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' + this.category.selectedCategory.category_name + ' RETRY';
27776
+ if (this.riskBulkUpload.header[0] !==
27777
+ 'What risk would you like to manage?*') {
27778
+ this.errorMessage =
27779
+ 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
27780
+ this.category.selectedCategory.category_name +
27781
+ ' RETRY';
27245
27782
  this.isWrongFile = false;
27246
27783
  this.isWrongFormat = true;
27247
27784
  return;
@@ -27252,18 +27789,26 @@ class AddMultipleRiskComponent {
27252
27789
  this.defaultOwner = this.templateInfo.ownerList[defaultOwner].name;
27253
27790
  }
27254
27791
  else {
27255
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' + this.category.selectedCategory.category_name + ' RETRY';
27792
+ this.errorMessage =
27793
+ 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
27794
+ this.category.selectedCategory.category_name +
27795
+ ' RETRY';
27256
27796
  this.isWrongFile = true;
27257
27797
  return;
27258
27798
  }
27259
- if ((this.member_obj_id != this.templateInfo.memberId) || (this.category.selectedCategory._id != this.templateInfo.categoryId)) {
27260
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' + this.category.selectedCategory.category_name + ' RETRY';
27799
+ if (this.member_obj_id != this.templateInfo.memberId ||
27800
+ this.category.selectedCategory._id != this.templateInfo.categoryId) {
27801
+ this.errorMessage =
27802
+ 'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
27803
+ this.category.selectedCategory.category_name +
27804
+ ' RETRY';
27261
27805
  this.isWrongFile = true;
27262
27806
  return;
27263
27807
  }
27264
27808
  const isEmpty = this.checkEmptyFile();
27265
27809
  if (isEmpty) {
27266
- this.errorMessage = 'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
27810
+ this.errorMessage =
27811
+ 'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
27267
27812
  this.isFileEmpty = true;
27268
27813
  this.isWrongFile = false;
27269
27814
  this.isWrongFormat = false;
@@ -27338,16 +27883,19 @@ class AddMultipleRiskComponent {
27338
27883
  // obj.customTag = customTags;
27339
27884
  // }
27340
27885
  let obj = this.setRiskDetails(risk);
27341
- if ((obj === null || obj === void 0 ? void 0 : obj.likelihood) && !((_a = this.templateInfo) === null || _a === void 0 ? void 0 : _a.likelihood.includes(obj === null || obj === void 0 ? void 0 : obj.likelihood))) {
27886
+ if ((obj === null || obj === void 0 ? void 0 : obj.likelihood) &&
27887
+ !((_a = this.templateInfo) === null || _a === void 0 ? void 0 : _a.likelihood.includes(obj === null || obj === void 0 ? void 0 : obj.likelihood))) {
27342
27888
  obj.isValid = false;
27343
27889
  }
27344
27890
  if ((obj === null || obj === void 0 ? void 0 : obj.impact) && !((_b = this.templateInfo) === null || _b === void 0 ? void 0 : _b.impact.includes(obj === null || obj === void 0 ? void 0 : obj.impact))) {
27345
27891
  obj.isValid = false;
27346
27892
  }
27347
- if ((obj === null || obj === void 0 ? void 0 : obj.velocity) && !((_c = this.templateInfo) === null || _c === void 0 ? void 0 : _c.velocity.includes(obj === null || obj === void 0 ? void 0 : obj.velocity))) {
27893
+ if ((obj === null || obj === void 0 ? void 0 : obj.velocity) &&
27894
+ !((_c = this.templateInfo) === null || _c === void 0 ? void 0 : _c.velocity.includes(obj === null || obj === void 0 ? void 0 : obj.velocity))) {
27348
27895
  obj.isValid = false;
27349
27896
  }
27350
- if ((obj === null || obj === void 0 ? void 0 : obj.vulnerability) && !((_d = this.templateInfo) === null || _d === void 0 ? void 0 : _d.vulnerability.includes(obj === null || obj === void 0 ? void 0 : obj.vulnerability))) {
27897
+ if ((obj === null || obj === void 0 ? void 0 : obj.vulnerability) &&
27898
+ !((_d = this.templateInfo) === null || _d === void 0 ? void 0 : _d.vulnerability.includes(obj === null || obj === void 0 ? void 0 : obj.vulnerability))) {
27351
27899
  obj.isValid = false;
27352
27900
  }
27353
27901
  this.riskBulkUpload.risks.push(obj);
@@ -27374,11 +27922,14 @@ class AddMultipleRiskComponent {
27374
27922
  checkValidity(risk) {
27375
27923
  var _a, _b;
27376
27924
  const re = /&nbsp;|<br>/g;
27377
- let trimmedName = (risk[0]) ? risk[0].toString().replace(re, '').trim() : '';
27925
+ let trimmedName = risk[0] ? risk[0].toString().replace(re, '').trim() : '';
27378
27926
  trimmedName = trimmedName.replace(/ +/g, ' ');
27379
27927
  // || (this.assessmentDeadLine && (!risk[6]))
27380
- if ((!trimmedName) || (risk[3] && (risk[3] == risk[6])) || ((!risk[3]) && (this.defaultOwner == risk[6]))
27381
- || (!risk[2]) || (!((_a = this.frequencyType) === null || _a === void 0 ? void 0 : _a.includes((_b = risk[4]) === null || _b === void 0 ? void 0 : _b.toLowerCase())))) {
27928
+ if (!trimmedName ||
27929
+ (risk[3] && risk[3] == risk[6]) ||
27930
+ (!risk[3] && this.defaultOwner == risk[6]) ||
27931
+ !risk[2] ||
27932
+ !((_a = this.frequencyType) === null || _a === void 0 ? void 0 : _a.includes((_b = risk[4]) === null || _b === void 0 ? void 0 : _b.toLowerCase()))) {
27382
27933
  return false;
27383
27934
  }
27384
27935
  else {
@@ -27391,8 +27942,14 @@ class AddMultipleRiskComponent {
27391
27942
  this.downloadPercent = 0;
27392
27943
  const today = new Date().toISOString().split('T');
27393
27944
  const downloadDate = today[0];
27394
- const fileName = 'VComply - Risk Module - Add Multiple Risks - ' + ((_b = (_a = this.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_name) + ' - ' + downloadDate + '.xlsx';
27395
- this.riskService.downloadTemplate(this.category.selectedCategory._id).subscribe((data) => {
27945
+ const fileName = 'VComply - Risk Module - Add Multiple Risks - ' +
27946
+ ((_b = (_a = this.category) === null || _a === void 0 ? void 0 : _a.selectedCategory) === null || _b === void 0 ? void 0 : _b.category_name) +
27947
+ ' - ' +
27948
+ downloadDate +
27949
+ '.xlsx';
27950
+ this.riskService
27951
+ .downloadTemplate(this.category.selectedCategory._id)
27952
+ .subscribe((data) => {
27396
27953
  if (data.loaded) {
27397
27954
  this.downloadPercent = 100 * (data.loaded / data.total);
27398
27955
  }
@@ -27415,7 +27972,14 @@ class AddMultipleRiskComponent {
27415
27972
  if ((risk === null || risk === void 0 ? void 0 : risk.frequency.toLowerCase()) === 'one time') {
27416
27973
  const date = new Date();
27417
27974
  date.setDate(date.getDate() + 1);
27418
- frequencyValue = '0~' + '' + date.getFullYear() + '~' + (date.getMonth() + 1) + '~' + date.getDate();
27975
+ frequencyValue =
27976
+ '0~' +
27977
+ '' +
27978
+ date.getFullYear() +
27979
+ '~' +
27980
+ (date.getMonth() + 1) +
27981
+ '~' +
27982
+ date.getDate();
27419
27983
  }
27420
27984
  else {
27421
27985
  frequencyValue = this.frequencyService.shortHand_freqCal(risk === null || risk === void 0 ? void 0 : risk.frequency);
@@ -27426,8 +27990,12 @@ class AddMultipleRiskComponent {
27426
27990
  description: risk === null || risk === void 0 ? void 0 : risk.description,
27427
27991
  category_custom_tag: risk === null || risk === void 0 ? void 0 : risk.customTag,
27428
27992
  assessment_deadline_enable: (_a = this.settingsInfo) === null || _a === void 0 ? void 0 : _a.assessment_deadline_enable,
27429
- owner: (risk === null || risk === void 0 ? void 0 : risk.owner) ? this.returnIds(risk === null || risk === void 0 ? void 0 : risk.owner, 'owner') : this.returnIds(this.defaultOwner, 'owner'),
27430
- category: ((_c = (_b = this.category) === null || _b === void 0 ? void 0 : _b.selectedCategory) === null || _c === void 0 ? void 0 : _c.category_id) ? [(_e = (_d = this.category) === null || _d === void 0 ? void 0 : _d.selectedCategory) === null || _e === void 0 ? void 0 : _e.category_id] : [],
27993
+ owner: (risk === null || risk === void 0 ? void 0 : risk.owner)
27994
+ ? this.returnIds(risk === null || risk === void 0 ? void 0 : risk.owner, 'owner')
27995
+ : this.returnIds(this.defaultOwner, 'owner'),
27996
+ category: ((_c = (_b = this.category) === null || _b === void 0 ? void 0 : _b.selectedCategory) === null || _c === void 0 ? void 0 : _c.category_id)
27997
+ ? [(_e = (_d = this.category) === null || _d === void 0 ? void 0 : _d.selectedCategory) === null || _e === void 0 ? void 0 : _e.category_id]
27998
+ : [],
27431
27999
  manage_oversight: this.returnIds(risk === null || risk === void 0 ? void 0 : risk.overseer, 'overseer'),
27432
28000
  rc_id: this.returnIds(risk === null || risk === void 0 ? void 0 : risk.rcName, 'rc_id'),
27433
28001
  head_ids: this.returnIds(risk === null || risk === void 0 ? void 0 : risk.rcName, 'rc_owner_ids'),
@@ -27442,7 +28010,7 @@ class AddMultipleRiskComponent {
27442
28010
  risk_progress_flag: 1,
27443
28011
  IfAssessmentDone: 0,
27444
28012
  workshop_id: '',
27445
- complete_assessment: (completeAssessment) ? 1 : 0,
28013
+ complete_assessment: completeAssessment ? 1 : 0,
27446
28014
  mitigation: this.returnIds(risk === null || risk === void 0 ? void 0 : risk.mitigationPriority, 'mitigation'),
27447
28015
  weightage_enable: (_f = this.settingsInfo) === null || _f === void 0 ? void 0 : _f.weightage_enable,
27448
28016
  treatment_type: (_g = this.settingsInfo) === null || _g === void 0 ? void 0 : _g.treatment_criteria,
@@ -27456,12 +28024,16 @@ class AddMultipleRiskComponent {
27456
28024
  ],
27457
28025
  // assessment_deadline_set_by: this.settingsInfo?.assessment_deadline_set_by, //check1 not appearing
27458
28026
  assessment_deadline_set_by: (_u = (_t = this.settingsInfo) === null || _t === void 0 ? void 0 : _t.assessment_deadline_set_by) !== null && _u !== void 0 ? _u : this.memberId,
27459
- assessment_deadline_days: ((_v = this.settingsInfo) === null || _v === void 0 ? void 0 : _v.assessment_deadline_enable) ? (_w = this.settingsInfo) === null || _w === void 0 ? void 0 : _w.assessment_deadline_days : risk === null || risk === void 0 ? void 0 : risk.assessmentDeadLine,
28027
+ assessment_deadline_days: ((_v = this.settingsInfo) === null || _v === void 0 ? void 0 : _v.assessment_deadline_enable)
28028
+ ? (_w = this.settingsInfo) === null || _w === void 0 ? void 0 : _w.assessment_deadline_days
28029
+ : risk === null || risk === void 0 ? void 0 : risk.assessmentDeadLine,
27460
28030
  frequency_details: {
27461
28031
  frequency: frequencyValue,
27462
- started_at: (_x = this.changeTimeZone(new Date)) !== null && _x !== void 0 ? _x : moment().format("YYYY-MM-DD"),
27463
- frequency_time: "11:00 pm",
27464
- remind_before_days: (risk === null || risk === void 0 ? void 0 : risk.emailReminder) ? risk === null || risk === void 0 ? void 0 : risk.emailReminder : this.setDefaultEmailReminderValue(risk === null || risk === void 0 ? void 0 : risk.frequency),
28032
+ started_at: (_x = this.changeTimeZone(new Date())) !== null && _x !== void 0 ? _x : moment$1().format('YYYY-MM-DD'),
28033
+ frequency_time: '11:00 pm',
28034
+ remind_before_days: (risk === null || risk === void 0 ? void 0 : risk.emailReminder)
28035
+ ? risk === null || risk === void 0 ? void 0 : risk.emailReminder
28036
+ : this.setDefaultEmailReminderValue(risk === null || risk === void 0 ? void 0 : risk.frequency),
27465
28037
  },
27466
28038
  risk_label: this.setRiskLabel(risk === null || risk === void 0 ? void 0 : risk.riskLabel),
27467
28039
  mitigation_plan_recommendation: (_y = risk === null || risk === void 0 ? void 0 : risk.mitigationPlans) !== null && _y !== void 0 ? _y : '',
@@ -27470,13 +28042,13 @@ class AddMultipleRiskComponent {
27470
28042
  payload.push(obj);
27471
28043
  }
27472
28044
  });
27473
- console.log("payloadpayloadpayloadpayloadpayloadpayload ====>", payload);
28045
+ console.log('payloadpayloadpayloadpayloadpayloadpayload ====>', payload);
27474
28046
  this.riskService.addBulkRisk(payload).subscribe((res) => {
27475
28047
  this.loader = false;
27476
28048
  this.showExcel = false;
27477
28049
  this.showSmiley = true;
27478
28050
  this.riskData = res;
27479
- }, err => {
28051
+ }, (err) => {
27480
28052
  console.log(err);
27481
28053
  this.loader = false;
27482
28054
  this.showExcel = false;
@@ -27498,7 +28070,9 @@ class AddMultipleRiskComponent {
27498
28070
  let owner_ids = [];
27499
28071
  this.templateInfo.rcList.forEach((headerIds) => {
27500
28072
  if (headerIds.rcName == item && headerIds.owner_ids) {
27501
- owner_ids = headerIds.owner_ids.includes(',') ? headerIds.owner_ids.split(',').map(Number) : [Number(headerIds.owner_ids)];
28073
+ owner_ids = headerIds.owner_ids.includes(',')
28074
+ ? headerIds.owner_ids.split(',').map(Number)
28075
+ : [Number(headerIds.owner_ids)];
27502
28076
  }
27503
28077
  });
27504
28078
  return owner_ids;
@@ -27536,14 +28110,14 @@ class AddMultipleRiskComponent {
27536
28110
  this.riskBulkUpload = {
27537
28111
  header: [],
27538
28112
  weightFactors: [],
27539
- risks: []
28113
+ risks: [],
27540
28114
  };
27541
28115
  this.templateInfo = {
27542
28116
  memberId: '',
27543
28117
  categoryId: '',
27544
28118
  ownerList: [],
27545
28119
  rcList: [],
27546
- mitigationList: []
28120
+ mitigationList: [],
27547
28121
  };
27548
28122
  this.isFileEmpty = false;
27549
28123
  this.isWrongFile = false;
@@ -27650,7 +28224,7 @@ class AddMultipleRiskComponent {
27650
28224
  if (tag) {
27651
28225
  const cTag = {
27652
28226
  custom_tag_value: (_a = risk[index + i]) !== null && _a !== void 0 ? _a : '',
27653
- custom_tag_name: tag.tagName
28227
+ custom_tag_name: tag.tagName,
27654
28228
  };
27655
28229
  customTags.push(cTag);
27656
28230
  }
@@ -27668,13 +28242,20 @@ class AddMultipleRiskComponent {
27668
28242
  */
27669
28243
  setDefaultEmailReminderValue(frequencyType) {
27670
28244
  switch (frequencyType === null || frequencyType === void 0 ? void 0 : frequencyType.toLowerCase()) {
27671
- case 'weekly': return 2;
27672
- case 'monthly': return 7;
27673
- case 'quarterly': return 7;
27674
- case 'biannual': return 30;
27675
- case 'annual': return 30;
27676
- case 'one time': return 15;
27677
- default: return 0;
28245
+ case 'weekly':
28246
+ return 2;
28247
+ case 'monthly':
28248
+ return 7;
28249
+ case 'quarterly':
28250
+ return 7;
28251
+ case 'biannual':
28252
+ return 30;
28253
+ case 'annual':
28254
+ return 30;
28255
+ case 'one time':
28256
+ return 15;
28257
+ default:
28258
+ return 0;
27678
28259
  }
27679
28260
  }
27680
28261
  /**
@@ -27685,9 +28266,12 @@ class AddMultipleRiskComponent {
27685
28266
  */
27686
28267
  setRiskLabel(label) {
27687
28268
  switch (label === null || label === void 0 ? void 0 : label.toLowerCase()) {
27688
- case 'newly identified risks': return 1;
27689
- case 'rapidly changing risks': return 2;
27690
- default: return 1;
28269
+ case 'newly identified risks':
28270
+ return 1;
28271
+ case 'rapidly changing risks':
28272
+ return 2;
28273
+ default:
28274
+ return 1;
27691
28275
  }
27692
28276
  }
27693
28277
  /**
@@ -27705,7 +28289,7 @@ class AddMultipleRiskComponent {
27705
28289
  const invDate = new Date(date.toLocaleString('en-US', {
27706
28290
  timeZone: (_a = this.authService.userDetails) === null || _a === void 0 ? void 0 : _a.timezone,
27707
28291
  }));
27708
- return moment(invDate).format("YYYY-MM-DD");
28292
+ return moment$1(invDate).format('YYYY-MM-DD');
27709
28293
  }
27710
28294
  }
27711
28295
  AddMultipleRiskComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AddMultipleRiskComponent, deps: [{ token: AddRiskService }, { token: AuthService }, { token: SnackBarService }, { token: FrequencyBulkService }], target: i0.ɵɵFactoryTarget.Component });
@@ -29033,7 +29617,7 @@ class LogAnIssueComponent {
29033
29617
  ? []
29034
29618
  : this.listData.userList.filter((e) => e.my_member_id === (issueData === null || issueData === void 0 ? void 0 : issueData.assignee_id)),
29035
29619
  issueDueDate: ((_o = issueData === null || issueData === void 0 ? void 0 : issueData.frequency_details) === null || _o === void 0 ? void 0 : _o.frequency_date)
29036
- ? moment(`${issueDueDate[0]}-${issueDueDate[1]}-${issueDueDate[2]}`)
29620
+ ? moment$1(`${issueDueDate[0]}-${issueDueDate[1]}-${issueDueDate[2]}`)
29037
29621
  : '',
29038
29622
  issueDueTime: this.logService.convertFrom24To12Format(issueData.frequency_details.frequency_time),
29039
29623
  exceptionType: (_p = issueData.exception_type) !== null && _p !== void 0 ? _p : 1,
@@ -33146,7 +33730,7 @@ class AddMultipleResponsibilityComponent {
33146
33730
  }
33147
33731
  else {
33148
33732
  const monthAndYear = month.split("'");
33149
- const startDate = moment(day + '-' + monthAndYear[0] + '-' + 20 + monthAndYear[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
33733
+ const startDate = moment$1(day + '-' + monthAndYear[0] + '-' + 20 + monthAndYear[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
33150
33734
  if (startDate == "Invalid date") {
33151
33735
  return false;
33152
33736
  }
@@ -33240,11 +33824,11 @@ class AddMultipleResponsibilityComponent {
33240
33824
  const assignorDetails = (report.assignor) ? this.returnIds(report.assignor, 'assignor') : '';
33241
33825
  const ccDetails = this.returnIds(report.alwaysNotify, 'cc');
33242
33826
  const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
33243
- const currentDate = moment().format('YYYY-MM-DD');
33827
+ const currentDate = moment$1().format('YYYY-MM-DD');
33244
33828
  const categoryName = (report.responsibilityCategory.includes('[WITHIN]')) ? report.responsibilityCategory.split(' [')[0] : report.responsibilityCategory;
33245
33829
  const frequencyValue = this.frequencyService.shortHand_freqCal(report.frequency, report.day, report.month);
33246
33830
  const dateAndMonth = report.month.split("'");
33247
- const startDate = moment(report.day + '-' + dateAndMonth[0] + '-' + 20 + dateAndMonth[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
33831
+ const startDate = moment$1(report.day + '-' + dateAndMonth[0] + '-' + 20 + dateAndMonth[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
33248
33832
  let completeDays;
33249
33833
  let notCompleteDays;
33250
33834
  const frequencyType = frequencyValue.split('~')[0];
@@ -33566,7 +34150,19 @@ class AddMultipleResponsibilityWithTabComponent {
33566
34150
  this.isNotificationPending = 0;
33567
34151
  this.closeAddMultipleResponsibility = new EventEmitter();
33568
34152
  this.queryParam = '';
33569
- this.recentResponsibilityUrl = { "byResponsibilities": { "type": ["recent_responsibilities"], "subType": ["CC"] }, "byStatus": { "type": [], "subType": [] }, "filterObject": { "responsibilityCenter": [], "entrustedBy": [], "entrustedTo": [], "riskIds": [], "responsibilityCategory": [] }, "timePeriodDetails": { "type": "", "selectedPeriod": "", "selectedYear": "" }, "status": "" };
34153
+ this.recentResponsibilityUrl = {
34154
+ byResponsibilities: { type: ['recent_responsibilities'], subType: ['CC'] },
34155
+ byStatus: { type: [], subType: [] },
34156
+ filterObject: {
34157
+ responsibilityCenter: [],
34158
+ entrustedBy: [],
34159
+ entrustedTo: [],
34160
+ riskIds: [],
34161
+ responsibilityCategory: [],
34162
+ },
34163
+ timePeriodDetails: { type: '', selectedPeriod: '', selectedYear: '' },
34164
+ status: '',
34165
+ };
33570
34166
  this.url = 'q={"byResponsibilities":{"type":["responsibilities_in_queue"],"subType":["CC"]},"byStatus":{"type":["responsibilities_in_queue"],"subType":[]},"filterObject":{"responsibilityCenter":[],"entrustedBy":[],"entrustedTo":[],"riskIds":[],"responsibilityCategory":[]},"timePeriodDetails":{"type":"","selectedPeriod":"","selectedYear":""},"status":""}';
33571
34167
  this.responsibilityBulkUpload = {
33572
34168
  header: [],
@@ -33576,7 +34172,7 @@ class AddMultipleResponsibilityWithTabComponent {
33576
34172
  this.tabIndex = {
33577
34173
  frequency: 0,
33578
34174
  ongoing: 1,
33579
- onCompletion: 2
34175
+ onCompletion: 2,
33580
34176
  };
33581
34177
  this.bulkUpload = {
33582
34178
  frequency: {
@@ -33593,7 +34189,7 @@ class AddMultipleResponsibilityWithTabComponent {
33593
34189
  header: [],
33594
34190
  subHeading: [],
33595
34191
  reports: [],
33596
- }
34192
+ },
33597
34193
  };
33598
34194
  this.templateInfo = {
33599
34195
  categoryList: [],
@@ -33602,7 +34198,7 @@ class AddMultipleResponsibilityWithTabComponent {
33602
34198
  assigneesList: [],
33603
34199
  reviewerList: [],
33604
34200
  parentResponsibility: [],
33605
- memberId: ''
34201
+ memberId: '',
33606
34202
  };
33607
34203
  this.isLoader = false;
33608
34204
  this.showCategoryList = false;
@@ -33617,14 +34213,24 @@ class AddMultipleResponsibilityWithTabComponent {
33617
34213
  this.fileResponse = [];
33618
34214
  this.memberId = 0;
33619
34215
  this.organizationId = 0;
33620
- this.errorMessage = " invalid file error";
34216
+ this.errorMessage = ' invalid file error';
33621
34217
  this.downloadStatus = 'NOT_DOWNLOADING';
33622
34218
  this.downloadPercent = 0;
33623
34219
  this.defaultOwner = '';
33624
34220
  this.smileyMessage = `You're All Set! We're processing your request and you will be notified via email upon completion.`;
33625
34221
  this.actionButtons = [
33626
- { buttonText: 'Entrust More Responsibilities', class: 'white-btn', id: 'addMore' },
33627
- { buttonText: (this.isNotificationPending) ? 'View Responsibilities In Queue' : 'View Responsibilities', class: 'blue-btn', id: 'view' },
34222
+ {
34223
+ buttonText: 'Entrust More Responsibilities',
34224
+ class: 'white-btn',
34225
+ id: 'addMore',
34226
+ },
34227
+ {
34228
+ buttonText: this.isNotificationPending
34229
+ ? 'View Responsibilities In Queue'
34230
+ : 'View Responsibilities',
34231
+ class: 'blue-btn',
34232
+ id: 'view',
34233
+ },
33628
34234
  ];
33629
34235
  this.showSmiley = false;
33630
34236
  this.member_obj_id = '';
@@ -33632,15 +34238,16 @@ class AddMultipleResponsibilityWithTabComponent {
33632
34238
  set uploadedFileData(data) {
33633
34239
  this.uploadedFile(data);
33634
34240
  }
33635
- ngOnChanges(changes) {
33636
- }
34241
+ ngOnChanges(changes) { }
33637
34242
  ngOnInit() {
33638
34243
  this.pickerChanged.emit(false);
33639
34244
  this.organizationId = this.authService.getOrganizationId();
33640
34245
  this.memberId = this.authService.getMemberId();
33641
34246
  this.member_obj_id = this.authService.getUserDetails()._id;
33642
34247
  this.userInfo = this.authService.getUserDetails().user;
33643
- this.defaultOwner = (this.userInfo) ? this.userInfo.name + ' (' + this.userInfo.email + ')' : '';
34248
+ this.defaultOwner = this.userInfo
34249
+ ? this.userInfo.name + ' (' + this.userInfo.email + ')'
34250
+ : '';
33644
34251
  this.getUserDetails();
33645
34252
  this.authService.getOrganizationDetails().subscribe((res) => {
33646
34253
  this.riskClassEnabled = res.enable_riskclass;
@@ -33670,7 +34277,7 @@ class AddMultipleResponsibilityWithTabComponent {
33670
34277
  assigneesList: [],
33671
34278
  reviewerList: [],
33672
34279
  parentResponsibility: [],
33673
- memberId: ''
34280
+ memberId: '',
33674
34281
  };
33675
34282
  this.uploadedFiles = [];
33676
34283
  const reference = document.querySelector('#scrollReference');
@@ -33712,7 +34319,8 @@ class AddMultipleResponsibilityWithTabComponent {
33712
34319
  case 'on completion responsibilities':
33713
34320
  this.setDataForDifferentTabs(sheetReport3, sheet);
33714
34321
  break;
33715
- default: break;
34322
+ default:
34323
+ break;
33716
34324
  }
33717
34325
  });
33718
34326
  };
@@ -33737,7 +34345,8 @@ class AddMultipleResponsibilityWithTabComponent {
33737
34345
  subHeading: [],
33738
34346
  };
33739
34347
  let sheetValue = XLSX.utils.sheet_to_json(ws, {
33740
- header: 1, raw: false,
34348
+ header: 1,
34349
+ raw: false,
33741
34350
  });
33742
34351
  let data = sheetValue.filter((res) => {
33743
34352
  let isUndefined = '';
@@ -33752,22 +34361,28 @@ class AddMultipleResponsibilityWithTabComponent {
33752
34361
  }
33753
34362
  });
33754
34363
  if (this.fileName.substr(-5) !== '.xlsx') {
33755
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' + ' RETRY';
34364
+ this.errorMessage =
34365
+ 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
34366
+ ' RETRY';
33756
34367
  this.isWrongFile = true;
33757
34368
  return;
33758
34369
  }
33759
34370
  responsibilityBulkUpload.header = cloneDeep$1(data[2]);
33760
34371
  responsibilityBulkUpload.subHeading = cloneDeep$1(data[3]);
33761
34372
  data = data.slice(5);
33762
- if ((this.member_obj_id != this.templateInfo.memberId)) {
33763
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' + ' RETRY';
34373
+ if (this.member_obj_id != this.templateInfo.memberId) {
34374
+ this.errorMessage =
34375
+ 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
34376
+ ' RETRY';
33764
34377
  this.isWrongFile = true;
33765
34378
  return;
33766
34379
  }
33767
34380
  const responsibilityData = data.filter((dataElement) => dataElement.length > 0);
33768
34381
  responsibilityData.forEach((report) => {
33769
34382
  let validDate;
33770
- const validUser = this.returnIds(report[2], 'entrusted_to') ? true : false;
34383
+ const validUser = this.returnIds(report[2], 'entrusted_to')
34384
+ ? true
34385
+ : false;
33771
34386
  if (responsibilityBulkUpload.header[1] === 'Program') {
33772
34387
  validDate = this.compareWithCurrentDate(report[4], report[5]);
33773
34388
  }
@@ -33778,20 +34393,24 @@ class AddMultipleResponsibilityWithTabComponent {
33778
34393
  if ((sheet === null || sheet === void 0 ? void 0 : sheet.toLowerCase()) === 'frequency responsibilities') {
33779
34394
  responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'frequency', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
33780
34395
  this.bulkUpload.frequency.header = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.header;
33781
- this.bulkUpload.frequency.subHeading = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
34396
+ this.bulkUpload.frequency.subHeading =
34397
+ responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
33782
34398
  this.bulkUpload.frequency.reports = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.reports;
33783
34399
  }
33784
34400
  if ((sheet === null || sheet === void 0 ? void 0 : sheet.toLowerCase()) === 'ongoing responsibilities') {
33785
34401
  responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'ongoing', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
33786
34402
  this.bulkUpload.ongoing.header = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.header;
33787
- this.bulkUpload.ongoing.subHeading = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
34403
+ this.bulkUpload.ongoing.subHeading =
34404
+ responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
33788
34405
  this.bulkUpload.ongoing.reports = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.reports;
33789
34406
  }
33790
34407
  if ((sheet === null || sheet === void 0 ? void 0 : sheet.toLowerCase()) === 'on completion responsibilities') {
33791
34408
  responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'onCompletion', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
33792
34409
  this.bulkUpload.onCompletion.header = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.header;
33793
- this.bulkUpload.onCompletion.subHeading = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
33794
- this.bulkUpload.onCompletion.reports = responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.reports;
34410
+ this.bulkUpload.onCompletion.subHeading =
34411
+ responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.subHeading;
34412
+ this.bulkUpload.onCompletion.reports =
34413
+ responsibilityBulkUpload === null || responsibilityBulkUpload === void 0 ? void 0 : responsibilityBulkUpload.reports;
33795
34414
  }
33796
34415
  });
33797
34416
  const isEmpty = this.checkEmptyFile(data);
@@ -33799,14 +34418,19 @@ class AddMultipleResponsibilityWithTabComponent {
33799
34418
  empty it will check if the file is the correct file, if it is not the correct file it will
33800
34419
  return an error message. If it is the correct file it will call the fileUpload() function. */
33801
34420
  if (isEmpty) {
33802
- this.errorMessage = 'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
34421
+ this.errorMessage =
34422
+ 'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
33803
34423
  this.isFileEmpty = true;
33804
34424
  this.isWrongFile = false;
33805
34425
  this.isWrongFormat = false;
33806
34426
  return;
33807
34427
  }
33808
- else if (((_b = (_a = this.bulkUpload) === null || _a === void 0 ? void 0 : _a.frequency) === null || _b === void 0 ? void 0 : _b.header[0]) !== 'Responsibility Name*' && ((_d = (_c = this.bulkUpload) === null || _c === void 0 ? void 0 : _c.ongoing) === null || _d === void 0 ? void 0 : _d.header[0]) !== 'Responsibility Name*' && ((_f = (_e = this.bulkUpload) === null || _e === void 0 ? void 0 : _e.onCompletion) === null || _f === void 0 ? void 0 : _f.header[0]) !== 'Responsibility Name*') {
33809
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' + ' RETRY';
34428
+ else if (((_b = (_a = this.bulkUpload) === null || _a === void 0 ? void 0 : _a.frequency) === null || _b === void 0 ? void 0 : _b.header[0]) !== 'Responsibility Name*' &&
34429
+ ((_d = (_c = this.bulkUpload) === null || _c === void 0 ? void 0 : _c.ongoing) === null || _d === void 0 ? void 0 : _d.header[0]) !== 'Responsibility Name*' &&
34430
+ ((_f = (_e = this.bulkUpload) === null || _e === void 0 ? void 0 : _e.onCompletion) === null || _f === void 0 ? void 0 : _f.header[0]) !== 'Responsibility Name*') {
34431
+ this.errorMessage =
34432
+ 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
34433
+ ' RETRY';
33810
34434
  this.isWrongFile = false;
33811
34435
  this.isWrongFormat = true;
33812
34436
  return;
@@ -33880,20 +34504,23 @@ class AddMultipleResponsibilityWithTabComponent {
33880
34504
  }
33881
34505
  else {
33882
34506
  const monthAndYear = month.split("'");
33883
- const startDate = moment(day + '-' + monthAndYear[0] + '-' + 20 + monthAndYear[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
33884
- if (startDate == "Invalid date") {
34507
+ const startDate = moment$1(day + '-' + monthAndYear[0] + '-' + 20 + monthAndYear[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
34508
+ if (startDate == 'Invalid date') {
33885
34509
  return false;
33886
34510
  }
33887
- setTimeout(() => {
33888
- }, 5);
34511
+ setTimeout(() => { }, 5);
33889
34512
  const date_value = new Date();
33890
- date_value.setMonth(typeof month !== 'number' ? ((_a = monthNames.filter((x) => x.month === (month === null || month === void 0 ? void 0 : month.substring(0, 3)))[0]) === null || _a === void 0 ? void 0 : _a.value) - 1 : month);
34513
+ date_value.setMonth(typeof month !== 'number'
34514
+ ? ((_a = monthNames.filter((x) => x.month === (month === null || month === void 0 ? void 0 : month.substring(0, 3)))[0]) === null || _a === void 0 ? void 0 : _a.value) - 1
34515
+ : month);
33891
34516
  date_value.setFullYear(Number(20 + month.split("'")[1]));
33892
34517
  date_value.setDate(Number(day));
33893
34518
  // const reportDate = new Date(day + month.split("'"));
33894
34519
  // console.log((currentDate.toJSON().split('T')[0])+"&&"+(date_value.toJSON().split('T')[0]))
33895
34520
  // debugger
33896
- if (((currentDate.toJSON().split('T')[0]) != (date_value.toJSON().split('T')[0])) && (currentDate > date_value)) {
34521
+ if (currentDate.toJSON().split('T')[0] !=
34522
+ date_value.toJSON().split('T')[0] &&
34523
+ currentDate > date_value) {
33897
34524
  return false;
33898
34525
  }
33899
34526
  else {
@@ -33927,7 +34554,9 @@ class AddMultipleResponsibilityWithTabComponent {
33927
34554
  else {
33928
34555
  // const reportDate = new Date(day + month.split("'"));
33929
34556
  const date_value = new Date();
33930
- date_value.setMonth(typeof month !== 'number' ? ((_a = monthNames.filter((x) => x.month === (month === null || month === void 0 ? void 0 : month.substring(0, 3)))[0]) === null || _a === void 0 ? void 0 : _a.value) - 1 : month);
34557
+ date_value.setMonth(typeof month !== 'number'
34558
+ ? ((_a = monthNames.filter((x) => x.month === (month === null || month === void 0 ? void 0 : month.substring(0, 3)))[0]) === null || _a === void 0 ? void 0 : _a.value) - 1
34559
+ : month);
33931
34560
  date_value.setFullYear(Number(20 + month.split("'")[1]));
33932
34561
  date_value.setDate(Number(day));
33933
34562
  if (currentDate > date_value) {
@@ -33975,21 +34604,31 @@ class AddMultipleResponsibilityWithTabComponent {
33975
34604
  }
33976
34605
  const rcDetails = this.returnIds(report === null || report === void 0 ? void 0 : report.responsibilityCenter, 'rc_id');
33977
34606
  const reviewerDetails = this.returnIds(report === null || report === void 0 ? void 0 : report.reviewer, 'reviewer');
33978
- const assignorDetails = (report === null || report === void 0 ? void 0 : report.assignor) ? this.returnIds(report === null || report === void 0 ? void 0 : report.assignor, 'assignor') : '';
34607
+ const assignorDetails = (report === null || report === void 0 ? void 0 : report.assignor)
34608
+ ? this.returnIds(report === null || report === void 0 ? void 0 : report.assignor, 'assignor')
34609
+ : '';
33979
34610
  // const ccDetails: any = this.returnIds(report.alwaysNotify, 'cc');
33980
34611
  const ccDetails = this.returnIds(report === null || report === void 0 ? void 0 : report.overseer, 'cc');
33981
34612
  const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
33982
- const currentDate = moment().format('YYYY-MM-DD');
34613
+ const currentDate = moment$1().format('YYYY-MM-DD');
33983
34614
  // const categoryName = (report.responsibilityCategory.includes('[WITHIN]')) ? report.responsibilityCategory.split(' [')[0] : report.responsibilityCategory
33984
- let ongoingReminderType = { 'Weekly': 1, 'Monthly': 2, 'Quarterly': 3 };
34615
+ let ongoingReminderType = { Weekly: 1, Monthly: 2, Quarterly: 3 };
33985
34616
  const ongoingValues = {
33986
34617
  setReminder: report === null || report === void 0 ? void 0 : report.setReminder,
33987
- frequencyReminder: ongoingReminderType[report === null || report === void 0 ? void 0 : report.frequencyReminder]
34618
+ frequencyReminder: ongoingReminderType[report === null || report === void 0 ? void 0 : report.frequencyReminder],
33988
34619
  };
33989
34620
  const frequencyValue = this.frequencyService.shortHand_freqCal(report === null || report === void 0 ? void 0 : report.frequency, report === null || report === void 0 ? void 0 : report.day, report === null || report === void 0 ? void 0 : report.month, '', report === null || report === void 0 ? void 0 : report.dueDate, ongoingValues);
33990
34621
  // const frequencyValue = this.frequencyService.shortHand_freqCal(report?.frequency, report?.day, report?.month, '');
33991
34622
  const dateAndMonth = (_a = report === null || report === void 0 ? void 0 : report.month) === null || _a === void 0 ? void 0 : _a.split("'");
33992
- const startDate = dateAndMonth ? moment((report === null || report === void 0 ? void 0 : report.day) + '-' + dateAndMonth[0] + '-' + 20 + dateAndMonth[1] + ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss') : '';
34623
+ const startDate = dateAndMonth
34624
+ ? moment$1((report === null || report === void 0 ? void 0 : report.day) +
34625
+ '-' +
34626
+ dateAndMonth[0] +
34627
+ '-' +
34628
+ 20 +
34629
+ dateAndMonth[1] +
34630
+ ' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss')
34631
+ : '';
33993
34632
  let completeDays;
33994
34633
  let notCompleteDays;
33995
34634
  const frequencyType = frequencyValue === null || frequencyValue === void 0 ? void 0 : frequencyValue.split('~')[0];
@@ -34010,77 +34649,141 @@ class AddMultipleResponsibilityWithTabComponent {
34010
34649
  const obj = {
34011
34650
  userId: (_b = this.templateInfo) === null || _b === void 0 ? void 0 : _b.memberId,
34012
34651
  organisation_id: this.organizationId,
34013
- member_id: (assignorDetails) ? assignorDetails === null || assignorDetails === void 0 ? void 0 : assignorDetails.memberId : this.memberId,
34014
- member_name: (assignorDetails) ? ((report === null || report === void 0 ? void 0 : report.assignor) ? report === null || report === void 0 ? void 0 : report.assignor.split(' (')[0] : '') : ((this.defaultOwner) ? (_c = this.defaultOwner) === null || _c === void 0 ? void 0 : _c.split(' (')[0] : ''),
34015
- member_email: (assignorDetails) ? ((report === null || report === void 0 ? void 0 : report.assignor) ? (_e = (_d = report === null || report === void 0 ? void 0 : report.assignor) === null || _d === void 0 ? void 0 : _d.split(' (')[1]) === null || _e === void 0 ? void 0 : _e.replace(')', '') : '') : ((this.defaultOwner) ? (_f = this.defaultOwner) === null || _f === void 0 ? void 0 : _f.split(' (')[1].replace(')', '') : ''),
34016
- created_by: (assignorDetails) ? this.memberId : 0,
34652
+ member_id: assignorDetails
34653
+ ? assignorDetails === null || assignorDetails === void 0 ? void 0 : assignorDetails.memberId
34654
+ : this.memberId,
34655
+ member_name: assignorDetails
34656
+ ? (report === null || report === void 0 ? void 0 : report.assignor)
34657
+ ? report === null || report === void 0 ? void 0 : report.assignor.split(' (')[0]
34658
+ : ''
34659
+ : this.defaultOwner
34660
+ ? (_c = this.defaultOwner) === null || _c === void 0 ? void 0 : _c.split(' (')[0]
34661
+ : '',
34662
+ member_email: assignorDetails
34663
+ ? (report === null || report === void 0 ? void 0 : report.assignor)
34664
+ ? (_e = (_d = report === null || report === void 0 ? void 0 : report.assignor) === null || _d === void 0 ? void 0 : _d.split(' (')[1]) === null || _e === void 0 ? void 0 : _e.replace(')', '')
34665
+ : ''
34666
+ : this.defaultOwner
34667
+ ? (_f = this.defaultOwner) === null || _f === void 0 ? void 0 : _f.split(' (')[1].replace(')', '')
34668
+ : '',
34669
+ created_by: assignorDetails ? this.memberId : 0,
34017
34670
  report_name: (_g = report === null || report === void 0 ? void 0 : report.responsibilityName) !== null && _g !== void 0 ? _g : '',
34018
34671
  entrusted_to: (_j = (_h = report === null || report === void 0 ? void 0 : report.assignee) === null || _h === void 0 ? void 0 : _h.split(' (')[0]) !== null && _j !== void 0 ? _j : '',
34019
- entrusted_to_id: this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee) ? this.getEmployeeIdFromGroup(report === null || report === void 0 ? void 0 : report.assignee) : (_l = (_k = this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '',
34020
- email_address: !this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee) ? ((_p = (_o = (_m = report === null || report === void 0 ? void 0 : report.assignee) === null || _m === void 0 ? void 0 : _m.split(' (')[1]) === null || _o === void 0 ? void 0 : _o.replace(')', '')) !== null && _p !== void 0 ? _p : '') : '',
34672
+ entrusted_to_id: this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)
34673
+ ? this.getEmployeeIdFromGroup(report === null || report === void 0 ? void 0 : report.assignee)
34674
+ : (_l = (_k = this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')) === null || _k === void 0 ? void 0 : _k.toString()) !== null && _l !== void 0 ? _l : '',
34675
+ email_address: !this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)
34676
+ ? (_p = (_o = (_m = report === null || report === void 0 ? void 0 : report.assignee) === null || _m === void 0 ? void 0 : _m.split(' (')[1]) === null || _o === void 0 ? void 0 : _o.replace(')', '')) !== null && _p !== void 0 ? _p : ''
34677
+ : '',
34021
34678
  isGroupAssignTo: ((_q = report === null || report === void 0 ? void 0 : report.assigneeType) === null || _q === void 0 ? void 0 : _q.includes('Any')) ? 1 : 0,
34022
34679
  // category_name: categoryName,
34023
34680
  category_name_with_tree: '',
34024
34681
  category_id: (_s = (_r = this.getProgramId(report === null || report === void 0 ? void 0 : report.program, report === null || report === void 0 ? void 0 : report.programCategory).categoryId) === null || _r === void 0 ? void 0 : _r.toString()) !== null && _s !== void 0 ? _s : '',
34025
- program_cat_ids: ((_t = this.getProgramId(report === null || report === void 0 ? void 0 : report.program, report === null || report === void 0 ? void 0 : report.programCategory)) === null || _t === void 0 ? void 0 : _t.programId) ? [(_u = this.getProgramId(report === null || report === void 0 ? void 0 : report.program, report === null || report === void 0 ? void 0 : report.programCategory)) === null || _u === void 0 ? void 0 : _u.programId] : [],
34682
+ program_cat_ids: ((_t = this.getProgramId(report === null || report === void 0 ? void 0 : report.program, report === null || report === void 0 ? void 0 : report.programCategory)) === null || _t === void 0 ? void 0 : _t.programId)
34683
+ ? [
34684
+ (_u = this.getProgramId(report === null || report === void 0 ? void 0 : report.program, report === null || report === void 0 ? void 0 : report.programCategory)) === null || _u === void 0 ? void 0 : _u.programId,
34685
+ ]
34686
+ : [],
34026
34687
  rc_name: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.name : '',
34027
34688
  rc_id: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.rcId : 0,
34028
- entity_tree: (rcDetails && (rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.rcId)) ? [{
34029
- parent_rc_ids: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.parentIds : [],
34030
- rc_id: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.rcId : 0
34031
- }] : [],
34689
+ entity_tree: rcDetails && (rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.rcId)
34690
+ ? [
34691
+ {
34692
+ parent_rc_ids: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.parentIds : [],
34693
+ rc_id: rcDetails ? rcDetails === null || rcDetails === void 0 ? void 0 : rcDetails.rcId : 0,
34694
+ },
34695
+ ]
34696
+ : [],
34032
34697
  userGroupIds: {
34033
- assigneeAllGroupIds: (!((_v = report === null || report === void 0 ? void 0 : report.assigneeType) === null || _v === void 0 ? void 0 : _v.includes('Any')) && this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)) ? [this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')] : [],
34034
- assigneeAnyoneGroupIds: (((_w = report === null || report === void 0 ? void 0 : report.assigneeType) === null || _w === void 0 ? void 0 : _w.includes('Any')) && this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)) ? [this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')] : [],
34698
+ assigneeAllGroupIds: !((_v = report === null || report === void 0 ? void 0 : report.assigneeType) === null || _v === void 0 ? void 0 : _v.includes('Any')) &&
34699
+ this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)
34700
+ ? [this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')]
34701
+ : [],
34702
+ assigneeAnyoneGroupIds: ((_w = report === null || report === void 0 ? void 0 : report.assigneeType) === null || _w === void 0 ? void 0 : _w.includes('Any')) &&
34703
+ this.isGroupSelected(report === null || report === void 0 ? void 0 : report.assignee)
34704
+ ? [this.returnIds(report === null || report === void 0 ? void 0 : report.assignee, 'entrusted_to')]
34705
+ : [],
34035
34706
  ccEmailGroupIds: [],
34036
34707
  failureCCEmailGroupIds: [],
34037
- reviewerGroupIds: []
34708
+ reviewerGroupIds: [],
34038
34709
  },
34039
34710
  frequency_handler: frequencyValue,
34040
34711
  compliance_type: frequencyValue === null || frequencyValue === void 0 ? void 0 : frequencyValue.split('~')[0],
34041
34712
  frequency_description: report === null || report === void 0 ? void 0 : report.frequency,
34042
34713
  start_date: (report === null || report === void 0 ? void 0 : report.day) ? startDate : currentDate + ' 00:00:00',
34043
34714
  risk_class: (_x = report === null || report === void 0 ? void 0 : report.reportClass) !== null && _x !== void 0 ? _x : '',
34044
- risk_classId: (report === null || report === void 0 ? void 0 : report.reportClass) ? this.returnIds(report === null || report === void 0 ? void 0 : report.reportClass, 'risk_class') : ((this.riskClassEnabled) ? 1 : 2),
34715
+ risk_classId: (report === null || report === void 0 ? void 0 : report.reportClass)
34716
+ ? this.returnIds(report === null || report === void 0 ? void 0 : report.reportClass, 'risk_class')
34717
+ : this.riskClassEnabled
34718
+ ? 1
34719
+ : 2,
34045
34720
  doc_utc: 0,
34046
34721
  comment: (_y = report === null || report === void 0 ? void 0 : report.notes) !== null && _y !== void 0 ? _y : '',
34047
34722
  cc_mail: ccDetails ? ccDetails === null || ccDetails === void 0 ? void 0 : ccDetails.email : '',
34048
34723
  cc_mail_id: ccDetails ? ccDetails === null || ccDetails === void 0 ? void 0 : ccDetails.employeeId : '',
34049
34724
  cc_failed_mail: ccFailureDetails ? ccFailureDetails === null || ccFailureDetails === void 0 ? void 0 : ccFailureDetails.email : '',
34050
34725
  cc_failure_id: ccFailureDetails ? ccFailureDetails === null || ccFailureDetails === void 0 ? void 0 : ccFailureDetails.employeeId : 0,
34051
- send_reminder: "",
34052
- responsibilityWindow: (frequencyType === '1') ? 0 : (completeDays && completeDays != '') ? completeDays : 0,
34053
- failed_after: (notCompleteDays && notCompleteDays != '') ? notCompleteDays : 0,
34054
- excel_sheet_name: "",
34055
- report_upload_flag: (((report === null || report === void 0 ? void 0 : report.isFormat) === 'Yes') && ((_z = report === null || report === void 0 ? void 0 : report.formatForResponsibility) === null || _z === void 0 ? void 0 : _z.length)) ? 1 : 0,
34726
+ send_reminder: '',
34727
+ responsibilityWindow: frequencyType === '1'
34728
+ ? 0
34729
+ : completeDays && completeDays != ''
34730
+ ? completeDays
34731
+ : 0,
34732
+ failed_after: notCompleteDays && notCompleteDays != '' ? notCompleteDays : 0,
34733
+ excel_sheet_name: '',
34734
+ report_upload_flag: (report === null || report === void 0 ? void 0 : report.isFormat) === 'Yes' &&
34735
+ ((_z = report === null || report === void 0 ? void 0 : report.formatForResponsibility) === null || _z === void 0 ? void 0 : _z.length)
34736
+ ? 1
34737
+ : 0,
34056
34738
  report_id: 0,
34057
34739
  is_assigned_flag: 0,
34058
34740
  private_library_id: 0,
34059
- keycompliance: ((report === null || report === void 0 ? void 0 : report.keyResponsibility) === 'Yes') ? 'Yes' : 'No',
34060
- key_compliance: ((report === null || report === void 0 ? void 0 : report.keyResponsibility) === 'Yes') ? 1 : 0,
34741
+ keycompliance: (report === null || report === void 0 ? void 0 : report.keyResponsibility) === 'Yes' ? 'Yes' : 'No',
34742
+ key_compliance: (report === null || report === void 0 ? void 0 : report.keyResponsibility) === 'Yes' ? 1 : 0,
34061
34743
  reviewerId: reviewerDetails ? reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.employeeId : 0,
34062
- reviewer_arr: (reviewerDetails && (reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.employeeId)) ? {
34063
- level1: {
34064
- reviewers: [{
34065
- member_id: reviewerDetails ? reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.employeeId : 0,
34066
- reviewer_accept: 0
34067
- }],
34068
- type: "SEQUENTIAL"
34744
+ reviewer_arr: reviewerDetails && (reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.employeeId)
34745
+ ? {
34746
+ level1: {
34747
+ reviewers: [
34748
+ {
34749
+ member_id: reviewerDetails
34750
+ ? reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.employeeId
34751
+ : 0,
34752
+ reviewer_accept: 0,
34753
+ },
34754
+ ],
34755
+ type: 'SEQUENTIAL',
34756
+ },
34069
34757
  }
34070
- } : {},
34071
- reviewerWindow: ((report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin) && (report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin) !== '') ? report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin : 2,
34072
- reviewerFailure: ((report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter) && (report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter) !== '') ? report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter : 2,
34758
+ : {},
34759
+ reviewerWindow: (report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin) &&
34760
+ (report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin) !== ''
34761
+ ? report === null || report === void 0 ? void 0 : report.reviewToBeCompletedWithin
34762
+ : 2,
34763
+ reviewerFailure: (report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter) &&
34764
+ (report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter) !== ''
34765
+ ? report === null || report === void 0 ? void 0 : report.reviewWillBeFailedAfter
34766
+ : 2,
34073
34767
  reviewer_email: reviewerDetails ? reviewerDetails === null || reviewerDetails === void 0 ? void 0 : reviewerDetails.email : '',
34074
- formatForResponsibility: (report === null || report === void 0 ? void 0 : report.formatForResponsibility) ? report.formatForResponsibility : '',
34768
+ formatForResponsibility: (report === null || report === void 0 ? void 0 : report.formatForResponsibility)
34769
+ ? report.formatForResponsibility
34770
+ : '',
34075
34771
  documentaryEvidence: (_0 = report === null || report === void 0 ? void 0 : report.evidenceNotes) !== null && _0 !== void 0 ? _0 : '',
34076
- isdocumentaryEvidence: (report.documentEvidenceRequired === 'Yes') ? 1 : 0,
34772
+ isdocumentaryEvidence: report.documentEvidenceRequired === 'Yes' ? 1 : 0,
34077
34773
  objective: (_1 = report.objective) !== null && _1 !== void 0 ? _1 : '',
34078
34774
  excel_sheet_info: this.fileResponse,
34079
34775
  showList: false,
34080
34776
  custom_tags: '[]',
34081
34777
  questionnaire_type: '',
34082
- on_completion_of_type: ((report === null || report === void 0 ? void 0 : report.frequency) === 'On Completion of' || ((_2 = report === null || report === void 0 ? void 0 : report.frequency) === null || _2 === void 0 ? void 0 : _2.toLowerCase()) === 'ongoing') ? 1 : 0,
34083
- on_completion_of: this.returnIds(report === null || report === void 0 ? void 0 : report.parentResponsibility, 'parentResponsibility') ? [this.returnIds(report === null || report === void 0 ? void 0 : report.parentResponsibility, 'parentResponsibility')] : [],
34778
+ on_completion_of_type: (report === null || report === void 0 ? void 0 : report.frequency) === 'On Completion of' ||
34779
+ ((_2 = report === null || report === void 0 ? void 0 : report.frequency) === null || _2 === void 0 ? void 0 : _2.toLowerCase()) === 'ongoing'
34780
+ ? 1
34781
+ : 0,
34782
+ on_completion_of: this.returnIds(report === null || report === void 0 ? void 0 : report.parentResponsibility, 'parentResponsibility')
34783
+ ? [
34784
+ this.returnIds(report === null || report === void 0 ? void 0 : report.parentResponsibility, 'parentResponsibility'),
34785
+ ]
34786
+ : [],
34084
34787
  };
34085
34788
  payload.push(obj);
34086
34789
  }
@@ -34091,7 +34794,7 @@ class AddMultipleResponsibilityWithTabComponent {
34091
34794
  this.showExcel = false;
34092
34795
  this.showSmiley = true;
34093
34796
  this.responsibilityData = res;
34094
- }, err => {
34797
+ }, (err) => {
34095
34798
  console.log(err);
34096
34799
  this.loader = false;
34097
34800
  this.showExcel = false;
@@ -34112,7 +34815,11 @@ class AddMultipleResponsibilityWithTabComponent {
34112
34815
  else {
34113
34816
  name = rc_element.name;
34114
34817
  }
34115
- rcObj = { name, rcId: rc_element.rc_id, parentIds: rc_element.parentIds };
34818
+ rcObj = {
34819
+ name,
34820
+ rcId: rc_element.rc_id,
34821
+ parentIds: rc_element.parentIds,
34822
+ };
34116
34823
  }
34117
34824
  });
34118
34825
  return rcObj;
@@ -34124,7 +34831,7 @@ class AddMultipleResponsibilityWithTabComponent {
34124
34831
  reviewerObj = {
34125
34832
  name: reviewerElement.name,
34126
34833
  employeeId: reviewerElement.my_member_id,
34127
- email: reviewerElement.email
34834
+ email: reviewerElement.email,
34128
34835
  };
34129
34836
  }
34130
34837
  });
@@ -34137,7 +34844,7 @@ class AddMultipleResponsibilityWithTabComponent {
34137
34844
  assignorObj = {
34138
34845
  name: assignorElement.name,
34139
34846
  email: assignorElement.email,
34140
- memberId: assignorElement.member_id
34847
+ memberId: assignorElement.member_id,
34141
34848
  };
34142
34849
  }
34143
34850
  });
@@ -34150,7 +34857,7 @@ class AddMultipleResponsibilityWithTabComponent {
34150
34857
  ccObj = {
34151
34858
  name: ccElement.name,
34152
34859
  employeeId: ccElement.employee_id,
34153
- email: ccElement.email
34860
+ email: ccElement.email,
34154
34861
  };
34155
34862
  }
34156
34863
  });
@@ -34163,7 +34870,7 @@ class AddMultipleResponsibilityWithTabComponent {
34163
34870
  ccfObj = {
34164
34871
  name: ccfElement.name,
34165
34872
  employeeId: ccfElement.employee_id,
34166
- email: ccfElement.email
34873
+ email: ccfElement.email,
34167
34874
  };
34168
34875
  }
34169
34876
  });
@@ -34226,7 +34933,7 @@ class AddMultipleResponsibilityWithTabComponent {
34226
34933
  header: [],
34227
34934
  subHeading: [],
34228
34935
  reports: [],
34229
- }
34936
+ },
34230
34937
  };
34231
34938
  this.templateInfo = {
34232
34939
  categoryList: [],
@@ -34234,7 +34941,7 @@ class AddMultipleResponsibilityWithTabComponent {
34234
34941
  assignorsList: [],
34235
34942
  assigneesList: [],
34236
34943
  reviewerList: [],
34237
- memberId: ''
34944
+ memberId: '',
34238
34945
  };
34239
34946
  this.isFileEmpty = false;
34240
34947
  this.isWrongFile = false;
@@ -34268,7 +34975,8 @@ class AddMultipleResponsibilityWithTabComponent {
34268
34975
  urlSubstring = 'compliance/manage-responsibility?' + this.url;
34269
34976
  }
34270
34977
  else {
34271
- urlSubstring = 'compliance/manage-responsibilities/responsibilities-queue';
34978
+ urlSubstring =
34979
+ 'compliance/manage-responsibilities/responsibilities-queue';
34272
34980
  }
34273
34981
  }
34274
34982
  else {
@@ -34300,7 +35008,7 @@ class AddMultipleResponsibilityWithTabComponent {
34300
35008
  this.fileResponse.push(res);
34301
35009
  }
34302
35010
  this.loader = false;
34303
- }, err => {
35011
+ }, (err) => {
34304
35012
  console.error(err);
34305
35013
  this.loader = false;
34306
35014
  this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
@@ -34312,14 +35020,16 @@ class AddMultipleResponsibilityWithTabComponent {
34312
35020
  this.templateInfo.memberId = tempList[0][18];
34313
35021
  }
34314
35022
  else {
34315
- this.errorMessage = 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' + ' RETRY';
35023
+ this.errorMessage =
35024
+ 'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
35025
+ ' RETRY';
34316
35026
  this.isWrongFile = true;
34317
35027
  return;
34318
35028
  }
34319
35029
  tempList.forEach((element) => {
34320
35030
  var _a, _b, _c, _d;
34321
35031
  /* Pushing the value of regulations Programs into the categoryList array. */
34322
- if (element[26] && typeof (element[26]) === 'number') {
35032
+ if (element[26] && typeof element[26] === 'number') {
34323
35033
  const regulations = {
34324
35034
  programName: element[22],
34325
35035
  programId: element[26],
@@ -34331,7 +35041,7 @@ class AddMultipleResponsibilityWithTabComponent {
34331
35041
  this.templateInfo.categoryList.push(regulations);
34332
35042
  }
34333
35043
  /* Pushing the value of standards Programs into the categoryList array. */
34334
- if (element[27] && typeof (element[27]) === 'number') {
35044
+ if (element[27] && typeof element[27] === 'number') {
34335
35045
  const standards = {
34336
35046
  programName: element[23],
34337
35047
  programId: element[27],
@@ -34343,7 +35053,7 @@ class AddMultipleResponsibilityWithTabComponent {
34343
35053
  this.templateInfo.categoryList.push(standards);
34344
35054
  }
34345
35055
  /* Pushing the value of internal Controls Programs into the categoryList array. */
34346
- if (element[28] && typeof (element[28]) === 'number') {
35056
+ if (element[28] && typeof element[28] === 'number') {
34347
35057
  const internalControls = {
34348
35058
  programName: element[24],
34349
35059
  programId: element[28],
@@ -34355,7 +35065,7 @@ class AddMultipleResponsibilityWithTabComponent {
34355
35065
  this.templateInfo.categoryList.push(internalControls);
34356
35066
  }
34357
35067
  /* Pushing the value of others Programs into the categoryList array. */
34358
- if (element[29] && typeof (element[29]) === 'number') {
35068
+ if (element[29] && typeof element[29] === 'number') {
34359
35069
  const others = {
34360
35070
  programName: element[25],
34361
35071
  programId: element[29],
@@ -34372,7 +35082,7 @@ class AddMultipleResponsibilityWithTabComponent {
34372
35082
  const rc = {
34373
35083
  name: element[9],
34374
35084
  rc_id: element[10],
34375
- parentIds: JSON.parse(element[11])
35085
+ parentIds: JSON.parse(element[11]),
34376
35086
  };
34377
35087
  this.templateInfo.rcList.push(rc);
34378
35088
  }
@@ -34385,7 +35095,7 @@ class AddMultipleResponsibilityWithTabComponent {
34385
35095
  name: element[19],
34386
35096
  email: element[19],
34387
35097
  employee_id: element[20],
34388
- my_member_id: JSON.parse(element[21])
35098
+ my_member_id: JSON.parse(element[21]),
34389
35099
  };
34390
35100
  this.templateInfo.assigneesList.push(assignee);
34391
35101
  }
@@ -34396,7 +35106,7 @@ class AddMultipleResponsibilityWithTabComponent {
34396
35106
  name: element[0],
34397
35107
  email: element[1],
34398
35108
  employee_id: element[3],
34399
- my_member_id: element[4]
35109
+ my_member_id: element[4],
34400
35110
  };
34401
35111
  this.templateInfo.reviewerList.push(reviewer);
34402
35112
  }
@@ -34418,7 +35128,7 @@ class AddMultipleResponsibilityWithTabComponent {
34418
35128
  if (element[17]) {
34419
35129
  const parentResponsibility = {
34420
35130
  name: element[16],
34421
- id: JSON.parse(element[17])
35131
+ id: JSON.parse(element[17]),
34422
35132
  };
34423
35133
  this.templateInfo.parentResponsibility.push(parentResponsibility);
34424
35134
  }
@@ -34530,14 +35240,22 @@ class AddMultipleResponsibilityWithTabComponent {
34530
35240
  reviewToBeCompletedWithin: report[21],
34531
35241
  reviewWillBeFailedAfter: report[22],
34532
35242
  overseer: report[23],
34533
- notifyOnFailure: report[24]
35243
+ notifyOnFailure: report[24],
34534
35244
  };
34535
35245
  obj['isValidData'] = this.isValidData(obj);
34536
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
35246
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35247
+ ? true
35248
+ : false;
34537
35249
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34538
35250
  obj['validDate'] = this.compareWithCurrentDate(obj === null || obj === void 0 ? void 0 : obj.day, obj === null || obj === void 0 ? void 0 : obj.month);
34539
35251
  obj['isPastDate'] = this.isPastDate(obj === null || obj === void 0 ? void 0 : obj.day, obj === null || obj === void 0 ? void 0 : obj.month);
34540
- obj['isValid'] = obj['isValidData'] && obj['validDate'] && !obj['isPastDate'] && ((_a = obj === null || obj === void 0 ? void 0 : obj.frequency) === null || _a === void 0 ? void 0 : _a.length) && !Object.values(obj['userValidateWithProgram']).includes(false) && obj['isValidUser'];
35252
+ obj['isValid'] =
35253
+ obj['isValidData'] &&
35254
+ obj['validDate'] &&
35255
+ !obj['isPastDate'] &&
35256
+ ((_a = obj === null || obj === void 0 ? void 0 : obj.frequency) === null || _a === void 0 ? void 0 : _a.length) &&
35257
+ !Object.values(obj['userValidateWithProgram']).includes(false) &&
35258
+ obj['isValidUser'];
34541
35259
  return obj;
34542
35260
  }
34543
35261
  else {
@@ -34566,14 +35284,21 @@ class AddMultipleResponsibilityWithTabComponent {
34566
35284
  reviewToBeCompletedWithin: report[18],
34567
35285
  reviewWillBeFailedAfter: report[19],
34568
35286
  overseer: report[20],
34569
- notifyOnFailure: report[21]
35287
+ notifyOnFailure: report[21],
34570
35288
  };
34571
35289
  obj['isValidData'] = this.isValidData(obj);
34572
35290
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34573
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
35291
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35292
+ ? true
35293
+ : false;
34574
35294
  obj['validDate'] = this.compareWithCurrentDate(obj === null || obj === void 0 ? void 0 : obj.day, obj === null || obj === void 0 ? void 0 : obj.month);
34575
35295
  obj['isPastDate'] = this.isPastDate(obj === null || obj === void 0 ? void 0 : obj.day, obj === null || obj === void 0 ? void 0 : obj.month);
34576
- obj['isValid'] = obj['isValidData'] && obj['validDate'] && !obj['isPastDate'] && ((_b = obj === null || obj === void 0 ? void 0 : obj.frequency) === null || _b === void 0 ? void 0 : _b.length) && obj['isValidUser'];
35296
+ obj['isValid'] =
35297
+ obj['isValidData'] &&
35298
+ obj['validDate'] &&
35299
+ !obj['isPastDate'] &&
35300
+ ((_b = obj === null || obj === void 0 ? void 0 : obj.frequency) === null || _b === void 0 ? void 0 : _b.length) &&
35301
+ obj['isValidUser'];
34577
35302
  return obj;
34578
35303
  }
34579
35304
  break;
@@ -34606,12 +35331,17 @@ class AddMultipleResponsibilityWithTabComponent {
34606
35331
  reviewToBeCompletedWithin: report[19],
34607
35332
  reviewWillBeFailedAfter: report[20],
34608
35333
  overseer: report[21],
34609
- notifyOnFailure: report[22]
35334
+ notifyOnFailure: report[22],
34610
35335
  };
34611
35336
  obj['isValidData'] = this.isValidData(obj);
34612
35337
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34613
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
34614
- obj['isValid'] = obj['isValidData'] && !Object.values(obj['userValidateWithProgram']).includes(false) && obj['isValidUser'];
35338
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35339
+ ? true
35340
+ : false;
35341
+ obj['isValid'] =
35342
+ obj['isValidData'] &&
35343
+ !Object.values(obj['userValidateWithProgram']).includes(false) &&
35344
+ obj['isValidUser'];
34615
35345
  return obj;
34616
35346
  }
34617
35347
  else {
@@ -34638,11 +35368,13 @@ class AddMultipleResponsibilityWithTabComponent {
34638
35368
  reviewToBeCompletedWithin: report[16],
34639
35369
  reviewWillBeFailedAfter: report[17],
34640
35370
  overseer: report[18],
34641
- notifyOnFailure: report[19]
35371
+ notifyOnFailure: report[19],
34642
35372
  };
34643
35373
  obj['isValidData'] = this.isValidData(obj);
34644
35374
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34645
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
35375
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35376
+ ? true
35377
+ : false;
34646
35378
  obj['isValid'] = obj['isValidData'] && obj['isValidUser'];
34647
35379
  return obj;
34648
35380
  }
@@ -34677,12 +35409,18 @@ class AddMultipleResponsibilityWithTabComponent {
34677
35409
  reviewToBeCompletedWithin: report[21],
34678
35410
  reviewWillBeFailedAfter: report[22],
34679
35411
  overseer: report[23],
34680
- notifyOnFailure: report[24]
35412
+ notifyOnFailure: report[24],
34681
35413
  };
34682
35414
  obj['isValidData'] = this.isValidData(obj);
34683
35415
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34684
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
34685
- obj['isValid'] = obj['isValidData'] && !Object.values(obj['userValidateWithProgram']).includes(false) && ((_c = obj === null || obj === void 0 ? void 0 : obj.parentResponsibility) === null || _c === void 0 ? void 0 : _c.length) && obj['isValidUser'];
35416
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35417
+ ? true
35418
+ : false;
35419
+ obj['isValid'] =
35420
+ obj['isValidData'] &&
35421
+ !Object.values(obj['userValidateWithProgram']).includes(false) &&
35422
+ ((_c = obj === null || obj === void 0 ? void 0 : obj.parentResponsibility) === null || _c === void 0 ? void 0 : _c.length) &&
35423
+ obj['isValidUser'];
34686
35424
  return obj;
34687
35425
  }
34688
35426
  else {
@@ -34711,12 +35449,17 @@ class AddMultipleResponsibilityWithTabComponent {
34711
35449
  reviewToBeCompletedWithin: report[18],
34712
35450
  reviewWillBeFailedAfter: report[19],
34713
35451
  overseer: report[20],
34714
- notifyOnFailure: report[21]
35452
+ notifyOnFailure: report[21],
34715
35453
  };
34716
35454
  obj['isValidData'] = this.isValidData(obj);
34717
35455
  obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
34718
- obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to') ? true : false;
34719
- obj['isValid'] = obj['isValidData'] && ((_d = obj === null || obj === void 0 ? void 0 : obj.parentResponsibility) === null || _d === void 0 ? void 0 : _d.length) && obj['isValidUser'];
35456
+ obj['isValidUser'] = this.returnIds(obj === null || obj === void 0 ? void 0 : obj.assignee, 'entrusted_to')
35457
+ ? true
35458
+ : false;
35459
+ obj['isValid'] =
35460
+ obj['isValidData'] &&
35461
+ ((_d = obj === null || obj === void 0 ? void 0 : obj.parentResponsibility) === null || _d === void 0 ? void 0 : _d.length) &&
35462
+ obj['isValidUser'];
34720
35463
  return obj;
34721
35464
  }
34722
35465
  }
@@ -34745,7 +35488,9 @@ class AddMultipleResponsibilityWithTabComponent {
34745
35488
  */
34746
35489
  isValidData(data) {
34747
35490
  var _a, _b, _c;
34748
- const responsibility = ((_a = this.checkValidResponsibilityName(data === null || data === void 0 ? void 0 : data.responsibilityName)) === null || _a === void 0 ? void 0 : _a.length) ? true : false;
35491
+ const responsibility = ((_a = this.checkValidResponsibilityName(data === null || data === void 0 ? void 0 : data.responsibilityName)) === null || _a === void 0 ? void 0 : _a.length)
35492
+ ? true
35493
+ : false;
34749
35494
  const assignee = ((_b = data === null || data === void 0 ? void 0 : data.assignee) === null || _b === void 0 ? void 0 : _b.length) ? true : false;
34750
35495
  const frequency = ((_c = data === null || data === void 0 ? void 0 : data.frequency) === null || _c === void 0 ? void 0 : _c.length) ? true : false;
34751
35496
  if (assignee && responsibility && frequency && this.isValidUsers(data)) {
@@ -34766,12 +35511,23 @@ class AddMultipleResponsibilityWithTabComponent {
34766
35511
  * @returns A boolean value.
34767
35512
  */
34768
35513
  isValidUsers(data) {
34769
- if (((data === null || data === void 0 ? void 0 : data.assignor) && (((data === null || data === void 0 ? void 0 : data.assignor) == (data === null || data === void 0 ? void 0 : data.overseer)) || ((data === null || data === void 0 ? void 0 : data.assignor) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure)))) ||
34770
- ((!(data === null || data === void 0 ? void 0 : data.assignor)) && ((this.defaultOwner == (data === null || data === void 0 ? void 0 : data.overseer)) || (this.defaultOwner == (data === null || data === void 0 ? void 0 : data.notifyOnFailure)))) ||
34771
- ((data === null || data === void 0 ? void 0 : data.assignee) && (((data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.reviewer)) || ((data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.overseer)) || ((data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure)))) ||
34772
- ((!(data === null || data === void 0 ? void 0 : data.assignee)) && ((this.defaultOwner == (data === null || data === void 0 ? void 0 : data.overseer)) || (this.defaultOwner == (data === null || data === void 0 ? void 0 : data.notifyOnFailure)))) ||
34773
- ((data === null || data === void 0 ? void 0 : data.reviewer) && (((data === null || data === void 0 ? void 0 : data.reviewer) == (data === null || data === void 0 ? void 0 : data.overseer)) || ((data === null || data === void 0 ? void 0 : data.reviewer) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure)))) ||
34774
- (!(data === null || data === void 0 ? void 0 : data.assignee))) {
35514
+ if (((data === null || data === void 0 ? void 0 : data.assignor) &&
35515
+ ((data === null || data === void 0 ? void 0 : data.assignor) == (data === null || data === void 0 ? void 0 : data.overseer) ||
35516
+ (data === null || data === void 0 ? void 0 : data.assignor) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure))) ||
35517
+ (!(data === null || data === void 0 ? void 0 : data.assignor) &&
35518
+ (this.defaultOwner == (data === null || data === void 0 ? void 0 : data.overseer) ||
35519
+ this.defaultOwner == (data === null || data === void 0 ? void 0 : data.notifyOnFailure))) ||
35520
+ ((data === null || data === void 0 ? void 0 : data.assignee) &&
35521
+ ((data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.reviewer) ||
35522
+ (data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.overseer) ||
35523
+ (data === null || data === void 0 ? void 0 : data.assignee) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure))) ||
35524
+ (!(data === null || data === void 0 ? void 0 : data.assignee) &&
35525
+ (this.defaultOwner == (data === null || data === void 0 ? void 0 : data.overseer) ||
35526
+ this.defaultOwner == (data === null || data === void 0 ? void 0 : data.notifyOnFailure))) ||
35527
+ ((data === null || data === void 0 ? void 0 : data.reviewer) &&
35528
+ ((data === null || data === void 0 ? void 0 : data.reviewer) == (data === null || data === void 0 ? void 0 : data.overseer) ||
35529
+ (data === null || data === void 0 ? void 0 : data.reviewer) == (data === null || data === void 0 ? void 0 : data.notifyOnFailure))) ||
35530
+ !(data === null || data === void 0 ? void 0 : data.assignee)) {
34775
35531
  return false;
34776
35532
  }
34777
35533
  else {
@@ -34804,16 +35560,24 @@ class AddMultipleResponsibilityWithTabComponent {
34804
35560
  let isValidNotifyOnFailure = true;
34805
35561
  if (program && ((_o = this.orgDetails) === null || _o === void 0 ? void 0 : _o.hasProgramFullPermission)) {
34806
35562
  if (((_q = (_p = program[0]) === null || _p === void 0 ? void 0 : _p.assignee) === null || _q === void 0 ? void 0 : _q.length) && (selectedAssignee === null || selectedAssignee === void 0 ? void 0 : selectedAssignee.length)) {
34807
- isValidAssignee = ((_s = (_r = program[0]) === null || _r === void 0 ? void 0 : _r.assignee) === null || _s === void 0 ? void 0 : _s.includes((_t = selectedAssignee[0]) === null || _t === void 0 ? void 0 : _t.my_member_id)) ? true : false;
35563
+ isValidAssignee = ((_s = (_r = program[0]) === null || _r === void 0 ? void 0 : _r.assignee) === null || _s === void 0 ? void 0 : _s.includes((_t = selectedAssignee[0]) === null || _t === void 0 ? void 0 : _t.my_member_id))
35564
+ ? true
35565
+ : false;
34808
35566
  }
34809
35567
  if (((_v = (_u = program[0]) === null || _u === void 0 ? void 0 : _u.reviewer) === null || _v === void 0 ? void 0 : _v.length) && (selectedReviewer === null || selectedReviewer === void 0 ? void 0 : selectedReviewer.length)) {
34810
- isValidReviewer = ((_x = (_w = program[0]) === null || _w === void 0 ? void 0 : _w.reviewer) === null || _x === void 0 ? void 0 : _x.includes((_y = selectedReviewer[0]) === null || _y === void 0 ? void 0 : _y.my_member_id)) ? true : false;
35568
+ isValidReviewer = ((_x = (_w = program[0]) === null || _w === void 0 ? void 0 : _w.reviewer) === null || _x === void 0 ? void 0 : _x.includes((_y = selectedReviewer[0]) === null || _y === void 0 ? void 0 : _y.my_member_id))
35569
+ ? true
35570
+ : false;
34811
35571
  }
34812
35572
  if (((_0 = (_z = program[0]) === null || _z === void 0 ? void 0 : _z.overseer) === null || _0 === void 0 ? void 0 : _0.length) && (selectedOverseer === null || selectedOverseer === void 0 ? void 0 : selectedOverseer.length)) {
34813
- isValidOverseer = ((_2 = (_1 = program[0]) === null || _1 === void 0 ? void 0 : _1.overseer) === null || _2 === void 0 ? void 0 : _2.includes((_3 = selectedOverseer[0]) === null || _3 === void 0 ? void 0 : _3.my_member_id)) ? true : false;
35573
+ isValidOverseer = ((_2 = (_1 = program[0]) === null || _1 === void 0 ? void 0 : _1.overseer) === null || _2 === void 0 ? void 0 : _2.includes((_3 = selectedOverseer[0]) === null || _3 === void 0 ? void 0 : _3.my_member_id))
35574
+ ? true
35575
+ : false;
34814
35576
  }
34815
35577
  if (((_5 = (_4 = program[0]) === null || _4 === void 0 ? void 0 : _4.overseer) === null || _5 === void 0 ? void 0 : _5.length) && (selectedNotifyOnFailure === null || selectedNotifyOnFailure === void 0 ? void 0 : selectedNotifyOnFailure.length)) {
34816
- isValidNotifyOnFailure = ((_7 = (_6 = program[0]) === null || _6 === void 0 ? void 0 : _6.overseer) === null || _7 === void 0 ? void 0 : _7.includes((_8 = selectedNotifyOnFailure[0]) === null || _8 === void 0 ? void 0 : _8.my_member_id)) ? true : false;
35578
+ isValidNotifyOnFailure = ((_7 = (_6 = program[0]) === null || _6 === void 0 ? void 0 : _6.overseer) === null || _7 === void 0 ? void 0 : _7.includes((_8 = selectedNotifyOnFailure[0]) === null || _8 === void 0 ? void 0 : _8.my_member_id))
35579
+ ? true
35580
+ : false;
34817
35581
  }
34818
35582
  }
34819
35583
  return {
@@ -34845,7 +35609,8 @@ class AddMultipleResponsibilityWithTabComponent {
34845
35609
  subProgramId = (subProgram === null || subProgram === void 0 ? void 0 : subProgram.length) ? (_e = subProgram[0]) === null || _e === void 0 ? void 0 : _e.id : undefined;
34846
35610
  }
34847
35611
  if (subProgramId && (program === null || program === void 0 ? void 0 : program.length)) {
34848
- categoryId = ((_g = (_f = program[0]) === null || _f === void 0 ? void 0 : _f.programId) === null || _g === void 0 ? void 0 : _g.toString()) + ',' + (subProgramId === null || subProgramId === void 0 ? void 0 : subProgramId.toString());
35612
+ categoryId =
35613
+ ((_g = (_f = program[0]) === null || _f === void 0 ? void 0 : _f.programId) === null || _g === void 0 ? void 0 : _g.toString()) + ',' + (subProgramId === null || subProgramId === void 0 ? void 0 : subProgramId.toString());
34849
35614
  }
34850
35615
  else if (program === null || program === void 0 ? void 0 : program.length) {
34851
35616
  categoryId = (_j = (_h = program[0]) === null || _h === void 0 ? void 0 : _h.programId) === null || _j === void 0 ? void 0 : _j.toString();
@@ -34889,7 +35654,9 @@ class AddMultipleResponsibilityWithTabComponent {
34889
35654
  isGroupSelected(item) {
34890
35655
  let isGroup = false;
34891
35656
  this.templateInfo.assigneesList.forEach((enElement) => {
34892
- if (enElement.nameAndEmail == item && ((item === null || item === void 0 ? void 0 : item.includes('Users)')) || (item === null || item === void 0 ? void 0 : item.includes('User)'))) && typeof (enElement === null || enElement === void 0 ? void 0 : enElement.my_member_id) == 'object') {
35657
+ if (enElement.nameAndEmail == item &&
35658
+ ((item === null || item === void 0 ? void 0 : item.includes('Users)')) || (item === null || item === void 0 ? void 0 : item.includes('User)'))) &&
35659
+ typeof (enElement === null || enElement === void 0 ? void 0 : enElement.my_member_id) == 'object') {
34893
35660
  isGroup = true;
34894
35661
  }
34895
35662
  });