vcomply-workflow-engine 6.1.56 → 6.1.59
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/esm2022/lib/add-multiple-responsibility/add-multiple-responsibility.component.mjs +13 -163
- package/esm2022/lib/add-multiple-responsibility-container/add-multiple-responsibility-container.component.mjs +8 -3
- package/esm2022/lib/add-multiple-responsibility-with-tab/add-multiple-responsibility-with-tab.component.mjs +13 -215
- package/esm2022/lib/constants/common.constants.mjs +2 -1
- package/esm2022/lib/services/bulk-upload.service.mjs +2 -2
- package/esm2022/lib/sharedComponents/frequency/frequency-ongoing/frequency-ongoing.component.mjs +5 -5
- package/esm2022/lib/workflow/grc-object/grc-object-container/grc-object-container.component.mjs +2 -3
- package/esm2022/lib/workflow/shared/components/program-responsibility-listing/program-responsibility-listing.component.mjs +4 -5
- package/esm2022/lib/workflow/shared/services/grc.service.mjs +3 -3
- package/fesm2022/vcomply-workflow-engine.mjs +42 -389
- package/fesm2022/vcomply-workflow-engine.mjs.map +1 -1
- package/lib/constants/common.constants.d.ts +1 -0
- package/lib/sharedComponents/frequency/frequency-ongoing/frequency-ongoing.component.d.ts +1 -0
- package/lib/workflow/shared/services/grc.service.d.ts +1 -1
- package/lib/workflow-risk/workflow-risk.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1010,7 +1010,7 @@ class GrcService {
|
|
|
1010
1010
|
this.env = config.envConfig;
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
|
-
getAllResponsibilities(pageNo) {
|
|
1013
|
+
getAllResponsibilities(pageNo, rcIds) {
|
|
1014
1014
|
const businessCycle = this.getBusinessCycle();
|
|
1015
1015
|
const formattedCycle = businessCycle.selected_cycle
|
|
1016
1016
|
? dayjs(businessCycle.selected_cycle.split('-')[0]).format('YYYY-MM-DD') +
|
|
@@ -1020,7 +1020,7 @@ class GrcService {
|
|
|
1020
1020
|
const headers = new HttpHeaders()
|
|
1021
1021
|
.set('token', this.authService.getAuthorizationToken())
|
|
1022
1022
|
.set('biz_cycle', formattedCycle);
|
|
1023
|
-
return this.http.get(this.env.complianceGet + `sailsResponsibilitiesList&page=1&limit=-1`, { headers });
|
|
1023
|
+
return this.http.get(this.env.complianceGet + `sailsResponsibilitiesList&page=1&limit=-1&rc=${rcIds}`, { headers });
|
|
1024
1024
|
}
|
|
1025
1025
|
getGRCList(event) {
|
|
1026
1026
|
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
@@ -6044,8 +6044,6 @@ class ProgramResponsibilityListingComponent {
|
|
|
6044
6044
|
this.animation = false;
|
|
6045
6045
|
}, 300);
|
|
6046
6046
|
this.getResponsibilitiesList();
|
|
6047
|
-
// this.getProgramsList();
|
|
6048
|
-
// this.getProgramsCount();
|
|
6049
6047
|
}
|
|
6050
6048
|
close() {
|
|
6051
6049
|
this.closeList.emit(this.preSelectedProgramAndResp);
|
|
@@ -6253,6 +6251,7 @@ class ProgramResponsibilityListingComponent {
|
|
|
6253
6251
|
params = params.append('paginationType', 'small');
|
|
6254
6252
|
params = params.append('pageType', 'risk');
|
|
6255
6253
|
params = params.append('callFrom', 'grc');
|
|
6254
|
+
const rcIds = this.getSelectedRCIds(this.selectedRC).join(',');
|
|
6256
6255
|
let businessCycle = {
|
|
6257
6256
|
start_date: this.currentBusinessCycle?.start_date,
|
|
6258
6257
|
end_date: this.currentBusinessCycle?.end_date,
|
|
@@ -6272,7 +6271,7 @@ class ProgramResponsibilityListingComponent {
|
|
|
6272
6271
|
},
|
|
6273
6272
|
};
|
|
6274
6273
|
this.responsibilityCall = this.grcService
|
|
6275
|
-
.getAllResponsibilities(this.responsibilityCurrentPage)
|
|
6274
|
+
.getAllResponsibilities(this.responsibilityCurrentPage, rcIds)
|
|
6276
6275
|
.subscribe({
|
|
6277
6276
|
next: (res) => {
|
|
6278
6277
|
this.categoryLoader = false;
|
|
@@ -6373,7 +6372,7 @@ class ProgramResponsibilityListingComponent {
|
|
|
6373
6372
|
}
|
|
6374
6373
|
getSelectedRCIds(selectedRC) {
|
|
6375
6374
|
let selectedRCIds = [];
|
|
6376
|
-
selectedRCIds = selectedRC?.map((rc) => rc?.
|
|
6375
|
+
selectedRCIds = selectedRC?.map((rc) => rc?.rcid);
|
|
6377
6376
|
return selectedRCIds;
|
|
6378
6377
|
}
|
|
6379
6378
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ProgramResponsibilityListingComponent, deps: [{ token: GrcService }, { token: ResponsibilityService }, { token: GetUserDetailsPipe$1 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -7903,7 +7902,7 @@ class GrcObjectContainerComponent {
|
|
|
7903
7902
|
this.checkIsDataLoaded();
|
|
7904
7903
|
}
|
|
7905
7904
|
getAllResponsibilitiesList() {
|
|
7906
|
-
this.grcService.getAllResponsibilities(0).subscribe({
|
|
7905
|
+
this.grcService.getAllResponsibilities(0, '').subscribe({
|
|
7907
7906
|
next: (data) => {
|
|
7908
7907
|
this.responsibilityList = data?.data?.responsibilities;
|
|
7909
7908
|
},
|
|
@@ -8400,7 +8399,6 @@ class GrcObjectContainerComponent {
|
|
|
8400
8399
|
this.additionalOption.LINK_RISK_CATEGORIES_RISKS = false;
|
|
8401
8400
|
this.populateOptionalFields();
|
|
8402
8401
|
}
|
|
8403
|
-
//TODO: Remove this after API is ready
|
|
8404
8402
|
getAllResponsibilities() {
|
|
8405
8403
|
this.apiService.getAllResponsibilities().subscribe({
|
|
8406
8404
|
next: (data) => {
|
|
@@ -12021,6 +12019,7 @@ const MONTH_NAMES = [
|
|
|
12021
12019
|
|
|
12022
12020
|
const NO_DATA_FOUND_IMAGE$1 = 'No results matched your search criteria.';
|
|
12023
12021
|
const PAGINATION_LIMIT = 30;
|
|
12022
|
+
const ONGOING_FREQUENCY = 'Ongoing responsibilities don’t follow a set schedule—they’re triggered by specific events. When you select this frequency, no due dates are generated automatically. You can add due dates manually as the event occurs, giving you full control over timing.';
|
|
12024
12023
|
|
|
12025
12024
|
class FrequencyService {
|
|
12026
12025
|
constructor(http, authService, grcService, config) {
|
|
@@ -29467,6 +29466,7 @@ class FrequencyOngoingComponent {
|
|
|
29467
29466
|
this.selectedType = 0; // selected type
|
|
29468
29467
|
this.selectedOngoingType = 2; // default month selected;
|
|
29469
29468
|
this.ongoingType = ['Week', 'Month', 'Quarter', 'Every 6 months', 'Annual'];
|
|
29469
|
+
this.ongoingFrequency = ONGOING_FREQUENCY;
|
|
29470
29470
|
this.startDate = Math.floor(Date.now() / 1000);
|
|
29471
29471
|
this.lifecycleDetails = '0000-00-00~~0';
|
|
29472
29472
|
this.frequencyDetails = new EventEmitter();
|
|
@@ -29517,11 +29517,11 @@ class FrequencyOngoingComponent {
|
|
|
29517
29517
|
this.frequencyDetails.emit(this.frequencyInfo);
|
|
29518
29518
|
}
|
|
29519
29519
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyOngoingComponent, deps: [{ token: FrequencyService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29520
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FrequencyOngoingComponent, selector: "app-frequency-ongoing", inputs: { selectedType: "selectedType", selectedOngoingType: "selectedOngoingType", frequencyData: "frequencyData", startDate: "startDate" }, outputs: { frequencyDetails: "frequencyDetails" }, ngImport: i0, template: "<div class=\"frequency-ongoing\">\n <div class=\"
|
|
29520
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FrequencyOngoingComponent, selector: "app-frequency-ongoing", inputs: { selectedType: "selectedType", selectedOngoingType: "selectedOngoingType", frequencyData: "frequencyData", startDate: "startDate" }, outputs: { frequencyDetails: "frequencyDetails" }, ngImport: i0, template: "<div class=\"frequency-ongoing\">\n <div class=\"frequency-ongoing-item first vx-p-3 vx-d-flex vx-align-center\">\n <div class=\"vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\">\n {{ongoingFrequency}}\n </div>\n\n </div>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .frequency-ongoing{position:relative}::ng-deep .frequency-ongoing-item{border:1px solid #f1f1f1}::ng-deep .frequency-ongoing-item.first{border-radius:.25rem .25rem 0 0}::ng-deep .frequency-ongoing-item.last{border-radius:0 0 .25rem .25rem;border-top:none}::ng-deep .frequency-ongoing-item app-cs-radio{display:flex}::ng-deep .frequency-ongoing-item .sub-radio{padding-left:1.625rem}::ng-deep .frequency-ongoing-item .sub-radio app-cs-radio{display:flex;margin-right:1.75rem}\n"] }); }
|
|
29521
29521
|
}
|
|
29522
29522
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FrequencyOngoingComponent, decorators: [{
|
|
29523
29523
|
type: Component,
|
|
29524
|
-
args: [{ selector: 'app-frequency-ongoing', template: "<div class=\"frequency-ongoing\">\n <div class=\"
|
|
29524
|
+
args: [{ selector: 'app-frequency-ongoing', template: "<div class=\"frequency-ongoing\">\n <div class=\"frequency-ongoing-item first vx-p-3 vx-d-flex vx-align-center\">\n <div class=\"vx-fs-13 vx-paragraph-txt vx-p-3 vx-pt-4 vx-pb-4 vx-d-block\">\n {{ongoingFrequency}}\n </div>\n\n </div>\n</div>", styles: ["@import\"https://cdn.v-comply.com/design-system/css/icons/icons.css\";@import\"https://cdn.v-comply.com/design-system/css/mixin/mixin.css\";@import\"https://cdn.v-comply.com/design-system/css/header/header.css\";@import\"https://cdn.v-comply.com/design-system/css/display/display.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-top.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-left.css\";@import\"https://cdn.v-comply.com/design-system/css/margin/margin-right.css\";@import\"https://cdn.v-comply.com/design-system/css/alignment/alignment.css\";@import\"https://cdn.v-comply.com/design-system/css/text/text.css\";@import\"https://cdn.v-comply.com/design-system/css/button/button.css\";@import\"https://cdn.v-comply.com/design-system/css/color/color.css\";@import\"https://cdn.v-comply.com/design-system/css/popover/popover.css\";@import\"https://cdn.v-comply.com/design-system/css/width/width.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-top.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-bottom.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-left.css\";@import\"https://cdn.v-comply.com/design-system/css/padding/padding-right.css\";::ng-deep .frequency-ongoing{position:relative}::ng-deep .frequency-ongoing-item{border:1px solid #f1f1f1}::ng-deep .frequency-ongoing-item.first{border-radius:.25rem .25rem 0 0}::ng-deep .frequency-ongoing-item.last{border-radius:0 0 .25rem .25rem;border-top:none}::ng-deep .frequency-ongoing-item app-cs-radio{display:flex}::ng-deep .frequency-ongoing-item .sub-radio{padding-left:1.625rem}::ng-deep .frequency-ongoing-item .sub-radio app-cs-radio{display:flex;margin-right:1.75rem}\n"] }]
|
|
29525
29525
|
}], ctorParameters: function () { return [{ type: FrequencyService }]; }, propDecorators: { selectedType: [{
|
|
29526
29526
|
type: Input
|
|
29527
29527
|
}], selectedOngoingType: [{
|
|
@@ -46126,7 +46126,7 @@ class BulkUploadService {
|
|
|
46126
46126
|
const listData = XLSX.utils.sheet_to_json(data, {
|
|
46127
46127
|
header: 1, raw: false,
|
|
46128
46128
|
});
|
|
46129
|
-
let finalData = listData.slice(dataStartIndex);
|
|
46129
|
+
let finalData = listData.slice(0, dataStartIndex);
|
|
46130
46130
|
return this.checkEmptyFile(finalData);
|
|
46131
46131
|
}
|
|
46132
46132
|
checkEmptyFile(data) {
|
|
@@ -46454,7 +46454,6 @@ class AddMultipleResponsibilityComponent {
|
|
|
46454
46454
|
this.fileUpload();
|
|
46455
46455
|
}
|
|
46456
46456
|
const responsibilityData = this.data.filter((dataElement) => dataElement.length > 0);
|
|
46457
|
-
console.log(responsibilityData, 'responsibilityData');
|
|
46458
46457
|
responsibilityData.forEach((report) => {
|
|
46459
46458
|
let validDate;
|
|
46460
46459
|
const validFields = this.checkValidity(report);
|
|
@@ -46717,168 +46716,19 @@ class AddMultipleResponsibilityComponent {
|
|
|
46717
46716
|
submitResponsibilityBulkUpload() {
|
|
46718
46717
|
this.loader = true;
|
|
46719
46718
|
let payload = [];
|
|
46720
|
-
const frequencyTypeArray = ['1', '2', '3', '4', '7', '0'];
|
|
46721
|
-
const defaultWindow = [0, 2, 7, 30, 7, 15];
|
|
46722
|
-
const defaultFailedDay = [1, 2, 5, 5, 5, 5];
|
|
46723
46719
|
let validResponsibilities = 0;
|
|
46724
|
-
|
|
46725
|
-
|
|
46726
|
-
|
|
46727
|
-
|
|
46728
|
-
|
|
46729
|
-
|
|
46730
|
-
|
|
46731
|
-
|
|
46732
|
-
|
|
46733
|
-
|
|
46734
|
-
|
|
46735
|
-
|
|
46736
|
-
};
|
|
46737
|
-
}
|
|
46738
|
-
else {
|
|
46739
|
-
this.responsibilityBulkUpload.reports.forEach((report) => {
|
|
46740
|
-
if (report.isValid) {
|
|
46741
|
-
if (report.responsibilityCategory === null) {
|
|
46742
|
-
report.responsibilityCategory = '';
|
|
46743
|
-
}
|
|
46744
|
-
const rcDetails = this.returnIds(report.responsibilityCenter, 'rc_id');
|
|
46745
|
-
const reviewerDetails = this.returnIds(report.reviewer, 'reviewer');
|
|
46746
|
-
const assignorDetails = report.assignor
|
|
46747
|
-
? this.returnIds(report.assignor, 'assignor')
|
|
46748
|
-
: '';
|
|
46749
|
-
const ccDetails = this.returnIds(report.alwaysNotify, 'cc');
|
|
46750
|
-
const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
|
|
46751
|
-
const currentDate = moment().format('YYYY-MM-DD');
|
|
46752
|
-
const categoryName = report.responsibilityCategory.includes('[WITHIN]')
|
|
46753
|
-
? report.responsibilityCategory.split(' [')[0]
|
|
46754
|
-
: report.responsibilityCategory;
|
|
46755
|
-
const frequencyValue = this.frequencyService.shortHand_freqCal(report.frequency, report.day, report.month);
|
|
46756
|
-
const dateAndMonth = report.month.split("'");
|
|
46757
|
-
const startDate = moment(report.day +
|
|
46758
|
-
'-' +
|
|
46759
|
-
dateAndMonth[0] +
|
|
46760
|
-
'-' +
|
|
46761
|
-
20 +
|
|
46762
|
-
dateAndMonth[1] +
|
|
46763
|
-
' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss');
|
|
46764
|
-
let completeDays;
|
|
46765
|
-
let notCompleteDays;
|
|
46766
|
-
const frequencyType = frequencyValue.split('~')[0];
|
|
46767
|
-
if (report.responsibilityWindow !== '') {
|
|
46768
|
-
completeDays = report.responsibilityWindow;
|
|
46769
|
-
}
|
|
46770
|
-
else if (frequencyTypeArray.includes(frequencyType)) {
|
|
46771
|
-
const indexOfArray = frequencyTypeArray.indexOf(frequencyType);
|
|
46772
|
-
completeDays = defaultWindow[indexOfArray];
|
|
46773
|
-
}
|
|
46774
|
-
if (report.failedAfter !== '') {
|
|
46775
|
-
notCompleteDays = report.failedAfter;
|
|
46776
|
-
}
|
|
46777
|
-
else if (frequencyTypeArray.includes(frequencyType)) {
|
|
46778
|
-
const indexOfArray = frequencyTypeArray.indexOf(frequencyType);
|
|
46779
|
-
notCompleteDays = defaultFailedDay[indexOfArray];
|
|
46780
|
-
}
|
|
46781
|
-
const obj = {
|
|
46782
|
-
userId: this.templateInfo.memberId,
|
|
46783
|
-
organisation_id: this.organizationId,
|
|
46784
|
-
member_id: assignorDetails
|
|
46785
|
-
? assignorDetails.memberId
|
|
46786
|
-
: this.memberId,
|
|
46787
|
-
member_name: assignorDetails
|
|
46788
|
-
? report.assignor
|
|
46789
|
-
? report.assignor.split(' (')[0]
|
|
46790
|
-
: ''
|
|
46791
|
-
: this.defaultOwner
|
|
46792
|
-
? this.defaultOwner.split(' (')[0]
|
|
46793
|
-
: '',
|
|
46794
|
-
member_email: assignorDetails
|
|
46795
|
-
? report.assignor
|
|
46796
|
-
? report.assignor.split(' (')[1].replace(')', '')
|
|
46797
|
-
: ''
|
|
46798
|
-
: this.defaultOwner
|
|
46799
|
-
? this.defaultOwner.split(' (')[1].replace(')', '')
|
|
46800
|
-
: '',
|
|
46801
|
-
created_by: assignorDetails ? this.memberId : 0,
|
|
46802
|
-
report_name: report.responsibilityName ?? '',
|
|
46803
|
-
entrusted_to: report.assignee.split(' (')[0] ?? '',
|
|
46804
|
-
entrusted_to_id: this.returnIds(report.assignee, 'entrusted_to'),
|
|
46805
|
-
email_address: report.assignee.split(' (')[1].replace(')', '') ?? '',
|
|
46806
|
-
category_name: categoryName,
|
|
46807
|
-
category_name_with_tree: '',
|
|
46808
|
-
category_id: this.returnIds(report.responsibilityCategory, 'category_id'),
|
|
46809
|
-
rc_name: rcDetails ? rcDetails.name : '',
|
|
46810
|
-
rc_id: rcDetails ? rcDetails.rcId : 0,
|
|
46811
|
-
entity_tree: rcDetails && rcDetails.rcId
|
|
46812
|
-
? [
|
|
46813
|
-
{
|
|
46814
|
-
parent_rc_ids: rcDetails ? rcDetails.parentIds : [],
|
|
46815
|
-
rc_id: rcDetails ? rcDetails.rcId : 0,
|
|
46816
|
-
},
|
|
46817
|
-
]
|
|
46818
|
-
: [],
|
|
46819
|
-
frequency_handler: frequencyValue,
|
|
46820
|
-
compliance_type: frequencyValue.split('~')[0],
|
|
46821
|
-
frequency_description: report.frequency,
|
|
46822
|
-
start_date: report.day ? startDate : currentDate + ' 00:00:00',
|
|
46823
|
-
risk_class: report.reportClass ?? '',
|
|
46824
|
-
risk_classId: report.reportClass
|
|
46825
|
-
? this.returnIds(report.reportClass, 'risk_class')
|
|
46826
|
-
: this.riskClassEnabled
|
|
46827
|
-
? 1
|
|
46828
|
-
: 2,
|
|
46829
|
-
doc_utc: 0,
|
|
46830
|
-
comment: report.notes ?? '',
|
|
46831
|
-
cc_mail: ccDetails ? ccDetails.email : '',
|
|
46832
|
-
cc_mail_id: ccDetails ? ccDetails.employeeId : '',
|
|
46833
|
-
cc_failed_mail: ccFailureDetails ? ccFailureDetails.email : '',
|
|
46834
|
-
cc_failure_id: ccFailureDetails ? ccFailureDetails.employeeId : 0,
|
|
46835
|
-
send_reminder: '',
|
|
46836
|
-
responsibilityWindow: frequencyType === '1' ? 0 : completeDays,
|
|
46837
|
-
failed_after: notCompleteDays,
|
|
46838
|
-
excel_sheet_name: '',
|
|
46839
|
-
report_upload_flag: report.documentEvidenceRequired === 'Yes' ? 1 : 0,
|
|
46840
|
-
report_id: 0,
|
|
46841
|
-
is_assigned_flag: 0,
|
|
46842
|
-
private_library_id: 0,
|
|
46843
|
-
keycompliance: report.keyResponsibility === 'Yes' ? 'Yes' : 'No',
|
|
46844
|
-
key_compliance: report.keyResponsibility === 'Yes' ? 1 : 0,
|
|
46845
|
-
reviewerId: reviewerDetails ? reviewerDetails.employeeId : 0,
|
|
46846
|
-
reviewer_arr: reviewerDetails && reviewerDetails.employeeId
|
|
46847
|
-
? {
|
|
46848
|
-
level1: {
|
|
46849
|
-
reviewers: [
|
|
46850
|
-
{
|
|
46851
|
-
member_id: reviewerDetails
|
|
46852
|
-
? reviewerDetails.employeeId
|
|
46853
|
-
: 0,
|
|
46854
|
-
reviewer_accept: 0,
|
|
46855
|
-
},
|
|
46856
|
-
],
|
|
46857
|
-
type: 'SEQUENTIAL',
|
|
46858
|
-
},
|
|
46859
|
-
}
|
|
46860
|
-
: {},
|
|
46861
|
-
reviewerWindow: report.reviewToBeCompletedWithin === ''
|
|
46862
|
-
? 2
|
|
46863
|
-
: report.reviewToBeCompletedWithin,
|
|
46864
|
-
reviewerFailure: report.reviewWillBeFailedAfter === ''
|
|
46865
|
-
? 2
|
|
46866
|
-
: report.reviewWillBeFailedAfter,
|
|
46867
|
-
reviewer_email: reviewerDetails ? reviewerDetails.email : '',
|
|
46868
|
-
formatForResponsibility: report.formatForResponsibility
|
|
46869
|
-
? report.formatForResponsibility
|
|
46870
|
-
: '',
|
|
46871
|
-
documentaryEvidence: report.notes ?? '',
|
|
46872
|
-
isdocumentaryEvidence: report.documentEvidenceRequired === 'Yes' ? 1 : 0,
|
|
46873
|
-
objective: report.objective ?? '',
|
|
46874
|
-
excel_sheet_info: this.fileResponse,
|
|
46875
|
-
showList: false,
|
|
46876
|
-
custom_tags: '[]',
|
|
46877
|
-
};
|
|
46878
|
-
payload.push(obj);
|
|
46879
|
-
}
|
|
46880
|
-
});
|
|
46881
|
-
}
|
|
46720
|
+
this.responsibilityBulkUpload?.reports.forEach((report) => {
|
|
46721
|
+
if (report?.isValid) {
|
|
46722
|
+
validResponsibilities += 1;
|
|
46723
|
+
}
|
|
46724
|
+
});
|
|
46725
|
+
payload = {
|
|
46726
|
+
originalFilename: this.fileResponse[0]?.original_filename,
|
|
46727
|
+
fileName: this.fileResponse[0]?.filename,
|
|
46728
|
+
filePath: this.fileResponse[0]?.filepath,
|
|
46729
|
+
totalResponsibilityCount: this.responsibilityBulkUpload?.reports?.length,
|
|
46730
|
+
validResponsibilityCount: validResponsibilities,
|
|
46731
|
+
};
|
|
46882
46732
|
this.responsibilityService.addBulkResponsibility(payload).subscribe((res) => {
|
|
46883
46733
|
this.loader = false;
|
|
46884
46734
|
this.showExcel = false;
|
|
@@ -47566,223 +47416,21 @@ class AddMultipleResponsibilityWithTabComponent {
|
|
|
47566
47416
|
this.loader = true;
|
|
47567
47417
|
let payload = [];
|
|
47568
47418
|
let responsibilityMultiTabBulkUpload = [];
|
|
47569
|
-
const frequencyTypeArray = ['1', '2', '3', '4', '7', '0', '6', '9'];
|
|
47570
|
-
const defaultWindow = [0, 2, 7, 30, 7, 15, 3, 30];
|
|
47571
|
-
const defaultFailedDay = [1, 2, 5, 5, 5, 5, 5, 5];
|
|
47572
47419
|
let validResponsibilities = 0;
|
|
47573
|
-
let responsibilityBulkUpload = this.bulkUpload?.frequency?.reports?.concat(this.bulkUpload?.ongoing?.reports, this.bulkUpload?.onCompletion?.reports);
|
|
47574
47420
|
responsibilityMultiTabBulkUpload =
|
|
47575
47421
|
this.bulkUpload?.frequency?.reports?.concat(this.bulkUpload?.ongoing?.reports, this.bulkUpload?.onCompletion?.reports);
|
|
47576
|
-
|
|
47577
|
-
|
|
47578
|
-
|
|
47579
|
-
|
|
47580
|
-
|
|
47581
|
-
|
|
47582
|
-
|
|
47583
|
-
|
|
47584
|
-
|
|
47585
|
-
|
|
47586
|
-
|
|
47587
|
-
|
|
47588
|
-
};
|
|
47589
|
-
}
|
|
47590
|
-
else {
|
|
47591
|
-
responsibilityBulkUpload.forEach((report) => {
|
|
47592
|
-
if (report.isValid) {
|
|
47593
|
-
if (report?.responsibilityCategory === null) {
|
|
47594
|
-
report.responsibilityCategory = '';
|
|
47595
|
-
}
|
|
47596
|
-
const rcDetails = this.returnIds(report?.responsibilityCenter, 'rc_id');
|
|
47597
|
-
const reviewerDetails = this.returnIds(report?.reviewer, 'reviewer');
|
|
47598
|
-
const assignorDetails = report?.assignor
|
|
47599
|
-
? this.returnIds(report?.assignor, 'assignor')
|
|
47600
|
-
: '';
|
|
47601
|
-
const ccDetails = this.returnIds(report?.overseer, 'cc');
|
|
47602
|
-
const ccFailureDetails = this.returnIds(report.notifyOnFailure, 'ccFailure');
|
|
47603
|
-
const currentDate = moment().format('YYYY-MM-DD');
|
|
47604
|
-
let ongoingReminderType = {
|
|
47605
|
-
Weekly: 1,
|
|
47606
|
-
Monthly: 2,
|
|
47607
|
-
Quarterly: 3,
|
|
47608
|
-
};
|
|
47609
|
-
const ongoingValues = {
|
|
47610
|
-
setReminder: report?.setReminder,
|
|
47611
|
-
frequencyReminder: ongoingReminderType[report?.frequencyReminder],
|
|
47612
|
-
};
|
|
47613
|
-
const frequencyValue = this.frequencyService.shortHand_freqCal(report?.frequency, report?.day, report?.month, '', report?.dueDate, ongoingValues);
|
|
47614
|
-
const dateAndMonth = report?.month?.split("'");
|
|
47615
|
-
const startDate = dateAndMonth
|
|
47616
|
-
? moment(report?.day +
|
|
47617
|
-
'-' +
|
|
47618
|
-
dateAndMonth[0] +
|
|
47619
|
-
'-' +
|
|
47620
|
-
20 +
|
|
47621
|
-
dateAndMonth[1] +
|
|
47622
|
-
' 00:00:00', 'DD-MMMM-YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss')
|
|
47623
|
-
: '';
|
|
47624
|
-
let completeDays;
|
|
47625
|
-
let notCompleteDays;
|
|
47626
|
-
const frequencyType = frequencyValue?.split('~')[0];
|
|
47627
|
-
if (report.responsibilityWindow &&
|
|
47628
|
-
report.responsibilityWindow !== '') {
|
|
47629
|
-
completeDays = report?.responsibilityWindow;
|
|
47630
|
-
}
|
|
47631
|
-
else if (frequencyTypeArray?.includes(frequencyType)) {
|
|
47632
|
-
const indexOfArray = frequencyTypeArray?.indexOf(frequencyType);
|
|
47633
|
-
completeDays = defaultWindow[indexOfArray];
|
|
47634
|
-
}
|
|
47635
|
-
if (report?.failedAfter && report?.failedAfter !== '') {
|
|
47636
|
-
notCompleteDays = report?.failedAfter;
|
|
47637
|
-
}
|
|
47638
|
-
else if (frequencyTypeArray.includes(frequencyType)) {
|
|
47639
|
-
const indexOfArray = frequencyTypeArray?.indexOf(frequencyType);
|
|
47640
|
-
notCompleteDays = defaultFailedDay[indexOfArray];
|
|
47641
|
-
}
|
|
47642
|
-
const obj = {
|
|
47643
|
-
userId: this.templateInfo?.memberId,
|
|
47644
|
-
organisation_id: this.organizationId,
|
|
47645
|
-
member_id: assignorDetails
|
|
47646
|
-
? assignorDetails?.memberId
|
|
47647
|
-
: this.member_obj_id,
|
|
47648
|
-
member_name: assignorDetails
|
|
47649
|
-
? report?.assignor
|
|
47650
|
-
? report?.assignor.split(' (')[0]
|
|
47651
|
-
: ''
|
|
47652
|
-
: this.defaultOwner
|
|
47653
|
-
? this.defaultOwner?.split(' (')[0]
|
|
47654
|
-
: '',
|
|
47655
|
-
member_email: assignorDetails
|
|
47656
|
-
? report?.assignor
|
|
47657
|
-
? report?.assignor?.split(' (')[1]?.replace(')', '')
|
|
47658
|
-
: ''
|
|
47659
|
-
: this.defaultOwner
|
|
47660
|
-
? this.defaultOwner?.split(' (')[1].replace(')', '')
|
|
47661
|
-
: '',
|
|
47662
|
-
created_by: assignorDetails ? this.member_obj_id : 0,
|
|
47663
|
-
report_name: report?.responsibilityName ?? '',
|
|
47664
|
-
entrusted_to: report?.assignee?.split(' (')[0] ?? '',
|
|
47665
|
-
entrusted_to_id: this.isGroupSelected(report?.assignee)
|
|
47666
|
-
? this.getEmployeeIdFromGroup(report?.assignee)
|
|
47667
|
-
: this.returnIds(report?.assignee, 'entrusted_to')?.toString() ??
|
|
47668
|
-
'',
|
|
47669
|
-
email_address: !this.isGroupSelected(report?.assignee)
|
|
47670
|
-
? report?.assignee?.split(' (')[1]?.replace(')', '') ?? ''
|
|
47671
|
-
: '',
|
|
47672
|
-
isGroupAssignTo: report?.assigneeType?.includes('Any') ? 1 : 0,
|
|
47673
|
-
category_name_with_tree: '',
|
|
47674
|
-
category_id: this.getProgramId(report?.program, report?.programCategory).categoryId?.toString() ?? '',
|
|
47675
|
-
program_cat_ids: this.getProgramId(report?.program, report?.programCategory)?.programId
|
|
47676
|
-
? [
|
|
47677
|
-
this.getProgramId(report?.program, report?.programCategory)
|
|
47678
|
-
?.programId,
|
|
47679
|
-
]
|
|
47680
|
-
: [],
|
|
47681
|
-
rc_name: rcDetails ? rcDetails?.name : '',
|
|
47682
|
-
rc_id: rcDetails ? rcDetails?.rcId : 0,
|
|
47683
|
-
entity_tree: rcDetails && rcDetails?.rcId
|
|
47684
|
-
? [
|
|
47685
|
-
{
|
|
47686
|
-
parent_rc_ids: rcDetails ? rcDetails?.parentIds : [],
|
|
47687
|
-
rc_id: rcDetails ? rcDetails?.rcId : 0,
|
|
47688
|
-
},
|
|
47689
|
-
]
|
|
47690
|
-
: [],
|
|
47691
|
-
userGroupIds: {
|
|
47692
|
-
assigneeAllGroupIds: !report?.assigneeType?.includes('Any') &&
|
|
47693
|
-
this.isGroupSelected(report?.assignee)
|
|
47694
|
-
? [this.returnIds(report?.assignee, 'entrusted_to')]
|
|
47695
|
-
: [],
|
|
47696
|
-
assigneeAnyoneGroupIds: report?.assigneeType?.includes('Any') &&
|
|
47697
|
-
this.isGroupSelected(report?.assignee)
|
|
47698
|
-
? [this.returnIds(report?.assignee, 'entrusted_to')]
|
|
47699
|
-
: [],
|
|
47700
|
-
ccEmailGroupIds: [],
|
|
47701
|
-
failureCCEmailGroupIds: [],
|
|
47702
|
-
reviewerGroupIds: [],
|
|
47703
|
-
},
|
|
47704
|
-
frequency_handler: frequencyValue,
|
|
47705
|
-
compliance_type: frequencyValue?.split('~')[0],
|
|
47706
|
-
frequency_description: report?.frequency,
|
|
47707
|
-
start_date: report?.day ? startDate : currentDate + ' 00:00:00',
|
|
47708
|
-
risk_class: report?.reportClass ?? '',
|
|
47709
|
-
risk_classId: report?.reportClass
|
|
47710
|
-
? this.returnIds(report?.reportClass, 'risk_class')
|
|
47711
|
-
: this.riskClassEnabled
|
|
47712
|
-
? 1
|
|
47713
|
-
: 2,
|
|
47714
|
-
doc_utc: 0,
|
|
47715
|
-
comment: report?.notes ?? '',
|
|
47716
|
-
cc_mail: ccDetails ? ccDetails?.email : '',
|
|
47717
|
-
cc_mail_id: ccDetails ? ccDetails?.employeeId : '',
|
|
47718
|
-
cc_failed_mail: ccFailureDetails ? ccFailureDetails?.email : '',
|
|
47719
|
-
cc_failure_id: ccFailureDetails ? ccFailureDetails?.employeeId : 0,
|
|
47720
|
-
send_reminder: '',
|
|
47721
|
-
responsibilityWindow: frequencyType === '1'
|
|
47722
|
-
? 0
|
|
47723
|
-
: completeDays && completeDays != ''
|
|
47724
|
-
? completeDays
|
|
47725
|
-
: 0,
|
|
47726
|
-
failed_after: notCompleteDays && notCompleteDays != '' ? notCompleteDays : 0,
|
|
47727
|
-
excel_sheet_name: '',
|
|
47728
|
-
report_upload_flag: report?.isFormat === 'Yes' &&
|
|
47729
|
-
report?.formatForResponsibility?.length
|
|
47730
|
-
? 1
|
|
47731
|
-
: 0,
|
|
47732
|
-
report_id: 0,
|
|
47733
|
-
is_assigned_flag: 0,
|
|
47734
|
-
private_library_id: 0,
|
|
47735
|
-
keycompliance: report?.keyResponsibility === 'Yes' ? 'Yes' : 'No',
|
|
47736
|
-
key_compliance: report?.keyResponsibility === 'Yes' ? 1 : 0,
|
|
47737
|
-
reviewerId: reviewerDetails ? reviewerDetails?.employeeId : 0,
|
|
47738
|
-
reviewer_arr: reviewerDetails && reviewerDetails?.employeeId
|
|
47739
|
-
? {
|
|
47740
|
-
level1: {
|
|
47741
|
-
reviewers: [
|
|
47742
|
-
{
|
|
47743
|
-
member_id: reviewerDetails
|
|
47744
|
-
? reviewerDetails?.employeeId
|
|
47745
|
-
: 0,
|
|
47746
|
-
reviewer_accept: 0,
|
|
47747
|
-
},
|
|
47748
|
-
],
|
|
47749
|
-
type: 'SEQUENTIAL',
|
|
47750
|
-
},
|
|
47751
|
-
}
|
|
47752
|
-
: {},
|
|
47753
|
-
reviewerWindow: report?.reviewToBeCompletedWithin &&
|
|
47754
|
-
report?.reviewToBeCompletedWithin !== ''
|
|
47755
|
-
? report?.reviewToBeCompletedWithin
|
|
47756
|
-
: 2,
|
|
47757
|
-
reviewerFailure: report?.reviewWillBeFailedAfter &&
|
|
47758
|
-
report?.reviewWillBeFailedAfter !== ''
|
|
47759
|
-
? report?.reviewWillBeFailedAfter
|
|
47760
|
-
: 2,
|
|
47761
|
-
reviewer_email: reviewerDetails ? reviewerDetails?.email : '',
|
|
47762
|
-
formatForResponsibility: report?.formatForResponsibility
|
|
47763
|
-
? report.formatForResponsibility
|
|
47764
|
-
: '',
|
|
47765
|
-
documentaryEvidence: report?.evidenceNotes ?? '',
|
|
47766
|
-
isdocumentaryEvidence: report.documentEvidenceRequired === 'Yes' ? 1 : 0,
|
|
47767
|
-
objective: report.objective ?? '',
|
|
47768
|
-
excel_sheet_info: this.fileResponse,
|
|
47769
|
-
showList: false,
|
|
47770
|
-
custom_tags: '[]',
|
|
47771
|
-
questionnaire_type: '',
|
|
47772
|
-
on_completion_of_type: report?.frequency === 'On Completion of' ||
|
|
47773
|
-
report?.frequency?.toLowerCase() === 'ongoing'
|
|
47774
|
-
? 1
|
|
47775
|
-
: 0,
|
|
47776
|
-
on_completion_of: this.returnIds(report?.parentResponsibility, 'parentResponsibility')
|
|
47777
|
-
? [
|
|
47778
|
-
this.returnIds(report?.parentResponsibility, 'parentResponsibility'),
|
|
47779
|
-
]
|
|
47780
|
-
: [],
|
|
47781
|
-
};
|
|
47782
|
-
payload.push(obj);
|
|
47783
|
-
}
|
|
47784
|
-
});
|
|
47785
|
-
}
|
|
47422
|
+
responsibilityMultiTabBulkUpload?.forEach((report) => {
|
|
47423
|
+
if (report?.isValid) {
|
|
47424
|
+
validResponsibilities += 1;
|
|
47425
|
+
}
|
|
47426
|
+
});
|
|
47427
|
+
payload = {
|
|
47428
|
+
originalFilename: this.fileResponse[0]?.original_filename,
|
|
47429
|
+
fileName: this.fileResponse[0]?.filename,
|
|
47430
|
+
filePath: this.fileResponse[0]?.filepath,
|
|
47431
|
+
totalResponsibilityCount: responsibilityMultiTabBulkUpload?.length,
|
|
47432
|
+
validResponsibilityCount: validResponsibilities,
|
|
47433
|
+
};
|
|
47786
47434
|
this.responsibilityService.addBulkResponsibility(payload).subscribe((res) => {
|
|
47787
47435
|
this.loader = false;
|
|
47788
47436
|
this.showExcel = false;
|
|
@@ -48731,13 +48379,16 @@ class AddMultipleResponsibilityContainerComponent {
|
|
|
48731
48379
|
const wb = XLSX.read(bstr, { type: 'binary' });
|
|
48732
48380
|
let sheetData = '';
|
|
48733
48381
|
let memberArray = [];
|
|
48382
|
+
console.log(wb, 'wb', wb?.SheetNames?.length);
|
|
48734
48383
|
if (wb?.SheetNames?.length > 2) {
|
|
48384
|
+
console.log(wb.SheetNames, 'wb.SheetNames under if');
|
|
48735
48385
|
const sheetData = wb.SheetNames[RESPONSIBILITY.sheetIndex.data]; // get hidden Data sheet
|
|
48736
48386
|
const tempData = wb.Sheets[sheetData];
|
|
48737
48387
|
const tData = XLSX.utils.sheet_to_json(tempData, {
|
|
48738
48388
|
header: 1,
|
|
48739
48389
|
});
|
|
48740
48390
|
const tempList = tData.filter((dataElement) => dataElement.length > 0);
|
|
48391
|
+
console.log(tempList, 'tempList');
|
|
48741
48392
|
for (let i = 0; i < tempList.length; i++) {
|
|
48742
48393
|
if (!tempList[i][3]) {
|
|
48743
48394
|
break;
|
|
@@ -48748,8 +48399,8 @@ class AddMultipleResponsibilityContainerComponent {
|
|
|
48748
48399
|
const excelData1 = wb.Sheets[excelSheetName1];
|
|
48749
48400
|
const excelSheetName2 = wb.SheetNames[RESPONSIBILITY.sheetIndex.onGoingResponsibility];
|
|
48750
48401
|
const excelData2 = wb.Sheets[excelSheetName2];
|
|
48751
|
-
|
|
48752
|
-
|
|
48402
|
+
console.log(excelData1, excelSheetName1, 'excelData1');
|
|
48403
|
+
console.log(excelData2, excelSheetName2, 'excelData2');
|
|
48753
48404
|
isEmpty =
|
|
48754
48405
|
this.bulkUploadService.hasDataInList(excelData1, 7) &&
|
|
48755
48406
|
this.bulkUploadService.hasDataInList(excelData2, 7);
|
|
@@ -48767,6 +48418,7 @@ class AddMultipleResponsibilityContainerComponent {
|
|
|
48767
48418
|
const tempList = tData.filter((dataElement) => dataElement.length > 0);
|
|
48768
48419
|
const excelSheetName = wb.SheetNames[0];
|
|
48769
48420
|
const excelData = wb.Sheets[excelSheetName];
|
|
48421
|
+
console.log(excelData, 'excelData');
|
|
48770
48422
|
isEmpty = this.bulkUploadService.hasDataInList(excelData, 2);
|
|
48771
48423
|
isCorrectFile = this.bulkUploadService.checkCorrectFile(excelData, 0);
|
|
48772
48424
|
templateInfo.memberId = tempList[0][25];
|
|
@@ -48786,6 +48438,7 @@ class AddMultipleResponsibilityContainerComponent {
|
|
|
48786
48438
|
this.isWrongFile = true;
|
|
48787
48439
|
return;
|
|
48788
48440
|
}
|
|
48441
|
+
console.log(isEmpty, 'isEmpty container');
|
|
48789
48442
|
if (isEmpty) {
|
|
48790
48443
|
this.errorMessage =
|
|
48791
48444
|
'You have uploaded a blank template. Please add details for all mandatory fields. RETRY';
|