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.
- package/esm2020/lib/add-multiple-responsibility/add-multiple-responsibility.component.mjs +2 -2
- package/esm2020/lib/add-multiple-responsibility-with-tab/add-multiple-responsibility-with-tab.component.mjs +310 -123
- package/esm2020/lib/add-multiple-risk/add-multiple-risk.component.mjs +128 -64
- package/esm2020/lib/log-an-issue/log-an-issue.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-annual/frequency-annual.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-biannual/frequency-biannual.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-container/frequency-container.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-daily/frequency-daily.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-lifecycle/frequency-lifecycle.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-monthly/frequency-monthly.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-on-completion-of/frequency-on-completion-of.component.mjs +26 -11
- package/esm2020/lib/sharedComponents/frequency/frequency-one-time/frequency-one-time.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-quarterly/frequency-quarterly.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency-top/frequency-top.component.mjs +21 -8
- package/esm2020/lib/sharedComponents/frequency/frequency-weekly/frequency-weekly.component.mjs +2 -2
- package/esm2020/lib/sharedComponents/frequency/frequency.service.mjs +5 -3
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-annual/frequency-dialog-annual.component.mjs +113 -23
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-biannual/frequency-dialog-biannual.component.mjs +60 -21
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-container/frequency-dialog-container.component.mjs +53 -43
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-monthly/frequency-dialog-monthly.component.mjs +64 -25
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-one-time/frequency-dialog-one-time.component.mjs +63 -20
- package/esm2020/lib/sharedComponents/frequency-dialog/frequency-dialog-quarterly/frequency-dialog-quarterly.component.mjs +65 -23
- package/esm2020/lib/workflow-compliance/workflow-compliance.component.mjs +2 -2
- package/esm2020/lib/workflow-policy/workflow-policy.component.mjs +2 -2
- package/esm2020/lib/workflow-risk/workflow-risk.component.mjs +365 -131
- package/fesm2015/vcomply-workflow-engine.mjs +1304 -537
- package/fesm2015/vcomply-workflow-engine.mjs.map +1 -1
- package/fesm2020/vcomply-workflow-engine.mjs +1320 -541
- package/fesm2020/vcomply-workflow-engine.mjs.map +1 -1
- package/lib/sharedComponents/frequency/frequency-lifecycle/frequency-lifecycle.component.d.ts +1 -1
- package/lib/sharedComponents/frequency/frequency-on-completion-of/frequency-on-completion-of.component.d.ts +1 -1
- 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
|
|
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';
|
|
@@ -2270,7 +2271,7 @@ class FrequencyService {
|
|
|
2270
2271
|
row.frequency_template === 'every 2 weeks' ||
|
|
2271
2272
|
row.frequency_template === 'every 3 weeks') &&
|
|
2272
2273
|
row.frequency_template !== 'every day') {
|
|
2273
|
-
const momentUnix = moment(getDate +
|
|
2274
|
+
const momentUnix = moment$1(getDate +
|
|
2274
2275
|
'-' +
|
|
2275
2276
|
(new Date().getMonth() + 1) +
|
|
2276
2277
|
'-' +
|
|
@@ -2667,7 +2668,9 @@ class FrequencyService {
|
|
|
2667
2668
|
}
|
|
2668
2669
|
getResponsibilitiesCount(payload) {
|
|
2669
2670
|
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2670
|
-
return this.http
|
|
2671
|
+
return this.http
|
|
2672
|
+
.post(this.env.responsibilityPost + 'manage_responsibilities_reports_count', payload, { headers })
|
|
2673
|
+
.pipe(retry(1));
|
|
2671
2674
|
}
|
|
2672
2675
|
}
|
|
2673
2676
|
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 });
|
|
@@ -4570,17 +4573,20 @@ class FrequencyDialogMonthlyComponent {
|
|
|
4570
4573
|
ngOnInit() {
|
|
4571
4574
|
this.frequencyInfo = Object.assign(this.frequencyService?.frequencyInfo);
|
|
4572
4575
|
this.monthNameArray = [...new Set(this.frequencyService?.monthArray)];
|
|
4573
|
-
this.shortMonth = this.frequencyService?.monthArray.map(month => month.substring(0, 3));
|
|
4574
|
-
console.log(
|
|
4575
|
-
if (this.frequencyData?.pattern != '' &&
|
|
4576
|
+
this.shortMonth = this.frequencyService?.monthArray.map((month) => month.substring(0, 3));
|
|
4577
|
+
console.log('this.frequencyData ==>', this.frequencyData);
|
|
4578
|
+
if (this.frequencyData?.pattern != '' &&
|
|
4579
|
+
parseInt(this.frequencyData?.pattern.split('~')[0]) === 3) {
|
|
4576
4580
|
this.populateFrequency();
|
|
4577
4581
|
}
|
|
4578
4582
|
this.getMonthlyFrequency();
|
|
4579
4583
|
}
|
|
4580
4584
|
populateFrequency() {
|
|
4581
4585
|
const patternInfo = this.frequencyData?.pattern.split('~');
|
|
4582
|
-
console.log(
|
|
4583
|
-
this.selectedMonthly = patternInfo[2]
|
|
4586
|
+
console.log('patternInfo ==>', patternInfo, this.frequencyData);
|
|
4587
|
+
this.selectedMonthly = patternInfo[2]
|
|
4588
|
+
.split(',')
|
|
4589
|
+
.map((ele) => Number(ele) - 1);
|
|
4584
4590
|
// const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
|
|
4585
4591
|
this.monthlyInterval = this.frequencyData?.failedTime;
|
|
4586
4592
|
this.monthlyWindow = this.frequencyData?.window;
|
|
@@ -4614,12 +4620,12 @@ class FrequencyDialogMonthlyComponent {
|
|
|
4614
4620
|
this.getMonthlyFrequency();
|
|
4615
4621
|
}
|
|
4616
4622
|
onTimeChanged(event) {
|
|
4617
|
-
console.log(
|
|
4623
|
+
console.log('time event =>', event);
|
|
4618
4624
|
this.monthlyInterval = event;
|
|
4619
4625
|
this.getMonthlyFrequency();
|
|
4620
4626
|
}
|
|
4621
4627
|
onMonthSelected(event) {
|
|
4622
|
-
console.log(
|
|
4628
|
+
console.log('evnet', event);
|
|
4623
4629
|
if (event.checked) {
|
|
4624
4630
|
this.selectedMonthly.push(event.index);
|
|
4625
4631
|
}
|
|
@@ -4642,18 +4648,21 @@ class FrequencyDialogMonthlyComponent {
|
|
|
4642
4648
|
break;
|
|
4643
4649
|
}
|
|
4644
4650
|
if (event.startFrom.toString().length > 10) {
|
|
4645
|
-
console.log(
|
|
4651
|
+
console.log('start 1111');
|
|
4646
4652
|
this.startDate = Math.floor(event.startFrom / 1000);
|
|
4647
4653
|
}
|
|
4648
4654
|
else {
|
|
4649
|
-
console.log(
|
|
4655
|
+
console.log('start 11112222');
|
|
4650
4656
|
this.startDate = Math.floor(event.startFrom);
|
|
4651
4657
|
}
|
|
4652
|
-
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
4658
|
+
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
4659
|
+
86400000);
|
|
4653
4660
|
console.log('strat date ====>', this.startDate);
|
|
4654
4661
|
console.log('end date', endByDate);
|
|
4655
4662
|
if (event.type === 0) {
|
|
4656
|
-
endByDate = event.endsBy
|
|
4663
|
+
endByDate = event.endsBy
|
|
4664
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
4665
|
+
: endByDate;
|
|
4657
4666
|
console.log('endByDate', endByDate);
|
|
4658
4667
|
}
|
|
4659
4668
|
this.monthlyLifeCycleStart = new Date(this.startDate * 1000);
|
|
@@ -4676,7 +4685,8 @@ class FrequencyDialogMonthlyComponent {
|
|
|
4676
4685
|
this.selectedMonthly = this.selectedMonthly.sort((n1, n2) => n1 - n2);
|
|
4677
4686
|
const monthIndex = this.selectedMonthly.map((ele) => ele + 1);
|
|
4678
4687
|
this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.monthlyInput));
|
|
4679
|
-
this.frequencyInfo.pattern =
|
|
4688
|
+
this.frequencyInfo.pattern =
|
|
4689
|
+
3 + '~' + this.monthlyInput + '~' + monthIndex + '~' + '0';
|
|
4680
4690
|
this.frequencyInfo.case = 'month';
|
|
4681
4691
|
this.frequencyInfo.failedAfter = this.monthlyFailed;
|
|
4682
4692
|
this.frequencyInfo.window = this.monthlyWindow;
|
|
@@ -4687,36 +4697,68 @@ class FrequencyDialogMonthlyComponent {
|
|
|
4687
4697
|
this.frequencyInfo.reportId = 0;
|
|
4688
4698
|
this.frequencyInfo.continuous_failed_days = this.monthlyDeactivatedValue;
|
|
4689
4699
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
4690
|
-
console.log(
|
|
4700
|
+
console.log(' this.frequencyInfo ==>', this.frequencyInfo);
|
|
4691
4701
|
}
|
|
4692
4702
|
getFrequencyPlaceholder(monthlyInput) {
|
|
4693
|
-
console.log(
|
|
4703
|
+
console.log('monthlyInput ==>', monthlyInput);
|
|
4694
4704
|
const selectedMonth = this.selectedMonthly.map((ele) => {
|
|
4695
4705
|
return this.shortMonth[ele];
|
|
4696
4706
|
});
|
|
4697
4707
|
let placeholder = '';
|
|
4698
4708
|
if (monthlyInput === 1) {
|
|
4699
|
-
placeholder =
|
|
4709
|
+
placeholder =
|
|
4710
|
+
'1st of every ' +
|
|
4711
|
+
selectedMonth.join(', ') +
|
|
4712
|
+
' by ' +
|
|
4713
|
+
this.monthlyInterval;
|
|
4700
4714
|
}
|
|
4701
4715
|
else if (monthlyInput === 2) {
|
|
4702
|
-
placeholder =
|
|
4716
|
+
placeholder =
|
|
4717
|
+
'2nd of every ' +
|
|
4718
|
+
selectedMonth.join(', ') +
|
|
4719
|
+
' by ' +
|
|
4720
|
+
this.monthlyInterval;
|
|
4703
4721
|
}
|
|
4704
4722
|
else if (monthlyInput === 3) {
|
|
4705
|
-
placeholder =
|
|
4723
|
+
placeholder =
|
|
4724
|
+
'3rd of every ' +
|
|
4725
|
+
selectedMonth.join(', ') +
|
|
4726
|
+
' by ' +
|
|
4727
|
+
this.monthlyInterval;
|
|
4706
4728
|
}
|
|
4707
4729
|
else if (monthlyInput === 21 || monthlyInput === 31) {
|
|
4708
|
-
placeholder =
|
|
4730
|
+
placeholder =
|
|
4731
|
+
monthlyInput +
|
|
4732
|
+
'st of every ' +
|
|
4733
|
+
selectedMonth.join(', ') +
|
|
4734
|
+
' by ' +
|
|
4735
|
+
this.monthlyInterval;
|
|
4709
4736
|
}
|
|
4710
4737
|
else if (monthlyInput === 22) {
|
|
4711
|
-
placeholder =
|
|
4738
|
+
placeholder =
|
|
4739
|
+
monthlyInput +
|
|
4740
|
+
'nd of every ' +
|
|
4741
|
+
selectedMonth.join(', ') +
|
|
4742
|
+
' by ' +
|
|
4743
|
+
this.monthlyInterval;
|
|
4712
4744
|
}
|
|
4713
4745
|
else if (monthlyInput === 23) {
|
|
4714
|
-
placeholder =
|
|
4746
|
+
placeholder =
|
|
4747
|
+
monthlyInput +
|
|
4748
|
+
'rd of every ' +
|
|
4749
|
+
selectedMonth.join(', ') +
|
|
4750
|
+
' by ' +
|
|
4751
|
+
this.monthlyInterval;
|
|
4715
4752
|
}
|
|
4716
4753
|
else if (monthlyInput > 3) {
|
|
4717
|
-
placeholder =
|
|
4754
|
+
placeholder =
|
|
4755
|
+
monthlyInput +
|
|
4756
|
+
'th of every ' +
|
|
4757
|
+
selectedMonth.join(', ') +
|
|
4758
|
+
' by ' +
|
|
4759
|
+
this.monthlyInterval;
|
|
4718
4760
|
}
|
|
4719
|
-
console.log(
|
|
4761
|
+
console.log('placeholder ==>', placeholder);
|
|
4720
4762
|
return placeholder;
|
|
4721
4763
|
}
|
|
4722
4764
|
}
|
|
@@ -4788,18 +4830,20 @@ class FrequencyDialogQuarterlyComponent {
|
|
|
4788
4830
|
this.frequencyInfo = Object.assign(this.frequencyService?.frequencyInfo);
|
|
4789
4831
|
this.quarterlyArray = [...new Set(this.frequencyService.quarterlyMonth)];
|
|
4790
4832
|
const indexOfMonth = this.quarterlyGroup.indexOf(this.frequencyService.changeTimeZone(new Date())?.getMonth());
|
|
4791
|
-
this.selectedQuarterly =
|
|
4792
|
-
|
|
4793
|
-
|
|
4833
|
+
this.selectedQuarterly =
|
|
4834
|
+
indexOfMonth < 4 ? 0 : indexOfMonth > 3 && indexOfMonth < 8 ? 1 : 2;
|
|
4835
|
+
console.log('this.frequencyData ==>', this.frequencyData);
|
|
4836
|
+
if (this.frequencyData?.pattern != '' &&
|
|
4837
|
+
parseInt(this.frequencyData?.pattern?.split('~')[0]) === 7) {
|
|
4794
4838
|
this.populateFrequency();
|
|
4795
4839
|
}
|
|
4796
4840
|
this.getQuarterlyFrequency();
|
|
4797
4841
|
}
|
|
4798
4842
|
populateFrequency() {
|
|
4799
4843
|
const patternInfo = this.frequencyData?.pattern.split('~');
|
|
4800
|
-
console.log(
|
|
4844
|
+
console.log('patternInfo ==>', patternInfo);
|
|
4801
4845
|
const month = parseInt(patternInfo[2].split(',').map(Number)[0]);
|
|
4802
|
-
console.log(
|
|
4846
|
+
console.log('monte ', month);
|
|
4803
4847
|
const index = this.quarterlyGroup.indexOf(month - 1);
|
|
4804
4848
|
this.selectedQuarterly = index < 4 ? 0 : index > 3 && index < 8 ? 1 : 2;
|
|
4805
4849
|
// const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
|
|
@@ -4832,12 +4876,12 @@ class FrequencyDialogQuarterlyComponent {
|
|
|
4832
4876
|
this.getQuarterlyFrequency();
|
|
4833
4877
|
}
|
|
4834
4878
|
onTimeChanged(event) {
|
|
4835
|
-
console.log(
|
|
4879
|
+
console.log('time event =>', event);
|
|
4836
4880
|
this.quarterlyInterval = event;
|
|
4837
4881
|
this.getQuarterlyFrequency();
|
|
4838
4882
|
}
|
|
4839
4883
|
selectedMonth(event) {
|
|
4840
|
-
console.log(
|
|
4884
|
+
console.log('event ==>', event);
|
|
4841
4885
|
this.selectedQuarterly = parseInt(event.target.value);
|
|
4842
4886
|
this.getQuarterlyFrequency();
|
|
4843
4887
|
}
|
|
@@ -4860,10 +4904,13 @@ class FrequencyDialogQuarterlyComponent {
|
|
|
4860
4904
|
else {
|
|
4861
4905
|
this.startDate = Math.floor(event.startFrom);
|
|
4862
4906
|
}
|
|
4863
|
-
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
4907
|
+
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
4908
|
+
86400000);
|
|
4864
4909
|
console.log('end date', endByDate);
|
|
4865
4910
|
if (event.type === 0) {
|
|
4866
|
-
endByDate = event.endsBy
|
|
4911
|
+
endByDate = event.endsBy
|
|
4912
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
4913
|
+
: endByDate;
|
|
4867
4914
|
console.log('endByDate', endByDate);
|
|
4868
4915
|
}
|
|
4869
4916
|
this.frequencyInfo.failed_time_utc = endByDate;
|
|
@@ -4879,9 +4926,14 @@ class FrequencyDialogQuarterlyComponent {
|
|
|
4879
4926
|
this.getQuarterlyFrequency();
|
|
4880
4927
|
}
|
|
4881
4928
|
getQuarterlyFrequency() {
|
|
4882
|
-
let monthSequence = this.selectedQuarterly === 0
|
|
4929
|
+
let monthSequence = this.selectedQuarterly === 0
|
|
4930
|
+
? this.quarterlyGroup.slice(0, 4)
|
|
4931
|
+
: this.selectedQuarterly === 1
|
|
4932
|
+
? this.quarterlyGroup.slice(4, 8)
|
|
4933
|
+
: this.quarterlyGroup.slice(8);
|
|
4883
4934
|
monthSequence = monthSequence.map((ele) => ele + 1);
|
|
4884
|
-
this.frequencyInfo.pattern =
|
|
4935
|
+
this.frequencyInfo.pattern =
|
|
4936
|
+
7 + '~' + this.quarterlyInput + '~' + monthSequence + '~' + '0';
|
|
4885
4937
|
this.frequencyInfo.case = 'quarterly';
|
|
4886
4938
|
this.frequencyInfo.failedAfter = this.quarterlyFailed;
|
|
4887
4939
|
this.frequencyInfo.window = this.quarterlyWindow;
|
|
@@ -4892,33 +4944,65 @@ class FrequencyDialogQuarterlyComponent {
|
|
|
4892
4944
|
this.frequencyInfo.reportId = 0;
|
|
4893
4945
|
this.frequencyInfo.placeholder = this.getPlaceholder(Number(this.quarterlyInput));
|
|
4894
4946
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
4895
|
-
console.log(
|
|
4947
|
+
console.log(' this.frequencyInfo ==>', this.frequencyInfo);
|
|
4896
4948
|
}
|
|
4897
4949
|
getPlaceholder(quarterlyInput) {
|
|
4898
|
-
console.log(
|
|
4950
|
+
console.log(' this.placeholder ==>', quarterlyInput, quarterlyInput === 2, typeof quarterlyInput);
|
|
4899
4951
|
let placeholder = '';
|
|
4900
4952
|
if (quarterlyInput === 1) {
|
|
4901
|
-
placeholder =
|
|
4953
|
+
placeholder =
|
|
4954
|
+
'1st of every ' +
|
|
4955
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4956
|
+
' by ' +
|
|
4957
|
+
this.quarterlyInterval;
|
|
4902
4958
|
}
|
|
4903
4959
|
else if (quarterlyInput === 2) {
|
|
4904
|
-
placeholder =
|
|
4960
|
+
placeholder =
|
|
4961
|
+
'2nd of every ' +
|
|
4962
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4963
|
+
' by ' +
|
|
4964
|
+
this.quarterlyInterval;
|
|
4905
4965
|
}
|
|
4906
4966
|
else if (quarterlyInput === 3) {
|
|
4907
|
-
placeholder =
|
|
4967
|
+
placeholder =
|
|
4968
|
+
'3rd of every ' +
|
|
4969
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4970
|
+
' by ' +
|
|
4971
|
+
this.quarterlyInterval;
|
|
4908
4972
|
}
|
|
4909
4973
|
else if (quarterlyInput === 21 || quarterlyInput === 31) {
|
|
4910
|
-
placeholder =
|
|
4974
|
+
placeholder =
|
|
4975
|
+
quarterlyInput +
|
|
4976
|
+
'st of every ' +
|
|
4977
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4978
|
+
' by ' +
|
|
4979
|
+
this.quarterlyInterval;
|
|
4911
4980
|
}
|
|
4912
4981
|
else if (quarterlyInput === 22) {
|
|
4913
|
-
placeholder =
|
|
4982
|
+
placeholder =
|
|
4983
|
+
quarterlyInput +
|
|
4984
|
+
'nd of every ' +
|
|
4985
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4986
|
+
' by ' +
|
|
4987
|
+
this.quarterlyInterval;
|
|
4914
4988
|
}
|
|
4915
4989
|
else if (quarterlyInput === 23) {
|
|
4916
|
-
placeholder =
|
|
4990
|
+
placeholder =
|
|
4991
|
+
quarterlyInput +
|
|
4992
|
+
'rd of every ' +
|
|
4993
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
4994
|
+
' by ' +
|
|
4995
|
+
this.quarterlyInterval;
|
|
4917
4996
|
}
|
|
4918
4997
|
else if (quarterlyInput > 3) {
|
|
4919
|
-
placeholder =
|
|
4998
|
+
placeholder =
|
|
4999
|
+
quarterlyInput +
|
|
5000
|
+
'th of every ' +
|
|
5001
|
+
this.quarterlyArray[this.selectedQuarterly] +
|
|
5002
|
+
' by ' +
|
|
5003
|
+
this.quarterlyInterval;
|
|
4920
5004
|
}
|
|
4921
|
-
console.log(
|
|
5005
|
+
console.log(' this.placeholderede ==>', placeholder);
|
|
4922
5006
|
return placeholder;
|
|
4923
5007
|
}
|
|
4924
5008
|
}
|
|
@@ -4962,16 +5046,19 @@ class FrequencyDialogBiannualComponent {
|
|
|
4962
5046
|
ngOnInit() {
|
|
4963
5047
|
this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
|
|
4964
5048
|
this.monthNameArray = [...new Set(this.frequencyService.monthArray)];
|
|
4965
|
-
this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
|
|
4966
|
-
console.log(
|
|
4967
|
-
if (this.frequencyData?.pattern != '' &&
|
|
5049
|
+
this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
|
|
5050
|
+
console.log('this.frequencyData ==>', this.frequencyData);
|
|
5051
|
+
if (this.frequencyData?.pattern != '' &&
|
|
5052
|
+
parseInt(this.frequencyData?.pattern.split('~')[0]) === 9) {
|
|
4968
5053
|
this.populateFrequency();
|
|
4969
5054
|
}
|
|
4970
5055
|
this.getBiannualFrequency();
|
|
4971
5056
|
}
|
|
4972
5057
|
populateFrequency() {
|
|
4973
5058
|
const patternInfo = this.frequencyData?.pattern.split('~');
|
|
4974
|
-
this.biannualSelected = patternInfo[2]
|
|
5059
|
+
this.biannualSelected = patternInfo[2]
|
|
5060
|
+
.split(',')
|
|
5061
|
+
.map((ele) => Number(ele) - 1);
|
|
4975
5062
|
// const lifecycleInfo = this.frequencyData?.lifecycle.split('~~');
|
|
4976
5063
|
this.biannualInterval = this.frequencyData?.failedTime;
|
|
4977
5064
|
this.biannualWindow = this.frequencyData?.window;
|
|
@@ -4996,7 +5083,7 @@ class FrequencyDialogBiannualComponent {
|
|
|
4996
5083
|
// }
|
|
4997
5084
|
}
|
|
4998
5085
|
onMonthSelected(event) {
|
|
4999
|
-
console.log(
|
|
5086
|
+
console.log('event', event);
|
|
5000
5087
|
if (event.checked) {
|
|
5001
5088
|
this.biannualSelected.push(event.index);
|
|
5002
5089
|
}
|
|
@@ -5011,7 +5098,7 @@ class FrequencyDialogBiannualComponent {
|
|
|
5011
5098
|
this.getBiannualFrequency();
|
|
5012
5099
|
}
|
|
5013
5100
|
onTimeChanged(event) {
|
|
5014
|
-
console.log(
|
|
5101
|
+
console.log('time event =>', event);
|
|
5015
5102
|
this.biannualInterval = event;
|
|
5016
5103
|
this.getBiannualFrequency();
|
|
5017
5104
|
}
|
|
@@ -5038,18 +5125,21 @@ class FrequencyDialogBiannualComponent {
|
|
|
5038
5125
|
break;
|
|
5039
5126
|
}
|
|
5040
5127
|
if (event.startFrom.toString().length > 10) {
|
|
5041
|
-
console.log(
|
|
5128
|
+
console.log('start 1111');
|
|
5042
5129
|
this.startDate = Math.floor(event.startFrom / 1000);
|
|
5043
5130
|
}
|
|
5044
5131
|
else {
|
|
5045
|
-
console.log(
|
|
5132
|
+
console.log('start 11112222');
|
|
5046
5133
|
this.startDate = Math.floor(event.startFrom);
|
|
5047
5134
|
}
|
|
5048
|
-
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
5135
|
+
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
5136
|
+
86400000);
|
|
5049
5137
|
console.log('strat date ====>', this.startDate);
|
|
5050
5138
|
console.log('end date', endByDate);
|
|
5051
5139
|
if (event.type === 0) {
|
|
5052
|
-
endByDate = event.endsBy
|
|
5140
|
+
endByDate = event.endsBy
|
|
5141
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
5142
|
+
: endByDate;
|
|
5053
5143
|
console.log('endByDate', endByDate);
|
|
5054
5144
|
}
|
|
5055
5145
|
this.frequencyInfo.failed_time_utc = endByDate;
|
|
@@ -5058,7 +5148,8 @@ class FrequencyDialogBiannualComponent {
|
|
|
5058
5148
|
getBiannualFrequency() {
|
|
5059
5149
|
this.biannualSelected = this.biannualSelected.sort((n1, n2) => n1 - n2);
|
|
5060
5150
|
const monthIndex = this.biannualSelected.map((ele) => ele + 1);
|
|
5061
|
-
this.frequencyInfo.pattern =
|
|
5151
|
+
this.frequencyInfo.pattern =
|
|
5152
|
+
9 + '~' + this.biannualInput + '~' + monthIndex.join(',') + '~0';
|
|
5062
5153
|
this.frequencyInfo.case = 'biannual';
|
|
5063
5154
|
this.frequencyInfo.failedAfter = this.biannualFailed;
|
|
5064
5155
|
this.frequencyInfo.window = this.biannualWindow;
|
|
@@ -5069,7 +5160,7 @@ class FrequencyDialogBiannualComponent {
|
|
|
5069
5160
|
this.frequencyInfo.reportId = 0;
|
|
5070
5161
|
this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.biannualInput));
|
|
5071
5162
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
5072
|
-
console.log(
|
|
5163
|
+
console.log(' this.frequencyInfo ==>', this.frequencyInfo);
|
|
5073
5164
|
}
|
|
5074
5165
|
getFrequencyPlaceholder(biannualInput) {
|
|
5075
5166
|
let placeholder = '';
|
|
@@ -5077,25 +5168,57 @@ class FrequencyDialogBiannualComponent {
|
|
|
5077
5168
|
return this.shortMonth[ele];
|
|
5078
5169
|
});
|
|
5079
5170
|
if (biannualInput === 1) {
|
|
5080
|
-
placeholder =
|
|
5171
|
+
placeholder =
|
|
5172
|
+
'1st of every ' +
|
|
5173
|
+
selectedMonth.join(', ') +
|
|
5174
|
+
' by ' +
|
|
5175
|
+
this.biannualInterval;
|
|
5081
5176
|
}
|
|
5082
5177
|
else if (biannualInput === 2) {
|
|
5083
|
-
placeholder =
|
|
5178
|
+
placeholder =
|
|
5179
|
+
'2nd of every ' +
|
|
5180
|
+
selectedMonth.join(', ') +
|
|
5181
|
+
' by ' +
|
|
5182
|
+
this.biannualInterval;
|
|
5084
5183
|
}
|
|
5085
5184
|
else if (biannualInput === 3) {
|
|
5086
|
-
placeholder =
|
|
5185
|
+
placeholder =
|
|
5186
|
+
'3rd of every ' +
|
|
5187
|
+
selectedMonth.join(', ') +
|
|
5188
|
+
' by ' +
|
|
5189
|
+
this.biannualInterval;
|
|
5087
5190
|
}
|
|
5088
5191
|
else if (biannualInput === 21 || biannualInput === 31) {
|
|
5089
|
-
placeholder =
|
|
5192
|
+
placeholder =
|
|
5193
|
+
biannualInput +
|
|
5194
|
+
'st of every ' +
|
|
5195
|
+
selectedMonth.join(', ') +
|
|
5196
|
+
' by ' +
|
|
5197
|
+
this.biannualInterval;
|
|
5090
5198
|
}
|
|
5091
5199
|
else if (biannualInput === 22) {
|
|
5092
|
-
placeholder =
|
|
5200
|
+
placeholder =
|
|
5201
|
+
biannualInput +
|
|
5202
|
+
'nd of every ' +
|
|
5203
|
+
selectedMonth.join(', ') +
|
|
5204
|
+
' by ' +
|
|
5205
|
+
this.biannualInterval;
|
|
5093
5206
|
}
|
|
5094
5207
|
else if (biannualInput === 23) {
|
|
5095
|
-
placeholder =
|
|
5208
|
+
placeholder =
|
|
5209
|
+
biannualInput +
|
|
5210
|
+
'rd of every ' +
|
|
5211
|
+
selectedMonth.join(', ') +
|
|
5212
|
+
' by ' +
|
|
5213
|
+
this.biannualInterval;
|
|
5096
5214
|
}
|
|
5097
5215
|
else if (biannualInput > 3) {
|
|
5098
|
-
placeholder =
|
|
5216
|
+
placeholder =
|
|
5217
|
+
biannualInput +
|
|
5218
|
+
'th of every ' +
|
|
5219
|
+
selectedMonth.join(', ') +
|
|
5220
|
+
' by ' +
|
|
5221
|
+
this.biannualInterval;
|
|
5099
5222
|
}
|
|
5100
5223
|
return placeholder;
|
|
5101
5224
|
}
|
|
@@ -5139,8 +5262,9 @@ class FrequencyDialogAnnualComponent {
|
|
|
5139
5262
|
ngOnInit() {
|
|
5140
5263
|
this.monthList = this.frequencyService.monthArray;
|
|
5141
5264
|
this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
|
|
5142
|
-
this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
|
|
5143
|
-
if (this.frequencyData?.pattern != '' &&
|
|
5265
|
+
this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
|
|
5266
|
+
if (this.frequencyData?.pattern != '' &&
|
|
5267
|
+
parseInt(this.frequencyData?.pattern.split('~')[0]) === 4) {
|
|
5144
5268
|
this.populateFrequency();
|
|
5145
5269
|
}
|
|
5146
5270
|
this.getAnnualFrequency();
|
|
@@ -5158,7 +5282,8 @@ class FrequencyDialogAnnualComponent {
|
|
|
5158
5282
|
// }
|
|
5159
5283
|
this.yearlyLifecycleOccurance = Number(patternInfo[1]);
|
|
5160
5284
|
this.yearlyLifeCycleStart = new Date(this.frequencyData?.startDate * 1000);
|
|
5161
|
-
this.startDate =
|
|
5285
|
+
this.startDate =
|
|
5286
|
+
this.frequencyData?.startFrom ?? this.frequencyData?.startDate;
|
|
5162
5287
|
this.yearlyFailed = this.frequencyData?.failed;
|
|
5163
5288
|
// if( lifecycleInfo[0] !== '0000-00-00') {
|
|
5164
5289
|
// const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix()
|
|
@@ -5207,9 +5332,12 @@ class FrequencyDialogAnnualComponent {
|
|
|
5207
5332
|
else {
|
|
5208
5333
|
this.startDate = Math.floor(event.startFrom);
|
|
5209
5334
|
}
|
|
5210
|
-
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
5335
|
+
let endByDate = Math.floor(this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 +
|
|
5336
|
+
86400000);
|
|
5211
5337
|
if (event.type === 0) {
|
|
5212
|
-
endByDate = event.endsBy
|
|
5338
|
+
endByDate = event.endsBy
|
|
5339
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
5340
|
+
: endByDate;
|
|
5213
5341
|
}
|
|
5214
5342
|
this.frequencyInfo.failed_time_utc = endByDate;
|
|
5215
5343
|
this.getAnnualFrequency();
|
|
@@ -5226,7 +5354,14 @@ class FrequencyDialogAnnualComponent {
|
|
|
5226
5354
|
// frequency pattern and details info
|
|
5227
5355
|
getAnnualFrequency() {
|
|
5228
5356
|
this.frequencyInfo.placeholder = this.getFrequencyPlaceholder(Number(this.yearlyInput));
|
|
5229
|
-
this.frequencyInfo.pattern =
|
|
5357
|
+
this.frequencyInfo.pattern =
|
|
5358
|
+
4 +
|
|
5359
|
+
'~' +
|
|
5360
|
+
this.yearlyDay +
|
|
5361
|
+
'~' +
|
|
5362
|
+
(this.yearlySelected + 1) +
|
|
5363
|
+
'~' +
|
|
5364
|
+
this.yearlyInput;
|
|
5230
5365
|
this.frequencyInfo.case = 'yearly';
|
|
5231
5366
|
this.frequencyInfo.failedAfter = this.yearlyFailed;
|
|
5232
5367
|
this.frequencyInfo.window = this.yearlyWindow;
|
|
@@ -5235,7 +5370,7 @@ class FrequencyDialogAnnualComponent {
|
|
|
5235
5370
|
this.frequencyInfo.lifecycleDetails = this.lifecycleDetails;
|
|
5236
5371
|
this.frequencyInfo.startFrom = this.startDate;
|
|
5237
5372
|
this.frequencyInfo.reportId = 0;
|
|
5238
|
-
console.log(
|
|
5373
|
+
console.log(' this.frequencyInfo ==>', this.frequencyInfo);
|
|
5239
5374
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
5240
5375
|
}
|
|
5241
5376
|
getFrequencyPlaceholder(yearlyInput) {
|
|
@@ -5252,25 +5387,57 @@ class FrequencyDialogAnnualComponent {
|
|
|
5252
5387
|
getPlaceholderForSt2() {
|
|
5253
5388
|
let placeholder = '';
|
|
5254
5389
|
if (this.yearlyDay === 1) {
|
|
5255
|
-
placeholder =
|
|
5390
|
+
placeholder =
|
|
5391
|
+
'1st of every ' +
|
|
5392
|
+
this.shortMonth[this.yearlySelected] +
|
|
5393
|
+
' by ' +
|
|
5394
|
+
this.yearlyInterval;
|
|
5256
5395
|
}
|
|
5257
5396
|
if (this.yearlyDay === 2) {
|
|
5258
|
-
placeholder =
|
|
5397
|
+
placeholder =
|
|
5398
|
+
'2nd of every ' +
|
|
5399
|
+
this.shortMonth[this.yearlySelected] +
|
|
5400
|
+
' by ' +
|
|
5401
|
+
this.yearlyInterval;
|
|
5259
5402
|
}
|
|
5260
5403
|
if (this.yearlyDay === 3) {
|
|
5261
|
-
placeholder =
|
|
5404
|
+
placeholder =
|
|
5405
|
+
'3rd of every ' +
|
|
5406
|
+
this.shortMonth[this.yearlySelected] +
|
|
5407
|
+
' by ' +
|
|
5408
|
+
this.yearlyInterval;
|
|
5262
5409
|
}
|
|
5263
5410
|
if (this.yearlyDay > 3) {
|
|
5264
|
-
placeholder =
|
|
5411
|
+
placeholder =
|
|
5412
|
+
this.yearlyDay +
|
|
5413
|
+
'th of every ' +
|
|
5414
|
+
this.shortMonth[this.yearlySelected] +
|
|
5415
|
+
' by ' +
|
|
5416
|
+
this.yearlyInterval;
|
|
5265
5417
|
}
|
|
5266
5418
|
if (this.yearlyDay === 31 || this.yearlyDay === 21) {
|
|
5267
|
-
placeholder =
|
|
5419
|
+
placeholder =
|
|
5420
|
+
this.yearlyDay +
|
|
5421
|
+
'st of every ' +
|
|
5422
|
+
this.shortMonth[this.yearlySelected] +
|
|
5423
|
+
' by ' +
|
|
5424
|
+
this.yearlyInterval;
|
|
5268
5425
|
}
|
|
5269
5426
|
if (this.yearlyDay === 22) {
|
|
5270
|
-
placeholder =
|
|
5427
|
+
placeholder =
|
|
5428
|
+
this.yearlyDay +
|
|
5429
|
+
'nd of every ' +
|
|
5430
|
+
this.shortMonth[this.yearlySelected] +
|
|
5431
|
+
' by ' +
|
|
5432
|
+
this.yearlyInterval;
|
|
5271
5433
|
}
|
|
5272
5434
|
if (this.yearlyDay === 23) {
|
|
5273
|
-
placeholder =
|
|
5435
|
+
placeholder =
|
|
5436
|
+
this.yearlyDay +
|
|
5437
|
+
'rd of every ' +
|
|
5438
|
+
this.shortMonth[this.yearlySelected] +
|
|
5439
|
+
' by ' +
|
|
5440
|
+
this.yearlyInterval;
|
|
5274
5441
|
}
|
|
5275
5442
|
return placeholder;
|
|
5276
5443
|
}
|
|
@@ -5278,25 +5445,71 @@ class FrequencyDialogAnnualComponent {
|
|
|
5278
5445
|
getPlaceholderForGt1() {
|
|
5279
5446
|
let placeholder = '';
|
|
5280
5447
|
if (this.yearlyDay === 1) {
|
|
5281
|
-
placeholder =
|
|
5448
|
+
placeholder =
|
|
5449
|
+
'1st of ' +
|
|
5450
|
+
this.shortMonth[this.yearlySelected] +
|
|
5451
|
+
', Interval: every ' +
|
|
5452
|
+
this.yearlyInput +
|
|
5453
|
+
' years by ' +
|
|
5454
|
+
this.yearlyInterval;
|
|
5282
5455
|
}
|
|
5283
5456
|
if (this.yearlyDay === 2) {
|
|
5284
|
-
placeholder =
|
|
5457
|
+
placeholder =
|
|
5458
|
+
'2nd of ' +
|
|
5459
|
+
this.shortMonth[this.yearlySelected] +
|
|
5460
|
+
', Interval: every ' +
|
|
5461
|
+
this.yearlyInput +
|
|
5462
|
+
' years by ' +
|
|
5463
|
+
this.yearlyInterval;
|
|
5285
5464
|
}
|
|
5286
5465
|
if (this.yearlyDay === 3) {
|
|
5287
|
-
placeholder =
|
|
5466
|
+
placeholder =
|
|
5467
|
+
'3rd of ' +
|
|
5468
|
+
this.shortMonth[this.yearlySelected] +
|
|
5469
|
+
', Interval: every ' +
|
|
5470
|
+
this.yearlyInput +
|
|
5471
|
+
' years by ' +
|
|
5472
|
+
this.yearlyInterval;
|
|
5288
5473
|
}
|
|
5289
5474
|
if (this.yearlyDay > 3) {
|
|
5290
|
-
placeholder =
|
|
5475
|
+
placeholder =
|
|
5476
|
+
this.yearlyDay +
|
|
5477
|
+
'th of ' +
|
|
5478
|
+
this.shortMonth[this.yearlySelected] +
|
|
5479
|
+
', Interval: every ' +
|
|
5480
|
+
this.yearlyInput +
|
|
5481
|
+
' years by ' +
|
|
5482
|
+
this.yearlyInterval;
|
|
5291
5483
|
}
|
|
5292
5484
|
if (this.yearlyDay === 31 || this.yearlyDay === 21) {
|
|
5293
|
-
placeholder =
|
|
5485
|
+
placeholder =
|
|
5486
|
+
this.yearlyDay +
|
|
5487
|
+
'st of ' +
|
|
5488
|
+
this.shortMonth[this.yearlySelected] +
|
|
5489
|
+
', Interval: every ' +
|
|
5490
|
+
this.yearlyInput +
|
|
5491
|
+
' years by ' +
|
|
5492
|
+
this.yearlyInterval;
|
|
5294
5493
|
}
|
|
5295
5494
|
if (this.yearlyDay === 22) {
|
|
5296
|
-
placeholder =
|
|
5495
|
+
placeholder =
|
|
5496
|
+
this.yearlyDay +
|
|
5497
|
+
'nd of ' +
|
|
5498
|
+
this.shortMonth[this.yearlySelected] +
|
|
5499
|
+
', Interval: every ' +
|
|
5500
|
+
this.yearlyInput +
|
|
5501
|
+
' years by ' +
|
|
5502
|
+
this.yearlyInterval;
|
|
5297
5503
|
}
|
|
5298
5504
|
if (this.yearlyDay === 23) {
|
|
5299
|
-
placeholder =
|
|
5505
|
+
placeholder =
|
|
5506
|
+
this.yearlyDay +
|
|
5507
|
+
'rd of ' +
|
|
5508
|
+
this.shortMonth[this.yearlySelected] +
|
|
5509
|
+
', Interval: every ' +
|
|
5510
|
+
this.yearlyInput +
|
|
5511
|
+
' years by ' +
|
|
5512
|
+
this.yearlyInterval;
|
|
5300
5513
|
}
|
|
5301
5514
|
return placeholder;
|
|
5302
5515
|
}
|
|
@@ -5328,19 +5541,23 @@ class FrequencyDialogOneTimeComponent {
|
|
|
5328
5541
|
this.todayDate = this.frequencyService.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1));
|
|
5329
5542
|
this.shortMonth = [];
|
|
5330
5543
|
this.dateObjectData = this.frequencyService.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1));
|
|
5331
|
-
this.minDate = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
5544
|
+
this.minDate = moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
5332
5545
|
this.mode = '';
|
|
5333
5546
|
this.frequencyDetails = new EventEmitter();
|
|
5334
5547
|
}
|
|
5335
5548
|
ngOnInit() {
|
|
5336
5549
|
this.dateConfig = this.frequencyService.dateConfig;
|
|
5337
|
-
this.dateConfig['min'] = this.frequencyService
|
|
5550
|
+
this.dateConfig['min'] = this.frequencyService
|
|
5551
|
+
.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1))
|
|
5552
|
+
?.getDate()
|
|
5553
|
+
?.toString();
|
|
5338
5554
|
this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
|
|
5339
|
-
this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
|
|
5340
|
-
this.selectedDate = moment(this.todayDate);
|
|
5341
|
-
console.log(
|
|
5342
|
-
console.log(
|
|
5343
|
-
if (this.frequencyData?.pattern != '' &&
|
|
5555
|
+
this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
|
|
5556
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
5557
|
+
console.log('this.dateConfig ', this.dateConfig, this.todayDate);
|
|
5558
|
+
console.log('this.frequencyData ==>', this.frequencyData, this.frequencyData?.pattern.split('~'));
|
|
5559
|
+
if (this.frequencyData?.pattern != '' &&
|
|
5560
|
+
this.frequencyData?.pattern.split('~')[0] === '0') {
|
|
5344
5561
|
this.populateFrequency();
|
|
5345
5562
|
}
|
|
5346
5563
|
else {
|
|
@@ -5349,20 +5566,21 @@ class FrequencyDialogOneTimeComponent {
|
|
|
5349
5566
|
}
|
|
5350
5567
|
populateFrequency() {
|
|
5351
5568
|
const patternInfo = this.frequencyData?.pattern.split('~');
|
|
5352
|
-
console.log(
|
|
5353
|
-
const timeStamp = moment(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData?.failedTime}`,
|
|
5354
|
-
console.log(
|
|
5569
|
+
console.log('patternInfo ==>', patternInfo);
|
|
5570
|
+
const timeStamp = moment$1(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData?.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
5571
|
+
console.log('timeStamp -->', timeStamp);
|
|
5355
5572
|
this.todayDate = new Date(timeStamp * 1000);
|
|
5356
|
-
this.selectedDate = moment(this.todayDate);
|
|
5573
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
5357
5574
|
this.oneTimeFailed = this.frequencyData?.failed;
|
|
5358
5575
|
this.oneTimeWindow = this.frequencyData?.window;
|
|
5359
5576
|
this.oneTimeStartTime = this.frequencyData?.failedTime;
|
|
5360
|
-
this.oneTimeSelected =
|
|
5361
|
-
|
|
5577
|
+
this.oneTimeSelected =
|
|
5578
|
+
patternInfo[1] + '~' + patternInfo[2] + '~' + patternInfo[3];
|
|
5579
|
+
this.dateObjectData = new Date(moment$1(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
|
|
5362
5580
|
this.getOneTimeFrequency();
|
|
5363
5581
|
}
|
|
5364
5582
|
openDatePicker() {
|
|
5365
|
-
const newDate = moment(this.todayDate);
|
|
5583
|
+
const newDate = moment$1(this.todayDate);
|
|
5366
5584
|
this.datePicker?.api?.moveCalendarTo(newDate);
|
|
5367
5585
|
this.datePicker?.api?.open();
|
|
5368
5586
|
this.datepickerOverlay = true;
|
|
@@ -5382,41 +5600,79 @@ class FrequencyDialogOneTimeComponent {
|
|
|
5382
5600
|
this.getOneTimeFrequency();
|
|
5383
5601
|
}
|
|
5384
5602
|
onTimeChanged(event) {
|
|
5385
|
-
console.log(
|
|
5603
|
+
console.log('event sring', event);
|
|
5386
5604
|
console.log(this.dateObjectData);
|
|
5387
5605
|
this.oneTimeStartTime = event;
|
|
5388
5606
|
if (typeof this.dateObjectData == 'object') {
|
|
5389
|
-
this.dateObjectData = moment(this.dateObjectData).toDate();
|
|
5607
|
+
this.dateObjectData = moment$1(this.dateObjectData).toDate();
|
|
5390
5608
|
}
|
|
5391
5609
|
console.log(this.dateObjectData);
|
|
5392
|
-
let timeStamp = moment(this.dateObjectData.getDate() +
|
|
5393
|
-
|
|
5610
|
+
let timeStamp = moment$1(this.dateObjectData.getDate() +
|
|
5611
|
+
'-' +
|
|
5612
|
+
(this.dateObjectData.getMonth() + 1) +
|
|
5613
|
+
'-' +
|
|
5614
|
+
this.dateObjectData.getFullYear() +
|
|
5615
|
+
' ' +
|
|
5616
|
+
this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
|
|
5617
|
+
this.oneTimeSelected = moment$1(timeStamp * 1000)
|
|
5618
|
+
.format('YYYY~MM~DDTHH:mm:ssZ')
|
|
5619
|
+
.split('T')[0];
|
|
5394
5620
|
console.log('timeStamp', timeStamp, this.oneTimeSelected);
|
|
5395
5621
|
this.getOneTimeFrequency();
|
|
5396
5622
|
}
|
|
5397
5623
|
dateChange(event) {
|
|
5398
5624
|
this.selectedDate = event.date;
|
|
5399
|
-
const newDate = moment(event.date).unix();
|
|
5625
|
+
const newDate = moment$1(event.date).unix();
|
|
5400
5626
|
this.dateObjectData = new Date(newDate * 1000);
|
|
5401
5627
|
this.todayDate = this.dateObjectData;
|
|
5402
|
-
let timeStamp = moment(this.dateObjectData.getDate() +
|
|
5628
|
+
let timeStamp = moment$1(this.dateObjectData.getDate() +
|
|
5629
|
+
'-' +
|
|
5630
|
+
(this.dateObjectData.getMonth() + 1) +
|
|
5631
|
+
'-' +
|
|
5632
|
+
this.dateObjectData.getFullYear() +
|
|
5633
|
+
' ' +
|
|
5634
|
+
this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
|
|
5403
5635
|
// tslint:disable-next-line: no-console
|
|
5404
5636
|
console.log('timeStamp', timeStamp, Date.now() / 1000, Date.now() / 1000 > timeStamp);
|
|
5405
|
-
this.oneTimeSelected = event.date
|
|
5637
|
+
this.oneTimeSelected = event.date
|
|
5638
|
+
.format('YYYY~MM~DDTHH:mm:ssZ')
|
|
5639
|
+
.split('T')[0];
|
|
5406
5640
|
// tslint:disable-next-line: no-console
|
|
5407
5641
|
console.log(event.date.format('YYYY~MM~DDTHH:mm:ssZ'));
|
|
5408
5642
|
this.getOneTimeFrequency();
|
|
5409
5643
|
}
|
|
5410
5644
|
getOneTimeFrequency() {
|
|
5411
5645
|
if (this.oneTimeSelected !== '') {
|
|
5412
|
-
this.todayDate = moment(this.todayDate).toDate();
|
|
5646
|
+
this.todayDate = moment$1(this.todayDate).toDate();
|
|
5413
5647
|
}
|
|
5414
|
-
this.selectedDate = moment(this.todayDate);
|
|
5648
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
5415
5649
|
// tslint:disable-next-line: max-line-length
|
|
5416
5650
|
this.frequencyInfo.placeholder =
|
|
5417
|
-
'One Time ' +
|
|
5651
|
+
'One Time ' +
|
|
5652
|
+
this.todayDate.getDate() +
|
|
5653
|
+
' ' +
|
|
5654
|
+
this.shortMonth[this.todayDate.getMonth()] +
|
|
5655
|
+
' ' +
|
|
5656
|
+
this.todayDate.getFullYear() +
|
|
5657
|
+
' by ' +
|
|
5658
|
+
this.oneTimeStartTime;
|
|
5418
5659
|
this.frequencyInfo.pattern =
|
|
5419
|
-
0 +
|
|
5660
|
+
0 +
|
|
5661
|
+
'~' +
|
|
5662
|
+
(this.oneTimeSelected === ''
|
|
5663
|
+
? this.frequencyService
|
|
5664
|
+
.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1))
|
|
5665
|
+
?.getFullYear() +
|
|
5666
|
+
'~' +
|
|
5667
|
+
(this.frequencyService
|
|
5668
|
+
.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1))
|
|
5669
|
+
?.getMonth() +
|
|
5670
|
+
1) +
|
|
5671
|
+
'~' +
|
|
5672
|
+
this.frequencyService
|
|
5673
|
+
.changeTimeZone(new Date()?.setDate(new Date()?.getDate() + 1))
|
|
5674
|
+
?.getDate()
|
|
5675
|
+
: this.oneTimeSelected);
|
|
5420
5676
|
this.frequencyInfo.case = 'oneTime';
|
|
5421
5677
|
this.frequencyInfo.failedAfter = this.oneTimeFailed;
|
|
5422
5678
|
this.frequencyInfo.window = this.oneTimeWindow;
|
|
@@ -5425,7 +5681,7 @@ class FrequencyDialogOneTimeComponent {
|
|
|
5425
5681
|
this.frequencyInfo.failed_time_utc = 0;
|
|
5426
5682
|
this.frequencyInfo.reportId = 0;
|
|
5427
5683
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
5428
|
-
console.log(
|
|
5684
|
+
console.log(' this.frequencyInfo ==>', this.frequencyInfo);
|
|
5429
5685
|
}
|
|
5430
5686
|
}
|
|
5431
5687
|
FrequencyDialogOneTimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FrequencyDialogOneTimeComponent, deps: [{ token: FrequencyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -5474,39 +5730,39 @@ class FrequencyDialogContainerComponent {
|
|
|
5474
5730
|
},
|
|
5475
5731
|
{
|
|
5476
5732
|
name: 'Weekly',
|
|
5477
|
-
type: 'weekly'
|
|
5733
|
+
type: 'weekly',
|
|
5478
5734
|
},
|
|
5479
5735
|
{
|
|
5480
5736
|
name: 'Monthly',
|
|
5481
|
-
type: 'monthly'
|
|
5737
|
+
type: 'monthly',
|
|
5482
5738
|
},
|
|
5483
5739
|
{
|
|
5484
5740
|
name: 'Quarterly',
|
|
5485
|
-
type: 'quarterly'
|
|
5741
|
+
type: 'quarterly',
|
|
5486
5742
|
},
|
|
5487
5743
|
{
|
|
5488
5744
|
name: 'Biannual',
|
|
5489
|
-
type: 'biannual'
|
|
5745
|
+
type: 'biannual',
|
|
5490
5746
|
},
|
|
5491
5747
|
{
|
|
5492
5748
|
name: 'Annual',
|
|
5493
|
-
type: 'annual'
|
|
5749
|
+
type: 'annual',
|
|
5494
5750
|
},
|
|
5495
5751
|
{
|
|
5496
5752
|
name: 'One Time',
|
|
5497
|
-
type: 'oneTime'
|
|
5753
|
+
type: 'oneTime',
|
|
5498
5754
|
},
|
|
5499
5755
|
{
|
|
5500
5756
|
name: 'Random',
|
|
5501
|
-
type: 'random'
|
|
5757
|
+
type: 'random',
|
|
5502
5758
|
},
|
|
5503
5759
|
{
|
|
5504
5760
|
name: 'On Completion Of',
|
|
5505
|
-
type: 'onCompletionOf'
|
|
5761
|
+
type: 'onCompletionOf',
|
|
5506
5762
|
},
|
|
5507
5763
|
{
|
|
5508
5764
|
name: 'Ongoing',
|
|
5509
|
-
type: 'ongoing'
|
|
5765
|
+
type: 'ongoing',
|
|
5510
5766
|
},
|
|
5511
5767
|
];
|
|
5512
5768
|
}
|
|
@@ -5514,7 +5770,7 @@ class FrequencyDialogContainerComponent {
|
|
|
5514
5770
|
this.frequencyDetails['pattern'] = frequency?.frequency;
|
|
5515
5771
|
this.frequencyDetails['window'] = frequency?.remind_before_days;
|
|
5516
5772
|
this.frequencyDetails['failedTime'] = frequency?.frequency_time;
|
|
5517
|
-
console.log(
|
|
5773
|
+
console.log('frequencyDetailsfrequencyDetailsfrequencyDetails', this.frequencyDetails);
|
|
5518
5774
|
}
|
|
5519
5775
|
ngOnInit() {
|
|
5520
5776
|
if (this.frequencyDetails?.pattern != '') {
|
|
@@ -5529,7 +5785,7 @@ class FrequencyDialogContainerComponent {
|
|
|
5529
5785
|
this.closeFrequency.emit();
|
|
5530
5786
|
}
|
|
5531
5787
|
onFrequencySelected(event) {
|
|
5532
|
-
console.log(
|
|
5788
|
+
console.log('event.....', event);
|
|
5533
5789
|
this.frequencyData = event;
|
|
5534
5790
|
this.isNextDisabled = this.isInvalid();
|
|
5535
5791
|
}
|
|
@@ -5538,48 +5794,48 @@ class FrequencyDialogContainerComponent {
|
|
|
5538
5794
|
switch (frequencyPattern) {
|
|
5539
5795
|
case 0:
|
|
5540
5796
|
this.frequencyTab = 'oneTime';
|
|
5541
|
-
this.currentTabName =
|
|
5797
|
+
this.currentTabName = 'a one time';
|
|
5542
5798
|
break;
|
|
5543
5799
|
case 1:
|
|
5544
5800
|
this.frequencyTab = 'daily';
|
|
5545
|
-
this.currentTabName =
|
|
5801
|
+
this.currentTabName = 'a daily';
|
|
5546
5802
|
break;
|
|
5547
5803
|
case 2:
|
|
5548
5804
|
this.frequencyTab = 'weekly';
|
|
5549
|
-
this.currentTabName =
|
|
5805
|
+
this.currentTabName = 'a weekly';
|
|
5550
5806
|
break;
|
|
5551
5807
|
case 3:
|
|
5552
5808
|
this.frequencyTab = 'monthly';
|
|
5553
|
-
this.currentTabName =
|
|
5809
|
+
this.currentTabName = 'a monthly';
|
|
5554
5810
|
break;
|
|
5555
5811
|
case 4:
|
|
5556
5812
|
this.frequencyTab = 'annual';
|
|
5557
|
-
this.currentTabName =
|
|
5813
|
+
this.currentTabName = 'an annual ';
|
|
5558
5814
|
break;
|
|
5559
5815
|
case 5:
|
|
5560
5816
|
this.frequencyTab = 'daily';
|
|
5561
|
-
this.currentTabName =
|
|
5817
|
+
this.currentTabName = 'a daily';
|
|
5562
5818
|
break;
|
|
5563
5819
|
case 6:
|
|
5564
5820
|
this.frequencyTab = 'onCompletionOf';
|
|
5565
|
-
this.currentTabName =
|
|
5821
|
+
this.currentTabName = 'an on completion of';
|
|
5566
5822
|
this.frequencyData.report_id = this.frequencyDetails.selectedReport;
|
|
5567
5823
|
break;
|
|
5568
5824
|
case 7:
|
|
5569
5825
|
this.frequencyTab = 'quarterly';
|
|
5570
|
-
this.currentTabName =
|
|
5826
|
+
this.currentTabName = 'a quarterly';
|
|
5571
5827
|
break;
|
|
5572
5828
|
case 8:
|
|
5573
5829
|
this.frequencyTab = 'random';
|
|
5574
|
-
this.currentTabName =
|
|
5830
|
+
this.currentTabName = 'a random';
|
|
5575
5831
|
break;
|
|
5576
5832
|
case 9:
|
|
5577
5833
|
this.frequencyTab = 'biannual';
|
|
5578
|
-
this.currentTabName =
|
|
5834
|
+
this.currentTabName = 'a biannual';
|
|
5579
5835
|
break;
|
|
5580
5836
|
case 10:
|
|
5581
5837
|
this.frequencyTab = 'ongoing';
|
|
5582
|
-
this.currentTabName =
|
|
5838
|
+
this.currentTabName = 'an ongoing';
|
|
5583
5839
|
break;
|
|
5584
5840
|
}
|
|
5585
5841
|
this.isNextDisabled = false;
|
|
@@ -5590,7 +5846,10 @@ class FrequencyDialogContainerComponent {
|
|
|
5590
5846
|
this.currentTabName = 'a one time';
|
|
5591
5847
|
}
|
|
5592
5848
|
else {
|
|
5593
|
-
this.currentTabName =
|
|
5849
|
+
this.currentTabName =
|
|
5850
|
+
frequency.startsWith('On') || frequency.toLowerCase() === 'annual'
|
|
5851
|
+
? 'an ' + frequency
|
|
5852
|
+
: 'a ' + frequency;
|
|
5594
5853
|
}
|
|
5595
5854
|
}
|
|
5596
5855
|
isInvalid() {
|
|
@@ -5606,7 +5865,6 @@ class FrequencyDialogContainerComponent {
|
|
|
5606
5865
|
isInvalid = false;
|
|
5607
5866
|
this.isNextDisabled = false;
|
|
5608
5867
|
}
|
|
5609
|
-
;
|
|
5610
5868
|
break;
|
|
5611
5869
|
case 'weekly':
|
|
5612
5870
|
if (this.frequencyData.continuous_failed_days < 2) {
|
|
@@ -5618,14 +5876,14 @@ class FrequencyDialogContainerComponent {
|
|
|
5618
5876
|
isInvalid = false;
|
|
5619
5877
|
this.isNextDisabled = false;
|
|
5620
5878
|
}
|
|
5621
|
-
|
|
5622
|
-
|
|
5879
|
+
if (frequencyDetails[1] == '' ||
|
|
5880
|
+
!frequencyDetails[1] ||
|
|
5881
|
+
frequencyDetails.length < 4) {
|
|
5623
5882
|
isInvalid = true;
|
|
5624
5883
|
}
|
|
5625
5884
|
else {
|
|
5626
5885
|
isInvalid = false;
|
|
5627
5886
|
}
|
|
5628
|
-
;
|
|
5629
5887
|
break;
|
|
5630
5888
|
case 'monthly':
|
|
5631
5889
|
if (this.frequencyData.continuous_failed_days < 2) {
|
|
@@ -5637,17 +5895,19 @@ class FrequencyDialogContainerComponent {
|
|
|
5637
5895
|
isInvalid = false;
|
|
5638
5896
|
this.isNextDisabled = false;
|
|
5639
5897
|
}
|
|
5640
|
-
|
|
5641
|
-
|
|
5898
|
+
if (frequencyDetails[2] == '' ||
|
|
5899
|
+
!frequencyDetails[2] ||
|
|
5900
|
+
frequencyDetails.length < 4) {
|
|
5642
5901
|
isInvalid = true;
|
|
5643
5902
|
}
|
|
5644
5903
|
else {
|
|
5645
5904
|
isInvalid = false;
|
|
5646
5905
|
}
|
|
5647
|
-
;
|
|
5648
5906
|
break;
|
|
5649
5907
|
case 'biannual':
|
|
5650
|
-
if (frequencyDetails.length === 0 ||
|
|
5908
|
+
if (frequencyDetails.length === 0 ||
|
|
5909
|
+
frequencyDetails[2] === '' ||
|
|
5910
|
+
frequencyDetails[2].split(',')?.length < 2) {
|
|
5651
5911
|
isInvalid = true;
|
|
5652
5912
|
}
|
|
5653
5913
|
else {
|
|
@@ -5656,8 +5916,9 @@ class FrequencyDialogContainerComponent {
|
|
|
5656
5916
|
break;
|
|
5657
5917
|
case 'oneTime':
|
|
5658
5918
|
if (frequencyDetails?.length > 0) {
|
|
5659
|
-
const selectedTime = moment(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
5660
|
-
if (this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 >
|
|
5919
|
+
const selectedTime = moment$1(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
5920
|
+
if (this.frequencyService.changeTimeZone(new Date())?.getTime() / 1000 >
|
|
5921
|
+
selectedTime) {
|
|
5661
5922
|
this.snackbar.show('Please set a future date.', 'alert');
|
|
5662
5923
|
isInvalid = true;
|
|
5663
5924
|
break;
|
|
@@ -5680,27 +5941,32 @@ class FrequencyDialogContainerComponent {
|
|
|
5680
5941
|
}
|
|
5681
5942
|
break;
|
|
5682
5943
|
case 'random':
|
|
5683
|
-
if (parseInt(frequencyDetails[1]) == 2 &&
|
|
5944
|
+
if (parseInt(frequencyDetails[1]) == 2 &&
|
|
5945
|
+
(frequencyDetails[2] == '' ||
|
|
5946
|
+
!frequencyDetails[2] ||
|
|
5947
|
+
frequencyDetails.length < 4)) {
|
|
5684
5948
|
isInvalid = true;
|
|
5685
5949
|
}
|
|
5686
5950
|
else {
|
|
5687
5951
|
isInvalid = false;
|
|
5688
5952
|
}
|
|
5689
|
-
;
|
|
5690
5953
|
break;
|
|
5691
|
-
default:
|
|
5954
|
+
default:
|
|
5955
|
+
isInvalid = false;
|
|
5692
5956
|
}
|
|
5693
5957
|
return isInvalid;
|
|
5694
5958
|
}
|
|
5695
5959
|
save() {
|
|
5696
5960
|
let frequency_details = {
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5961
|
+
frequency: this.frequencyData?.pattern,
|
|
5962
|
+
started_at: this.frequencyService?.changeTimeZone(new Date())
|
|
5963
|
+
? moment$1(this.frequencyService?.changeTimeZone(new Date()))?.format('YYYY-MM-DD')
|
|
5964
|
+
: moment$1().format('YYYY-MM-DD'),
|
|
5965
|
+
frequency_time: this.frequencyData?.timeIn12hr,
|
|
5966
|
+
remind_before_days: this.frequencyData?.window,
|
|
5967
|
+
placeholder: this.frequencyData?.placeholder,
|
|
5702
5968
|
};
|
|
5703
|
-
console.log(
|
|
5969
|
+
console.log('frequency_detailsfrequency_details', frequency_details);
|
|
5704
5970
|
this.selectedFrequency.emit(frequency_details);
|
|
5705
5971
|
this.closeFrequency.emit();
|
|
5706
5972
|
}
|
|
@@ -5754,7 +6020,13 @@ class WorkflowRiskComponent {
|
|
|
5754
6020
|
{ buttonText: 'Add More Risks', class: 'white-btn', id: 'addMore' },
|
|
5755
6021
|
{ buttonText: 'View Risk', class: 'blue-btn', id: 'viewRisks' },
|
|
5756
6022
|
];
|
|
5757
|
-
this.sideSelectorElements = [
|
|
6023
|
+
this.sideSelectorElements = [
|
|
6024
|
+
'rc',
|
|
6025
|
+
'owner',
|
|
6026
|
+
'overseer',
|
|
6027
|
+
'category',
|
|
6028
|
+
'frequency',
|
|
6029
|
+
];
|
|
5758
6030
|
this.showSmiley = false;
|
|
5759
6031
|
this.mode = 'EDIT';
|
|
5760
6032
|
this.riskId = '';
|
|
@@ -5773,19 +6045,19 @@ class WorkflowRiskComponent {
|
|
|
5773
6045
|
this.categoryList = {
|
|
5774
6046
|
strategic: {
|
|
5775
6047
|
name: 'STRATEGIC',
|
|
5776
|
-
data: []
|
|
6048
|
+
data: [],
|
|
5777
6049
|
},
|
|
5778
6050
|
operational: {
|
|
5779
6051
|
name: 'OPERATIONAL',
|
|
5780
|
-
data: []
|
|
6052
|
+
data: [],
|
|
5781
6053
|
},
|
|
5782
6054
|
compliance: {
|
|
5783
6055
|
name: 'COMPLIANCE',
|
|
5784
|
-
data: []
|
|
6056
|
+
data: [],
|
|
5785
6057
|
},
|
|
5786
6058
|
others: {
|
|
5787
6059
|
name: 'OTHERS',
|
|
5788
|
-
data: []
|
|
6060
|
+
data: [],
|
|
5789
6061
|
},
|
|
5790
6062
|
};
|
|
5791
6063
|
this.overseersList = [];
|
|
@@ -5817,10 +6089,10 @@ class WorkflowRiskComponent {
|
|
|
5817
6089
|
addMitigationPlan: false,
|
|
5818
6090
|
mitigationDescriptionPlan: '',
|
|
5819
6091
|
frequency_details: {
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
6092
|
+
frequency: '',
|
|
6093
|
+
started_at: '',
|
|
6094
|
+
frequency_time: '',
|
|
6095
|
+
remind_before_days: 0,
|
|
5824
6096
|
},
|
|
5825
6097
|
addRiskLabel: false,
|
|
5826
6098
|
riskLabelValue: 1,
|
|
@@ -5840,10 +6112,10 @@ class WorkflowRiskComponent {
|
|
|
5840
6112
|
// annual: 4~28~9~3
|
|
5841
6113
|
// oneTime: 0~2022~12~28
|
|
5842
6114
|
this.frequencyDetails = {
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
6115
|
+
frequency: '',
|
|
6116
|
+
started_at: '',
|
|
6117
|
+
frequency_time: '',
|
|
6118
|
+
remind_before_days: 0,
|
|
5847
6119
|
};
|
|
5848
6120
|
this.frequencyPlaceholder = 'Set a Reassessment Frequency';
|
|
5849
6121
|
this.shortMonth = [];
|
|
@@ -5856,7 +6128,7 @@ class WorkflowRiskComponent {
|
|
|
5856
6128
|
/* Creating an array for risk label with it's value. */
|
|
5857
6129
|
this.riskLabelList = [
|
|
5858
6130
|
{ name: 'Newly Identified Risk', value: 1 },
|
|
5859
|
-
{ name: 'Rapidly Changing Risk', value: 2 }
|
|
6131
|
+
{ name: 'Rapidly Changing Risk', value: 2 },
|
|
5860
6132
|
];
|
|
5861
6133
|
this.description = {
|
|
5862
6134
|
mode: 'prime',
|
|
@@ -5868,7 +6140,7 @@ class WorkflowRiskComponent {
|
|
|
5868
6140
|
mode: 'prime',
|
|
5869
6141
|
colorPalette: true,
|
|
5870
6142
|
link: true,
|
|
5871
|
-
placeholder: 'Describe the recommended mitigation plans'
|
|
6143
|
+
placeholder: 'Describe the recommended mitigation plans',
|
|
5872
6144
|
};
|
|
5873
6145
|
// if (config) {
|
|
5874
6146
|
// this.apiUrl = config.apiUrl;
|
|
@@ -5876,7 +6148,7 @@ class WorkflowRiskComponent {
|
|
|
5876
6148
|
this.timezone = this.authService.getUserTimeZone();
|
|
5877
6149
|
}
|
|
5878
6150
|
ngOnInit() {
|
|
5879
|
-
this.featureflag_groups = this.feature.isFeatureEnabled(
|
|
6151
|
+
this.featureflag_groups = this.feature.isFeatureEnabled('ff_risk_groups');
|
|
5880
6152
|
this.pickerChanged.emit(false);
|
|
5881
6153
|
this.loader = true;
|
|
5882
6154
|
this.uiKitService.isLoader = true;
|
|
@@ -5888,12 +6160,12 @@ class WorkflowRiskComponent {
|
|
|
5888
6160
|
}
|
|
5889
6161
|
this.getCategoryList();
|
|
5890
6162
|
this.getSettingsInfo();
|
|
5891
|
-
this.shortMonth = this.frequencyService.monthArray.map(month => month.substring(0, 3));
|
|
6163
|
+
this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
|
|
5892
6164
|
if (this.mode === 'CREATE') {
|
|
5893
6165
|
this.organizationId = this.authService.getOrganizationId();
|
|
5894
6166
|
}
|
|
5895
6167
|
this.memberId = this.authService.getMemberId();
|
|
5896
|
-
console.log(
|
|
6168
|
+
console.log('member id of logged in user', this.memberId);
|
|
5897
6169
|
if (this.secondaryOpenPortal !== 'OTHER' && this.mode !== 'EDIT') {
|
|
5898
6170
|
this.nonRemovableUsersList.push(this.memberId);
|
|
5899
6171
|
}
|
|
@@ -5914,7 +6186,7 @@ class WorkflowRiskComponent {
|
|
|
5914
6186
|
getGroupList() {
|
|
5915
6187
|
this.riskService.getGroupsList().subscribe((res) => {
|
|
5916
6188
|
this.groupsList = res?.data;
|
|
5917
|
-
}, err => {
|
|
6189
|
+
}, (err) => {
|
|
5918
6190
|
console.error(err);
|
|
5919
6191
|
});
|
|
5920
6192
|
}
|
|
@@ -5948,7 +6220,7 @@ class WorkflowRiskComponent {
|
|
|
5948
6220
|
this.riskForm.riskType = 'REPORTED';
|
|
5949
6221
|
}
|
|
5950
6222
|
if (res && res?.roleActions) {
|
|
5951
|
-
const moduleIndex = res.roleActions.findIndex((element) => element.moduleName ==
|
|
6223
|
+
const moduleIndex = res.roleActions.findIndex((element) => element.moduleName == 'risk');
|
|
5952
6224
|
const riskPermissions = res.roleActions[moduleIndex].subModule[1].permissions;
|
|
5953
6225
|
riskPermissions.forEach((permission) => {
|
|
5954
6226
|
if (permission.name == 'manage risks' && permission.enable) {
|
|
@@ -5961,7 +6233,7 @@ class WorkflowRiskComponent {
|
|
|
5961
6233
|
this.riskForm.riskType = 'NORMAL';
|
|
5962
6234
|
this.riskTypeChangeAllowed = false;
|
|
5963
6235
|
}
|
|
5964
|
-
}
|
|
6236
|
+
},
|
|
5965
6237
|
});
|
|
5966
6238
|
}
|
|
5967
6239
|
changeRisk(type) {
|
|
@@ -5989,7 +6261,11 @@ class WorkflowRiskComponent {
|
|
|
5989
6261
|
if (this.riskForm.riskType === 'REPORTED') {
|
|
5990
6262
|
this.actionButtons = [
|
|
5991
6263
|
{ buttonText: 'Add More Risks', class: 'white-btn', id: 'addMore' },
|
|
5992
|
-
{
|
|
6264
|
+
{
|
|
6265
|
+
buttonText: 'View Reported Risks',
|
|
6266
|
+
class: 'blue-btn',
|
|
6267
|
+
id: 'manageReportedRisk',
|
|
6268
|
+
},
|
|
5993
6269
|
];
|
|
5994
6270
|
}
|
|
5995
6271
|
else {
|
|
@@ -6028,16 +6304,23 @@ class WorkflowRiskComponent {
|
|
|
6028
6304
|
}
|
|
6029
6305
|
this.riskForm.overseersList = this.setList(this.ownersList, res.manage_oversight, 'member_id');
|
|
6030
6306
|
this.riskForm.overseersGroupList = this.setList(this.groupsList, res?.overseergroup_ids, '_id');
|
|
6031
|
-
this.riskForm.mitigation = res?.mitigation
|
|
6307
|
+
this.riskForm.mitigation = res?.mitigation
|
|
6308
|
+
? res?.mitigation
|
|
6309
|
+
: this.riskForm?.mitigation;
|
|
6032
6310
|
this.riskForm.assessment_deadline_days = res.assessment_deadline_days;
|
|
6033
|
-
this.riskForm.addOverseer =
|
|
6034
|
-
|
|
6311
|
+
this.riskForm.addOverseer =
|
|
6312
|
+
res.manage_oversight.length > 0 || res?.overseergroup_ids?.length > 0
|
|
6313
|
+
? true
|
|
6314
|
+
: false;
|
|
6315
|
+
this.riskForm.addMitigation = res.mitigation ? true : false;
|
|
6035
6316
|
// this.memberId = res.member_id;
|
|
6036
6317
|
this.organizationId = res.organisation_id;
|
|
6037
6318
|
this.riskForm.head_ids = res?.head_ids ? res?.head_ids : [];
|
|
6038
|
-
this.riskForm.mitigationDescriptionPlan =
|
|
6039
|
-
|
|
6040
|
-
this.riskForm.
|
|
6319
|
+
this.riskForm.mitigationDescriptionPlan =
|
|
6320
|
+
res?.mitigation_plan_recommendation ?? '';
|
|
6321
|
+
this.riskForm.addMitigationPlan =
|
|
6322
|
+
res?.mitigation_plan_recommendation.trim()?.length ? true : false;
|
|
6323
|
+
this.riskForm.addRiskLabel = res.risk_label ? true : false;
|
|
6041
6324
|
if (res.assessment_date_timestamp) {
|
|
6042
6325
|
this.date = new Date(res.assessment_date);
|
|
6043
6326
|
}
|
|
@@ -6052,17 +6335,23 @@ class WorkflowRiskComponent {
|
|
|
6052
6335
|
this.nonRemovableUsersList = Array.from(new Set([...this.nonRemovableUsersList, ...res?.owner]));
|
|
6053
6336
|
}
|
|
6054
6337
|
if (this.secondaryOpenPortal !== 'OTHER' && this.mode === 'EDIT') {
|
|
6055
|
-
this.nonRemovableUsersList = Array.from(new Set([
|
|
6338
|
+
this.nonRemovableUsersList = Array.from(new Set([
|
|
6339
|
+
...this.nonRemovableUsersList,
|
|
6340
|
+
...this.getCurrentlyLoggedInUser(),
|
|
6341
|
+
]));
|
|
6056
6342
|
}
|
|
6057
6343
|
if (res?.risk_type === 'NORMAL') {
|
|
6058
|
-
this.nonRemovableUsersList = Array.from(new Set([
|
|
6344
|
+
this.nonRemovableUsersList = Array.from(new Set([
|
|
6345
|
+
...this.nonRemovableUsersList,
|
|
6346
|
+
...this.getCurrentlyLoggedInUser(),
|
|
6347
|
+
]));
|
|
6059
6348
|
}
|
|
6060
6349
|
this.populateOptionalFields();
|
|
6061
6350
|
this.frequencyDataPopulate(res?.frequency_details);
|
|
6062
6351
|
this.riskForm.frequency_details = res?.frequency_details;
|
|
6063
6352
|
this.getFrequencyPlaceholder(res.frequency_details);
|
|
6064
6353
|
this.setOverseersList();
|
|
6065
|
-
}, err => {
|
|
6354
|
+
}, (err) => {
|
|
6066
6355
|
console.log(err);
|
|
6067
6356
|
this.loader = false;
|
|
6068
6357
|
this.uiKitService.isLoader = false;
|
|
@@ -6103,10 +6392,12 @@ class WorkflowRiskComponent {
|
|
|
6103
6392
|
}
|
|
6104
6393
|
getRCList() {
|
|
6105
6394
|
const rcArray = [];
|
|
6106
|
-
this.riskService
|
|
6395
|
+
this.riskService
|
|
6396
|
+
.getResponsibilityCenterList(rcArray, this.mode === 'EDIT' ? this.riskId : '')
|
|
6397
|
+
.subscribe((res) => {
|
|
6107
6398
|
this.responsibilityCentersList = res;
|
|
6108
6399
|
this.rcListLoaded = true;
|
|
6109
|
-
}, err => {
|
|
6400
|
+
}, (err) => {
|
|
6110
6401
|
console.error(err);
|
|
6111
6402
|
this.rcListLoaded = true;
|
|
6112
6403
|
});
|
|
@@ -6118,7 +6409,7 @@ class WorkflowRiskComponent {
|
|
|
6118
6409
|
this.categoryList.compliance.data = res.compliance_arr;
|
|
6119
6410
|
this.categoryList.others.data = res.others_arr;
|
|
6120
6411
|
this.categoryListLoaded = true;
|
|
6121
|
-
}, err => {
|
|
6412
|
+
}, (err) => {
|
|
6122
6413
|
console.error(err);
|
|
6123
6414
|
this.categoryListLoaded = true;
|
|
6124
6415
|
});
|
|
@@ -6133,30 +6424,30 @@ class WorkflowRiskComponent {
|
|
|
6133
6424
|
this.riskForm.ownersList.push(res[index]);
|
|
6134
6425
|
}
|
|
6135
6426
|
}
|
|
6136
|
-
}, err => {
|
|
6427
|
+
}, (err) => {
|
|
6137
6428
|
console.error(err);
|
|
6138
6429
|
this.usersListLoaded = true;
|
|
6139
6430
|
});
|
|
6140
6431
|
}
|
|
6141
6432
|
getAdminsList() {
|
|
6142
|
-
this.riskService.getAdminKeyAdminList().subscribe(res => {
|
|
6433
|
+
this.riskService.getAdminKeyAdminList().subscribe((res) => {
|
|
6143
6434
|
this.adminsList = res;
|
|
6144
6435
|
this.adminsListLoaded = true;
|
|
6145
|
-
}, err => {
|
|
6436
|
+
}, (err) => {
|
|
6146
6437
|
console.error(err);
|
|
6147
6438
|
this.adminsListLoaded = true;
|
|
6148
6439
|
});
|
|
6149
6440
|
}
|
|
6150
6441
|
getSettingsInfo() {
|
|
6151
|
-
this.riskService.getRiskSettingDetails().subscribe(res => {
|
|
6442
|
+
this.riskService.getRiskSettingDetails().subscribe((res) => {
|
|
6152
6443
|
this.settingsInfo = res;
|
|
6153
6444
|
this.hideOptionalFields(res);
|
|
6154
6445
|
this.mitigationDetails = res?.risk_mitigation_priority?.mitigation_data;
|
|
6155
|
-
let defaultMitigation = this.mitigationDetails?.filter((ele) => ele?.mitigation_name ===
|
|
6446
|
+
let defaultMitigation = this.mitigationDetails?.filter((ele) => ele?.mitigation_name === 'LOW');
|
|
6156
6447
|
if (defaultMitigation?.length) {
|
|
6157
6448
|
this.riskForm.mitigation = defaultMitigation[0]?.mitigation_id;
|
|
6158
6449
|
}
|
|
6159
|
-
}, err => {
|
|
6450
|
+
}, (err) => {
|
|
6160
6451
|
console.error(err);
|
|
6161
6452
|
});
|
|
6162
6453
|
}
|
|
@@ -6166,7 +6457,10 @@ class WorkflowRiskComponent {
|
|
|
6166
6457
|
}
|
|
6167
6458
|
}
|
|
6168
6459
|
checkWhetherAllListsLoaded() {
|
|
6169
|
-
if (this.rcListLoaded &&
|
|
6460
|
+
if (this.rcListLoaded &&
|
|
6461
|
+
this.usersListLoaded &&
|
|
6462
|
+
this.adminsListLoaded &&
|
|
6463
|
+
this.categoryListLoaded) {
|
|
6170
6464
|
this.setOverseersList();
|
|
6171
6465
|
if (this.mode === 'EDIT') {
|
|
6172
6466
|
this.getRiskDetails(this.riskId);
|
|
@@ -6205,7 +6499,7 @@ class WorkflowRiskComponent {
|
|
|
6205
6499
|
rcOwnerIds = [...new Set(rcOwnerIds)];
|
|
6206
6500
|
this.riskForm.head_ids = rcOwnerIds;
|
|
6207
6501
|
this.overseersList = allUsers.filter((user) => !ids.includes(user.member_id));
|
|
6208
|
-
console.log(
|
|
6502
|
+
console.log('overseer list', this.overseersList);
|
|
6209
6503
|
this.riskForm.overseersList = this.riskForm.overseersList.filter((user) => !ids.includes(user.member_id));
|
|
6210
6504
|
//Groups which are selected in Owners field should not be visible Overseer
|
|
6211
6505
|
let groupids = [];
|
|
@@ -6219,7 +6513,7 @@ class WorkflowRiskComponent {
|
|
|
6219
6513
|
this.riskForm.overseersGroupList = this.riskForm.overseersGroupList.filter((user) => !groupids.includes(user.group_id));
|
|
6220
6514
|
}
|
|
6221
6515
|
activateSelector(type, event) {
|
|
6222
|
-
console.log(
|
|
6516
|
+
console.log('typetypetypetype==>', type, event);
|
|
6223
6517
|
this.activeSelector = event ? type : '';
|
|
6224
6518
|
if (['rc', 'owner', 'overseer', 'category', 'frequency'].includes(type)) {
|
|
6225
6519
|
this.pickerChanged.emit(event);
|
|
@@ -6255,7 +6549,7 @@ class WorkflowRiskComponent {
|
|
|
6255
6549
|
case 'category':
|
|
6256
6550
|
this.riskForm.category = {
|
|
6257
6551
|
type: 'strategic',
|
|
6258
|
-
selectedCategory: ''
|
|
6552
|
+
selectedCategory: '',
|
|
6259
6553
|
};
|
|
6260
6554
|
this.riskForm.categoryCustomTags = [];
|
|
6261
6555
|
break;
|
|
@@ -6275,7 +6569,7 @@ class WorkflowRiskComponent {
|
|
|
6275
6569
|
category.selectedCategory.custom_tag.forEach((element) => {
|
|
6276
6570
|
const tag = {
|
|
6277
6571
|
custom_tag_name: element.tagName,
|
|
6278
|
-
custom_tag_value: ''
|
|
6572
|
+
custom_tag_value: '',
|
|
6279
6573
|
};
|
|
6280
6574
|
customTags.push(tag);
|
|
6281
6575
|
});
|
|
@@ -6287,7 +6581,7 @@ class WorkflowRiskComponent {
|
|
|
6287
6581
|
if (this.featureflag_groups) {
|
|
6288
6582
|
let ownerids;
|
|
6289
6583
|
let groupIds;
|
|
6290
|
-
ownerids = this.returnIds(ids.users,
|
|
6584
|
+
ownerids = this.returnIds(ids.users, 'member_id');
|
|
6291
6585
|
groupIds = this.returnIds(ids.groups, 'group_id');
|
|
6292
6586
|
const selectedOwners = this.setList(this.ownersList, ownerids, 'member_id');
|
|
6293
6587
|
const selectedGroups = this.setList(this.groupsList, groupIds, 'group_id');
|
|
@@ -6311,7 +6605,7 @@ class WorkflowRiskComponent {
|
|
|
6311
6605
|
else {
|
|
6312
6606
|
let overseerids;
|
|
6313
6607
|
let overseerGroupIds;
|
|
6314
|
-
overseerids = this.returnIds(ids.users,
|
|
6608
|
+
overseerids = this.returnIds(ids.users, 'member_id');
|
|
6315
6609
|
overseerGroupIds = this.returnIds(ids.groups, 'group_id');
|
|
6316
6610
|
const selectedOverseers = this.setList(this.overseersList, overseerids, 'member_id');
|
|
6317
6611
|
const selectedOverseerGroups = this.setList(this.overseersGroupList, overseerGroupIds, 'group_id');
|
|
@@ -6361,9 +6655,11 @@ class WorkflowRiskComponent {
|
|
|
6361
6655
|
return data;
|
|
6362
6656
|
}
|
|
6363
6657
|
returnIds(list, key) {
|
|
6364
|
-
return list.map(ele => {
|
|
6365
|
-
|
|
6366
|
-
|
|
6658
|
+
return list.map((ele) => {
|
|
6659
|
+
if (ele[key]) {
|
|
6660
|
+
return ele[key];
|
|
6661
|
+
}
|
|
6662
|
+
});
|
|
6367
6663
|
}
|
|
6368
6664
|
submitRisk() {
|
|
6369
6665
|
this.setPopupButtons();
|
|
@@ -6374,7 +6670,10 @@ class WorkflowRiskComponent {
|
|
|
6374
6670
|
else if (this.mode === 'EDIT' && this.editDetails.IfAssessmentDone > 0) {
|
|
6375
6671
|
const prevRCArr = this.editDetails.rc_id;
|
|
6376
6672
|
const currRCArr = this.returnIds(this.riskForm.responsibilityCentersList, 'rc_id');
|
|
6377
|
-
if (prevRCArr.length === currRCArr.length &&
|
|
6673
|
+
if (prevRCArr.length === currRCArr.length &&
|
|
6674
|
+
prevRCArr
|
|
6675
|
+
.sort()
|
|
6676
|
+
.every((value, index) => value === currRCArr.sort()[index])) {
|
|
6378
6677
|
this.createRisk(this.riskForm);
|
|
6379
6678
|
}
|
|
6380
6679
|
else {
|
|
@@ -6414,10 +6713,14 @@ class WorkflowRiskComponent {
|
|
|
6414
6713
|
const re = / |<br>/g;
|
|
6415
6714
|
this.riskForm.title = event.replace(re, '').trim();
|
|
6416
6715
|
// ((!this.settingsInfo.assessment_deadline_enable) && (this.riskForm?.assessment_deadline_days < 1) && this.riskForm?.riskType !== 'REPORTED') ||
|
|
6417
|
-
if (!this.riskForm.title ||
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
(this.riskForm
|
|
6716
|
+
if (!this.riskForm.title ||
|
|
6717
|
+
this.riskForm.responsibilityCentersList.length == 0 ||
|
|
6718
|
+
this.riskForm.ownersList.length == 0 ||
|
|
6719
|
+
(this.riskForm.riskType === 'REPORTED' &&
|
|
6720
|
+
!this.riskForm?.description?.trim()?.length) ||
|
|
6721
|
+
(this.riskForm?.riskType !== 'REPORTED' &&
|
|
6722
|
+
(!this.riskForm?.frequency_details?.frequency ||
|
|
6723
|
+
this.riskForm?.frequency_details?.frequency === ''))) {
|
|
6421
6724
|
return false;
|
|
6422
6725
|
}
|
|
6423
6726
|
else {
|
|
@@ -6434,19 +6737,23 @@ class WorkflowRiskComponent {
|
|
|
6434
6737
|
assessment_deadline_enable: this.settingsInfo.assessment_deadline_enable,
|
|
6435
6738
|
owner: this.returnIds(riskForm.ownersList, 'member_id'),
|
|
6436
6739
|
// usergroup_ids: this.returnIds(riskForm.groupsList,'_id'),
|
|
6437
|
-
category:
|
|
6438
|
-
|
|
6740
|
+
category: riskForm.category?.selectedCategory?.category_id
|
|
6741
|
+
? [riskForm.category.selectedCategory.category_id]
|
|
6742
|
+
: [],
|
|
6743
|
+
manage_oversight: riskForm.addOverseer
|
|
6744
|
+
? this.returnIds(riskForm.overseersList, 'member_id')
|
|
6745
|
+
: [],
|
|
6439
6746
|
// overseergroup_ids : riskForm.addOverseer ? this.returnIds(riskForm.overseersGroupList,'_id') :[] ,
|
|
6440
6747
|
rc_id: this.returnIds(riskForm.responsibilityCentersList, 'item_id'),
|
|
6441
6748
|
head_ids: riskForm.head_ids,
|
|
6442
6749
|
rating_arr: [],
|
|
6443
6750
|
member_id: this.memberId,
|
|
6444
6751
|
organisation_id: this.organizationId,
|
|
6445
|
-
risk_progress_flag:
|
|
6446
|
-
IfAssessmentDone:
|
|
6447
|
-
workshop_id:
|
|
6752
|
+
risk_progress_flag: this.mode === 'EDIT' ? this.editDetails.risk_progress_flag : 1,
|
|
6753
|
+
IfAssessmentDone: this.mode == 'EDIT' ? this.editDetails.IfAssessmentDone : 0,
|
|
6754
|
+
workshop_id: this.mode == 'EDIT' ? this.editDetails.workshop_id : 0,
|
|
6448
6755
|
complete_assessment: 0,
|
|
6449
|
-
mitigation:
|
|
6756
|
+
mitigation: riskForm.addMitigation ? riskForm.mitigation : 0,
|
|
6450
6757
|
weightage_enable: this.settingsInfo.weightage_enable,
|
|
6451
6758
|
treatment_type: this.settingsInfo.treatment_criteria,
|
|
6452
6759
|
weightage_details: this.settingsInfo.weightage_details,
|
|
@@ -6460,15 +6767,19 @@ class WorkflowRiskComponent {
|
|
|
6460
6767
|
assessment_deadline_set_by: this.settingsInfo.assessment_deadline_set_by,
|
|
6461
6768
|
// assessment_deadline_days: (this.settingsInfo.assessment_deadline_enable) ? this.settingsInfo.assessment_deadline_days : riskForm.assessment_deadline_days,
|
|
6462
6769
|
risk_type: this.riskForm?.riskType ?? 'NORMAL',
|
|
6463
|
-
mitigation_plan_recommendation: this.riskForm?.addMitigationPlan
|
|
6770
|
+
mitigation_plan_recommendation: this.riskForm?.addMitigationPlan
|
|
6771
|
+
? this.riskForm?.mitigationDescriptionPlan ?? ''
|
|
6772
|
+
: '',
|
|
6464
6773
|
frequency_details: this.riskForm?.frequency_details,
|
|
6465
|
-
risk_label:
|
|
6774
|
+
risk_label: riskForm?.addRiskLabel ? riskForm?.riskLabelValue : 1,
|
|
6466
6775
|
};
|
|
6467
6776
|
if (this.featureflag_groups) {
|
|
6468
6777
|
payload['usergroup_ids'] = this.returnIds(riskForm.groupsList, '_id');
|
|
6469
|
-
payload['overseergroup_ids'] = riskForm.addOverseer
|
|
6778
|
+
payload['overseergroup_ids'] = riskForm.addOverseer
|
|
6779
|
+
? this.returnIds(riskForm.overseersGroupList, '_id')
|
|
6780
|
+
: [];
|
|
6470
6781
|
}
|
|
6471
|
-
console.log(
|
|
6782
|
+
console.log('payloadpayloadpayloadpayload', payload);
|
|
6472
6783
|
if (this.mode == 'CREATE') {
|
|
6473
6784
|
this.riskService.addRisk(payload).subscribe((res) => {
|
|
6474
6785
|
console.log(res);
|
|
@@ -6479,7 +6790,7 @@ class WorkflowRiskComponent {
|
|
|
6479
6790
|
this.showSmiley = true;
|
|
6480
6791
|
this.uiKitService.isSmileyOn = true;
|
|
6481
6792
|
// this.resetForm();
|
|
6482
|
-
}, err => {
|
|
6793
|
+
}, (err) => {
|
|
6483
6794
|
console.log(err);
|
|
6484
6795
|
this.loader = false;
|
|
6485
6796
|
this.uiKitService.isLoader = false;
|
|
@@ -6494,7 +6805,7 @@ class WorkflowRiskComponent {
|
|
|
6494
6805
|
this.uiKitService.isSmileyOn = true;
|
|
6495
6806
|
this.loader = false;
|
|
6496
6807
|
this.uiKitService.isLoader = false;
|
|
6497
|
-
}, err => {
|
|
6808
|
+
}, (err) => {
|
|
6498
6809
|
console.log(err);
|
|
6499
6810
|
this.loader = false;
|
|
6500
6811
|
this.uiKitService.isLoader = false;
|
|
@@ -6502,7 +6813,10 @@ class WorkflowRiskComponent {
|
|
|
6502
6813
|
});
|
|
6503
6814
|
}
|
|
6504
6815
|
if (this.openedFrom === 'MOVE_TO_REGISTER') {
|
|
6505
|
-
this.closeWorkflow.emit({
|
|
6816
|
+
this.closeWorkflow.emit({
|
|
6817
|
+
evt: { action: 'MOVE_TO_REGISTER', payload },
|
|
6818
|
+
confirm: false,
|
|
6819
|
+
});
|
|
6506
6820
|
}
|
|
6507
6821
|
}
|
|
6508
6822
|
resetForm() {
|
|
@@ -6530,13 +6844,13 @@ class WorkflowRiskComponent {
|
|
|
6530
6844
|
addOverseer: false,
|
|
6531
6845
|
addMitigation: false,
|
|
6532
6846
|
frequency_details: {
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6847
|
+
frequency: '',
|
|
6848
|
+
started_at: '',
|
|
6849
|
+
frequency_time: '',
|
|
6850
|
+
remind_before_days: 0,
|
|
6537
6851
|
},
|
|
6538
6852
|
riskLabelValue: 1,
|
|
6539
|
-
addRiskLabel: false
|
|
6853
|
+
addRiskLabel: false,
|
|
6540
6854
|
};
|
|
6541
6855
|
this.nonRemovableUsersList = [];
|
|
6542
6856
|
this.organizationId = this.authService.getOrganizationId();
|
|
@@ -6634,10 +6948,10 @@ class WorkflowRiskComponent {
|
|
|
6634
6948
|
this.activeDeselector();
|
|
6635
6949
|
this.frequencyDataPopulate(event);
|
|
6636
6950
|
this.riskForm.frequency_details = {
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6951
|
+
frequency: event?.frequency,
|
|
6952
|
+
started_at: event?.started_at,
|
|
6953
|
+
frequency_time: event?.frequency_time,
|
|
6954
|
+
remind_before_days: event?.remind_before_days,
|
|
6641
6955
|
};
|
|
6642
6956
|
this.frequencyPlaceholder = event?.placeholder;
|
|
6643
6957
|
this.pickerChanged.emit(false);
|
|
@@ -6665,10 +6979,22 @@ class WorkflowRiskComponent {
|
|
|
6665
6979
|
break;
|
|
6666
6980
|
case 0:
|
|
6667
6981
|
{
|
|
6668
|
-
const dateObject = new Date(moment(frequencyDetails[1] +
|
|
6982
|
+
const dateObject = new Date(moment$1(frequencyDetails[1] +
|
|
6983
|
+
'-' +
|
|
6984
|
+
frequencyDetails[2] +
|
|
6985
|
+
'-' +
|
|
6986
|
+
frequencyDetails[3] +
|
|
6987
|
+
' 00:00:00', 'YYYY-MM-DD HH:mm:ss').unix() * 1000);
|
|
6669
6988
|
// tslint:disable-next-line: max-line-length
|
|
6670
6989
|
this.frequencyPlaceholder =
|
|
6671
|
-
'One Time ' +
|
|
6990
|
+
'One Time ' +
|
|
6991
|
+
dateObject.getDate() +
|
|
6992
|
+
' ' +
|
|
6993
|
+
this.shortMonth[dateObject.getMonth()] +
|
|
6994
|
+
' ' +
|
|
6995
|
+
dateObject.getFullYear() +
|
|
6996
|
+
' by ' +
|
|
6997
|
+
frequencyTime;
|
|
6672
6998
|
}
|
|
6673
6999
|
break;
|
|
6674
7000
|
}
|
|
@@ -6692,16 +7018,25 @@ class WorkflowRiskComponent {
|
|
|
6692
7018
|
return this.frequencyService.dayName[parseInt(ele) - 1];
|
|
6693
7019
|
});
|
|
6694
7020
|
if (parseInt(frequencyDetails[3]) === 1) {
|
|
6695
|
-
this.frequencyPlaceholder =
|
|
7021
|
+
this.frequencyPlaceholder =
|
|
7022
|
+
'Every ' + selectedDay.join() + ' by ' + frequencyTime;
|
|
6696
7023
|
}
|
|
6697
7024
|
if (parseInt(frequencyDetails[3]) === 2) {
|
|
6698
|
-
this.frequencyPlaceholder =
|
|
7025
|
+
this.frequencyPlaceholder =
|
|
7026
|
+
'Every alternate ' + selectedDay.join() + ' by ' + frequencyTime;
|
|
6699
7027
|
}
|
|
6700
7028
|
if (parseInt(frequencyDetails[3]) === 3) {
|
|
6701
|
-
this.frequencyPlaceholder =
|
|
7029
|
+
this.frequencyPlaceholder =
|
|
7030
|
+
'Every 3rd ' + selectedDay.join() + ' by ' + frequencyTime;
|
|
6702
7031
|
}
|
|
6703
7032
|
if (parseInt(frequencyDetails[3]) > 3) {
|
|
6704
|
-
this.frequencyPlaceholder =
|
|
7033
|
+
this.frequencyPlaceholder =
|
|
7034
|
+
'Every ' +
|
|
7035
|
+
parseInt(frequencyDetails[3]) +
|
|
7036
|
+
'th ' +
|
|
7037
|
+
selectedDay.join() +
|
|
7038
|
+
' by ' +
|
|
7039
|
+
frequencyTime;
|
|
6705
7040
|
}
|
|
6706
7041
|
}
|
|
6707
7042
|
}
|
|
@@ -6716,25 +7051,49 @@ class WorkflowRiskComponent {
|
|
|
6716
7051
|
return this.shortMonth[parseInt(ele) - 1];
|
|
6717
7052
|
});
|
|
6718
7053
|
if (parseInt(frequencyDetails[1]) === 1) {
|
|
6719
|
-
this.frequencyPlaceholder =
|
|
7054
|
+
this.frequencyPlaceholder =
|
|
7055
|
+
'1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6720
7056
|
}
|
|
6721
7057
|
else if (parseInt(frequencyDetails[1]) === 2) {
|
|
6722
|
-
this.frequencyPlaceholder =
|
|
7058
|
+
this.frequencyPlaceholder =
|
|
7059
|
+
'2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6723
7060
|
}
|
|
6724
7061
|
else if (parseInt(frequencyDetails[1]) === 3) {
|
|
6725
|
-
this.frequencyPlaceholder =
|
|
7062
|
+
this.frequencyPlaceholder =
|
|
7063
|
+
'3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6726
7064
|
}
|
|
6727
|
-
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
6728
|
-
|
|
7065
|
+
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
7066
|
+
parseInt(frequencyDetails[1]) === 31) {
|
|
7067
|
+
this.frequencyPlaceholder =
|
|
7068
|
+
parseInt(frequencyDetails[1]) +
|
|
7069
|
+
'st of every ' +
|
|
7070
|
+
selectedMonth.join(', ') +
|
|
7071
|
+
' by ' +
|
|
7072
|
+
frequencyTime;
|
|
6729
7073
|
}
|
|
6730
7074
|
else if (parseInt(frequencyDetails[1]) === 22) {
|
|
6731
|
-
this.frequencyPlaceholder =
|
|
7075
|
+
this.frequencyPlaceholder =
|
|
7076
|
+
parseInt(frequencyDetails[1]) +
|
|
7077
|
+
'nd of every ' +
|
|
7078
|
+
selectedMonth.join(', ') +
|
|
7079
|
+
' by ' +
|
|
7080
|
+
frequencyTime;
|
|
6732
7081
|
}
|
|
6733
7082
|
else if (parseInt(frequencyDetails[1]) === 23) {
|
|
6734
|
-
this.frequencyPlaceholder =
|
|
7083
|
+
this.frequencyPlaceholder =
|
|
7084
|
+
parseInt(frequencyDetails[1]) +
|
|
7085
|
+
'rd of every ' +
|
|
7086
|
+
selectedMonth.join(', ') +
|
|
7087
|
+
' by ' +
|
|
7088
|
+
frequencyTime;
|
|
6735
7089
|
}
|
|
6736
7090
|
else if (parseInt(frequencyDetails[1]) > 3) {
|
|
6737
|
-
this.frequencyPlaceholder =
|
|
7091
|
+
this.frequencyPlaceholder =
|
|
7092
|
+
parseInt(frequencyDetails[1]) +
|
|
7093
|
+
'th of every ' +
|
|
7094
|
+
selectedMonth.join(', ') +
|
|
7095
|
+
' by ' +
|
|
7096
|
+
frequencyTime;
|
|
6738
7097
|
}
|
|
6739
7098
|
}
|
|
6740
7099
|
}
|
|
@@ -6756,52 +7115,132 @@ class WorkflowRiskComponent {
|
|
|
6756
7115
|
const yearSequence = parseInt(frequencyDetails[3]) > 0 ? parseInt(frequencyDetails[3]) : 1;
|
|
6757
7116
|
if (yearSequence < 2) {
|
|
6758
7117
|
if (parseInt(frequencyDetails[1]) === 1) {
|
|
6759
|
-
this.frequencyPlaceholder =
|
|
7118
|
+
this.frequencyPlaceholder =
|
|
7119
|
+
'1st of every ' +
|
|
7120
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7121
|
+
' by ' +
|
|
7122
|
+
frequencyTime;
|
|
6760
7123
|
}
|
|
6761
7124
|
if (parseInt(frequencyDetails[1]) === 2) {
|
|
6762
|
-
this.frequencyPlaceholder =
|
|
7125
|
+
this.frequencyPlaceholder =
|
|
7126
|
+
'2nd of every ' +
|
|
7127
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7128
|
+
' by ' +
|
|
7129
|
+
frequencyTime;
|
|
6763
7130
|
}
|
|
6764
7131
|
if (parseInt(frequencyDetails[1]) === 3) {
|
|
6765
|
-
this.frequencyPlaceholder =
|
|
7132
|
+
this.frequencyPlaceholder =
|
|
7133
|
+
'3rd of every ' +
|
|
7134
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7135
|
+
' by ' +
|
|
7136
|
+
frequencyTime;
|
|
6766
7137
|
}
|
|
6767
7138
|
if (parseInt(frequencyDetails[1]) > 3) {
|
|
6768
|
-
this.frequencyPlaceholder =
|
|
7139
|
+
this.frequencyPlaceholder =
|
|
7140
|
+
parseInt(frequencyDetails[1]) +
|
|
7141
|
+
'th of every ' +
|
|
7142
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7143
|
+
' by ' +
|
|
7144
|
+
frequencyTime;
|
|
6769
7145
|
}
|
|
6770
|
-
if (parseInt(frequencyDetails[1]) === 31 ||
|
|
6771
|
-
|
|
7146
|
+
if (parseInt(frequencyDetails[1]) === 31 ||
|
|
7147
|
+
parseInt(frequencyDetails[1]) === 21) {
|
|
7148
|
+
this.frequencyPlaceholder =
|
|
7149
|
+
parseInt(frequencyDetails[1]) +
|
|
7150
|
+
'st of every ' +
|
|
7151
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7152
|
+
' by ' +
|
|
7153
|
+
frequencyTime;
|
|
6772
7154
|
}
|
|
6773
7155
|
if (parseInt(frequencyDetails[1]) === 22) {
|
|
6774
|
-
this.frequencyPlaceholder =
|
|
7156
|
+
this.frequencyPlaceholder =
|
|
7157
|
+
parseInt(frequencyDetails[1]) +
|
|
7158
|
+
'nd of every ' +
|
|
7159
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7160
|
+
' by ' +
|
|
7161
|
+
frequencyTime;
|
|
6775
7162
|
}
|
|
6776
7163
|
if (parseInt(frequencyDetails[1]) === 23) {
|
|
6777
|
-
this.frequencyPlaceholder =
|
|
7164
|
+
this.frequencyPlaceholder =
|
|
7165
|
+
parseInt(frequencyDetails[1]) +
|
|
7166
|
+
'rd of every ' +
|
|
7167
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7168
|
+
' by ' +
|
|
7169
|
+
frequencyTime;
|
|
6778
7170
|
}
|
|
6779
7171
|
}
|
|
6780
7172
|
if (yearSequence > 1) {
|
|
6781
7173
|
if (parseInt(frequencyDetails[1]) === 1) {
|
|
6782
7174
|
// tslint:disable-next-line: max-line-length
|
|
6783
|
-
this.frequencyPlaceholder =
|
|
7175
|
+
this.frequencyPlaceholder =
|
|
7176
|
+
'1st of ' +
|
|
7177
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7178
|
+
', Interval: every ' +
|
|
7179
|
+
yearSequence +
|
|
7180
|
+
' years by ' +
|
|
7181
|
+
frequencyTime;
|
|
6784
7182
|
}
|
|
6785
7183
|
if (parseInt(frequencyDetails[1]) === 2) {
|
|
6786
7184
|
// tslint:disable-next-line: max-line-length
|
|
6787
|
-
this.frequencyPlaceholder =
|
|
7185
|
+
this.frequencyPlaceholder =
|
|
7186
|
+
'2nd of' +
|
|
7187
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7188
|
+
', Interval: every ' +
|
|
7189
|
+
yearSequence +
|
|
7190
|
+
' years by ' +
|
|
7191
|
+
frequencyTime;
|
|
6788
7192
|
}
|
|
6789
7193
|
if (parseInt(frequencyDetails[1]) === 3) {
|
|
6790
7194
|
// tslint:disable-next-line: max-line-length
|
|
6791
|
-
this.frequencyPlaceholder =
|
|
7195
|
+
this.frequencyPlaceholder =
|
|
7196
|
+
'3rd of ' +
|
|
7197
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7198
|
+
', Interval: every ' +
|
|
7199
|
+
yearSequence +
|
|
7200
|
+
' years by ' +
|
|
7201
|
+
frequencyTime;
|
|
6792
7202
|
}
|
|
6793
7203
|
if (parseInt(frequencyDetails[1]) > 3) {
|
|
6794
7204
|
// tslint:disable-next-line: max-line-length
|
|
6795
|
-
this.frequencyPlaceholder =
|
|
7205
|
+
this.frequencyPlaceholder =
|
|
7206
|
+
parseInt(frequencyDetails[1]) +
|
|
7207
|
+
'th of ' +
|
|
7208
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7209
|
+
', Interval: every ' +
|
|
7210
|
+
yearSequence +
|
|
7211
|
+
' years by ' +
|
|
7212
|
+
frequencyTime;
|
|
6796
7213
|
}
|
|
6797
|
-
if (parseInt(frequencyDetails[1]) === 31 ||
|
|
6798
|
-
|
|
7214
|
+
if (parseInt(frequencyDetails[1]) === 31 ||
|
|
7215
|
+
parseInt(frequencyDetails[1]) === 21) {
|
|
7216
|
+
this.frequencyPlaceholder =
|
|
7217
|
+
parseInt(frequencyDetails[1]) +
|
|
7218
|
+
'st of ' +
|
|
7219
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7220
|
+
', Interval: every ' +
|
|
7221
|
+
yearSequence +
|
|
7222
|
+
' years by ' +
|
|
7223
|
+
frequencyTime;
|
|
6799
7224
|
}
|
|
6800
7225
|
if (parseInt(frequencyDetails[1]) === 22) {
|
|
6801
|
-
this.frequencyPlaceholder =
|
|
7226
|
+
this.frequencyPlaceholder =
|
|
7227
|
+
parseInt(frequencyDetails[1]) +
|
|
7228
|
+
'nd of ' +
|
|
7229
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7230
|
+
', Interval: every ' +
|
|
7231
|
+
yearSequence +
|
|
7232
|
+
' years by ' +
|
|
7233
|
+
frequencyTime;
|
|
6802
7234
|
}
|
|
6803
7235
|
if (parseInt(frequencyDetails[1]) === 23) {
|
|
6804
|
-
this.frequencyPlaceholder =
|
|
7236
|
+
this.frequencyPlaceholder =
|
|
7237
|
+
parseInt(frequencyDetails[1]) +
|
|
7238
|
+
'rd of ' +
|
|
7239
|
+
this.shortMonth[parseInt(frequencyDetails[2]) - 1] +
|
|
7240
|
+
', Interval: every ' +
|
|
7241
|
+
yearSequence +
|
|
7242
|
+
' years by ' +
|
|
7243
|
+
frequencyTime;
|
|
6805
7244
|
}
|
|
6806
7245
|
}
|
|
6807
7246
|
}
|
|
@@ -6814,27 +7253,64 @@ class WorkflowRiskComponent {
|
|
|
6814
7253
|
*/
|
|
6815
7254
|
getQuarterlyPlaceholder(frequencyDetails, frequencyTime) {
|
|
6816
7255
|
{
|
|
6817
|
-
const quarterly = [
|
|
7256
|
+
const quarterly = [
|
|
7257
|
+
'January, April, July, October',
|
|
7258
|
+
'February, May, August, November',
|
|
7259
|
+
' March, June, September, December',
|
|
7260
|
+
];
|
|
6818
7261
|
if (parseInt(frequencyDetails[1]) === 1) {
|
|
6819
|
-
this.frequencyPlaceholder =
|
|
7262
|
+
this.frequencyPlaceholder =
|
|
7263
|
+
'1st of every ' +
|
|
7264
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7265
|
+
' by ' +
|
|
7266
|
+
frequencyTime;
|
|
6820
7267
|
}
|
|
6821
7268
|
else if (parseInt(frequencyDetails[1]) === 2) {
|
|
6822
|
-
this.frequencyPlaceholder =
|
|
7269
|
+
this.frequencyPlaceholder =
|
|
7270
|
+
'2nd of every ' +
|
|
7271
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7272
|
+
' by ' +
|
|
7273
|
+
frequencyTime;
|
|
6823
7274
|
}
|
|
6824
7275
|
else if (parseInt(frequencyDetails[1]) === 3) {
|
|
6825
|
-
this.frequencyPlaceholder =
|
|
7276
|
+
this.frequencyPlaceholder =
|
|
7277
|
+
'3rd of every ' +
|
|
7278
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7279
|
+
' by ' +
|
|
7280
|
+
frequencyTime;
|
|
6826
7281
|
}
|
|
6827
|
-
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
6828
|
-
|
|
7282
|
+
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
7283
|
+
parseInt(frequencyDetails[1]) === 31) {
|
|
7284
|
+
this.frequencyPlaceholder =
|
|
7285
|
+
parseInt(frequencyDetails[1]) +
|
|
7286
|
+
'st of every ' +
|
|
7287
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7288
|
+
' by ' +
|
|
7289
|
+
frequencyTime;
|
|
6829
7290
|
}
|
|
6830
7291
|
else if (parseInt(frequencyDetails[1]) === 22) {
|
|
6831
|
-
this.frequencyPlaceholder =
|
|
7292
|
+
this.frequencyPlaceholder =
|
|
7293
|
+
parseInt(frequencyDetails[1]) +
|
|
7294
|
+
'nd of every ' +
|
|
7295
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7296
|
+
' by ' +
|
|
7297
|
+
frequencyTime;
|
|
6832
7298
|
}
|
|
6833
7299
|
else if (parseInt(frequencyDetails[1]) === 23) {
|
|
6834
|
-
this.frequencyPlaceholder =
|
|
7300
|
+
this.frequencyPlaceholder =
|
|
7301
|
+
parseInt(frequencyDetails[1]) +
|
|
7302
|
+
'rd of every ' +
|
|
7303
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7304
|
+
' by ' +
|
|
7305
|
+
frequencyTime;
|
|
6835
7306
|
}
|
|
6836
7307
|
else if (parseInt(frequencyDetails[1]) > 3) {
|
|
6837
|
-
this.frequencyPlaceholder =
|
|
7308
|
+
this.frequencyPlaceholder =
|
|
7309
|
+
parseInt(frequencyDetails[1]) +
|
|
7310
|
+
'th of every ' +
|
|
7311
|
+
quarterly[parseInt(frequencyDetails[2].split(',')[0]) - 1] +
|
|
7312
|
+
' by ' +
|
|
7313
|
+
frequencyTime;
|
|
6838
7314
|
}
|
|
6839
7315
|
}
|
|
6840
7316
|
}
|
|
@@ -6849,25 +7325,49 @@ class WorkflowRiskComponent {
|
|
|
6849
7325
|
return this.shortMonth[parseInt(ele) - 1];
|
|
6850
7326
|
});
|
|
6851
7327
|
if (parseInt(frequencyDetails[1]) === 1) {
|
|
6852
|
-
this.frequencyPlaceholder =
|
|
7328
|
+
this.frequencyPlaceholder =
|
|
7329
|
+
'1st of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6853
7330
|
}
|
|
6854
7331
|
else if (parseInt(frequencyDetails[1]) === 2) {
|
|
6855
|
-
this.frequencyPlaceholder =
|
|
7332
|
+
this.frequencyPlaceholder =
|
|
7333
|
+
'2nd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6856
7334
|
}
|
|
6857
7335
|
else if (parseInt(frequencyDetails[1]) === 3) {
|
|
6858
|
-
this.frequencyPlaceholder =
|
|
7336
|
+
this.frequencyPlaceholder =
|
|
7337
|
+
'3rd of every ' + selectedMonth.join(', ') + ' by ' + frequencyTime;
|
|
6859
7338
|
}
|
|
6860
|
-
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
6861
|
-
|
|
7339
|
+
else if (parseInt(frequencyDetails[1]) === 21 ||
|
|
7340
|
+
parseInt(frequencyDetails[1]) === 31) {
|
|
7341
|
+
this.frequencyPlaceholder =
|
|
7342
|
+
parseInt(frequencyDetails[1]) +
|
|
7343
|
+
'st of every ' +
|
|
7344
|
+
selectedMonth.join(', ') +
|
|
7345
|
+
' by ' +
|
|
7346
|
+
frequencyTime;
|
|
6862
7347
|
}
|
|
6863
7348
|
else if (parseInt(frequencyDetails[1]) === 22) {
|
|
6864
|
-
this.frequencyPlaceholder =
|
|
7349
|
+
this.frequencyPlaceholder =
|
|
7350
|
+
parseInt(frequencyDetails[1]) +
|
|
7351
|
+
'nd of every ' +
|
|
7352
|
+
selectedMonth.join(', ') +
|
|
7353
|
+
' by ' +
|
|
7354
|
+
frequencyTime;
|
|
6865
7355
|
}
|
|
6866
7356
|
else if (parseInt(frequencyDetails[1]) === 23) {
|
|
6867
|
-
this.frequencyPlaceholder =
|
|
7357
|
+
this.frequencyPlaceholder =
|
|
7358
|
+
parseInt(frequencyDetails[1]) +
|
|
7359
|
+
'rd of every ' +
|
|
7360
|
+
selectedMonth.join(', ') +
|
|
7361
|
+
' by ' +
|
|
7362
|
+
frequencyTime;
|
|
6868
7363
|
}
|
|
6869
7364
|
else if (parseInt(frequencyDetails[1]) > 3) {
|
|
6870
|
-
this.frequencyPlaceholder =
|
|
7365
|
+
this.frequencyPlaceholder =
|
|
7366
|
+
parseInt(frequencyDetails[1]) +
|
|
7367
|
+
'th of every ' +
|
|
7368
|
+
selectedMonth.join(', ') +
|
|
7369
|
+
' by ' +
|
|
7370
|
+
frequencyTime;
|
|
6871
7371
|
}
|
|
6872
7372
|
}
|
|
6873
7373
|
}
|
|
@@ -6894,10 +7394,10 @@ class WorkflowRiskComponent {
|
|
|
6894
7394
|
*/
|
|
6895
7395
|
frequencyDataPopulate(event) {
|
|
6896
7396
|
let data = {
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
7397
|
+
frequency: event?.frequency,
|
|
7398
|
+
started_at: event?.started_at,
|
|
7399
|
+
frequency_time: event?.frequency_time,
|
|
7400
|
+
remind_before_days: event?.remind_before_days,
|
|
6901
7401
|
};
|
|
6902
7402
|
this.frequencyDetails = data;
|
|
6903
7403
|
}
|
|
@@ -12790,14 +13290,15 @@ class FrequencyTopComponent {
|
|
|
12790
13290
|
this.dateObjectData = new Date();
|
|
12791
13291
|
this.timeData = '11:59 PM';
|
|
12792
13292
|
}
|
|
12793
|
-
ngOnInit() {
|
|
12794
|
-
}
|
|
13293
|
+
ngOnInit() { }
|
|
12795
13294
|
enterValueFirst(event, actionType) {
|
|
12796
13295
|
if (this.id !== 0 && this.id !== 1 && this.id !== 5) {
|
|
12797
13296
|
this.enterValue(this.occurrenceFirst, actionType);
|
|
12798
13297
|
return;
|
|
12799
13298
|
}
|
|
12800
|
-
if (!Number.isNaN(Number(this.occurrenceFirst)) &&
|
|
13299
|
+
if (!Number.isNaN(Number(this.occurrenceFirst)) &&
|
|
13300
|
+
this.occurrenceFirst !== 0 &&
|
|
13301
|
+
Number(this.occurrenceFirst) > 0) {
|
|
12801
13302
|
this.occurrenceFirst = Number(this.occurrenceFirst);
|
|
12802
13303
|
this.valueChangedFirst.emit({
|
|
12803
13304
|
type: actionType,
|
|
@@ -12810,7 +13311,10 @@ class FrequencyTopComponent {
|
|
|
12810
13311
|
}
|
|
12811
13312
|
}
|
|
12812
13313
|
enterValue(event, actionType) {
|
|
12813
|
-
if (!Number.isNaN(Number(event)) &&
|
|
13314
|
+
if (!Number.isNaN(Number(event)) &&
|
|
13315
|
+
event !== 0 &&
|
|
13316
|
+
Number(event) > 0 &&
|
|
13317
|
+
Number(event) < 32) {
|
|
12814
13318
|
this.occurrenceFirst = Number(event);
|
|
12815
13319
|
this.valueChangedFirst.emit({
|
|
12816
13320
|
type: actionType,
|
|
@@ -12823,15 +13327,21 @@ class FrequencyTopComponent {
|
|
|
12823
13327
|
}
|
|
12824
13328
|
}
|
|
12825
13329
|
getToday() {
|
|
12826
|
-
return moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
13330
|
+
return moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
12827
13331
|
}
|
|
12828
13332
|
onTimeChanged(event) {
|
|
12829
13333
|
try {
|
|
12830
13334
|
this.timeData = event;
|
|
12831
13335
|
if (typeof this.dateObjectData == 'object') {
|
|
12832
|
-
this.dateObjectData = moment(this.dateObjectData).toDate();
|
|
13336
|
+
this.dateObjectData = moment$1(this.dateObjectData).toDate();
|
|
12833
13337
|
}
|
|
12834
|
-
let timeStamp = moment(this.dateObjectData.getDate() +
|
|
13338
|
+
let timeStamp = moment$1(this.dateObjectData.getDate() +
|
|
13339
|
+
'-' +
|
|
13340
|
+
(this.dateObjectData.getMonth() + 1) +
|
|
13341
|
+
'-' +
|
|
13342
|
+
this.dateObjectData.getFullYear() +
|
|
13343
|
+
' ' +
|
|
13344
|
+
this.timeData, 'DD-MM-YYYY hh:mm a').unix();
|
|
12835
13345
|
if (Date.now() / 1000 > timeStamp) {
|
|
12836
13346
|
this.nextDisable.emit(true);
|
|
12837
13347
|
}
|
|
@@ -12845,7 +13355,10 @@ class FrequencyTopComponent {
|
|
|
12845
13355
|
}
|
|
12846
13356
|
}
|
|
12847
13357
|
enterYearDay(event) {
|
|
12848
|
-
if (!Number.isNaN(Number(this.yearlyDay)) &&
|
|
13358
|
+
if (!Number.isNaN(Number(this.yearlyDay)) &&
|
|
13359
|
+
this.yearlyDay !== 0 &&
|
|
13360
|
+
Number(this.yearlyDay) > 0 &&
|
|
13361
|
+
Number(this.yearlyDay) < 32) {
|
|
12849
13362
|
//this.yearlyDay = Number(event.target.value);
|
|
12850
13363
|
this.yearlyDateChanged.emit(this.yearlyDay);
|
|
12851
13364
|
}
|
|
@@ -12901,7 +13414,7 @@ class FrequencyLifecycleComponent {
|
|
|
12901
13414
|
this.startDateUnix = Date.now();
|
|
12902
13415
|
// All input variable
|
|
12903
13416
|
this.startDate = new Date();
|
|
12904
|
-
this.endDate = moment(new Date(this.startDate).getTime() + 86400000);
|
|
13417
|
+
this.endDate = moment$1(new Date(this.startDate).getTime() + 86400000);
|
|
12905
13418
|
this.occurrance = 10;
|
|
12906
13419
|
this.selectedLifecycleType = 2; // 0 = End by , End After, 2 = perpetual
|
|
12907
13420
|
this.id = 0;
|
|
@@ -12916,30 +13429,30 @@ class FrequencyLifecycleComponent {
|
|
|
12916
13429
|
this.endDateConfig = Object.assign({ ...this.frequencyService.dateConfig });
|
|
12917
13430
|
this.startDateConfig['min'] = new Date().getDate().toString();
|
|
12918
13431
|
//this.startDateUnix = this.startDate.getDate().toString()
|
|
12919
|
-
this.endDateConfig['min'] = moment(new Date(new Date(this.startDate).getTime() + 86400000));
|
|
13432
|
+
this.endDateConfig['min'] = moment$1(new Date(new Date(this.startDate).getTime() + 86400000));
|
|
12920
13433
|
this.getEndDate(this.startDate);
|
|
12921
13434
|
this.changeEndDateObj(this.endDate);
|
|
12922
13435
|
console.log('endDate ==>', this.endDate);
|
|
12923
13436
|
}
|
|
12924
13437
|
getEndDate(event) {
|
|
12925
|
-
const time = moment(this.endDate).format('DD-MM-YYYY HH:mm:ss');
|
|
12926
|
-
const getUnixTime = moment(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
|
|
13438
|
+
const time = moment$1(this.endDate).format('DD-MM-YYYY HH:mm:ss');
|
|
13439
|
+
const getUnixTime = moment$1(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
|
|
12927
13440
|
console.log('end date ==>time', time, getUnixTime);
|
|
12928
|
-
this.startDateUnix = moment(event).unix();
|
|
13441
|
+
this.startDateUnix = moment$1(event).unix();
|
|
12929
13442
|
console.log(' this.startDateUnix ==>', this.startDate, this.startDateUnix);
|
|
12930
13443
|
if (this.startDateUnix >= getUnixTime) {
|
|
12931
|
-
this.endDate = moment(new Date(this.startDate).getTime() + 86400000);
|
|
13444
|
+
this.endDate = moment$1(new Date(this.startDate).getTime() + 86400000);
|
|
12932
13445
|
}
|
|
12933
13446
|
else {
|
|
12934
|
-
this.endDate = moment(this.endDate);
|
|
13447
|
+
this.endDate = moment$1(this.endDate);
|
|
12935
13448
|
}
|
|
12936
13449
|
}
|
|
12937
13450
|
changeEndDateObj(date) {
|
|
12938
|
-
this.endDateObject = new Date(moment(date).unix() * 1000);
|
|
13451
|
+
this.endDateObject = new Date(moment$1(date).unix() * 1000);
|
|
12939
13452
|
}
|
|
12940
13453
|
ngOnChanges(change) {
|
|
12941
13454
|
console.log('changes ==>', change, this.selectedLifecycleType);
|
|
12942
|
-
this.endBy = moment(this.endDate)
|
|
13455
|
+
this.endBy = moment$1(this.endDate)
|
|
12943
13456
|
.format('DD-MMMM-YYYYTHH:mm:ssZ')
|
|
12944
13457
|
.split('T')[0];
|
|
12945
13458
|
}
|
|
@@ -12947,7 +13460,7 @@ class FrequencyLifecycleComponent {
|
|
|
12947
13460
|
// console.log("this.endDate ==> DoCcheck", this.endDate, this.startDate)
|
|
12948
13461
|
}
|
|
12949
13462
|
openDatePicker() {
|
|
12950
|
-
const newDate = moment(this.startDate);
|
|
13463
|
+
const newDate = moment$1(this.startDate);
|
|
12951
13464
|
console.log('newDate ==>', newDate);
|
|
12952
13465
|
this.datePicker.api.moveCalendarTo(newDate);
|
|
12953
13466
|
this.datePicker.api.open();
|
|
@@ -13003,7 +13516,7 @@ class FrequencyLifecycleComponent {
|
|
|
13003
13516
|
this.endDate = event.date;
|
|
13004
13517
|
this.changeEndDateObj(this.endDate);
|
|
13005
13518
|
// console.log(event, );
|
|
13006
|
-
this.endBy = moment(event.date).format('DD-MMMM-YYYY');
|
|
13519
|
+
this.endBy = moment$1(event.date).format('DD-MMMM-YYYY');
|
|
13007
13520
|
// console.log(this.endBy);
|
|
13008
13521
|
const dateObject = {
|
|
13009
13522
|
type: this.selectedLifecycleType,
|
|
@@ -13018,20 +13531,20 @@ class FrequencyLifecycleComponent {
|
|
|
13018
13531
|
// start from change event
|
|
13019
13532
|
startFromChange(event) {
|
|
13020
13533
|
console.log(' start date change', event, this.endDate);
|
|
13021
|
-
const time = moment(this.endDate).format('DD-MM-YYYY HH:mm:ss');
|
|
13022
|
-
const getUnixTime = moment(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
|
|
13534
|
+
const time = moment$1(this.endDate).format('DD-MM-YYYY HH:mm:ss');
|
|
13535
|
+
const getUnixTime = moment$1(time.split(' ')[0] + ' 00:00:00', 'DD-MM-YYYY HH:mm:ss').unix();
|
|
13023
13536
|
console.log('end date ==>time', time, getUnixTime);
|
|
13024
|
-
this.startDateUnix = moment(event.date).unix();
|
|
13537
|
+
this.startDateUnix = moment$1(event.date).unix();
|
|
13025
13538
|
console.log(' this.startDateUnix ==>', this.startDate, this.startDateUnix);
|
|
13026
13539
|
if (this.startDateUnix >= getUnixTime) {
|
|
13027
|
-
this.endDate = moment(this.startDateUnix * 1000 + 86400000);
|
|
13540
|
+
this.endDate = moment$1(this.startDateUnix * 1000 + 86400000);
|
|
13028
13541
|
this.changeEndDateObj(this.endDate);
|
|
13029
13542
|
console.log('this.endDate ==>', this.endDate, this.startDate);
|
|
13030
|
-
this.endBy = moment(this.endDate)
|
|
13543
|
+
this.endBy = moment$1(this.endDate)
|
|
13031
13544
|
.format('DD-MMMM-YYYYTHH:mm:ssZ')
|
|
13032
13545
|
.split('T')[0];
|
|
13033
13546
|
}
|
|
13034
|
-
this.endDateConfig['min'] = Object.assign(moment(new Date(new Date(event.date).getTime() + 86400000)));
|
|
13547
|
+
this.endDateConfig['min'] = Object.assign(moment$1(new Date(new Date(event.date).getTime() + 86400000)));
|
|
13035
13548
|
console.log('this.endDateConfig ==>', this.endDateConfig);
|
|
13036
13549
|
this.selectedOccurance.emit({
|
|
13037
13550
|
type: this.selectedLifecycleType,
|
|
@@ -13219,7 +13732,7 @@ class FrequencyDailyComponent {
|
|
|
13219
13732
|
this.dailyFailed = this.frequencyData.failed;
|
|
13220
13733
|
this.dailyDeactivatedValue = this.frequencyData.continuous_failed_days;
|
|
13221
13734
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
13222
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13735
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13223
13736
|
this.dailyLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
13224
13737
|
}
|
|
13225
13738
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -13280,7 +13793,7 @@ class FrequencyDailyComponent {
|
|
|
13280
13793
|
console.log('end date', endByDate);
|
|
13281
13794
|
if (event.type === 0) {
|
|
13282
13795
|
endByDate = event.endsBy
|
|
13283
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13796
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13284
13797
|
: endByDate;
|
|
13285
13798
|
console.log('endByDate', endByDate);
|
|
13286
13799
|
}
|
|
@@ -13413,7 +13926,7 @@ class FrequencyWeeklyComponent {
|
|
|
13413
13926
|
this.weeklyFailed = this.frequencyData.failed;
|
|
13414
13927
|
this.weeklyDeactivatedValue = this.frequencyData.continuous_failed_days;
|
|
13415
13928
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
13416
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13929
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13417
13930
|
this.weeklyLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
13418
13931
|
}
|
|
13419
13932
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -13473,7 +13986,7 @@ class FrequencyWeeklyComponent {
|
|
|
13473
13986
|
console.log('end date', endByDate);
|
|
13474
13987
|
if (event.type === 0) {
|
|
13475
13988
|
endByDate = event.endsBy
|
|
13476
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13989
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13477
13990
|
: endByDate;
|
|
13478
13991
|
console.log('endByDate', endByDate);
|
|
13479
13992
|
}
|
|
@@ -13617,7 +14130,7 @@ class FrequencyMonthlyComponent {
|
|
|
13617
14130
|
this.monthlyFailed = this.frequencyData.failed;
|
|
13618
14131
|
this.monthlyDeactivatedValue = this.frequencyData.continuous_failed_days;
|
|
13619
14132
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
13620
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14133
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13621
14134
|
this.monthlyLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
13622
14135
|
}
|
|
13623
14136
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -13677,7 +14190,7 @@ class FrequencyMonthlyComponent {
|
|
|
13677
14190
|
console.log('end date', endByDate);
|
|
13678
14191
|
if (event.type === 0) {
|
|
13679
14192
|
endByDate = event.endsBy
|
|
13680
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14193
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13681
14194
|
: endByDate;
|
|
13682
14195
|
console.log('endByDate', endByDate);
|
|
13683
14196
|
}
|
|
@@ -13879,7 +14392,7 @@ class FrequencyQuarterlyComponent {
|
|
|
13879
14392
|
this.quarterlyLifeCycleStart = new Date(this.frequencyData.startDate * 1000);
|
|
13880
14393
|
this.quarterlyFailed = this.frequencyData.failed;
|
|
13881
14394
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
13882
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14395
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
13883
14396
|
this.quarterlyLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
13884
14397
|
}
|
|
13885
14398
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -13931,7 +14444,7 @@ class FrequencyQuarterlyComponent {
|
|
|
13931
14444
|
console.log('end date', endByDate);
|
|
13932
14445
|
if (event.type === 0) {
|
|
13933
14446
|
endByDate = event.endsBy
|
|
13934
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14447
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
13935
14448
|
: endByDate;
|
|
13936
14449
|
console.log('endByDate', endByDate);
|
|
13937
14450
|
}
|
|
@@ -14094,7 +14607,7 @@ class FrequencyBiannualComponent {
|
|
|
14094
14607
|
this.biannualLifeCycleStart = new Date(this.frequencyData.startDate * 1000);
|
|
14095
14608
|
this.biannualFailed = this.frequencyData.failed;
|
|
14096
14609
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
14097
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14610
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14098
14611
|
this.biannualLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
14099
14612
|
}
|
|
14100
14613
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -14163,7 +14676,7 @@ class FrequencyBiannualComponent {
|
|
|
14163
14676
|
console.log('end date', endByDate);
|
|
14164
14677
|
if (event.type === 0) {
|
|
14165
14678
|
endByDate = event.endsBy
|
|
14166
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14679
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14167
14680
|
: endByDate;
|
|
14168
14681
|
console.log('endByDate', endByDate);
|
|
14169
14682
|
}
|
|
@@ -14313,7 +14826,7 @@ class FrequencyAnnualComponent {
|
|
|
14313
14826
|
this.frequencyData.startFrom ?? this.frequencyData.startDate;
|
|
14314
14827
|
this.yearlyFailed = this.frequencyData.failed;
|
|
14315
14828
|
if (lifecycleInfo[0] !== '0000-00-00') {
|
|
14316
|
-
const dateSelected = moment(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14829
|
+
const dateSelected = moment$1(lifecycleInfo[0] + ' 11:59 pm', 'DD-MMMM-YYYY HH:mm a').unix();
|
|
14317
14830
|
this.yearlyLifeCycleEndTime = new Date(dateSelected * 1000);
|
|
14318
14831
|
}
|
|
14319
14832
|
this.lifecycleDetails = this.frequencyData.lifecycle;
|
|
@@ -14364,7 +14877,7 @@ class FrequencyAnnualComponent {
|
|
|
14364
14877
|
let endByDate = Math.floor(new Date().getTime() / 1000 + 86400000);
|
|
14365
14878
|
if (event.type === 0) {
|
|
14366
14879
|
endByDate = event.endsBy
|
|
14367
|
-
? moment(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14880
|
+
? moment$1(event.endsBy + ' 00:00:00', 'DD-MMM-YYYY HH:mm:ss').unix()
|
|
14368
14881
|
: endByDate;
|
|
14369
14882
|
}
|
|
14370
14883
|
this.frequencyInfo.failed_time_utc = endByDate;
|
|
@@ -14565,7 +15078,7 @@ class FrequencyOneTimeComponent {
|
|
|
14565
15078
|
this.todayDate = new Date();
|
|
14566
15079
|
this.shortMonth = [];
|
|
14567
15080
|
this.dateObjectData = new Date();
|
|
14568
|
-
this.minDate = moment(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
15081
|
+
this.minDate = moment$1(Date.now()).format('YYYY-MM-DD HH:mm:ss')?.split(' ')[0];
|
|
14569
15082
|
this.pageType = 'responsibility';
|
|
14570
15083
|
this.mode = '';
|
|
14571
15084
|
this.frequencyDetails = new EventEmitter();
|
|
@@ -14575,7 +15088,7 @@ class FrequencyOneTimeComponent {
|
|
|
14575
15088
|
this.dateConfig['min'] = new Date().getDate().toString();
|
|
14576
15089
|
this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
|
|
14577
15090
|
this.shortMonth = this.frequencyService.monthArray.map((month) => month.substring(0, 3));
|
|
14578
|
-
this.selectedDate = moment(this.todayDate);
|
|
15091
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
14579
15092
|
console.log('this.dateConfig ', this.dateConfig, this.todayDate);
|
|
14580
15093
|
console.log('this.frequencyData ==>', this.frequencyData, this.frequencyData.pattern.split('~'));
|
|
14581
15094
|
if (this.frequencyData.pattern != '' &&
|
|
@@ -14589,20 +15102,20 @@ class FrequencyOneTimeComponent {
|
|
|
14589
15102
|
populateFrequency() {
|
|
14590
15103
|
const patternInfo = this.frequencyData.pattern.split('~');
|
|
14591
15104
|
console.log('patternInfo ==>', patternInfo);
|
|
14592
|
-
const timeStamp = moment(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
15105
|
+
const timeStamp = moment$1(`${patternInfo[3]}-${patternInfo[2]}-${patternInfo[1]} ${this.frequencyData.failedTime}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
14593
15106
|
console.log('timeStamp -->', timeStamp);
|
|
14594
15107
|
this.todayDate = new Date(timeStamp * 1000);
|
|
14595
|
-
this.selectedDate = moment(this.todayDate);
|
|
15108
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
14596
15109
|
this.oneTimeFailed = this.frequencyData.failed;
|
|
14597
15110
|
this.oneTimeWindow = this.frequencyData.window;
|
|
14598
15111
|
this.oneTimeStartTime = this.frequencyData.failedTime;
|
|
14599
15112
|
this.oneTimeSelected =
|
|
14600
15113
|
patternInfo[1] + '~' + patternInfo[2] + '~' + patternInfo[3];
|
|
14601
|
-
this.dateObjectData = new Date(moment(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
|
|
15114
|
+
this.dateObjectData = new Date(moment$1(this.oneTimeSelected + ' ' + this.oneTimeStartTime, 'YYYY~MM~DD HH:mm:ss').unix() * 1000);
|
|
14602
15115
|
this.getOneTimeFrequency();
|
|
14603
15116
|
}
|
|
14604
15117
|
openDatePicker() {
|
|
14605
|
-
const newDate = moment(this.todayDate);
|
|
15118
|
+
const newDate = moment$1(this.todayDate);
|
|
14606
15119
|
this.datePicker.api.moveCalendarTo(newDate);
|
|
14607
15120
|
this.datePicker.api.open();
|
|
14608
15121
|
this.datepickerOverlay = true;
|
|
@@ -14626,17 +15139,17 @@ class FrequencyOneTimeComponent {
|
|
|
14626
15139
|
console.log(this.dateObjectData);
|
|
14627
15140
|
this.oneTimeStartTime = event;
|
|
14628
15141
|
if (typeof this.dateObjectData == 'object') {
|
|
14629
|
-
this.dateObjectData = moment(this.dateObjectData).toDate();
|
|
15142
|
+
this.dateObjectData = moment$1(this.dateObjectData).toDate();
|
|
14630
15143
|
}
|
|
14631
15144
|
console.log(this.dateObjectData);
|
|
14632
|
-
let timeStamp = moment(this.dateObjectData.getDate() +
|
|
15145
|
+
let timeStamp = moment$1(this.dateObjectData.getDate() +
|
|
14633
15146
|
'-' +
|
|
14634
15147
|
(this.dateObjectData.getMonth() + 1) +
|
|
14635
15148
|
'-' +
|
|
14636
15149
|
this.dateObjectData.getFullYear() +
|
|
14637
15150
|
' ' +
|
|
14638
15151
|
this.oneTimeStartTime, 'DD-MM-YYYY hh:mm a').unix();
|
|
14639
|
-
this.oneTimeSelected = moment(timeStamp * 1000)
|
|
15152
|
+
this.oneTimeSelected = moment$1(timeStamp * 1000)
|
|
14640
15153
|
.format('YYYY~MM~DDTHH:mm:ssZ')
|
|
14641
15154
|
.split('T')[0];
|
|
14642
15155
|
console.log('timeStamp', timeStamp, this.oneTimeSelected);
|
|
@@ -14644,10 +15157,10 @@ class FrequencyOneTimeComponent {
|
|
|
14644
15157
|
}
|
|
14645
15158
|
dateChange(event) {
|
|
14646
15159
|
this.selectedDate = event.date;
|
|
14647
|
-
const newDate = moment(event.date).unix();
|
|
15160
|
+
const newDate = moment$1(event.date).unix();
|
|
14648
15161
|
this.dateObjectData = new Date(newDate * 1000);
|
|
14649
15162
|
this.todayDate = this.dateObjectData;
|
|
14650
|
-
let timeStamp = moment(this.dateObjectData.getDate() +
|
|
15163
|
+
let timeStamp = moment$1(this.dateObjectData.getDate() +
|
|
14651
15164
|
'-' +
|
|
14652
15165
|
(this.dateObjectData.getMonth() + 1) +
|
|
14653
15166
|
'-' +
|
|
@@ -14665,9 +15178,9 @@ class FrequencyOneTimeComponent {
|
|
|
14665
15178
|
}
|
|
14666
15179
|
getOneTimeFrequency() {
|
|
14667
15180
|
if (this.oneTimeSelected !== '') {
|
|
14668
|
-
this.todayDate = moment(this.todayDate).toDate();
|
|
15181
|
+
this.todayDate = moment$1(this.todayDate).toDate();
|
|
14669
15182
|
}
|
|
14670
|
-
this.selectedDate = moment(this.todayDate);
|
|
15183
|
+
this.selectedDate = moment$1(this.todayDate);
|
|
14671
15184
|
// tslint:disable-next-line: max-line-length
|
|
14672
15185
|
this.frequencyInfo.placeholder =
|
|
14673
15186
|
'One Time ' +
|
|
@@ -15315,7 +15828,9 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15315
15828
|
this.frequencyInfo = Object.assign(this.frequencyService.frequencyInfo);
|
|
15316
15829
|
this.getCompletionReports();
|
|
15317
15830
|
this.getOnCompletionFrequency();
|
|
15318
|
-
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15831
|
+
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15832
|
+
? Object.keys(this.selectedResponsibilityDetails)?.length > 0
|
|
15833
|
+
: false;
|
|
15319
15834
|
}
|
|
15320
15835
|
populateFrequency() {
|
|
15321
15836
|
const frequencySelected = this.frequencyData.pattern.split('~');
|
|
@@ -15325,7 +15840,9 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15325
15840
|
this.onCompletionOfTime = this.frequencyData.failedTime;
|
|
15326
15841
|
this.selectedResponsibilityDetails = this.onCompletionOfResponsibility.find((res) => res.ReportId === this.frequencyData.selectedReport);
|
|
15327
15842
|
this.getOnCompletionFrequency();
|
|
15328
|
-
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15843
|
+
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15844
|
+
? Object.keys(this.selectedResponsibilityDetails)?.length > 0
|
|
15845
|
+
: false;
|
|
15329
15846
|
}
|
|
15330
15847
|
onTimeChanged(event) {
|
|
15331
15848
|
this.onCompletionOfTime = event;
|
|
@@ -15343,10 +15860,13 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15343
15860
|
onResponsibilitySelection(event) {
|
|
15344
15861
|
if (this.featureFlag_on_completion_of) {
|
|
15345
15862
|
this.selectedResponsibilityDetails = event;
|
|
15346
|
-
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15863
|
+
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15864
|
+
? Object.keys(this.selectedResponsibilityDetails)?.length > 0
|
|
15865
|
+
: false;
|
|
15347
15866
|
}
|
|
15348
|
-
if (typeof
|
|
15349
|
-
this.frequencyInfo.reportId =
|
|
15867
|
+
if (typeof this.selectedResponsibilityDetails === 'object') {
|
|
15868
|
+
this.frequencyInfo.reportId =
|
|
15869
|
+
this.selectedResponsibilityDetails?.ReportId;
|
|
15350
15870
|
}
|
|
15351
15871
|
else {
|
|
15352
15872
|
this.frequencyInfo.reportId = 0;
|
|
@@ -15360,7 +15880,8 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15360
15880
|
if (this.frequencyData?.onCompletionReportDetails) {
|
|
15361
15881
|
this.onCompletionOfResponsibility.push(this.frequencyData?.onCompletionReportDetails);
|
|
15362
15882
|
}
|
|
15363
|
-
if (this.frequencyData.pattern != '' &&
|
|
15883
|
+
if (this.frequencyData.pattern != '' &&
|
|
15884
|
+
parseInt(this.frequencyData.pattern.split('~')[0]) === 6) {
|
|
15364
15885
|
this.populateFrequency();
|
|
15365
15886
|
}
|
|
15366
15887
|
}
|
|
@@ -15377,15 +15898,20 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15377
15898
|
' ' +
|
|
15378
15899
|
(this.onCompletionOfInput > 1 ? 'days' : 'day') +
|
|
15379
15900
|
' after completion of ' +
|
|
15380
|
-
(this.onCompletionOfResponsibility &&
|
|
15381
|
-
|
|
15901
|
+
(this.onCompletionOfResponsibility &&
|
|
15902
|
+
this.selectedResponsibilityDetails?.report_name
|
|
15903
|
+
? this.selectedResponsibilityDetails?.report_name
|
|
15904
|
+
: '');
|
|
15905
|
+
this.frequencyInfo.pattern =
|
|
15906
|
+
6 + '~' + '0' + '~' + '0' + '~' + this.onCompletionOfInput;
|
|
15382
15907
|
this.frequencyInfo.case = 'onCompletionOf';
|
|
15383
15908
|
this.frequencyInfo.failedAfter = this.onCompletionOfFailed;
|
|
15384
15909
|
this.frequencyInfo.window = this.onCompletionOfWindow;
|
|
15385
15910
|
this.frequencyInfo.timeIn12hr = this.onCompletionOfTime;
|
|
15386
15911
|
this.frequencyInfo.timeIn24Hr = this.frequencyService.timeFrom12hTo24h(this.onCompletionOfTime);
|
|
15387
15912
|
this.frequencyInfo.failed_time_utc = 0;
|
|
15388
|
-
this.frequencyInfo.reportId =
|
|
15913
|
+
this.frequencyInfo.reportId =
|
|
15914
|
+
this.selectedResponsibilityDetails?.ReportId ?? 0;
|
|
15389
15915
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
15390
15916
|
}
|
|
15391
15917
|
openRadioResponsibility(event) {
|
|
@@ -15401,7 +15927,9 @@ class FrequencyOnCompletionOfComponent {
|
|
|
15401
15927
|
}
|
|
15402
15928
|
remove() {
|
|
15403
15929
|
this.selectedResponsibilityDetails = {};
|
|
15404
|
-
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15930
|
+
this.isSelectedData = this.selectedResponsibilityDetails
|
|
15931
|
+
? Object.keys(this.selectedResponsibilityDetails)?.length > 0
|
|
15932
|
+
: false;
|
|
15405
15933
|
this.frequencyInfo.reportId = 0;
|
|
15406
15934
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
15407
15935
|
}
|
|
@@ -15700,7 +16228,7 @@ class FrequencyContainerComponent {
|
|
|
15700
16228
|
break;
|
|
15701
16229
|
case 'oneTime':
|
|
15702
16230
|
if (frequencyDetails?.length > 0) {
|
|
15703
|
-
const selectedTime = moment(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
16231
|
+
const selectedTime = moment$1(`${frequencyDetails[3]}-${frequencyDetails[2]}-${frequencyDetails[1]} ${this.frequencyData.timeIn12hr}`, 'DD-MM-YYYY HH:mm a').unix();
|
|
15704
16232
|
if (Date.now() / 1000 > selectedTime) {
|
|
15705
16233
|
this.snackbar.show('Please set a future date.', 'alert');
|
|
15706
16234
|
isInvalid = true;
|
|
@@ -20725,8 +21253,8 @@ class WorkflowComplianceComponent {
|
|
|
20725
21253
|
entrustResponsibility(entrustForm) {
|
|
20726
21254
|
this.loader = true;
|
|
20727
21255
|
this.uiKitService.isLoader = true;
|
|
20728
|
-
let startDate = moment(parseInt(entrustForm.startDate) * 1000).format('YYYY-MM-DD HH:mm:ss');
|
|
20729
|
-
startDate = moment(startDate.split(' ')[0] + ' 00:00:00').format('YYYY-MM-DD HH:mm:ss');
|
|
21256
|
+
let startDate = moment$1(parseInt(entrustForm.startDate) * 1000).format('YYYY-MM-DD HH:mm:ss');
|
|
21257
|
+
startDate = moment$1(startDate.split(' ')[0] + ' 00:00:00').format('YYYY-MM-DD HH:mm:ss');
|
|
20730
21258
|
const rcDetails = entrustForm.rc?.length > 0
|
|
20731
21259
|
? entrustForm.rc.map((rc) => {
|
|
20732
21260
|
if (rc) {
|
|
@@ -20942,7 +21470,7 @@ class WorkflowComplianceComponent {
|
|
|
20942
21470
|
sample: this.selectedSample === 0 ? this.sampleValue : 0,
|
|
20943
21471
|
percentage: this.selectedSample === 1 ? this.samplePercentage : 0,
|
|
20944
21472
|
frequency_pattern: `1~0~${this.sendAuditRemindersValue}~1`,
|
|
20945
|
-
frequency_time: moment(this.auditTime, 'HH:mm a').format('HH:mm:ss'),
|
|
21473
|
+
frequency_time: moment$1(this.auditTime, 'HH:mm a').format('HH:mm:ss'),
|
|
20946
21474
|
}
|
|
20947
21475
|
: {
|
|
20948
21476
|
category_id: 0,
|
|
@@ -21346,7 +21874,7 @@ class WorkflowComplianceComponent {
|
|
|
21346
21874
|
break;
|
|
21347
21875
|
case 0:
|
|
21348
21876
|
{
|
|
21349
|
-
const dateObject = new Date(moment(frequencyDetails[1] +
|
|
21877
|
+
const dateObject = new Date(moment$1(frequencyDetails[1] +
|
|
21350
21878
|
'-' +
|
|
21351
21879
|
frequencyDetails[2] +
|
|
21352
21880
|
'-' +
|
|
@@ -21959,7 +22487,7 @@ class WorkflowComplianceComponent {
|
|
|
21959
22487
|
this.sendAuditRemindersValue = testPlanCategory.frequency_pattern
|
|
21960
22488
|
? parseInt(testPlanCategory.frequency_pattern.split('~')[2])
|
|
21961
22489
|
: 2;
|
|
21962
|
-
this.auditTime = moment(testPlanCategory?.frequency_time, 'HH:mm:ss').format('HH:mm a');
|
|
22490
|
+
this.auditTime = moment$1(testPlanCategory?.frequency_time, 'HH:mm:ss').format('HH:mm a');
|
|
21963
22491
|
}
|
|
21964
22492
|
//on sample toggle on/off
|
|
21965
22493
|
checkInputValue(event) {
|
|
@@ -24011,7 +24539,7 @@ class WorkflowPolicyComponent {
|
|
|
24011
24539
|
associatedDocuments: {
|
|
24012
24540
|
formatFiles: [],
|
|
24013
24541
|
},
|
|
24014
|
-
policyDueDate: moment(),
|
|
24542
|
+
policyDueDate: moment$1(),
|
|
24015
24543
|
customTags: [],
|
|
24016
24544
|
checkpointDetails: [],
|
|
24017
24545
|
totalQuestion: 0,
|
|
@@ -24823,7 +25351,7 @@ class WorkflowPolicyComponent {
|
|
|
24823
25351
|
(this.policyForm.mark_failed_after = event.failedAfter);
|
|
24824
25352
|
this.policyForm.remind_days_before_due_date = event.window;
|
|
24825
25353
|
this.policyForm.failed_time = event.timeIn24Hr;
|
|
24826
|
-
this.policyForm.assignee_start_date = moment(event.startFrom * 1000).format('ddd MMM DD YYYY');
|
|
25354
|
+
this.policyForm.assignee_start_date = moment$1(event.startFrom * 1000).format('ddd MMM DD YYYY');
|
|
24827
25355
|
this.activateSelector('frequency', false);
|
|
24828
25356
|
const payload = {
|
|
24829
25357
|
frequency_details: event.pattern,
|
|
@@ -24909,7 +25437,7 @@ class WorkflowPolicyComponent {
|
|
|
24909
25437
|
this.policyForm.review_frequency_type = event.pattern.split('~')[0];
|
|
24910
25438
|
this.policyForm.review_remind_days_before_due_date = event.window;
|
|
24911
25439
|
this.policyForm.reviewFailedTime = event.timeIn24Hr;
|
|
24912
|
-
this.policyForm.reviewer_start_date = moment(event.startFrom * 1000).format('ddd MMM DD YYYY');
|
|
25440
|
+
this.policyForm.reviewer_start_date = moment$1(event.startFrom * 1000).format('ddd MMM DD YYYY');
|
|
24913
25441
|
this.activateSelector('reviewerFrequency', false);
|
|
24914
25442
|
const payload = {
|
|
24915
25443
|
frequency_details: event.pattern,
|
|
@@ -25056,7 +25584,7 @@ class WorkflowPolicyComponent {
|
|
|
25056
25584
|
? policy.mark_failed_after
|
|
25057
25585
|
: '',
|
|
25058
25586
|
// startDate: policy.policyDueDate.toDateString(),
|
|
25059
|
-
startDate: moment(policy.policyDueDate).format('ddd MMM DD YYYY'),
|
|
25587
|
+
startDate: moment$1(policy.policyDueDate).format('ddd MMM DD YYYY'),
|
|
25060
25588
|
ReviewerAttachments: policy.addReviewers && policy.documentsAndLinks.formatFiles
|
|
25061
25589
|
? reviewerFiles
|
|
25062
25590
|
: [],
|
|
@@ -25368,8 +25896,8 @@ class WorkflowPolicyComponent {
|
|
|
25368
25896
|
}
|
|
25369
25897
|
: { formatFiles: [] };
|
|
25370
25898
|
this.policyForm.policyDueDate = data.startDate
|
|
25371
|
-
? moment(data.startDate)
|
|
25372
|
-
: moment();
|
|
25899
|
+
? moment$1(data.startDate)
|
|
25900
|
+
: moment$1();
|
|
25373
25901
|
this.policyForm.checkpointDetails = data.checkpoints
|
|
25374
25902
|
? data.checkpoints
|
|
25375
25903
|
: [];
|
|
@@ -26746,19 +27274,19 @@ class AddMultipleRiskComponent {
|
|
|
26746
27274
|
this.categoryList = {
|
|
26747
27275
|
strategic: {
|
|
26748
27276
|
name: 'STRATEGIC',
|
|
26749
|
-
data: []
|
|
27277
|
+
data: [],
|
|
26750
27278
|
},
|
|
26751
27279
|
operational: {
|
|
26752
27280
|
name: 'OPERATIONAL',
|
|
26753
|
-
data: []
|
|
27281
|
+
data: [],
|
|
26754
27282
|
},
|
|
26755
27283
|
compliance: {
|
|
26756
27284
|
name: 'COMPLIANCE',
|
|
26757
|
-
data: []
|
|
27285
|
+
data: [],
|
|
26758
27286
|
},
|
|
26759
27287
|
others: {
|
|
26760
27288
|
name: 'OTHERS',
|
|
26761
|
-
data: []
|
|
27289
|
+
data: [],
|
|
26762
27290
|
},
|
|
26763
27291
|
};
|
|
26764
27292
|
this.category = {
|
|
@@ -26779,7 +27307,7 @@ class AddMultipleRiskComponent {
|
|
|
26779
27307
|
likelihood: [],
|
|
26780
27308
|
impact: [],
|
|
26781
27309
|
velocity: [],
|
|
26782
|
-
vulnerability: []
|
|
27310
|
+
vulnerability: [],
|
|
26783
27311
|
};
|
|
26784
27312
|
this.isLoader = false;
|
|
26785
27313
|
this.showCategoryList = false;
|
|
@@ -26792,7 +27320,7 @@ class AddMultipleRiskComponent {
|
|
|
26792
27320
|
this.showExcel = false;
|
|
26793
27321
|
this.memberId = 0;
|
|
26794
27322
|
this.organizationId = 0;
|
|
26795
|
-
this.errorMessage =
|
|
27323
|
+
this.errorMessage = ' invalid file error';
|
|
26796
27324
|
this.downloadStatus = 'NOT_DOWNLOADING';
|
|
26797
27325
|
this.downloadPercent = 0;
|
|
26798
27326
|
this.smileyMessage = `You're All Set! We're uploading the risks. The risk owners will be notified once the risks have been uploaded.`;
|
|
@@ -26803,10 +27331,16 @@ class AddMultipleRiskComponent {
|
|
|
26803
27331
|
this.showSmiley = false;
|
|
26804
27332
|
this.member_obj_id = '';
|
|
26805
27333
|
this.defaultOwner = '';
|
|
26806
|
-
this.frequencyType = [
|
|
26807
|
-
|
|
26808
|
-
|
|
27334
|
+
this.frequencyType = [
|
|
27335
|
+
'weekly',
|
|
27336
|
+
'monthly',
|
|
27337
|
+
'quarterly',
|
|
27338
|
+
'biannual',
|
|
27339
|
+
'annual',
|
|
27340
|
+
'one time',
|
|
27341
|
+
];
|
|
26809
27342
|
}
|
|
27343
|
+
ngOnChanges(changes) { }
|
|
26810
27344
|
ngOnInit() {
|
|
26811
27345
|
this.pickerChanged.emit(false);
|
|
26812
27346
|
this.getCategoryList();
|
|
@@ -26823,13 +27357,14 @@ class AddMultipleRiskComponent {
|
|
|
26823
27357
|
this.categoryList.operational.data = res.operational_arr;
|
|
26824
27358
|
this.categoryList.compliance.data = res.compliance_arr;
|
|
26825
27359
|
this.categoryList.others.data = res.others_arr;
|
|
26826
|
-
}, err => {
|
|
27360
|
+
}, (err) => {
|
|
26827
27361
|
console.error(err);
|
|
26828
27362
|
this.isLoader = false;
|
|
26829
27363
|
});
|
|
26830
27364
|
}
|
|
26831
27365
|
saveSelectedCategory(category) {
|
|
26832
|
-
if (this.category?.selectedCategory?.category_id !=
|
|
27366
|
+
if (this.category?.selectedCategory?.category_id !=
|
|
27367
|
+
category?.selectedCategory?.category_id) {
|
|
26833
27368
|
this.downloadStatus = 'NOT_DOWNLOADING';
|
|
26834
27369
|
}
|
|
26835
27370
|
this.showCategoryList = false;
|
|
@@ -26843,14 +27378,14 @@ class AddMultipleRiskComponent {
|
|
|
26843
27378
|
removeCategory() {
|
|
26844
27379
|
this.category = {
|
|
26845
27380
|
type: 'strategic',
|
|
26846
|
-
selectedCategory: ''
|
|
27381
|
+
selectedCategory: '',
|
|
26847
27382
|
};
|
|
26848
27383
|
this.reset();
|
|
26849
27384
|
}
|
|
26850
27385
|
getSettingsInfo() {
|
|
26851
|
-
this.riskService.getRiskSettingDetails().subscribe(res => {
|
|
27386
|
+
this.riskService.getRiskSettingDetails().subscribe((res) => {
|
|
26852
27387
|
this.settingsInfo = res;
|
|
26853
|
-
}, err => {
|
|
27388
|
+
}, (err) => {
|
|
26854
27389
|
console.error(err);
|
|
26855
27390
|
});
|
|
26856
27391
|
}
|
|
@@ -26865,7 +27400,7 @@ class AddMultipleRiskComponent {
|
|
|
26865
27400
|
this.riskBulkUpload = {
|
|
26866
27401
|
header: [],
|
|
26867
27402
|
weightFactors: [],
|
|
26868
|
-
risks: []
|
|
27403
|
+
risks: [],
|
|
26869
27404
|
};
|
|
26870
27405
|
this.templateInfo = {
|
|
26871
27406
|
memberId: '',
|
|
@@ -26876,7 +27411,7 @@ class AddMultipleRiskComponent {
|
|
|
26876
27411
|
likelihood: [],
|
|
26877
27412
|
impact: [],
|
|
26878
27413
|
velocity: [],
|
|
26879
|
-
vulnerability: []
|
|
27414
|
+
vulnerability: [],
|
|
26880
27415
|
};
|
|
26881
27416
|
const reference = document.querySelector('#scrollReference');
|
|
26882
27417
|
if (reference) {
|
|
@@ -26911,14 +27446,14 @@ class AddMultipleRiskComponent {
|
|
|
26911
27446
|
if (element[8]) {
|
|
26912
27447
|
const member = {
|
|
26913
27448
|
name: element[8],
|
|
26914
|
-
member_id: element[9]
|
|
27449
|
+
member_id: element[9],
|
|
26915
27450
|
};
|
|
26916
27451
|
this.templateInfo.ownerList.push(member);
|
|
26917
27452
|
}
|
|
26918
27453
|
if (element[2]) {
|
|
26919
27454
|
const mitigation = {
|
|
26920
27455
|
mitigationName: element[2],
|
|
26921
|
-
mitigation_id: element[3]
|
|
27456
|
+
mitigation_id: element[3],
|
|
26922
27457
|
};
|
|
26923
27458
|
this.templateInfo.mitigationList.push(mitigation);
|
|
26924
27459
|
}
|
|
@@ -26926,7 +27461,7 @@ class AddMultipleRiskComponent {
|
|
|
26926
27461
|
const rc = {
|
|
26927
27462
|
rcName: element[6],
|
|
26928
27463
|
rc_id: element[7],
|
|
26929
|
-
owner_ids: element[11]
|
|
27464
|
+
owner_ids: element[11],
|
|
26930
27465
|
};
|
|
26931
27466
|
this.templateInfo.rcList.push(rc);
|
|
26932
27467
|
}
|
|
@@ -26936,20 +27471,29 @@ class AddMultipleRiskComponent {
|
|
|
26936
27471
|
if (element[13]) {
|
|
26937
27472
|
this.templateInfo?.impact.push(element[13]);
|
|
26938
27473
|
}
|
|
26939
|
-
if (this.riskBulkUpload?.weightFactors?.includes('Velocity') &&
|
|
27474
|
+
if (this.riskBulkUpload?.weightFactors?.includes('Velocity') &&
|
|
27475
|
+
element[14]) {
|
|
26940
27476
|
this.templateInfo.velocity.push(element[14]);
|
|
26941
27477
|
}
|
|
26942
|
-
if (this.riskBulkUpload?.weightFactors?.includes('Vulnerability') &&
|
|
27478
|
+
if (this.riskBulkUpload?.weightFactors?.includes('Vulnerability') &&
|
|
27479
|
+
element[15]) {
|
|
26943
27480
|
this.templateInfo.vulnerability.push(element[15]);
|
|
26944
27481
|
}
|
|
26945
27482
|
});
|
|
26946
27483
|
if (this.fileName.substr(-5) !== '.xlsx') {
|
|
26947
|
-
this.errorMessage =
|
|
27484
|
+
this.errorMessage =
|
|
27485
|
+
'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
|
|
27486
|
+
this.category.selectedCategory.category_name +
|
|
27487
|
+
' RETRY';
|
|
26948
27488
|
this.isWrongFile = true;
|
|
26949
27489
|
return;
|
|
26950
27490
|
}
|
|
26951
|
-
if (this.riskBulkUpload.header[0] !==
|
|
26952
|
-
|
|
27491
|
+
if (this.riskBulkUpload.header[0] !==
|
|
27492
|
+
'What risk would you like to manage?*') {
|
|
27493
|
+
this.errorMessage =
|
|
27494
|
+
'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
|
|
27495
|
+
this.category.selectedCategory.category_name +
|
|
27496
|
+
' RETRY';
|
|
26953
27497
|
this.isWrongFile = false;
|
|
26954
27498
|
this.isWrongFormat = true;
|
|
26955
27499
|
return;
|
|
@@ -26960,18 +27504,26 @@ class AddMultipleRiskComponent {
|
|
|
26960
27504
|
this.defaultOwner = this.templateInfo.ownerList[defaultOwner].name;
|
|
26961
27505
|
}
|
|
26962
27506
|
else {
|
|
26963
|
-
this.errorMessage =
|
|
27507
|
+
this.errorMessage =
|
|
27508
|
+
'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
|
|
27509
|
+
this.category.selectedCategory.category_name +
|
|
27510
|
+
' RETRY';
|
|
26964
27511
|
this.isWrongFile = true;
|
|
26965
27512
|
return;
|
|
26966
27513
|
}
|
|
26967
|
-
if (
|
|
26968
|
-
this.
|
|
27514
|
+
if (this.member_obj_id != this.templateInfo.memberId ||
|
|
27515
|
+
this.category.selectedCategory._id != this.templateInfo.categoryId) {
|
|
27516
|
+
this.errorMessage =
|
|
27517
|
+
'The incorrect file has been uploaded. Please upload the template file for Risk Category:' +
|
|
27518
|
+
this.category.selectedCategory.category_name +
|
|
27519
|
+
' RETRY';
|
|
26969
27520
|
this.isWrongFile = true;
|
|
26970
27521
|
return;
|
|
26971
27522
|
}
|
|
26972
27523
|
const isEmpty = this.checkEmptyFile();
|
|
26973
27524
|
if (isEmpty) {
|
|
26974
|
-
this.errorMessage =
|
|
27525
|
+
this.errorMessage =
|
|
27526
|
+
'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
|
|
26975
27527
|
this.isFileEmpty = true;
|
|
26976
27528
|
this.isWrongFile = false;
|
|
26977
27529
|
this.isWrongFormat = false;
|
|
@@ -27045,16 +27597,19 @@ class AddMultipleRiskComponent {
|
|
|
27045
27597
|
// obj.customTag = customTags;
|
|
27046
27598
|
// }
|
|
27047
27599
|
let obj = this.setRiskDetails(risk);
|
|
27048
|
-
if (obj?.likelihood &&
|
|
27600
|
+
if (obj?.likelihood &&
|
|
27601
|
+
!this.templateInfo?.likelihood.includes(obj?.likelihood)) {
|
|
27049
27602
|
obj.isValid = false;
|
|
27050
27603
|
}
|
|
27051
27604
|
if (obj?.impact && !this.templateInfo?.impact.includes(obj?.impact)) {
|
|
27052
27605
|
obj.isValid = false;
|
|
27053
27606
|
}
|
|
27054
|
-
if (obj?.velocity &&
|
|
27607
|
+
if (obj?.velocity &&
|
|
27608
|
+
!this.templateInfo?.velocity.includes(obj?.velocity)) {
|
|
27055
27609
|
obj.isValid = false;
|
|
27056
27610
|
}
|
|
27057
|
-
if (obj?.vulnerability &&
|
|
27611
|
+
if (obj?.vulnerability &&
|
|
27612
|
+
!this.templateInfo?.vulnerability.includes(obj?.vulnerability)) {
|
|
27058
27613
|
obj.isValid = false;
|
|
27059
27614
|
}
|
|
27060
27615
|
this.riskBulkUpload.risks.push(obj);
|
|
@@ -27080,11 +27635,14 @@ class AddMultipleRiskComponent {
|
|
|
27080
27635
|
}
|
|
27081
27636
|
checkValidity(risk) {
|
|
27082
27637
|
const re = / |<br>/g;
|
|
27083
|
-
let trimmedName =
|
|
27638
|
+
let trimmedName = risk[0] ? risk[0].toString().replace(re, '').trim() : '';
|
|
27084
27639
|
trimmedName = trimmedName.replace(/ +/g, ' ');
|
|
27085
27640
|
// || (this.assessmentDeadLine && (!risk[6]))
|
|
27086
|
-
if (
|
|
27087
|
-
|
|
27641
|
+
if (!trimmedName ||
|
|
27642
|
+
(risk[3] && risk[3] == risk[6]) ||
|
|
27643
|
+
(!risk[3] && this.defaultOwner == risk[6]) ||
|
|
27644
|
+
!risk[2] ||
|
|
27645
|
+
!this.frequencyType?.includes(risk[4]?.toLowerCase())) {
|
|
27088
27646
|
return false;
|
|
27089
27647
|
}
|
|
27090
27648
|
else {
|
|
@@ -27096,8 +27654,14 @@ class AddMultipleRiskComponent {
|
|
|
27096
27654
|
this.downloadPercent = 0;
|
|
27097
27655
|
const today = new Date().toISOString().split('T');
|
|
27098
27656
|
const downloadDate = today[0];
|
|
27099
|
-
const fileName = 'VComply - Risk Module - Add Multiple Risks - ' +
|
|
27100
|
-
|
|
27657
|
+
const fileName = 'VComply - Risk Module - Add Multiple Risks - ' +
|
|
27658
|
+
this.category?.selectedCategory?.category_name +
|
|
27659
|
+
' - ' +
|
|
27660
|
+
downloadDate +
|
|
27661
|
+
'.xlsx';
|
|
27662
|
+
this.riskService
|
|
27663
|
+
.downloadTemplate(this.category.selectedCategory._id)
|
|
27664
|
+
.subscribe((data) => {
|
|
27101
27665
|
if (data.loaded) {
|
|
27102
27666
|
this.downloadPercent = 100 * (data.loaded / data.total);
|
|
27103
27667
|
}
|
|
@@ -27119,7 +27683,14 @@ class AddMultipleRiskComponent {
|
|
|
27119
27683
|
if (risk?.frequency.toLowerCase() === 'one time') {
|
|
27120
27684
|
const date = new Date();
|
|
27121
27685
|
date.setDate(date.getDate() + 1);
|
|
27122
|
-
frequencyValue =
|
|
27686
|
+
frequencyValue =
|
|
27687
|
+
'0~' +
|
|
27688
|
+
'' +
|
|
27689
|
+
date.getFullYear() +
|
|
27690
|
+
'~' +
|
|
27691
|
+
(date.getMonth() + 1) +
|
|
27692
|
+
'~' +
|
|
27693
|
+
date.getDate();
|
|
27123
27694
|
}
|
|
27124
27695
|
else {
|
|
27125
27696
|
frequencyValue = this.frequencyService.shortHand_freqCal(risk?.frequency);
|
|
@@ -27130,8 +27701,12 @@ class AddMultipleRiskComponent {
|
|
|
27130
27701
|
description: risk?.description,
|
|
27131
27702
|
category_custom_tag: risk?.customTag,
|
|
27132
27703
|
assessment_deadline_enable: this.settingsInfo?.assessment_deadline_enable,
|
|
27133
|
-
owner:
|
|
27134
|
-
|
|
27704
|
+
owner: risk?.owner
|
|
27705
|
+
? this.returnIds(risk?.owner, 'owner')
|
|
27706
|
+
: this.returnIds(this.defaultOwner, 'owner'),
|
|
27707
|
+
category: this.category?.selectedCategory?.category_id
|
|
27708
|
+
? [this.category?.selectedCategory?.category_id]
|
|
27709
|
+
: [],
|
|
27135
27710
|
manage_oversight: this.returnIds(risk?.overseer, 'overseer'),
|
|
27136
27711
|
rc_id: this.returnIds(risk?.rcName, 'rc_id'),
|
|
27137
27712
|
head_ids: this.returnIds(risk?.rcName, 'rc_owner_ids'),
|
|
@@ -27146,7 +27721,7 @@ class AddMultipleRiskComponent {
|
|
|
27146
27721
|
risk_progress_flag: 1,
|
|
27147
27722
|
IfAssessmentDone: 0,
|
|
27148
27723
|
workshop_id: '',
|
|
27149
|
-
complete_assessment:
|
|
27724
|
+
complete_assessment: completeAssessment ? 1 : 0,
|
|
27150
27725
|
mitigation: this.returnIds(risk?.mitigationPriority, 'mitigation'),
|
|
27151
27726
|
weightage_enable: this.settingsInfo?.weightage_enable,
|
|
27152
27727
|
treatment_type: this.settingsInfo?.treatment_criteria,
|
|
@@ -27160,12 +27735,17 @@ class AddMultipleRiskComponent {
|
|
|
27160
27735
|
],
|
|
27161
27736
|
// assessment_deadline_set_by: this.settingsInfo?.assessment_deadline_set_by, //check1 not appearing
|
|
27162
27737
|
assessment_deadline_set_by: this.settingsInfo?.assessment_deadline_set_by ?? this.memberId,
|
|
27163
|
-
assessment_deadline_days:
|
|
27738
|
+
assessment_deadline_days: this.settingsInfo
|
|
27739
|
+
?.assessment_deadline_enable
|
|
27740
|
+
? this.settingsInfo?.assessment_deadline_days
|
|
27741
|
+
: risk?.assessmentDeadLine,
|
|
27164
27742
|
frequency_details: {
|
|
27165
27743
|
frequency: frequencyValue,
|
|
27166
|
-
started_at: this.changeTimeZone(new Date) ?? moment().format(
|
|
27167
|
-
frequency_time:
|
|
27168
|
-
remind_before_days: risk?.emailReminder
|
|
27744
|
+
started_at: this.changeTimeZone(new Date()) ?? moment$1().format('YYYY-MM-DD'),
|
|
27745
|
+
frequency_time: '11:00 pm',
|
|
27746
|
+
remind_before_days: risk?.emailReminder
|
|
27747
|
+
? risk?.emailReminder
|
|
27748
|
+
: this.setDefaultEmailReminderValue(risk?.frequency),
|
|
27169
27749
|
},
|
|
27170
27750
|
risk_label: this.setRiskLabel(risk?.riskLabel),
|
|
27171
27751
|
mitigation_plan_recommendation: risk?.mitigationPlans ?? '',
|
|
@@ -27174,13 +27754,13 @@ class AddMultipleRiskComponent {
|
|
|
27174
27754
|
payload.push(obj);
|
|
27175
27755
|
}
|
|
27176
27756
|
});
|
|
27177
|
-
console.log(
|
|
27757
|
+
console.log('payloadpayloadpayloadpayloadpayloadpayload ====>', payload);
|
|
27178
27758
|
this.riskService.addBulkRisk(payload).subscribe((res) => {
|
|
27179
27759
|
this.loader = false;
|
|
27180
27760
|
this.showExcel = false;
|
|
27181
27761
|
this.showSmiley = true;
|
|
27182
27762
|
this.riskData = res;
|
|
27183
|
-
}, err => {
|
|
27763
|
+
}, (err) => {
|
|
27184
27764
|
console.log(err);
|
|
27185
27765
|
this.loader = false;
|
|
27186
27766
|
this.showExcel = false;
|
|
@@ -27202,7 +27782,9 @@ class AddMultipleRiskComponent {
|
|
|
27202
27782
|
let owner_ids = [];
|
|
27203
27783
|
this.templateInfo.rcList.forEach((headerIds) => {
|
|
27204
27784
|
if (headerIds.rcName == item && headerIds.owner_ids) {
|
|
27205
|
-
owner_ids = headerIds.owner_ids.includes(',')
|
|
27785
|
+
owner_ids = headerIds.owner_ids.includes(',')
|
|
27786
|
+
? headerIds.owner_ids.split(',').map(Number)
|
|
27787
|
+
: [Number(headerIds.owner_ids)];
|
|
27206
27788
|
}
|
|
27207
27789
|
});
|
|
27208
27790
|
return owner_ids;
|
|
@@ -27240,14 +27822,14 @@ class AddMultipleRiskComponent {
|
|
|
27240
27822
|
this.riskBulkUpload = {
|
|
27241
27823
|
header: [],
|
|
27242
27824
|
weightFactors: [],
|
|
27243
|
-
risks: []
|
|
27825
|
+
risks: [],
|
|
27244
27826
|
};
|
|
27245
27827
|
this.templateInfo = {
|
|
27246
27828
|
memberId: '',
|
|
27247
27829
|
categoryId: '',
|
|
27248
27830
|
ownerList: [],
|
|
27249
27831
|
rcList: [],
|
|
27250
|
-
mitigationList: []
|
|
27832
|
+
mitigationList: [],
|
|
27251
27833
|
};
|
|
27252
27834
|
this.isFileEmpty = false;
|
|
27253
27835
|
this.isWrongFile = false;
|
|
@@ -27352,7 +27934,7 @@ class AddMultipleRiskComponent {
|
|
|
27352
27934
|
if (tag) {
|
|
27353
27935
|
const cTag = {
|
|
27354
27936
|
custom_tag_value: risk[index + i] ?? '',
|
|
27355
|
-
custom_tag_name: tag.tagName
|
|
27937
|
+
custom_tag_name: tag.tagName,
|
|
27356
27938
|
};
|
|
27357
27939
|
customTags.push(cTag);
|
|
27358
27940
|
}
|
|
@@ -27370,13 +27952,20 @@ class AddMultipleRiskComponent {
|
|
|
27370
27952
|
*/
|
|
27371
27953
|
setDefaultEmailReminderValue(frequencyType) {
|
|
27372
27954
|
switch (frequencyType?.toLowerCase()) {
|
|
27373
|
-
case 'weekly':
|
|
27374
|
-
|
|
27375
|
-
case '
|
|
27376
|
-
|
|
27377
|
-
case '
|
|
27378
|
-
|
|
27379
|
-
|
|
27955
|
+
case 'weekly':
|
|
27956
|
+
return 2;
|
|
27957
|
+
case 'monthly':
|
|
27958
|
+
return 7;
|
|
27959
|
+
case 'quarterly':
|
|
27960
|
+
return 7;
|
|
27961
|
+
case 'biannual':
|
|
27962
|
+
return 30;
|
|
27963
|
+
case 'annual':
|
|
27964
|
+
return 30;
|
|
27965
|
+
case 'one time':
|
|
27966
|
+
return 15;
|
|
27967
|
+
default:
|
|
27968
|
+
return 0;
|
|
27380
27969
|
}
|
|
27381
27970
|
}
|
|
27382
27971
|
/**
|
|
@@ -27387,9 +27976,12 @@ class AddMultipleRiskComponent {
|
|
|
27387
27976
|
*/
|
|
27388
27977
|
setRiskLabel(label) {
|
|
27389
27978
|
switch (label?.toLowerCase()) {
|
|
27390
|
-
case 'newly identified risks':
|
|
27391
|
-
|
|
27392
|
-
|
|
27979
|
+
case 'newly identified risks':
|
|
27980
|
+
return 1;
|
|
27981
|
+
case 'rapidly changing risks':
|
|
27982
|
+
return 2;
|
|
27983
|
+
default:
|
|
27984
|
+
return 1;
|
|
27393
27985
|
}
|
|
27394
27986
|
}
|
|
27395
27987
|
/**
|
|
@@ -27406,7 +27998,7 @@ class AddMultipleRiskComponent {
|
|
|
27406
27998
|
const invDate = new Date(date.toLocaleString('en-US', {
|
|
27407
27999
|
timeZone: this.authService.userDetails?.timezone,
|
|
27408
28000
|
}));
|
|
27409
|
-
return moment(invDate).format(
|
|
28001
|
+
return moment$1(invDate).format('YYYY-MM-DD');
|
|
27410
28002
|
}
|
|
27411
28003
|
}
|
|
27412
28004
|
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 });
|
|
@@ -28718,7 +29310,7 @@ class LogAnIssueComponent {
|
|
|
28718
29310
|
? []
|
|
28719
29311
|
: this.listData.userList.filter((e) => e.my_member_id === issueData?.assignee_id),
|
|
28720
29312
|
issueDueDate: issueData?.frequency_details?.frequency_date
|
|
28721
|
-
? moment(`${issueDueDate[0]}-${issueDueDate[1]}-${issueDueDate[2]}`)
|
|
29313
|
+
? moment$1(`${issueDueDate[0]}-${issueDueDate[1]}-${issueDueDate[2]}`)
|
|
28722
29314
|
: '',
|
|
28723
29315
|
issueDueTime: this.logService.convertFrom24To12Format(issueData.frequency_details.frequency_time),
|
|
28724
29316
|
exceptionType: issueData.exception_type ?? 1,
|
|
@@ -32758,7 +33350,7 @@ class AddMultipleResponsibilityComponent {
|
|
|
32758
33350
|
}
|
|
32759
33351
|
else {
|
|
32760
33352
|
const monthAndYear = month.split("'");
|
|
32761
|
-
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');
|
|
33353
|
+
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');
|
|
32762
33354
|
if (startDate == "Invalid date") {
|
|
32763
33355
|
return false;
|
|
32764
33356
|
}
|
|
@@ -32850,11 +33442,11 @@ class AddMultipleResponsibilityComponent {
|
|
|
32850
33442
|
const assignorDetails = (report.assignor) ? this.returnIds(report.assignor, 'assignor') : '';
|
|
32851
33443
|
const ccDetails = this.returnIds(report.alwaysNotify, 'cc');
|
|
32852
33444
|
const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
|
|
32853
|
-
const currentDate = moment().format('YYYY-MM-DD');
|
|
33445
|
+
const currentDate = moment$1().format('YYYY-MM-DD');
|
|
32854
33446
|
const categoryName = (report.responsibilityCategory.includes('[WITHIN]')) ? report.responsibilityCategory.split(' [')[0] : report.responsibilityCategory;
|
|
32855
33447
|
const frequencyValue = this.frequencyService.shortHand_freqCal(report.frequency, report.day, report.month);
|
|
32856
33448
|
const dateAndMonth = report.month.split("'");
|
|
32857
|
-
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');
|
|
33449
|
+
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');
|
|
32858
33450
|
let completeDays;
|
|
32859
33451
|
let notCompleteDays;
|
|
32860
33452
|
const frequencyType = frequencyValue.split('~')[0];
|
|
@@ -33176,7 +33768,19 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33176
33768
|
this.isNotificationPending = 0;
|
|
33177
33769
|
this.closeAddMultipleResponsibility = new EventEmitter();
|
|
33178
33770
|
this.queryParam = '';
|
|
33179
|
-
this.recentResponsibilityUrl = {
|
|
33771
|
+
this.recentResponsibilityUrl = {
|
|
33772
|
+
byResponsibilities: { type: ['recent_responsibilities'], subType: ['CC'] },
|
|
33773
|
+
byStatus: { type: [], subType: [] },
|
|
33774
|
+
filterObject: {
|
|
33775
|
+
responsibilityCenter: [],
|
|
33776
|
+
entrustedBy: [],
|
|
33777
|
+
entrustedTo: [],
|
|
33778
|
+
riskIds: [],
|
|
33779
|
+
responsibilityCategory: [],
|
|
33780
|
+
},
|
|
33781
|
+
timePeriodDetails: { type: '', selectedPeriod: '', selectedYear: '' },
|
|
33782
|
+
status: '',
|
|
33783
|
+
};
|
|
33180
33784
|
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":""}';
|
|
33181
33785
|
this.responsibilityBulkUpload = {
|
|
33182
33786
|
header: [],
|
|
@@ -33186,7 +33790,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33186
33790
|
this.tabIndex = {
|
|
33187
33791
|
frequency: 0,
|
|
33188
33792
|
ongoing: 1,
|
|
33189
|
-
onCompletion: 2
|
|
33793
|
+
onCompletion: 2,
|
|
33190
33794
|
};
|
|
33191
33795
|
this.bulkUpload = {
|
|
33192
33796
|
frequency: {
|
|
@@ -33203,7 +33807,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33203
33807
|
header: [],
|
|
33204
33808
|
subHeading: [],
|
|
33205
33809
|
reports: [],
|
|
33206
|
-
}
|
|
33810
|
+
},
|
|
33207
33811
|
};
|
|
33208
33812
|
this.templateInfo = {
|
|
33209
33813
|
categoryList: [],
|
|
@@ -33212,7 +33816,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33212
33816
|
assigneesList: [],
|
|
33213
33817
|
reviewerList: [],
|
|
33214
33818
|
parentResponsibility: [],
|
|
33215
|
-
memberId: ''
|
|
33819
|
+
memberId: '',
|
|
33216
33820
|
};
|
|
33217
33821
|
this.isLoader = false;
|
|
33218
33822
|
this.showCategoryList = false;
|
|
@@ -33227,14 +33831,24 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33227
33831
|
this.fileResponse = [];
|
|
33228
33832
|
this.memberId = 0;
|
|
33229
33833
|
this.organizationId = 0;
|
|
33230
|
-
this.errorMessage =
|
|
33834
|
+
this.errorMessage = ' invalid file error';
|
|
33231
33835
|
this.downloadStatus = 'NOT_DOWNLOADING';
|
|
33232
33836
|
this.downloadPercent = 0;
|
|
33233
33837
|
this.defaultOwner = '';
|
|
33234
33838
|
this.smileyMessage = `You're All Set! We're processing your request and you will be notified via email upon completion.`;
|
|
33235
33839
|
this.actionButtons = [
|
|
33236
|
-
{
|
|
33237
|
-
|
|
33840
|
+
{
|
|
33841
|
+
buttonText: 'Entrust More Responsibilities',
|
|
33842
|
+
class: 'white-btn',
|
|
33843
|
+
id: 'addMore',
|
|
33844
|
+
},
|
|
33845
|
+
{
|
|
33846
|
+
buttonText: this.isNotificationPending
|
|
33847
|
+
? 'View Responsibilities In Queue'
|
|
33848
|
+
: 'View Responsibilities',
|
|
33849
|
+
class: 'blue-btn',
|
|
33850
|
+
id: 'view',
|
|
33851
|
+
},
|
|
33238
33852
|
];
|
|
33239
33853
|
this.showSmiley = false;
|
|
33240
33854
|
this.member_obj_id = '';
|
|
@@ -33242,15 +33856,16 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33242
33856
|
set uploadedFileData(data) {
|
|
33243
33857
|
this.uploadedFile(data);
|
|
33244
33858
|
}
|
|
33245
|
-
ngOnChanges(changes) {
|
|
33246
|
-
}
|
|
33859
|
+
ngOnChanges(changes) { }
|
|
33247
33860
|
ngOnInit() {
|
|
33248
33861
|
this.pickerChanged.emit(false);
|
|
33249
33862
|
this.organizationId = this.authService.getOrganizationId();
|
|
33250
33863
|
this.memberId = this.authService.getMemberId();
|
|
33251
33864
|
this.member_obj_id = this.authService.getUserDetails()._id;
|
|
33252
33865
|
this.userInfo = this.authService.getUserDetails().user;
|
|
33253
|
-
this.defaultOwner =
|
|
33866
|
+
this.defaultOwner = this.userInfo
|
|
33867
|
+
? this.userInfo.name + ' (' + this.userInfo.email + ')'
|
|
33868
|
+
: '';
|
|
33254
33869
|
this.getUserDetails();
|
|
33255
33870
|
this.authService.getOrganizationDetails().subscribe((res) => {
|
|
33256
33871
|
this.riskClassEnabled = res.enable_riskclass;
|
|
@@ -33280,7 +33895,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33280
33895
|
assigneesList: [],
|
|
33281
33896
|
reviewerList: [],
|
|
33282
33897
|
parentResponsibility: [],
|
|
33283
|
-
memberId: ''
|
|
33898
|
+
memberId: '',
|
|
33284
33899
|
};
|
|
33285
33900
|
this.uploadedFiles = [];
|
|
33286
33901
|
const reference = document.querySelector('#scrollReference');
|
|
@@ -33322,7 +33937,8 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33322
33937
|
case 'on completion responsibilities':
|
|
33323
33938
|
this.setDataForDifferentTabs(sheetReport3, sheet);
|
|
33324
33939
|
break;
|
|
33325
|
-
default:
|
|
33940
|
+
default:
|
|
33941
|
+
break;
|
|
33326
33942
|
}
|
|
33327
33943
|
});
|
|
33328
33944
|
};
|
|
@@ -33346,7 +33962,8 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33346
33962
|
subHeading: [],
|
|
33347
33963
|
};
|
|
33348
33964
|
let sheetValue = XLSX.utils.sheet_to_json(ws, {
|
|
33349
|
-
header: 1,
|
|
33965
|
+
header: 1,
|
|
33966
|
+
raw: false,
|
|
33350
33967
|
});
|
|
33351
33968
|
let data = sheetValue.filter((res) => {
|
|
33352
33969
|
let isUndefined = '';
|
|
@@ -33361,22 +33978,28 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33361
33978
|
}
|
|
33362
33979
|
});
|
|
33363
33980
|
if (this.fileName.substr(-5) !== '.xlsx') {
|
|
33364
|
-
this.errorMessage =
|
|
33981
|
+
this.errorMessage =
|
|
33982
|
+
'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
|
|
33983
|
+
' RETRY';
|
|
33365
33984
|
this.isWrongFile = true;
|
|
33366
33985
|
return;
|
|
33367
33986
|
}
|
|
33368
33987
|
responsibilityBulkUpload.header = cloneDeep$1(data[2]);
|
|
33369
33988
|
responsibilityBulkUpload.subHeading = cloneDeep$1(data[3]);
|
|
33370
33989
|
data = data.slice(5);
|
|
33371
|
-
if (
|
|
33372
|
-
this.errorMessage =
|
|
33990
|
+
if (this.member_obj_id != this.templateInfo.memberId) {
|
|
33991
|
+
this.errorMessage =
|
|
33992
|
+
'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
|
|
33993
|
+
' RETRY';
|
|
33373
33994
|
this.isWrongFile = true;
|
|
33374
33995
|
return;
|
|
33375
33996
|
}
|
|
33376
33997
|
const responsibilityData = data.filter((dataElement) => dataElement.length > 0);
|
|
33377
33998
|
responsibilityData.forEach((report) => {
|
|
33378
33999
|
let validDate;
|
|
33379
|
-
const validUser = this.returnIds(report[2], 'entrusted_to')
|
|
34000
|
+
const validUser = this.returnIds(report[2], 'entrusted_to')
|
|
34001
|
+
? true
|
|
34002
|
+
: false;
|
|
33380
34003
|
if (responsibilityBulkUpload.header[1] === 'Program') {
|
|
33381
34004
|
validDate = this.compareWithCurrentDate(report[4], report[5]);
|
|
33382
34005
|
}
|
|
@@ -33387,20 +34010,24 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33387
34010
|
if (sheet?.toLowerCase() === 'frequency responsibilities') {
|
|
33388
34011
|
responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'frequency', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
|
|
33389
34012
|
this.bulkUpload.frequency.header = responsibilityBulkUpload?.header;
|
|
33390
|
-
this.bulkUpload.frequency.subHeading =
|
|
34013
|
+
this.bulkUpload.frequency.subHeading =
|
|
34014
|
+
responsibilityBulkUpload?.subHeading;
|
|
33391
34015
|
this.bulkUpload.frequency.reports = responsibilityBulkUpload?.reports;
|
|
33392
34016
|
}
|
|
33393
34017
|
if (sheet?.toLowerCase() === 'ongoing responsibilities') {
|
|
33394
34018
|
responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'ongoing', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
|
|
33395
34019
|
this.bulkUpload.ongoing.header = responsibilityBulkUpload?.header;
|
|
33396
|
-
this.bulkUpload.ongoing.subHeading =
|
|
34020
|
+
this.bulkUpload.ongoing.subHeading =
|
|
34021
|
+
responsibilityBulkUpload?.subHeading;
|
|
33397
34022
|
this.bulkUpload.ongoing.reports = responsibilityBulkUpload?.reports;
|
|
33398
34023
|
}
|
|
33399
34024
|
if (sheet?.toLowerCase() === 'on completion responsibilities') {
|
|
33400
34025
|
responsibilityBulkUpload.reports.push(this.setReportDetails(report, 'onCompletion', responsibilityBulkUpload.header[1] === 'Program' ? true : false));
|
|
33401
34026
|
this.bulkUpload.onCompletion.header = responsibilityBulkUpload?.header;
|
|
33402
|
-
this.bulkUpload.onCompletion.subHeading =
|
|
33403
|
-
|
|
34027
|
+
this.bulkUpload.onCompletion.subHeading =
|
|
34028
|
+
responsibilityBulkUpload?.subHeading;
|
|
34029
|
+
this.bulkUpload.onCompletion.reports =
|
|
34030
|
+
responsibilityBulkUpload?.reports;
|
|
33404
34031
|
}
|
|
33405
34032
|
});
|
|
33406
34033
|
const isEmpty = this.checkEmptyFile(data);
|
|
@@ -33408,14 +34035,19 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33408
34035
|
empty it will check if the file is the correct file, if it is not the correct file it will
|
|
33409
34036
|
return an error message. If it is the correct file it will call the fileUpload() function. */
|
|
33410
34037
|
if (isEmpty) {
|
|
33411
|
-
this.errorMessage =
|
|
34038
|
+
this.errorMessage =
|
|
34039
|
+
'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
|
|
33412
34040
|
this.isFileEmpty = true;
|
|
33413
34041
|
this.isWrongFile = false;
|
|
33414
34042
|
this.isWrongFormat = false;
|
|
33415
34043
|
return;
|
|
33416
34044
|
}
|
|
33417
|
-
else if (this.bulkUpload?.frequency?.header[0] !== 'Responsibility Name*' &&
|
|
33418
|
-
this.
|
|
34045
|
+
else if (this.bulkUpload?.frequency?.header[0] !== 'Responsibility Name*' &&
|
|
34046
|
+
this.bulkUpload?.ongoing?.header[0] !== 'Responsibility Name*' &&
|
|
34047
|
+
this.bulkUpload?.onCompletion?.header[0] !== 'Responsibility Name*') {
|
|
34048
|
+
this.errorMessage =
|
|
34049
|
+
'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
|
|
34050
|
+
' RETRY';
|
|
33419
34051
|
this.isWrongFile = false;
|
|
33420
34052
|
this.isWrongFormat = true;
|
|
33421
34053
|
return;
|
|
@@ -33487,20 +34119,24 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33487
34119
|
}
|
|
33488
34120
|
else {
|
|
33489
34121
|
const monthAndYear = month.split("'");
|
|
33490
|
-
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');
|
|
33491
|
-
if (startDate ==
|
|
34122
|
+
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');
|
|
34123
|
+
if (startDate == 'Invalid date') {
|
|
33492
34124
|
return false;
|
|
33493
34125
|
}
|
|
33494
|
-
setTimeout(() => {
|
|
33495
|
-
}, 5);
|
|
34126
|
+
setTimeout(() => { }, 5);
|
|
33496
34127
|
const date_value = new Date();
|
|
33497
|
-
date_value.setMonth(typeof month !== 'number'
|
|
34128
|
+
date_value.setMonth(typeof month !== 'number'
|
|
34129
|
+
? monthNames.filter((x) => x.month === month?.substring(0, 3))[0]
|
|
34130
|
+
?.value - 1
|
|
34131
|
+
: month);
|
|
33498
34132
|
date_value.setFullYear(Number(20 + month.split("'")[1]));
|
|
33499
34133
|
date_value.setDate(Number(day));
|
|
33500
34134
|
// const reportDate = new Date(day + month.split("'"));
|
|
33501
34135
|
// console.log((currentDate.toJSON().split('T')[0])+"&&"+(date_value.toJSON().split('T')[0]))
|
|
33502
34136
|
// debugger
|
|
33503
|
-
if (
|
|
34137
|
+
if (currentDate.toJSON().split('T')[0] !=
|
|
34138
|
+
date_value.toJSON().split('T')[0] &&
|
|
34139
|
+
currentDate > date_value) {
|
|
33504
34140
|
return false;
|
|
33505
34141
|
}
|
|
33506
34142
|
else {
|
|
@@ -33533,7 +34169,10 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33533
34169
|
else {
|
|
33534
34170
|
// const reportDate = new Date(day + month.split("'"));
|
|
33535
34171
|
const date_value = new Date();
|
|
33536
|
-
date_value.setMonth(typeof month !== 'number'
|
|
34172
|
+
date_value.setMonth(typeof month !== 'number'
|
|
34173
|
+
? monthNames.filter((x) => x.month === month?.substring(0, 3))[0]
|
|
34174
|
+
?.value - 1
|
|
34175
|
+
: month);
|
|
33537
34176
|
date_value.setFullYear(Number(20 + month.split("'")[1]));
|
|
33538
34177
|
date_value.setDate(Number(day));
|
|
33539
34178
|
if (currentDate > date_value) {
|
|
@@ -33579,21 +34218,31 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33579
34218
|
}
|
|
33580
34219
|
const rcDetails = this.returnIds(report?.responsibilityCenter, 'rc_id');
|
|
33581
34220
|
const reviewerDetails = this.returnIds(report?.reviewer, 'reviewer');
|
|
33582
|
-
const assignorDetails =
|
|
34221
|
+
const assignorDetails = report?.assignor
|
|
34222
|
+
? this.returnIds(report?.assignor, 'assignor')
|
|
34223
|
+
: '';
|
|
33583
34224
|
// const ccDetails: any = this.returnIds(report.alwaysNotify, 'cc');
|
|
33584
34225
|
const ccDetails = this.returnIds(report?.overseer, 'cc');
|
|
33585
34226
|
const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
|
|
33586
|
-
const currentDate = moment().format('YYYY-MM-DD');
|
|
34227
|
+
const currentDate = moment$1().format('YYYY-MM-DD');
|
|
33587
34228
|
// const categoryName = (report.responsibilityCategory.includes('[WITHIN]')) ? report.responsibilityCategory.split(' [')[0] : report.responsibilityCategory
|
|
33588
|
-
let ongoingReminderType = {
|
|
34229
|
+
let ongoingReminderType = { Weekly: 1, Monthly: 2, Quarterly: 3 };
|
|
33589
34230
|
const ongoingValues = {
|
|
33590
34231
|
setReminder: report?.setReminder,
|
|
33591
|
-
frequencyReminder: ongoingReminderType[report?.frequencyReminder]
|
|
34232
|
+
frequencyReminder: ongoingReminderType[report?.frequencyReminder],
|
|
33592
34233
|
};
|
|
33593
34234
|
const frequencyValue = this.frequencyService.shortHand_freqCal(report?.frequency, report?.day, report?.month, '', report?.dueDate, ongoingValues);
|
|
33594
34235
|
// const frequencyValue = this.frequencyService.shortHand_freqCal(report?.frequency, report?.day, report?.month, '');
|
|
33595
34236
|
const dateAndMonth = report?.month?.split("'");
|
|
33596
|
-
const startDate = dateAndMonth
|
|
34237
|
+
const startDate = dateAndMonth
|
|
34238
|
+
? moment$1(report?.day +
|
|
34239
|
+
'-' +
|
|
34240
|
+
dateAndMonth[0] +
|
|
34241
|
+
'-' +
|
|
34242
|
+
20 +
|
|
34243
|
+
dateAndMonth[1] +
|
|
34244
|
+
' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss')
|
|
34245
|
+
: '';
|
|
33597
34246
|
let completeDays;
|
|
33598
34247
|
let notCompleteDays;
|
|
33599
34248
|
const frequencyType = frequencyValue?.split('~')[0];
|
|
@@ -33614,77 +34263,143 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33614
34263
|
const obj = {
|
|
33615
34264
|
userId: this.templateInfo?.memberId,
|
|
33616
34265
|
organisation_id: this.organizationId,
|
|
33617
|
-
member_id:
|
|
33618
|
-
|
|
33619
|
-
|
|
33620
|
-
|
|
34266
|
+
member_id: assignorDetails
|
|
34267
|
+
? assignorDetails?.memberId
|
|
34268
|
+
: this.memberId,
|
|
34269
|
+
member_name: assignorDetails
|
|
34270
|
+
? report?.assignor
|
|
34271
|
+
? report?.assignor.split(' (')[0]
|
|
34272
|
+
: ''
|
|
34273
|
+
: this.defaultOwner
|
|
34274
|
+
? this.defaultOwner?.split(' (')[0]
|
|
34275
|
+
: '',
|
|
34276
|
+
member_email: assignorDetails
|
|
34277
|
+
? report?.assignor
|
|
34278
|
+
? report?.assignor?.split(' (')[1]?.replace(')', '')
|
|
34279
|
+
: ''
|
|
34280
|
+
: this.defaultOwner
|
|
34281
|
+
? this.defaultOwner?.split(' (')[1].replace(')', '')
|
|
34282
|
+
: '',
|
|
34283
|
+
created_by: assignorDetails ? this.memberId : 0,
|
|
33621
34284
|
report_name: report?.responsibilityName ?? '',
|
|
33622
34285
|
entrusted_to: report?.assignee?.split(' (')[0] ?? '',
|
|
33623
|
-
entrusted_to_id: this.isGroupSelected(report?.assignee)
|
|
33624
|
-
|
|
34286
|
+
entrusted_to_id: this.isGroupSelected(report?.assignee)
|
|
34287
|
+
? this.getEmployeeIdFromGroup(report?.assignee)
|
|
34288
|
+
: this.returnIds(report?.assignee, 'entrusted_to')?.toString() ??
|
|
34289
|
+
'',
|
|
34290
|
+
email_address: !this.isGroupSelected(report?.assignee)
|
|
34291
|
+
? report?.assignee?.split(' (')[1]?.replace(')', '') ?? ''
|
|
34292
|
+
: '',
|
|
33625
34293
|
isGroupAssignTo: report?.assigneeType?.includes('Any') ? 1 : 0,
|
|
33626
34294
|
// category_name: categoryName,
|
|
33627
34295
|
category_name_with_tree: '',
|
|
33628
34296
|
category_id: this.getProgramId(report?.program, report?.programCategory).categoryId?.toString() ?? '',
|
|
33629
|
-
program_cat_ids: this.getProgramId(report?.program, report?.programCategory)?.programId
|
|
34297
|
+
program_cat_ids: this.getProgramId(report?.program, report?.programCategory)?.programId
|
|
34298
|
+
? [
|
|
34299
|
+
this.getProgramId(report?.program, report?.programCategory)
|
|
34300
|
+
?.programId,
|
|
34301
|
+
]
|
|
34302
|
+
: [],
|
|
33630
34303
|
rc_name: rcDetails ? rcDetails?.name : '',
|
|
33631
34304
|
rc_id: rcDetails ? rcDetails?.rcId : 0,
|
|
33632
|
-
entity_tree:
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
34305
|
+
entity_tree: rcDetails && rcDetails?.rcId
|
|
34306
|
+
? [
|
|
34307
|
+
{
|
|
34308
|
+
parent_rc_ids: rcDetails ? rcDetails?.parentIds : [],
|
|
34309
|
+
rc_id: rcDetails ? rcDetails?.rcId : 0,
|
|
34310
|
+
},
|
|
34311
|
+
]
|
|
34312
|
+
: [],
|
|
33636
34313
|
userGroupIds: {
|
|
33637
|
-
assigneeAllGroupIds:
|
|
33638
|
-
|
|
34314
|
+
assigneeAllGroupIds: !report?.assigneeType?.includes('Any') &&
|
|
34315
|
+
this.isGroupSelected(report?.assignee)
|
|
34316
|
+
? [this.returnIds(report?.assignee, 'entrusted_to')]
|
|
34317
|
+
: [],
|
|
34318
|
+
assigneeAnyoneGroupIds: report?.assigneeType?.includes('Any') &&
|
|
34319
|
+
this.isGroupSelected(report?.assignee)
|
|
34320
|
+
? [this.returnIds(report?.assignee, 'entrusted_to')]
|
|
34321
|
+
: [],
|
|
33639
34322
|
ccEmailGroupIds: [],
|
|
33640
34323
|
failureCCEmailGroupIds: [],
|
|
33641
|
-
reviewerGroupIds: []
|
|
34324
|
+
reviewerGroupIds: [],
|
|
33642
34325
|
},
|
|
33643
34326
|
frequency_handler: frequencyValue,
|
|
33644
34327
|
compliance_type: frequencyValue?.split('~')[0],
|
|
33645
34328
|
frequency_description: report?.frequency,
|
|
33646
|
-
start_date:
|
|
34329
|
+
start_date: report?.day ? startDate : currentDate + ' 00:00:00',
|
|
33647
34330
|
risk_class: report?.reportClass ?? '',
|
|
33648
|
-
risk_classId:
|
|
34331
|
+
risk_classId: report?.reportClass
|
|
34332
|
+
? this.returnIds(report?.reportClass, 'risk_class')
|
|
34333
|
+
: this.riskClassEnabled
|
|
34334
|
+
? 1
|
|
34335
|
+
: 2,
|
|
33649
34336
|
doc_utc: 0,
|
|
33650
34337
|
comment: report?.notes ?? '',
|
|
33651
34338
|
cc_mail: ccDetails ? ccDetails?.email : '',
|
|
33652
34339
|
cc_mail_id: ccDetails ? ccDetails?.employeeId : '',
|
|
33653
34340
|
cc_failed_mail: ccFailureDetails ? ccFailureDetails?.email : '',
|
|
33654
34341
|
cc_failure_id: ccFailureDetails ? ccFailureDetails?.employeeId : 0,
|
|
33655
|
-
send_reminder:
|
|
33656
|
-
responsibilityWindow:
|
|
33657
|
-
|
|
33658
|
-
|
|
33659
|
-
|
|
34342
|
+
send_reminder: '',
|
|
34343
|
+
responsibilityWindow: frequencyType === '1'
|
|
34344
|
+
? 0
|
|
34345
|
+
: completeDays && completeDays != ''
|
|
34346
|
+
? completeDays
|
|
34347
|
+
: 0,
|
|
34348
|
+
failed_after: notCompleteDays && notCompleteDays != '' ? notCompleteDays : 0,
|
|
34349
|
+
excel_sheet_name: '',
|
|
34350
|
+
report_upload_flag: report?.isFormat === 'Yes' &&
|
|
34351
|
+
report?.formatForResponsibility?.length
|
|
34352
|
+
? 1
|
|
34353
|
+
: 0,
|
|
33660
34354
|
report_id: 0,
|
|
33661
34355
|
is_assigned_flag: 0,
|
|
33662
34356
|
private_library_id: 0,
|
|
33663
|
-
keycompliance:
|
|
33664
|
-
key_compliance:
|
|
34357
|
+
keycompliance: report?.keyResponsibility === 'Yes' ? 'Yes' : 'No',
|
|
34358
|
+
key_compliance: report?.keyResponsibility === 'Yes' ? 1 : 0,
|
|
33665
34359
|
reviewerId: reviewerDetails ? reviewerDetails?.employeeId : 0,
|
|
33666
|
-
reviewer_arr:
|
|
33667
|
-
|
|
33668
|
-
|
|
33669
|
-
|
|
33670
|
-
|
|
33671
|
-
|
|
33672
|
-
|
|
34360
|
+
reviewer_arr: reviewerDetails && reviewerDetails?.employeeId
|
|
34361
|
+
? {
|
|
34362
|
+
level1: {
|
|
34363
|
+
reviewers: [
|
|
34364
|
+
{
|
|
34365
|
+
member_id: reviewerDetails
|
|
34366
|
+
? reviewerDetails?.employeeId
|
|
34367
|
+
: 0,
|
|
34368
|
+
reviewer_accept: 0,
|
|
34369
|
+
},
|
|
34370
|
+
],
|
|
34371
|
+
type: 'SEQUENTIAL',
|
|
34372
|
+
},
|
|
33673
34373
|
}
|
|
33674
|
-
|
|
33675
|
-
reviewerWindow:
|
|
33676
|
-
|
|
34374
|
+
: {},
|
|
34375
|
+
reviewerWindow: report?.reviewToBeCompletedWithin &&
|
|
34376
|
+
report?.reviewToBeCompletedWithin !== ''
|
|
34377
|
+
? report?.reviewToBeCompletedWithin
|
|
34378
|
+
: 2,
|
|
34379
|
+
reviewerFailure: report?.reviewWillBeFailedAfter &&
|
|
34380
|
+
report?.reviewWillBeFailedAfter !== ''
|
|
34381
|
+
? report?.reviewWillBeFailedAfter
|
|
34382
|
+
: 2,
|
|
33677
34383
|
reviewer_email: reviewerDetails ? reviewerDetails?.email : '',
|
|
33678
|
-
formatForResponsibility: report?.formatForResponsibility
|
|
34384
|
+
formatForResponsibility: report?.formatForResponsibility
|
|
34385
|
+
? report.formatForResponsibility
|
|
34386
|
+
: '',
|
|
33679
34387
|
documentaryEvidence: report?.evidenceNotes ?? '',
|
|
33680
|
-
isdocumentaryEvidence:
|
|
34388
|
+
isdocumentaryEvidence: report.documentEvidenceRequired === 'Yes' ? 1 : 0,
|
|
33681
34389
|
objective: report.objective ?? '',
|
|
33682
34390
|
excel_sheet_info: this.fileResponse,
|
|
33683
34391
|
showList: false,
|
|
33684
34392
|
custom_tags: '[]',
|
|
33685
34393
|
questionnaire_type: '',
|
|
33686
|
-
on_completion_of_type:
|
|
33687
|
-
|
|
34394
|
+
on_completion_of_type: report?.frequency === 'On Completion of' ||
|
|
34395
|
+
report?.frequency?.toLowerCase() === 'ongoing'
|
|
34396
|
+
? 1
|
|
34397
|
+
: 0,
|
|
34398
|
+
on_completion_of: this.returnIds(report?.parentResponsibility, 'parentResponsibility')
|
|
34399
|
+
? [
|
|
34400
|
+
this.returnIds(report?.parentResponsibility, 'parentResponsibility'),
|
|
34401
|
+
]
|
|
34402
|
+
: [],
|
|
33688
34403
|
};
|
|
33689
34404
|
payload.push(obj);
|
|
33690
34405
|
}
|
|
@@ -33695,7 +34410,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33695
34410
|
this.showExcel = false;
|
|
33696
34411
|
this.showSmiley = true;
|
|
33697
34412
|
this.responsibilityData = res;
|
|
33698
|
-
}, err => {
|
|
34413
|
+
}, (err) => {
|
|
33699
34414
|
console.log(err);
|
|
33700
34415
|
this.loader = false;
|
|
33701
34416
|
this.showExcel = false;
|
|
@@ -33715,7 +34430,11 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33715
34430
|
else {
|
|
33716
34431
|
name = rc_element.name;
|
|
33717
34432
|
}
|
|
33718
|
-
rcObj = {
|
|
34433
|
+
rcObj = {
|
|
34434
|
+
name,
|
|
34435
|
+
rcId: rc_element.rc_id,
|
|
34436
|
+
parentIds: rc_element.parentIds,
|
|
34437
|
+
};
|
|
33719
34438
|
}
|
|
33720
34439
|
});
|
|
33721
34440
|
return rcObj;
|
|
@@ -33727,7 +34446,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33727
34446
|
reviewerObj = {
|
|
33728
34447
|
name: reviewerElement.name,
|
|
33729
34448
|
employeeId: reviewerElement.my_member_id,
|
|
33730
|
-
email: reviewerElement.email
|
|
34449
|
+
email: reviewerElement.email,
|
|
33731
34450
|
};
|
|
33732
34451
|
}
|
|
33733
34452
|
});
|
|
@@ -33740,7 +34459,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33740
34459
|
assignorObj = {
|
|
33741
34460
|
name: assignorElement.name,
|
|
33742
34461
|
email: assignorElement.email,
|
|
33743
|
-
memberId: assignorElement.member_id
|
|
34462
|
+
memberId: assignorElement.member_id,
|
|
33744
34463
|
};
|
|
33745
34464
|
}
|
|
33746
34465
|
});
|
|
@@ -33753,7 +34472,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33753
34472
|
ccObj = {
|
|
33754
34473
|
name: ccElement.name,
|
|
33755
34474
|
employeeId: ccElement.employee_id,
|
|
33756
|
-
email: ccElement.email
|
|
34475
|
+
email: ccElement.email,
|
|
33757
34476
|
};
|
|
33758
34477
|
}
|
|
33759
34478
|
});
|
|
@@ -33766,7 +34485,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33766
34485
|
ccfObj = {
|
|
33767
34486
|
name: ccfElement.name,
|
|
33768
34487
|
employeeId: ccfElement.employee_id,
|
|
33769
|
-
email: ccfElement.email
|
|
34488
|
+
email: ccfElement.email,
|
|
33770
34489
|
};
|
|
33771
34490
|
}
|
|
33772
34491
|
});
|
|
@@ -33829,7 +34548,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33829
34548
|
header: [],
|
|
33830
34549
|
subHeading: [],
|
|
33831
34550
|
reports: [],
|
|
33832
|
-
}
|
|
34551
|
+
},
|
|
33833
34552
|
};
|
|
33834
34553
|
this.templateInfo = {
|
|
33835
34554
|
categoryList: [],
|
|
@@ -33837,7 +34556,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33837
34556
|
assignorsList: [],
|
|
33838
34557
|
assigneesList: [],
|
|
33839
34558
|
reviewerList: [],
|
|
33840
|
-
memberId: ''
|
|
34559
|
+
memberId: '',
|
|
33841
34560
|
};
|
|
33842
34561
|
this.isFileEmpty = false;
|
|
33843
34562
|
this.isWrongFile = false;
|
|
@@ -33871,7 +34590,8 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33871
34590
|
urlSubstring = 'compliance/manage-responsibility?' + this.url;
|
|
33872
34591
|
}
|
|
33873
34592
|
else {
|
|
33874
|
-
urlSubstring =
|
|
34593
|
+
urlSubstring =
|
|
34594
|
+
'compliance/manage-responsibilities/responsibilities-queue';
|
|
33875
34595
|
}
|
|
33876
34596
|
}
|
|
33877
34597
|
else {
|
|
@@ -33903,7 +34623,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33903
34623
|
this.fileResponse.push(res);
|
|
33904
34624
|
}
|
|
33905
34625
|
this.loader = false;
|
|
33906
|
-
}, err => {
|
|
34626
|
+
}, (err) => {
|
|
33907
34627
|
console.error(err);
|
|
33908
34628
|
this.loader = false;
|
|
33909
34629
|
this.snackBar.show('OOPS! Something went wrong and the page could not be loaded. Could you please try one more time?', 'alert');
|
|
@@ -33914,13 +34634,15 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33914
34634
|
this.templateInfo.memberId = tempList[0][18];
|
|
33915
34635
|
}
|
|
33916
34636
|
else {
|
|
33917
|
-
this.errorMessage =
|
|
34637
|
+
this.errorMessage =
|
|
34638
|
+
'The incorrect file has been uploaded. Please upload the template which you downloaded from here.' +
|
|
34639
|
+
' RETRY';
|
|
33918
34640
|
this.isWrongFile = true;
|
|
33919
34641
|
return;
|
|
33920
34642
|
}
|
|
33921
34643
|
tempList.forEach((element) => {
|
|
33922
34644
|
/* Pushing the value of regulations Programs into the categoryList array. */
|
|
33923
|
-
if (element[26] && typeof
|
|
34645
|
+
if (element[26] && typeof element[26] === 'number') {
|
|
33924
34646
|
const regulations = {
|
|
33925
34647
|
programName: element[22],
|
|
33926
34648
|
programId: element[26],
|
|
@@ -33932,7 +34654,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33932
34654
|
this.templateInfo.categoryList.push(regulations);
|
|
33933
34655
|
}
|
|
33934
34656
|
/* Pushing the value of standards Programs into the categoryList array. */
|
|
33935
|
-
if (element[27] && typeof
|
|
34657
|
+
if (element[27] && typeof element[27] === 'number') {
|
|
33936
34658
|
const standards = {
|
|
33937
34659
|
programName: element[23],
|
|
33938
34660
|
programId: element[27],
|
|
@@ -33944,7 +34666,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33944
34666
|
this.templateInfo.categoryList.push(standards);
|
|
33945
34667
|
}
|
|
33946
34668
|
/* Pushing the value of internal Controls Programs into the categoryList array. */
|
|
33947
|
-
if (element[28] && typeof
|
|
34669
|
+
if (element[28] && typeof element[28] === 'number') {
|
|
33948
34670
|
const internalControls = {
|
|
33949
34671
|
programName: element[24],
|
|
33950
34672
|
programId: element[28],
|
|
@@ -33956,7 +34678,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33956
34678
|
this.templateInfo.categoryList.push(internalControls);
|
|
33957
34679
|
}
|
|
33958
34680
|
/* Pushing the value of others Programs into the categoryList array. */
|
|
33959
|
-
if (element[29] && typeof
|
|
34681
|
+
if (element[29] && typeof element[29] === 'number') {
|
|
33960
34682
|
const others = {
|
|
33961
34683
|
programName: element[25],
|
|
33962
34684
|
programId: element[29],
|
|
@@ -33973,7 +34695,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33973
34695
|
const rc = {
|
|
33974
34696
|
name: element[9],
|
|
33975
34697
|
rc_id: element[10],
|
|
33976
|
-
parentIds: JSON.parse(element[11])
|
|
34698
|
+
parentIds: JSON.parse(element[11]),
|
|
33977
34699
|
};
|
|
33978
34700
|
this.templateInfo.rcList.push(rc);
|
|
33979
34701
|
}
|
|
@@ -33986,7 +34708,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33986
34708
|
name: element[19],
|
|
33987
34709
|
email: element[19],
|
|
33988
34710
|
employee_id: element[20],
|
|
33989
|
-
my_member_id: JSON.parse(element[21])
|
|
34711
|
+
my_member_id: JSON.parse(element[21]),
|
|
33990
34712
|
};
|
|
33991
34713
|
this.templateInfo.assigneesList.push(assignee);
|
|
33992
34714
|
}
|
|
@@ -33997,7 +34719,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
33997
34719
|
name: element[0],
|
|
33998
34720
|
email: element[1],
|
|
33999
34721
|
employee_id: element[3],
|
|
34000
|
-
my_member_id: element[4]
|
|
34722
|
+
my_member_id: element[4],
|
|
34001
34723
|
};
|
|
34002
34724
|
this.templateInfo.reviewerList.push(reviewer);
|
|
34003
34725
|
}
|
|
@@ -34019,7 +34741,7 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34019
34741
|
if (element[17]) {
|
|
34020
34742
|
const parentResponsibility = {
|
|
34021
34743
|
name: element[16],
|
|
34022
|
-
id: JSON.parse(element[17])
|
|
34744
|
+
id: JSON.parse(element[17]),
|
|
34023
34745
|
};
|
|
34024
34746
|
this.templateInfo.parentResponsibility.push(parentResponsibility);
|
|
34025
34747
|
}
|
|
@@ -34128,14 +34850,22 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34128
34850
|
reviewToBeCompletedWithin: report[21],
|
|
34129
34851
|
reviewWillBeFailedAfter: report[22],
|
|
34130
34852
|
overseer: report[23],
|
|
34131
|
-
notifyOnFailure: report[24]
|
|
34853
|
+
notifyOnFailure: report[24],
|
|
34132
34854
|
};
|
|
34133
34855
|
obj['isValidData'] = this.isValidData(obj);
|
|
34134
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34856
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34857
|
+
? true
|
|
34858
|
+
: false;
|
|
34135
34859
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34136
34860
|
obj['validDate'] = this.compareWithCurrentDate(obj?.day, obj?.month);
|
|
34137
34861
|
obj['isPastDate'] = this.isPastDate(obj?.day, obj?.month);
|
|
34138
|
-
obj['isValid'] =
|
|
34862
|
+
obj['isValid'] =
|
|
34863
|
+
obj['isValidData'] &&
|
|
34864
|
+
obj['validDate'] &&
|
|
34865
|
+
!obj['isPastDate'] &&
|
|
34866
|
+
obj?.frequency?.length &&
|
|
34867
|
+
!Object.values(obj['userValidateWithProgram']).includes(false) &&
|
|
34868
|
+
obj['isValidUser'];
|
|
34139
34869
|
return obj;
|
|
34140
34870
|
}
|
|
34141
34871
|
else {
|
|
@@ -34164,14 +34894,21 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34164
34894
|
reviewToBeCompletedWithin: report[18],
|
|
34165
34895
|
reviewWillBeFailedAfter: report[19],
|
|
34166
34896
|
overseer: report[20],
|
|
34167
|
-
notifyOnFailure: report[21]
|
|
34897
|
+
notifyOnFailure: report[21],
|
|
34168
34898
|
};
|
|
34169
34899
|
obj['isValidData'] = this.isValidData(obj);
|
|
34170
34900
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34171
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34901
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34902
|
+
? true
|
|
34903
|
+
: false;
|
|
34172
34904
|
obj['validDate'] = this.compareWithCurrentDate(obj?.day, obj?.month);
|
|
34173
34905
|
obj['isPastDate'] = this.isPastDate(obj?.day, obj?.month);
|
|
34174
|
-
obj['isValid'] =
|
|
34906
|
+
obj['isValid'] =
|
|
34907
|
+
obj['isValidData'] &&
|
|
34908
|
+
obj['validDate'] &&
|
|
34909
|
+
!obj['isPastDate'] &&
|
|
34910
|
+
obj?.frequency?.length &&
|
|
34911
|
+
obj['isValidUser'];
|
|
34175
34912
|
return obj;
|
|
34176
34913
|
}
|
|
34177
34914
|
break;
|
|
@@ -34204,12 +34941,17 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34204
34941
|
reviewToBeCompletedWithin: report[19],
|
|
34205
34942
|
reviewWillBeFailedAfter: report[20],
|
|
34206
34943
|
overseer: report[21],
|
|
34207
|
-
notifyOnFailure: report[22]
|
|
34944
|
+
notifyOnFailure: report[22],
|
|
34208
34945
|
};
|
|
34209
34946
|
obj['isValidData'] = this.isValidData(obj);
|
|
34210
34947
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34211
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34212
|
-
|
|
34948
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34949
|
+
? true
|
|
34950
|
+
: false;
|
|
34951
|
+
obj['isValid'] =
|
|
34952
|
+
obj['isValidData'] &&
|
|
34953
|
+
!Object.values(obj['userValidateWithProgram']).includes(false) &&
|
|
34954
|
+
obj['isValidUser'];
|
|
34213
34955
|
return obj;
|
|
34214
34956
|
}
|
|
34215
34957
|
else {
|
|
@@ -34236,11 +34978,13 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34236
34978
|
reviewToBeCompletedWithin: report[16],
|
|
34237
34979
|
reviewWillBeFailedAfter: report[17],
|
|
34238
34980
|
overseer: report[18],
|
|
34239
|
-
notifyOnFailure: report[19]
|
|
34981
|
+
notifyOnFailure: report[19],
|
|
34240
34982
|
};
|
|
34241
34983
|
obj['isValidData'] = this.isValidData(obj);
|
|
34242
34984
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34243
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34985
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34986
|
+
? true
|
|
34987
|
+
: false;
|
|
34244
34988
|
obj['isValid'] = obj['isValidData'] && obj['isValidUser'];
|
|
34245
34989
|
return obj;
|
|
34246
34990
|
}
|
|
@@ -34275,12 +35019,18 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34275
35019
|
reviewToBeCompletedWithin: report[21],
|
|
34276
35020
|
reviewWillBeFailedAfter: report[22],
|
|
34277
35021
|
overseer: report[23],
|
|
34278
|
-
notifyOnFailure: report[24]
|
|
35022
|
+
notifyOnFailure: report[24],
|
|
34279
35023
|
};
|
|
34280
35024
|
obj['isValidData'] = this.isValidData(obj);
|
|
34281
35025
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34282
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34283
|
-
|
|
35026
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
35027
|
+
? true
|
|
35028
|
+
: false;
|
|
35029
|
+
obj['isValid'] =
|
|
35030
|
+
obj['isValidData'] &&
|
|
35031
|
+
!Object.values(obj['userValidateWithProgram']).includes(false) &&
|
|
35032
|
+
obj?.parentResponsibility?.length &&
|
|
35033
|
+
obj['isValidUser'];
|
|
34284
35034
|
return obj;
|
|
34285
35035
|
}
|
|
34286
35036
|
else {
|
|
@@ -34309,12 +35059,17 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34309
35059
|
reviewToBeCompletedWithin: report[18],
|
|
34310
35060
|
reviewWillBeFailedAfter: report[19],
|
|
34311
35061
|
overseer: report[20],
|
|
34312
|
-
notifyOnFailure: report[21]
|
|
35062
|
+
notifyOnFailure: report[21],
|
|
34313
35063
|
};
|
|
34314
35064
|
obj['isValidData'] = this.isValidData(obj);
|
|
34315
35065
|
obj['userValidateWithProgram'] = this.validateDataWithProgram(obj);
|
|
34316
|
-
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
34317
|
-
|
|
35066
|
+
obj['isValidUser'] = this.returnIds(obj?.assignee, 'entrusted_to')
|
|
35067
|
+
? true
|
|
35068
|
+
: false;
|
|
35069
|
+
obj['isValid'] =
|
|
35070
|
+
obj['isValidData'] &&
|
|
35071
|
+
obj?.parentResponsibility?.length &&
|
|
35072
|
+
obj['isValidUser'];
|
|
34318
35073
|
return obj;
|
|
34319
35074
|
}
|
|
34320
35075
|
}
|
|
@@ -34342,7 +35097,9 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34342
35097
|
* @returns A boolean value.
|
|
34343
35098
|
*/
|
|
34344
35099
|
isValidData(data) {
|
|
34345
|
-
const responsibility = this.checkValidResponsibilityName(data?.responsibilityName)?.length
|
|
35100
|
+
const responsibility = this.checkValidResponsibilityName(data?.responsibilityName)?.length
|
|
35101
|
+
? true
|
|
35102
|
+
: false;
|
|
34346
35103
|
const assignee = data?.assignee?.length ? true : false;
|
|
34347
35104
|
const frequency = data?.frequency?.length ? true : false;
|
|
34348
35105
|
if (assignee && responsibility && frequency && this.isValidUsers(data)) {
|
|
@@ -34363,12 +35120,23 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34363
35120
|
* @returns A boolean value.
|
|
34364
35121
|
*/
|
|
34365
35122
|
isValidUsers(data) {
|
|
34366
|
-
if ((data?.assignor &&
|
|
34367
|
-
(
|
|
34368
|
-
|
|
34369
|
-
(
|
|
34370
|
-
|
|
34371
|
-
|
|
35123
|
+
if ((data?.assignor &&
|
|
35124
|
+
(data?.assignor == data?.overseer ||
|
|
35125
|
+
data?.assignor == data?.notifyOnFailure)) ||
|
|
35126
|
+
(!data?.assignor &&
|
|
35127
|
+
(this.defaultOwner == data?.overseer ||
|
|
35128
|
+
this.defaultOwner == data?.notifyOnFailure)) ||
|
|
35129
|
+
(data?.assignee &&
|
|
35130
|
+
(data?.assignee == data?.reviewer ||
|
|
35131
|
+
data?.assignee == data?.overseer ||
|
|
35132
|
+
data?.assignee == data?.notifyOnFailure)) ||
|
|
35133
|
+
(!data?.assignee &&
|
|
35134
|
+
(this.defaultOwner == data?.overseer ||
|
|
35135
|
+
this.defaultOwner == data?.notifyOnFailure)) ||
|
|
35136
|
+
(data?.reviewer &&
|
|
35137
|
+
(data?.reviewer == data?.overseer ||
|
|
35138
|
+
data?.reviewer == data?.notifyOnFailure)) ||
|
|
35139
|
+
!data?.assignee) {
|
|
34372
35140
|
return false;
|
|
34373
35141
|
}
|
|
34374
35142
|
else {
|
|
@@ -34400,16 +35168,24 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34400
35168
|
let isValidNotifyOnFailure = true;
|
|
34401
35169
|
if (program && this.orgDetails?.hasProgramFullPermission) {
|
|
34402
35170
|
if (program[0]?.assignee?.length && selectedAssignee?.length) {
|
|
34403
|
-
isValidAssignee = program[0]?.assignee?.includes(selectedAssignee[0]?.my_member_id)
|
|
35171
|
+
isValidAssignee = program[0]?.assignee?.includes(selectedAssignee[0]?.my_member_id)
|
|
35172
|
+
? true
|
|
35173
|
+
: false;
|
|
34404
35174
|
}
|
|
34405
35175
|
if (program[0]?.reviewer?.length && selectedReviewer?.length) {
|
|
34406
|
-
isValidReviewer = program[0]?.reviewer?.includes(selectedReviewer[0]?.my_member_id)
|
|
35176
|
+
isValidReviewer = program[0]?.reviewer?.includes(selectedReviewer[0]?.my_member_id)
|
|
35177
|
+
? true
|
|
35178
|
+
: false;
|
|
34407
35179
|
}
|
|
34408
35180
|
if (program[0]?.overseer?.length && selectedOverseer?.length) {
|
|
34409
|
-
isValidOverseer = program[0]?.overseer?.includes(selectedOverseer[0]?.my_member_id)
|
|
35181
|
+
isValidOverseer = program[0]?.overseer?.includes(selectedOverseer[0]?.my_member_id)
|
|
35182
|
+
? true
|
|
35183
|
+
: false;
|
|
34410
35184
|
}
|
|
34411
35185
|
if (program[0]?.overseer?.length && selectedNotifyOnFailure?.length) {
|
|
34412
|
-
isValidNotifyOnFailure = program[0]?.overseer?.includes(selectedNotifyOnFailure[0]?.my_member_id)
|
|
35186
|
+
isValidNotifyOnFailure = program[0]?.overseer?.includes(selectedNotifyOnFailure[0]?.my_member_id)
|
|
35187
|
+
? true
|
|
35188
|
+
: false;
|
|
34413
35189
|
}
|
|
34414
35190
|
}
|
|
34415
35191
|
return {
|
|
@@ -34440,7 +35216,8 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34440
35216
|
subProgramId = subProgram?.length ? subProgram[0]?.id : undefined;
|
|
34441
35217
|
}
|
|
34442
35218
|
if (subProgramId && program?.length) {
|
|
34443
|
-
categoryId =
|
|
35219
|
+
categoryId =
|
|
35220
|
+
program[0]?.programId?.toString() + ',' + subProgramId?.toString();
|
|
34444
35221
|
}
|
|
34445
35222
|
else if (program?.length) {
|
|
34446
35223
|
categoryId = program[0]?.programId?.toString();
|
|
@@ -34482,7 +35259,9 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
34482
35259
|
isGroupSelected(item) {
|
|
34483
35260
|
let isGroup = false;
|
|
34484
35261
|
this.templateInfo.assigneesList.forEach((enElement) => {
|
|
34485
|
-
if (enElement.nameAndEmail == item &&
|
|
35262
|
+
if (enElement.nameAndEmail == item &&
|
|
35263
|
+
(item?.includes('Users)') || item?.includes('User)')) &&
|
|
35264
|
+
typeof enElement?.my_member_id == 'object') {
|
|
34486
35265
|
isGroup = true;
|
|
34487
35266
|
}
|
|
34488
35267
|
});
|