vcomply-workflow-engine 2.6.1 → 2.6.2
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/bundles/vcomply-workflow-engine.umd.js +389 -327
- package/bundles/vcomply-workflow-engine.umd.js.map +1 -1
- package/esm2015/lib/workflow-compliance/workflow-compliance.component.js +106 -35
- package/esm2015/lib/workflow-compliance/workflow-compliance.component.ngfactory.js +3 -2
- package/esm2015/lib/workflow-compliance/workflow-compliance.component.ngsummary.json +1 -1
- package/esm2015/lib/workflow-engine-container/workflow-engine-container.component.ngfactory.js +38 -38
- package/esm2015/vcomply-workflow-engine.js +84 -84
- package/esm2015/vcomply-workflow-engine.ngsummary.json +1 -1
- package/fesm2015/vcomply-workflow-engine.js +301 -231
- package/fesm2015/vcomply-workflow-engine.js.map +1 -1
- package/lib/workflow-compliance/workflow-compliance.component.d.ts +5 -2
- package/package.json +1 -1
- package/vcomply-workflow-engine.d.ts +83 -83
- package/vcomply-workflow-engine.metadata.json +1 -1
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Optional, EventEmitter, Component, HostListener, Input, Output, ViewChild, Pipe, NgModule, Directive, ElementRef, Renderer2, ChangeDetectorRef, forwardRef, HostBinding, ViewContainerRef, ComponentFactoryResolver, ApplicationRef, Injector, ViewChildren } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import { HttpHeaders, HttpClient, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
5
|
-
import { Subject, BehaviorSubject,
|
|
5
|
+
import { Subject, BehaviorSubject, retry as retry$1, takeUntil, distinctUntilChanged, take } from 'rxjs';
|
|
6
6
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
7
7
|
import { retry, map } from 'rxjs/operators';
|
|
8
8
|
import { cloneDeep, uniqBy, shuffle, some, isEqual } from 'lodash';
|
|
@@ -2301,14 +2301,210 @@ FrequencyService.ctorParameters = () => [
|
|
|
2301
2301
|
{ type: Configurations, decorators: [{ type: Optional }] }
|
|
2302
2302
|
];
|
|
2303
2303
|
|
|
2304
|
+
class ProgramsService {
|
|
2305
|
+
constructor(http, authService, config) {
|
|
2306
|
+
this.http = http;
|
|
2307
|
+
this.authService = authService;
|
|
2308
|
+
if (config) {
|
|
2309
|
+
this.env = config.envConfig;
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
getRoles() {
|
|
2313
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2314
|
+
return this.http.get(this.env.organizationGet + 'roles/getProgramRoles&bypass-businessCycle=true', { headers });
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Uploads the given file to server
|
|
2318
|
+
* @param payload payload File data to be uploaded
|
|
2319
|
+
* @param path path Path of file to be uploaded
|
|
2320
|
+
* @returns response after uploading a file
|
|
2321
|
+
*/
|
|
2322
|
+
uploadFiles(payload, path) {
|
|
2323
|
+
// {
|
|
2324
|
+
// reportProgress: true,
|
|
2325
|
+
// observe: 'events'}
|
|
2326
|
+
const ORG_PATH = `o/${path}`;
|
|
2327
|
+
return this.http.post(this.env.fileUploadEndPoint + ORG_PATH + '&ngsw-bypass=true', payload);
|
|
2328
|
+
}
|
|
2329
|
+
getResponsibilityCenterList() {
|
|
2330
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2331
|
+
return this.http.get(this.env.complianceGet + 'responsibilityCenterTree&bypass-businessCycle=true', {
|
|
2332
|
+
headers,
|
|
2333
|
+
}).pipe(retry$1(2));
|
|
2334
|
+
}
|
|
2335
|
+
fetchRoleUsers(roles, page, searchKey) {
|
|
2336
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2337
|
+
let queryString = '';
|
|
2338
|
+
if (page) {
|
|
2339
|
+
queryString += `&page=${page}`;
|
|
2340
|
+
}
|
|
2341
|
+
;
|
|
2342
|
+
if (searchKey) { }
|
|
2343
|
+
return this.http.post(this.env.organizationPost + 'roles/getUserDetails&limit=30&bypass-businessCycle=true' + queryString, { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
2344
|
+
}
|
|
2345
|
+
fetchAllRoleUsers(roles) {
|
|
2346
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2347
|
+
return this.http.post(this.env.organizationPost + 'roles/getUserDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
2348
|
+
}
|
|
2349
|
+
fetchAllRoleGroups(roles) {
|
|
2350
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2351
|
+
return this.http.post(this.env.organizationPost + 'roles/getGroupDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
2352
|
+
}
|
|
2353
|
+
fetchAllOrgUser() {
|
|
2354
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2355
|
+
//https://devapi.v-comply.com/organization/?mode=organisationUsersList&paginationType=small&admin=1
|
|
2356
|
+
return this.http.get(this.env.organizationGet + 'organisationUsersList&paginationType=small&bypass-businessCycle=true', { headers }).pipe(retry$1(2));
|
|
2357
|
+
}
|
|
2358
|
+
fetchComplianceGroups() {
|
|
2359
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2360
|
+
//https://devapi.v-comply.com/organization/?mode=groupsList&status=1&type=compliance
|
|
2361
|
+
return this.http.get(this.env.organizationGet + 'groupsList&status=1&type=compliance&bypass-businessCycle=true', { headers }).pipe(retry$1(2));
|
|
2362
|
+
}
|
|
2363
|
+
getBusinessCycle() {
|
|
2364
|
+
var _a, _b;
|
|
2365
|
+
const businessCycle = JSON.parse((_a = localStorage.getItem("businessCycle")) !== null && _a !== void 0 ? _a : '');
|
|
2366
|
+
return {
|
|
2367
|
+
selected_cycle: businessCycle
|
|
2368
|
+
? businessCycle.selectedCycle.start_date +
|
|
2369
|
+
"-" +
|
|
2370
|
+
businessCycle.selectedCycle.end_date
|
|
2371
|
+
: "",
|
|
2372
|
+
start_date: businessCycle ? businessCycle.selectedCycle.start_date : "",
|
|
2373
|
+
end_date: businessCycle ? businessCycle.selectedCycle.end_date : "",
|
|
2374
|
+
selected_cycle_arr: businessCycle
|
|
2375
|
+
? (_b = businessCycle === null || businessCycle === void 0 ? void 0 : businessCycle.selectedCycle) === null || _b === void 0 ? void 0 : _b.selected_cycle_arr
|
|
2376
|
+
: [],
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
saveProgram(payload) {
|
|
2380
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
2381
|
+
return this.http.post(this.env.programEndpoint + '/category/?isBusinessCycle=true', payload, { headers });
|
|
2382
|
+
}
|
|
2383
|
+
buildPayload(formData, instance) {
|
|
2384
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2385
|
+
console.log("Component Instance", instance);
|
|
2386
|
+
const form = formData === null || formData === void 0 ? void 0 : formData.value;
|
|
2387
|
+
console.log("Form Value", form);
|
|
2388
|
+
const payload = {
|
|
2389
|
+
mode: 'program',
|
|
2390
|
+
name: (_a = form === null || form === void 0 ? void 0 : form.program_name.trim()) !== null && _a !== void 0 ? _a : '',
|
|
2391
|
+
description: { text: (_b = form === null || form === void 0 ? void 0 : form.program_description) !== null && _b !== void 0 ? _b : '', attachments: (_c = form === null || form === void 0 ? void 0 : form.program_description_attachments) !== null && _c !== void 0 ? _c : [] },
|
|
2392
|
+
program_objective: { text: (_d = form === null || form === void 0 ? void 0 : form.program_objective) !== null && _d !== void 0 ? _d : '', attachments: (_e = form === null || form === void 0 ? void 0 : form.objective_attachment) !== null && _e !== void 0 ? _e : [] },
|
|
2393
|
+
roles: form.program_roles.map((ele) => { return { roleId: ele === null || ele === void 0 ? void 0 : ele._id, roleName: ele === null || ele === void 0 ? void 0 : ele.roleName, licenseType: ele === null || ele === void 0 ? void 0 : ele.licenseType }; }),
|
|
2394
|
+
owners: (_f = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners, 'member_id')) !== null && _f !== void 0 ? _f : [],
|
|
2395
|
+
owners_group: (_g = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners_group, 'group_id')) !== null && _g !== void 0 ? _g : [],
|
|
2396
|
+
all_user_in_role: (_h = form === null || form === void 0 ? void 0 : form.all_user_in_role) !== null && _h !== void 0 ? _h : false,
|
|
2397
|
+
programType: (_j = form === null || form === void 0 ? void 0 : form.program_type) !== null && _j !== void 0 ? _j : 0,
|
|
2398
|
+
// state:0,
|
|
2399
|
+
state: (_k = form === null || form === void 0 ? void 0 : form.program_state) !== null && _k !== void 0 ? _k : 0,
|
|
2400
|
+
approvers: (_l = this.listToId(form === null || form === void 0 ? void 0 : form.program_approver, 'member_id')) !== null && _l !== void 0 ? _l : [],
|
|
2401
|
+
calculate_past_upcoming_event: (_m = form === null || form === void 0 ? void 0 : form.performance_calculation) !== null && _m !== void 0 ? _m : '',
|
|
2402
|
+
program_frequency: (form === null || form === void 0 ? void 0 : form.recurring_frequency) ? 1 : 0,
|
|
2403
|
+
lock_scope: (form === null || form === void 0 ? void 0 : form.lock_scope_change) ? 1 : 0,
|
|
2404
|
+
rc_ids: this.listToId(form === null || form === void 0 ? void 0 : form.rc, 'item_id'),
|
|
2405
|
+
assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee, 'member_id'),
|
|
2406
|
+
assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee_group, 'group_id'),
|
|
2407
|
+
default_assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee, 'member_id'),
|
|
2408
|
+
default_assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee_group, 'group_id'),
|
|
2409
|
+
default_assignee_type: form === null || form === void 0 ? void 0 : form.assignee_completion_criteria,
|
|
2410
|
+
reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer, 'member_id'),
|
|
2411
|
+
reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer_group, 'group_id'),
|
|
2412
|
+
default_reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer, 'member_id'),
|
|
2413
|
+
default_reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer_group, 'group_id'),
|
|
2414
|
+
default_reviewers_type: form === null || form === void 0 ? void 0 : form.reviewer_completion_criteria,
|
|
2415
|
+
overseers: { cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_overseer, 'member_id'), cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_overseer_group, 'group_id'), failure_cc_email: [], failure_cc_email_groups: [] },
|
|
2416
|
+
default_overseers: { cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_overseer, 'member_id'), cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_overseer_group, 'group_id'),
|
|
2417
|
+
failure_cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_failed_overseer, 'member_id'), failure_cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_failed_overseer_group, 'group_id') },
|
|
2418
|
+
assessment: this.generateAssessment(form.program_assessments),
|
|
2419
|
+
evidence_upload_flag: (form === null || form === void 0 ? void 0 : form.evidence_required) ? 1 : 0,
|
|
2420
|
+
is_key_evidence: form === null || form === void 0 ? void 0 : form.allow_any_file_key_evidence,
|
|
2421
|
+
custom_fields: (_o = form === null || form === void 0 ? void 0 : form.custom_fields) !== null && _o !== void 0 ? _o : [],
|
|
2422
|
+
framework: (_p = this.getFramework(form === null || form === void 0 ? void 0 : form.framework)) !== null && _p !== void 0 ? _p : [],
|
|
2423
|
+
_id: instance.mode === 'EDIT' ? instance.programId : undefined,
|
|
2424
|
+
};
|
|
2425
|
+
console.log("payload", payload);
|
|
2426
|
+
return payload;
|
|
2427
|
+
}
|
|
2428
|
+
generateAssessment(assessment) {
|
|
2429
|
+
if (assessment && (assessment === null || assessment === void 0 ? void 0 : assessment.length)) {
|
|
2430
|
+
return assessment.map((cat) => { var _a; return Object.assign(Object.assign({}, cat), { assessmentIds: (_a = cat.assessmentIds) === null || _a === void 0 ? void 0 : _a.map((assess) => assess.id) }); });
|
|
2431
|
+
}
|
|
2432
|
+
else {
|
|
2433
|
+
return [];
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
getFramework(input) {
|
|
2437
|
+
console.log("generator", input);
|
|
2438
|
+
if (input) {
|
|
2439
|
+
return [{
|
|
2440
|
+
_id: input === null || input === void 0 ? void 0 : input._id,
|
|
2441
|
+
framework_name: input === null || input === void 0 ? void 0 : input.framework_name,
|
|
2442
|
+
type: input === null || input === void 0 ? void 0 : input.type,
|
|
2443
|
+
in_scope: this.listToId(input === null || input === void 0 ? void 0 : input.in_scope, '_id'),
|
|
2444
|
+
out_scope: this.listToId(input === null || input === void 0 ? void 0 : input.out_scope, '_id')
|
|
2445
|
+
}];
|
|
2446
|
+
}
|
|
2447
|
+
else {
|
|
2448
|
+
return [];
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
listToId(list, key) {
|
|
2452
|
+
if (list && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
2453
|
+
return list.map((ele) => ele[key]);
|
|
2454
|
+
}
|
|
2455
|
+
else {
|
|
2456
|
+
return [];
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
*
|
|
2461
|
+
* @param id : program object id
|
|
2462
|
+
* @returns
|
|
2463
|
+
*/
|
|
2464
|
+
getProgram(id) {
|
|
2465
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
2466
|
+
return this.http.get(this.env.programEndpoint + '/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', { headers });
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
*
|
|
2470
|
+
* @param payload payload which need to be updated
|
|
2471
|
+
* @param id program object id
|
|
2472
|
+
* @returns
|
|
2473
|
+
*/
|
|
2474
|
+
updateProgram(payload, id) {
|
|
2475
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
2476
|
+
return this.http.post(this.env.programEndpoint + '/category/editCategory/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', payload, { headers });
|
|
2477
|
+
}
|
|
2478
|
+
getMemeberByIds(ids) {
|
|
2479
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2480
|
+
return this.http.post(this.env.organizationPost + 'memberDetailsbyIds&bypass-businessCycle=true', { member_id: ids }, { headers }).pipe(retry$1(2));
|
|
2481
|
+
}
|
|
2482
|
+
getMemberByGroups(ids) {
|
|
2483
|
+
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
2484
|
+
return this.http.post(this.env.organizationPost + 'groupDetailsbyIds&bypass-businessCycle=true', { group_ids: ids }, { headers }).pipe(retry$1(2));
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
ProgramsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProgramsService_Factory() { return new ProgramsService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(AuthService), i0.ɵɵinject(Configurations, 8)); }, token: ProgramsService, providedIn: "root" });
|
|
2488
|
+
ProgramsService.decorators = [
|
|
2489
|
+
{ type: Injectable, args: [{
|
|
2490
|
+
providedIn: 'root'
|
|
2491
|
+
},] }
|
|
2492
|
+
];
|
|
2493
|
+
ProgramsService.ctorParameters = () => [
|
|
2494
|
+
{ type: HttpClient },
|
|
2495
|
+
{ type: AuthService },
|
|
2496
|
+
{ type: Configurations, decorators: [{ type: Optional }] }
|
|
2497
|
+
];
|
|
2498
|
+
|
|
2304
2499
|
class WorkflowComplianceComponent {
|
|
2305
|
-
constructor(authService, responsibilityService, frequencyService, uiKitService, snackBar, permission) {
|
|
2500
|
+
constructor(authService, responsibilityService, frequencyService, uiKitService, snackBar, permission, programService) {
|
|
2306
2501
|
this.authService = authService;
|
|
2307
2502
|
this.responsibilityService = responsibilityService;
|
|
2308
2503
|
this.frequencyService = frequencyService;
|
|
2309
2504
|
this.uiKitService = uiKitService;
|
|
2310
2505
|
this.snackBar = snackBar;
|
|
2311
2506
|
this.permission = permission;
|
|
2507
|
+
this.programService = programService;
|
|
2312
2508
|
this.mode = 'CREATE';
|
|
2313
2509
|
this.responsibilityId = '';
|
|
2314
2510
|
this.frameworkDetails = [];
|
|
@@ -2624,6 +2820,14 @@ class WorkflowComplianceComponent {
|
|
|
2624
2820
|
this.responsibilityService.getResponsibilityCenterList(params).subscribe(res => {
|
|
2625
2821
|
this.responsibilityCentersList = res;
|
|
2626
2822
|
this.rcListLoaded = true;
|
|
2823
|
+
const ids = this.returnIds(this.responsibilityForm.rc, 'item_id');
|
|
2824
|
+
const RC = this.responsibilityCentersList.filter((element) => ids.includes(element.item_id));
|
|
2825
|
+
if (RC === null || RC === void 0 ? void 0 : RC.length) {
|
|
2826
|
+
this.responsibilityForm.rc = RC;
|
|
2827
|
+
}
|
|
2828
|
+
else {
|
|
2829
|
+
this.responsibilityForm.rc = [];
|
|
2830
|
+
}
|
|
2627
2831
|
if (this.openedFrom === 'RISK_TREATMENT') {
|
|
2628
2832
|
this.responsibilityForm.rc = this.setList(this.responsibilityCentersList, [this.selectedRC], 'item_id');
|
|
2629
2833
|
this.moreOptions.RC = true;
|
|
@@ -2703,13 +2907,13 @@ class WorkflowComplianceComponent {
|
|
|
2703
2907
|
});
|
|
2704
2908
|
}
|
|
2705
2909
|
filterListsAccordingToProgram(program_id) {
|
|
2706
|
-
this.responsibilityForm.rc = [];
|
|
2707
|
-
this.responsibilityForm.assignees.list = [];
|
|
2708
|
-
this.responsibilityForm.reviewers.list = [];
|
|
2709
|
-
this.responsibilityForm.overseers.list = [];
|
|
2710
|
-
this.responsibilityForm.overseers.notifyList = [];
|
|
2711
|
-
this.responsibilityForm.assessment = { assessment_id: "", category_id: "" }
|
|
2712
|
-
this.groupsList = [];
|
|
2910
|
+
// this.responsibilityForm.rc = [];
|
|
2911
|
+
// this.responsibilityForm.assignees.list = [];
|
|
2912
|
+
// this.responsibilityForm.reviewers.list = [];
|
|
2913
|
+
// this.responsibilityForm.overseers.list = [];
|
|
2914
|
+
// this.responsibilityForm.overseers.notifyList = [];
|
|
2915
|
+
// this.responsibilityForm.assessment = { assessment_id: "", category_id: "" }
|
|
2916
|
+
// this.groupsList = [];
|
|
2713
2917
|
this.unSubscribeProgram.next();
|
|
2714
2918
|
this.unSubscribeProgram.complete();
|
|
2715
2919
|
if (program_id) {
|
|
@@ -2725,6 +2929,25 @@ class WorkflowComplianceComponent {
|
|
|
2725
2929
|
this.getAssignorsList();
|
|
2726
2930
|
}
|
|
2727
2931
|
}
|
|
2932
|
+
getProgramDetails(programId) {
|
|
2933
|
+
this.loader = true;
|
|
2934
|
+
this.programService.getProgram(programId).subscribe((res) => {
|
|
2935
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2936
|
+
if ((res === null || res === void 0 ? void 0 : res.assessment) && ((_a = res === null || res === void 0 ? void 0 : res.assessment) === null || _a === void 0 ? void 0 : _a.length) && ((_c = Object.keys((_b = this.responsibilityForm) === null || _b === void 0 ? void 0 : _b.assessment)) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
2937
|
+
const categoryAssessment = res === null || res === void 0 ? void 0 : res.assessment.filter((assessment) => { var _a, _b; return ((_b = (_a = this.responsibilityForm) === null || _a === void 0 ? void 0 : _a.assessment) === null || _b === void 0 ? void 0 : _b.category_id) === (assessment === null || assessment === void 0 ? void 0 : assessment.category_id); });
|
|
2938
|
+
if ((categoryAssessment === null || categoryAssessment === void 0 ? void 0 : categoryAssessment.length) && ((_e = (_d = categoryAssessment[0]) === null || _d === void 0 ? void 0 : _d.assessmentIds) === null || _e === void 0 ? void 0 : _e.length)) {
|
|
2939
|
+
const isExist = (_f = categoryAssessment[0]) === null || _f === void 0 ? void 0 : _f.assessmentIds.includes((_h = (_g = this.responsibilityForm) === null || _g === void 0 ? void 0 : _g.assessment) === null || _h === void 0 ? void 0 : _h.assessment_id);
|
|
2940
|
+
if (!isExist) {
|
|
2941
|
+
this.responsibilityForm.assessment = { assessment_id: "", category_id: "" };
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
else {
|
|
2945
|
+
this.responsibilityForm.assessment = { assessment_id: "", category_id: "" };
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
this.loader = false;
|
|
2949
|
+
});
|
|
2950
|
+
}
|
|
2728
2951
|
getListsAccordingToProgram(program_id) {
|
|
2729
2952
|
this.getPeopleListAgainstPID(program_id);
|
|
2730
2953
|
this.getRCList(program_id);
|
|
@@ -2778,6 +3001,7 @@ class WorkflowComplianceComponent {
|
|
|
2778
3001
|
params = params.append('program_ids', program_id);
|
|
2779
3002
|
}
|
|
2780
3003
|
this.responsibilityService.getOrganizationPeople(params).subscribe((res) => {
|
|
3004
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2781
3005
|
this.assigneesList = res.assignee.map((user) => {
|
|
2782
3006
|
user.member_name = user.employee_name;
|
|
2783
3007
|
return user;
|
|
@@ -2795,7 +3019,7 @@ class WorkflowComplianceComponent {
|
|
|
2795
3019
|
reviewersList: [...new Set(this.reviewersList)],
|
|
2796
3020
|
overseersList: [...new Set(this.overseersList)],
|
|
2797
3021
|
};
|
|
2798
|
-
if (this.responsibilityForm.program[0].default_assignee_ids) {
|
|
3022
|
+
if (this.responsibilityForm.program[0].default_assignee_ids || this.responsibilityForm.assignees.list.length) {
|
|
2799
3023
|
if (this.responsibilityForm.assignees.list.length) {
|
|
2800
3024
|
const ids = this.returnIds(this.responsibilityForm.assignees.list, 'my_member_id');
|
|
2801
3025
|
const allIds = [...new Set(ids), ...new Set(this.responsibilityForm.program[0].default_assignee_ids)];
|
|
@@ -2803,6 +3027,9 @@ class WorkflowComplianceComponent {
|
|
|
2803
3027
|
if (assignors.length) {
|
|
2804
3028
|
this.responsibilityForm.assignees.list = assignors;
|
|
2805
3029
|
}
|
|
3030
|
+
else {
|
|
3031
|
+
this.responsibilityForm.assignees.list = [];
|
|
3032
|
+
}
|
|
2806
3033
|
}
|
|
2807
3034
|
else {
|
|
2808
3035
|
const assignors = this.assigneesList.filter((element) => this.responsibilityForm.program[0].default_assignee_ids.includes(element.my_member_id));
|
|
@@ -2811,25 +3038,61 @@ class WorkflowComplianceComponent {
|
|
|
2811
3038
|
}
|
|
2812
3039
|
}
|
|
2813
3040
|
}
|
|
3041
|
+
else {
|
|
3042
|
+
this.responsibilityForm.assignees.list = [];
|
|
3043
|
+
}
|
|
2814
3044
|
const checkedMoreOptions = [];
|
|
2815
|
-
if (this.responsibilityForm.program[0].default_reviewers) {
|
|
2816
|
-
const
|
|
3045
|
+
if (((_b = (_a = this.responsibilityForm) === null || _a === void 0 ? void 0 : _a.program[0]) === null || _b === void 0 ? void 0 : _b.default_reviewers) || ((_e = (_d = (_c = this.responsibilityForm) === null || _c === void 0 ? void 0 : _c.reviewers) === null || _d === void 0 ? void 0 : _d.list) === null || _e === void 0 ? void 0 : _e.length)) {
|
|
3046
|
+
const ids = this.returnIds(this.responsibilityForm.reviewers.list, 'my_member_id');
|
|
3047
|
+
const allIds = [...new Set(ids), ...new Set(this.responsibilityForm.program[0].default_reviewers)];
|
|
3048
|
+
const reviewers = this.reviewersList.filter((element) => allIds.includes(element.my_member_id));
|
|
3049
|
+
// const reviewers = this.reviewersList.filter((element: any) => this.responsibilityForm.program[0].default_reviewers.includes(element.my_member_id));
|
|
2817
3050
|
if (reviewers.length) {
|
|
2818
3051
|
this.responsibilityForm.reviewers.list = reviewers;
|
|
2819
3052
|
this.moreOptions.REVIEWER = true;
|
|
2820
3053
|
}
|
|
3054
|
+
else {
|
|
3055
|
+
this.responsibilityForm.reviewers.list = [];
|
|
3056
|
+
}
|
|
3057
|
+
console.log("reviewersListreviewersList", this.responsibilityForm.program[0], this.reviewersList, this.responsibilityForm.reviewers.list, reviewers);
|
|
2821
3058
|
}
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
3059
|
+
else {
|
|
3060
|
+
this.responsibilityForm.reviewers.list = [];
|
|
3061
|
+
}
|
|
3062
|
+
if (this.responsibilityForm.program[0].default_overseers || ((_h = (_g = (_f = this.responsibilityForm) === null || _f === void 0 ? void 0 : _f.overseers) === null || _g === void 0 ? void 0 : _g.list) === null || _h === void 0 ? void 0 : _h.length) || ((_l = (_k = (_j = this.responsibilityForm) === null || _j === void 0 ? void 0 : _j.overseers) === null || _k === void 0 ? void 0 : _k.notifyList) === null || _l === void 0 ? void 0 : _l.length)) {
|
|
3063
|
+
const ids = this.returnIds((_o = (_m = this.responsibilityForm) === null || _m === void 0 ? void 0 : _m.overseers) === null || _o === void 0 ? void 0 : _o.list, 'my_member_id');
|
|
3064
|
+
const allDefaultCCIds = [...new Set(ids), ...new Set((_r = (_q = (_p = this.responsibilityForm) === null || _p === void 0 ? void 0 : _p.program[0]) === null || _q === void 0 ? void 0 : _q.default_overseers) === null || _r === void 0 ? void 0 : _r.cc_email)];
|
|
3065
|
+
const overseersCC = (_s = this.overseersList) === null || _s === void 0 ? void 0 : _s.filter((element) => allDefaultCCIds === null || allDefaultCCIds === void 0 ? void 0 : allDefaultCCIds.includes(element === null || element === void 0 ? void 0 : element.my_member_id));
|
|
3066
|
+
// const overseers = this.overseersList.filter((element: any) => this.responsibilityForm.program[0].default_overseers.cc_email.includes(element.my_member_id));
|
|
3067
|
+
const allDefaultCCFailureIds = [...new Set(ids), ...new Set((_v = (_u = (_t = this.responsibilityForm) === null || _t === void 0 ? void 0 : _t.program[0]) === null || _u === void 0 ? void 0 : _u.default_overseers) === null || _v === void 0 ? void 0 : _v.failure_cc_email)];
|
|
3068
|
+
const overseersCCFailure = (_w = this.overseersList) === null || _w === void 0 ? void 0 : _w.filter((element) => allDefaultCCFailureIds === null || allDefaultCCFailureIds === void 0 ? void 0 : allDefaultCCFailureIds.includes(element === null || element === void 0 ? void 0 : element.my_member_id));
|
|
3069
|
+
// const notifyOverseers = this.overseersList.filter((element: any) => this.responsibilityForm.program[0].default_overseers.failure_cc_email.includes(element.my_member_id));
|
|
3070
|
+
// if (overseers.length) {
|
|
3071
|
+
// this.responsibilityForm.overseers.list = overseers;
|
|
3072
|
+
// this.moreOptions.OVERSEER = true;
|
|
3073
|
+
// }
|
|
3074
|
+
// if (notifyOverseers.length) {
|
|
3075
|
+
// this.responsibilityForm.overseers.notifyList = notifyOverseers;
|
|
3076
|
+
// this.moreOptions.OVERSEER = true;
|
|
3077
|
+
// }
|
|
3078
|
+
if (overseersCC.length) {
|
|
3079
|
+
this.responsibilityForm.overseers.list = overseersCC;
|
|
2827
3080
|
this.moreOptions.OVERSEER = true;
|
|
2828
3081
|
}
|
|
2829
|
-
|
|
2830
|
-
this.responsibilityForm.overseers.
|
|
3082
|
+
else {
|
|
3083
|
+
this.responsibilityForm.overseers.list = [];
|
|
3084
|
+
}
|
|
3085
|
+
if (overseersCCFailure.length) {
|
|
3086
|
+
this.responsibilityForm.overseers.notifyList = overseersCCFailure;
|
|
2831
3087
|
this.moreOptions.OVERSEER = true;
|
|
2832
3088
|
}
|
|
3089
|
+
else {
|
|
3090
|
+
this.responsibilityForm.overseers.notifyList = [];
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
else {
|
|
3094
|
+
this.responsibilityForm.overseers.list = [];
|
|
3095
|
+
this.responsibilityForm.overseers.notifyList = [];
|
|
2833
3096
|
}
|
|
2834
3097
|
for (const key in this.moreOptions) {
|
|
2835
3098
|
if (this.moreOptions[key]) {
|
|
@@ -3117,7 +3380,7 @@ class WorkflowComplianceComponent {
|
|
|
3117
3380
|
}
|
|
3118
3381
|
}
|
|
3119
3382
|
saveSelectedList(type, selectedItems) {
|
|
3120
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
3383
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
3121
3384
|
switch (type) {
|
|
3122
3385
|
case 'assignors':
|
|
3123
3386
|
if (this.invalidType === 'whom') {
|
|
@@ -3189,21 +3452,22 @@ class WorkflowComplianceComponent {
|
|
|
3189
3452
|
this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(_j = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _j === void 0 ? void 0 : _j.category_id])];
|
|
3190
3453
|
}
|
|
3191
3454
|
else {
|
|
3455
|
+
((_l = Object.keys((_k = this.responsibilityForm) === null || _k === void 0 ? void 0 : _k.assessment)) === null || _l === void 0 ? void 0 : _l.length) ? this.getProgramDetails(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program._id) : null;
|
|
3192
3456
|
this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
|
|
3193
3457
|
this.responsibilityForm.program = [];
|
|
3194
3458
|
this.responsibilityForm.category_id = '';
|
|
3195
3459
|
this.responsibilityForm.program_selected_ids = [];
|
|
3196
3460
|
this.responsibilityForm.customTags = [];
|
|
3197
3461
|
this.responsibilityForm.program = (selectedItems.program) ? [selectedItems.program] : [];
|
|
3198
|
-
let categoryId = (
|
|
3199
|
-
if ((
|
|
3200
|
-
this.responsibilityForm.category_id = ((
|
|
3462
|
+
let categoryId = (_m = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _m === void 0 ? void 0 : _m.toString();
|
|
3463
|
+
if ((_o = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _o === void 0 ? void 0 : _o.length) {
|
|
3464
|
+
this.responsibilityForm.category_id = ((_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _p === void 0 ? void 0 : _p.category_id) + ',' + categoryId;
|
|
3201
3465
|
}
|
|
3202
3466
|
else {
|
|
3203
|
-
this.responsibilityForm.category_id = (
|
|
3467
|
+
this.responsibilityForm.category_id = (_r = (_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _q === void 0 ? void 0 : _q.category_id) === null || _r === void 0 ? void 0 : _r.toString();
|
|
3204
3468
|
}
|
|
3205
|
-
this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(
|
|
3206
|
-
const programCustomTags = ((
|
|
3469
|
+
this.responsibilityForm.program_selected_ids = [...new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories), ...new Set([(_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _s === void 0 ? void 0 : _s.category_id])];
|
|
3470
|
+
const programCustomTags = ((_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.custom_tags) ? JSON.parse((_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.custom_tags) : [];
|
|
3207
3471
|
programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach((tag) => {
|
|
3208
3472
|
const tagData = JSON === null || JSON === void 0 ? void 0 : JSON.parse(tag);
|
|
3209
3473
|
const index = this.responsibilityForm.customTags.findIndex((tagElement) => tagElement.tag_name == tagData.tag_name);
|
|
@@ -3211,12 +3475,12 @@ class WorkflowComplianceComponent {
|
|
|
3211
3475
|
this.responsibilityForm.customTags.push(tagData);
|
|
3212
3476
|
}
|
|
3213
3477
|
});
|
|
3214
|
-
this.responsibilityForm.formatAndEvidence.evidenceRequired = ((
|
|
3215
|
-
if ((
|
|
3478
|
+
this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_v = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _v === void 0 ? void 0 : _v.evidence_upload_flag) ? true : false;
|
|
3479
|
+
if ((_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.evidence_upload_flag) {
|
|
3216
3480
|
this.moreOptions.FORMATE_EVIDENCE = true;
|
|
3217
3481
|
}
|
|
3218
|
-
if (!(((
|
|
3219
|
-
if ((
|
|
3482
|
+
if (!(((_x = this.selectedProgram) === null || _x === void 0 ? void 0 : _x.programType) === 0 && ((_z = (_y = this.selectedProgram) === null || _y === void 0 ? void 0 : _y.name) === null || _z === void 0 ? void 0 : _z.toLowerCase()) === 'uncategorized')) {
|
|
3483
|
+
if ((_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _0 === void 0 ? void 0 : _0._id) {
|
|
3220
3484
|
this.filterListsAccordingToProgram(selectedItems.program._id);
|
|
3221
3485
|
}
|
|
3222
3486
|
else {
|
|
@@ -3268,10 +3532,10 @@ class WorkflowComplianceComponent {
|
|
|
3268
3532
|
this.responsibilityForm.riskMatrix = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.riskMatrix;
|
|
3269
3533
|
break;
|
|
3270
3534
|
case 'formate_evidence':
|
|
3271
|
-
this.responsibilityForm.formatAndEvidence.formatRequired = (
|
|
3272
|
-
this.responsibilityForm.formatAndEvidence.formatFiles = (
|
|
3273
|
-
this.responsibilityForm.formatAndEvidence.formatLinks = (
|
|
3274
|
-
this.responsibilityForm.formatAndEvidence.evidenceRequired = (
|
|
3535
|
+
this.responsibilityForm.formatAndEvidence.formatRequired = (_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _1 !== void 0 ? _1 : false;
|
|
3536
|
+
this.responsibilityForm.formatAndEvidence.formatFiles = (_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _2 !== void 0 ? _2 : [];
|
|
3537
|
+
this.responsibilityForm.formatAndEvidence.formatLinks = (_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _3 !== void 0 ? _3 : [];
|
|
3538
|
+
this.responsibilityForm.formatAndEvidence.evidenceRequired = (_4 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _4 !== void 0 ? _4 : false;
|
|
3275
3539
|
break;
|
|
3276
3540
|
case 'reviewFrequency':
|
|
3277
3541
|
this.responsibilityForm.reviewers.reviewFrequency = {
|
|
@@ -4451,7 +4715,8 @@ WorkflowComplianceComponent.ctorParameters = () => [
|
|
|
4451
4715
|
{ type: FrequencyService },
|
|
4452
4716
|
{ type: UiKitService },
|
|
4453
4717
|
{ type: SnackBarService },
|
|
4454
|
-
{ type: AuthService }
|
|
4718
|
+
{ type: AuthService },
|
|
4719
|
+
{ type: ProgramsService }
|
|
4455
4720
|
];
|
|
4456
4721
|
WorkflowComplianceComponent.propDecorators = {
|
|
4457
4722
|
mode: [{ type: Input }],
|
|
@@ -23418,201 +23683,6 @@ ProgramListingComponent.propDecorators = {
|
|
|
23418
23683
|
closeEvent: [{ type: Output }]
|
|
23419
23684
|
};
|
|
23420
23685
|
|
|
23421
|
-
class ProgramsService {
|
|
23422
|
-
constructor(http, authService, config) {
|
|
23423
|
-
this.http = http;
|
|
23424
|
-
this.authService = authService;
|
|
23425
|
-
if (config) {
|
|
23426
|
-
this.env = config.envConfig;
|
|
23427
|
-
}
|
|
23428
|
-
}
|
|
23429
|
-
getRoles() {
|
|
23430
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23431
|
-
return this.http.get(this.env.organizationGet + 'roles/getProgramRoles&bypass-businessCycle=true', { headers });
|
|
23432
|
-
}
|
|
23433
|
-
/**
|
|
23434
|
-
* Uploads the given file to server
|
|
23435
|
-
* @param payload payload File data to be uploaded
|
|
23436
|
-
* @param path path Path of file to be uploaded
|
|
23437
|
-
* @returns response after uploading a file
|
|
23438
|
-
*/
|
|
23439
|
-
uploadFiles(payload, path) {
|
|
23440
|
-
// {
|
|
23441
|
-
// reportProgress: true,
|
|
23442
|
-
// observe: 'events'}
|
|
23443
|
-
const ORG_PATH = `o/${path}`;
|
|
23444
|
-
return this.http.post(this.env.fileUploadEndPoint + ORG_PATH + '&ngsw-bypass=true', payload);
|
|
23445
|
-
}
|
|
23446
|
-
getResponsibilityCenterList() {
|
|
23447
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23448
|
-
return this.http.get(this.env.complianceGet + 'responsibilityCenterTree&bypass-businessCycle=true', {
|
|
23449
|
-
headers,
|
|
23450
|
-
}).pipe(retry$1(2));
|
|
23451
|
-
}
|
|
23452
|
-
fetchRoleUsers(roles, page, searchKey) {
|
|
23453
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23454
|
-
let queryString = '';
|
|
23455
|
-
if (page) {
|
|
23456
|
-
queryString += `&page=${page}`;
|
|
23457
|
-
}
|
|
23458
|
-
;
|
|
23459
|
-
if (searchKey) { }
|
|
23460
|
-
return this.http.post(this.env.organizationPost + 'roles/getUserDetails&limit=30&bypass-businessCycle=true' + queryString, { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
23461
|
-
}
|
|
23462
|
-
fetchAllRoleUsers(roles) {
|
|
23463
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23464
|
-
return this.http.post(this.env.organizationPost + 'roles/getUserDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
23465
|
-
}
|
|
23466
|
-
fetchAllRoleGroups(roles) {
|
|
23467
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23468
|
-
return this.http.post(this.env.organizationPost + 'roles/getGroupDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers }).pipe(retry$1(2));
|
|
23469
|
-
}
|
|
23470
|
-
fetchAllOrgUser() {
|
|
23471
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23472
|
-
//https://devapi.v-comply.com/organization/?mode=organisationUsersList&paginationType=small&admin=1
|
|
23473
|
-
return this.http.get(this.env.organizationGet + 'organisationUsersList&paginationType=small&bypass-businessCycle=true', { headers }).pipe(retry$1(2));
|
|
23474
|
-
}
|
|
23475
|
-
fetchComplianceGroups() {
|
|
23476
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23477
|
-
//https://devapi.v-comply.com/organization/?mode=groupsList&status=1&type=compliance
|
|
23478
|
-
return this.http.get(this.env.organizationGet + 'groupsList&status=1&type=compliance&bypass-businessCycle=true', { headers }).pipe(retry$1(2));
|
|
23479
|
-
}
|
|
23480
|
-
getBusinessCycle() {
|
|
23481
|
-
var _a, _b;
|
|
23482
|
-
const businessCycle = JSON.parse((_a = localStorage.getItem("businessCycle")) !== null && _a !== void 0 ? _a : '');
|
|
23483
|
-
return {
|
|
23484
|
-
selected_cycle: businessCycle
|
|
23485
|
-
? businessCycle.selectedCycle.start_date +
|
|
23486
|
-
"-" +
|
|
23487
|
-
businessCycle.selectedCycle.end_date
|
|
23488
|
-
: "",
|
|
23489
|
-
start_date: businessCycle ? businessCycle.selectedCycle.start_date : "",
|
|
23490
|
-
end_date: businessCycle ? businessCycle.selectedCycle.end_date : "",
|
|
23491
|
-
selected_cycle_arr: businessCycle
|
|
23492
|
-
? (_b = businessCycle === null || businessCycle === void 0 ? void 0 : businessCycle.selectedCycle) === null || _b === void 0 ? void 0 : _b.selected_cycle_arr
|
|
23493
|
-
: [],
|
|
23494
|
-
};
|
|
23495
|
-
}
|
|
23496
|
-
saveProgram(payload) {
|
|
23497
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
23498
|
-
return this.http.post(this.env.programEndpoint + '/category/?isBusinessCycle=true', payload, { headers });
|
|
23499
|
-
}
|
|
23500
|
-
buildPayload(formData, instance) {
|
|
23501
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
23502
|
-
console.log("Component Instance", instance);
|
|
23503
|
-
const form = formData === null || formData === void 0 ? void 0 : formData.value;
|
|
23504
|
-
console.log("Form Value", form);
|
|
23505
|
-
const payload = {
|
|
23506
|
-
mode: 'program',
|
|
23507
|
-
name: (_a = form === null || form === void 0 ? void 0 : form.program_name.trim()) !== null && _a !== void 0 ? _a : '',
|
|
23508
|
-
description: { text: (_b = form === null || form === void 0 ? void 0 : form.program_description) !== null && _b !== void 0 ? _b : '', attachments: (_c = form === null || form === void 0 ? void 0 : form.program_description_attachments) !== null && _c !== void 0 ? _c : [] },
|
|
23509
|
-
program_objective: { text: (_d = form === null || form === void 0 ? void 0 : form.program_objective) !== null && _d !== void 0 ? _d : '', attachments: (_e = form === null || form === void 0 ? void 0 : form.objective_attachment) !== null && _e !== void 0 ? _e : [] },
|
|
23510
|
-
roles: form.program_roles.map((ele) => { return { roleId: ele === null || ele === void 0 ? void 0 : ele._id, roleName: ele === null || ele === void 0 ? void 0 : ele.roleName, licenseType: ele === null || ele === void 0 ? void 0 : ele.licenseType }; }),
|
|
23511
|
-
owners: (_f = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners, 'member_id')) !== null && _f !== void 0 ? _f : [],
|
|
23512
|
-
owners_group: (_g = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners_group, 'group_id')) !== null && _g !== void 0 ? _g : [],
|
|
23513
|
-
all_user_in_role: (_h = form === null || form === void 0 ? void 0 : form.all_user_in_role) !== null && _h !== void 0 ? _h : false,
|
|
23514
|
-
programType: (_j = form === null || form === void 0 ? void 0 : form.program_type) !== null && _j !== void 0 ? _j : 0,
|
|
23515
|
-
// state:0,
|
|
23516
|
-
state: (_k = form === null || form === void 0 ? void 0 : form.program_state) !== null && _k !== void 0 ? _k : 0,
|
|
23517
|
-
approvers: (_l = this.listToId(form === null || form === void 0 ? void 0 : form.program_approver, 'member_id')) !== null && _l !== void 0 ? _l : [],
|
|
23518
|
-
calculate_past_upcoming_event: (_m = form === null || form === void 0 ? void 0 : form.performance_calculation) !== null && _m !== void 0 ? _m : '',
|
|
23519
|
-
program_frequency: (form === null || form === void 0 ? void 0 : form.recurring_frequency) ? 1 : 0,
|
|
23520
|
-
lock_scope: (form === null || form === void 0 ? void 0 : form.lock_scope_change) ? 1 : 0,
|
|
23521
|
-
rc_ids: this.listToId(form === null || form === void 0 ? void 0 : form.rc, 'item_id'),
|
|
23522
|
-
assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee, 'member_id'),
|
|
23523
|
-
assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee_group, 'group_id'),
|
|
23524
|
-
default_assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee, 'member_id'),
|
|
23525
|
-
default_assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee_group, 'group_id'),
|
|
23526
|
-
default_assignee_type: form === null || form === void 0 ? void 0 : form.assignee_completion_criteria,
|
|
23527
|
-
reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer, 'member_id'),
|
|
23528
|
-
reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer_group, 'group_id'),
|
|
23529
|
-
default_reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer, 'member_id'),
|
|
23530
|
-
default_reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer_group, 'group_id'),
|
|
23531
|
-
default_reviewers_type: form === null || form === void 0 ? void 0 : form.reviewer_completion_criteria,
|
|
23532
|
-
overseers: { cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_overseer, 'member_id'), cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_overseer_group, 'group_id'), failure_cc_email: [], failure_cc_email_groups: [] },
|
|
23533
|
-
default_overseers: { cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_overseer, 'member_id'), cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_overseer_group, 'group_id'),
|
|
23534
|
-
failure_cc_email: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_failed_overseer, 'member_id'), failure_cc_email_groups: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_failed_overseer_group, 'group_id') },
|
|
23535
|
-
assessment: this.generateAssessment(form.program_assessments),
|
|
23536
|
-
evidence_upload_flag: (form === null || form === void 0 ? void 0 : form.evidence_required) ? 1 : 0,
|
|
23537
|
-
is_key_evidence: form === null || form === void 0 ? void 0 : form.allow_any_file_key_evidence,
|
|
23538
|
-
custom_fields: (_o = form === null || form === void 0 ? void 0 : form.custom_fields) !== null && _o !== void 0 ? _o : [],
|
|
23539
|
-
framework: (_p = this.getFramework(form === null || form === void 0 ? void 0 : form.framework)) !== null && _p !== void 0 ? _p : [],
|
|
23540
|
-
_id: instance.mode === 'EDIT' ? instance.programId : undefined,
|
|
23541
|
-
};
|
|
23542
|
-
console.log("payload", payload);
|
|
23543
|
-
return payload;
|
|
23544
|
-
}
|
|
23545
|
-
generateAssessment(assessment) {
|
|
23546
|
-
if (assessment && (assessment === null || assessment === void 0 ? void 0 : assessment.length)) {
|
|
23547
|
-
return assessment.map((cat) => { var _a; return Object.assign(Object.assign({}, cat), { assessmentIds: (_a = cat.assessmentIds) === null || _a === void 0 ? void 0 : _a.map((assess) => assess.id) }); });
|
|
23548
|
-
}
|
|
23549
|
-
else {
|
|
23550
|
-
return [];
|
|
23551
|
-
}
|
|
23552
|
-
}
|
|
23553
|
-
getFramework(input) {
|
|
23554
|
-
console.log("generator", input);
|
|
23555
|
-
if (input) {
|
|
23556
|
-
return [{
|
|
23557
|
-
_id: input === null || input === void 0 ? void 0 : input._id,
|
|
23558
|
-
framework_name: input === null || input === void 0 ? void 0 : input.framework_name,
|
|
23559
|
-
type: input === null || input === void 0 ? void 0 : input.type,
|
|
23560
|
-
in_scope: this.listToId(input === null || input === void 0 ? void 0 : input.in_scope, '_id'),
|
|
23561
|
-
out_scope: this.listToId(input === null || input === void 0 ? void 0 : input.out_scope, '_id')
|
|
23562
|
-
}];
|
|
23563
|
-
}
|
|
23564
|
-
else {
|
|
23565
|
-
return [];
|
|
23566
|
-
}
|
|
23567
|
-
}
|
|
23568
|
-
listToId(list, key) {
|
|
23569
|
-
if (list && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
23570
|
-
return list.map((ele) => ele[key]);
|
|
23571
|
-
}
|
|
23572
|
-
else {
|
|
23573
|
-
return [];
|
|
23574
|
-
}
|
|
23575
|
-
}
|
|
23576
|
-
/**
|
|
23577
|
-
*
|
|
23578
|
-
* @param id : program object id
|
|
23579
|
-
* @returns
|
|
23580
|
-
*/
|
|
23581
|
-
getProgram(id) {
|
|
23582
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
23583
|
-
return this.http.get(this.env.programEndpoint + '/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', { headers });
|
|
23584
|
-
}
|
|
23585
|
-
/**
|
|
23586
|
-
*
|
|
23587
|
-
* @param payload payload which need to be updated
|
|
23588
|
-
* @param id program object id
|
|
23589
|
-
* @returns
|
|
23590
|
-
*/
|
|
23591
|
-
updateProgram(payload, id) {
|
|
23592
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
|
|
23593
|
-
return this.http.post(this.env.programEndpoint + '/category/editCategory/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', payload, { headers });
|
|
23594
|
-
}
|
|
23595
|
-
getMemeberByIds(ids) {
|
|
23596
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23597
|
-
return this.http.post(this.env.organizationPost + 'memberDetailsbyIds&bypass-businessCycle=true', { member_id: ids }, { headers }).pipe(retry$1(2));
|
|
23598
|
-
}
|
|
23599
|
-
getMemberByGroups(ids) {
|
|
23600
|
-
const headers = new HttpHeaders().set('token', this.authService.getAuthorizationToken());
|
|
23601
|
-
return this.http.post(this.env.organizationPost + 'groupDetailsbyIds&bypass-businessCycle=true', { group_ids: ids }, { headers }).pipe(retry$1(2));
|
|
23602
|
-
}
|
|
23603
|
-
}
|
|
23604
|
-
ProgramsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProgramsService_Factory() { return new ProgramsService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(AuthService), i0.ɵɵinject(Configurations, 8)); }, token: ProgramsService, providedIn: "root" });
|
|
23605
|
-
ProgramsService.decorators = [
|
|
23606
|
-
{ type: Injectable, args: [{
|
|
23607
|
-
providedIn: 'root'
|
|
23608
|
-
},] }
|
|
23609
|
-
];
|
|
23610
|
-
ProgramsService.ctorParameters = () => [
|
|
23611
|
-
{ type: HttpClient },
|
|
23612
|
-
{ type: AuthService },
|
|
23613
|
-
{ type: Configurations, decorators: [{ type: Optional }] }
|
|
23614
|
-
];
|
|
23615
|
-
|
|
23616
23686
|
const CONSTANTS = {
|
|
23617
23687
|
categoryType: [
|
|
23618
23688
|
{ label: 'REGULATIONS', value: 1 },
|
|
@@ -27171,5 +27241,5 @@ VComplyWorkflowEngineModule.decorators = [
|
|
|
27171
27241
|
* Generated bundle index. Do not edit.
|
|
27172
27242
|
*/
|
|
27173
27243
|
|
|
27174
|
-
export { VComplyWorkflowEngineModule, WorkflowEngineContainerComponent, WorkflowEngineService, UiKitService as ɵa, SnackBarService as ɵb,
|
|
27244
|
+
export { VComplyWorkflowEngineModule, WorkflowEngineContainerComponent, WorkflowEngineService, UiKitService as ɵa, SnackBarService as ɵb, CheckpointsListComponent as ɵba, ReviewFrequencyComponent as ɵbb, FrequencyContainerComponent as ɵbc, FrequencyDailyComponent as ɵbd, FrequencyWeeklyComponent as ɵbe, FrequencyMonthlyComponent as ɵbf, FrequencyQuarterlyComponent as ɵbg, FrequencyBiannualComponent as ɵbh, FrequencyAnnualComponent as ɵbi, FrequencyOneTimeComponent as ɵbj, FrequencyRandomComponent as ɵbk, FrequencyOnCompletionOfComponent as ɵbl, FrequencyOngoingComponent as ɵbm, FrequencyTopComponent as ɵbn, FrequencyLifecycleComponent as ɵbo, FrequencyDueDateComponent as ɵbp, FrequencyCheckboxListComponent as ɵbq, FrequencyRadioListComponent as ɵbr, GroupUsersListComponent as ɵbs, AddMultipleResponsibilityComponent as ɵbt, FrequencyBulkService as ɵbu, BulkResponsibilityViewComponent as ɵbv, CheckpointsPolicyContainerComponent as ɵbw, CheckpointsPolicyListComponent as ɵbx, CheckpointsPolicyQuestionsComponent as ɵby, WorkflowSurveyFormComponent as ɵbz, AuthService as ɵc, LogAnIssueComponent as ɵca, LogIssueService as ɵcb, FilterPipe as ɵcc, CheckboxListComponent as ɵcd, RadioListComponent as ɵce, ListMapperPipe as ɵcf, CreateDocumentsComponent as ɵcg, SearchPipe$1 as ɵch, UserFilterPipe as ɵci, FrameworkListComponent as ɵcj, ParentTableComponent as ɵck, DataTypePipe as ɵcl, CheckpointFloatingBarComponent as ɵcm, FormatAndEvidenceComponent as ɵcn, RiskClassificationComponent as ɵco, DragDropDirective as ɵcp, AutofocusDirective as ɵcq, ScrollInViewDirective as ɵcr, spaceTrimDirective as ɵcs, ShortMergePipe as ɵct, SpaceBreakerPipe as ɵcu, FormatHtmlPipe as ɵcv, WithinDataPipe as ɵcw, ResponsibilityRiskSelectorComponent as ɵcx, ConditionalFocusDirective as ɵcy, ListLoaderComponent as ɵcz, TokenDecoderService as ɵd, ArrayFilterPipe as ɵda, AuditCategoryListComponent as ɵdb, DocumentSectionComponent as ɵdc, WorkflowAssessmentComponent as ɵdd, AssessmentService$2 as ɵde, ImportAnAssessmentComponent as ɵdf, AssessmentListComponent as ɵdg, AssessmentService$1 as ɵdh, RadioListWithPaginationComponent as ɵdi, LinkTreatmentLoaderComponent as ɵdj, AssessmentListLoaderComponent as ɵdk, AssessmentListSubLoaderComponent as ɵdl, UncategorizedFilterPipe as ɵdm, ProgramListingComponent as ɵdn, WorkflowProgramComponent as ɵdo, RolesListComponent as ɵdp, FrameworkListTableComponent as ɵdq, FrameworkResponsibilityTableComponent as ɵdr, FrameworkTableLoaderComponent as ɵds, ArrayConcatPipe as ɵdt, CreateAssessmentModule as ɵdu, CreateAssessmentContainerComponent as ɵdv, EditorService as ɵdw, DialogService as ɵdx, DialogModule as ɵdy, DialogComponent as ɵdz, Configurations as ɵe, InsertionDirective as ɵea, DialogRef as ɵeb, DialogConfig as ɵec, QuestionTypeComponent as ɵed, AddPageDetailsComponent as ɵee, AssessmentSettingsComponent as ɵef, ResultCriteriaService as ɵeg, AddSegmentPopupComponent as ɵeh, AddResponseSetPopupComponent as ɵei, EditorWrapperComponent as ɵej, ValidatorService as ɵek, QuickSettingsComponent as ɵel, SingleLineEditorComponent as ɵem, ResponseSelectorComponent as ɵen, MoveComponent as ɵeo, LogicComponent as ɵep, AddLogicComponent as ɵeq, ToolkitComponent as ɵer, ErrorMessagePipe as ɵes, QuestionFilterPipe as ɵet, QuestionParserPipe as ɵeu, FormatterPipe as ɵev, SettingAnonymousComponent as ɵew, SettingResponseSegmentComponent as ɵex, PageHeaderComponent as ɵey, WelcomeThankyouComponent as ɵez, WorkflowRiskComponent as ɵf, CurrentPageQuestionPipe as ɵfa, QuestionPageFilterPipe as ɵfb, TypeOfPipe as ɵfc, TooltipModule as ɵfd, ToolTipDirective as ɵfe, PopoverModule as ɵff, PopoverComponent as ɵfg, PopoverService as ɵfh, PopoverDirective as ɵfi, PopoverEventDirective as ɵfj, PopoverLongpressDirective as ɵfk, FormgroupModule$1 as ɵfl, CsCheckboxComponent$1 as ɵfm, CsRadioComponent$1 as ɵfn, CsSwitchComponent$1 as ɵfo, CsRadioGroupComponent$1 as ɵfp, CsSelectComponent$2 as ɵfq, PascalPipe$1 as ɵfr, CsCheckboxIndeterminateComponent$1 as ɵfs, NoDataModule$1 as ɵft, NoDataComponent$1 as ɵfu, BuildModule as ɵfv, MultipleChoiceComponent as ɵfw, CheckboxComponent$1 as ɵfx, ImageChoiceComponent as ɵfy, StarRatingComponent as ɵfz, AddRiskService as ɵg, MatrixDropdownComponent as ɵga, DropdownComponent as ɵgb, MatrixRatingScaleComponent as ɵgc, RankingComponent as ɵgd, SliderComponent as ɵge, MultipleTextboxComponent as ɵgf, DateTimeComponent as ɵgg, ChoiceSettingsPanelComponent as ɵgh, WelcomeComponent$1 as ɵgi, ThankYouComponent$1 as ɵgj, WeightageSelectorComponent as ɵgk, FormgroupModule as ɵgl, CsCheckboxComponent as ɵgm, CsRadioComponent as ɵgn, CsSwitchComponent as ɵgo, CsRadioGroupComponent as ɵgp, CsSelectComponent as ɵgq, PascalPipe as ɵgr, SearchMultiSelectPipe as ɵgs, ClickOutsideDirective as ɵgt, CsCheckboxIndeterminateComponent as ɵgu, PreviewModule as ɵgv, PreviewWrapperComponent as ɵgw, PreviewMultipleChoiceComponent as ɵgx, PreviewCheckboxComponent as ɵgy, PreviewImageChoiceComponent as ɵgz, WorkflowComplianceComponent as ɵh, PreviewStarRatingComponent as ɵha, PreviewSingleTextboxComponent as ɵhb, PreviewCommentBoxComponent as ɵhc, PreviewMatrixDropdownComponent as ɵhd, PreviewDropdownComponent as ɵhe, PreviewMatrixRatingScaleComponent as ɵhf, PreviewRankingComponent as ɵhg, PreviewSliderComponent as ɵhh, PreviewMultipleTextboxComponent as ɵhi, PreviewDateTimeComponent as ɵhj, PreviewFileUploadComponent as ɵhk, WelcomeComponent as ɵhl, ThankYouComponent as ɵhm, SelectModule as ɵhn, CsSelectComponent$1 as ɵho, SelectService as ɵhp, CsOptionComponent as ɵhq, AssessmentPreviewModule as ɵhr, CheckboxQuestionComponent as ɵhs, DateTimeComponent$1 as ɵht, DeviceComponent as ɵhu, FileUploadComponent as ɵhv, PreviewComponent as ɵhw, PreviewContainerComponent as ɵhx, QuickSettingsComponent$1 as ɵhy, RadioQuestionComponent as ɵhz, ResponsibilityService as ɵi, SelectQuestionComponent as ɵia, SingleTextboxComponent as ɵib, PageHeaderComponent$1 as ɵic, WelcomeComponent$2 as ɵid, LogicQuestionsModule as ɵie, LogicMultipleChoiceComponent as ɵif, LogicCheckboxComponent as ɵig, LogicImageChoiceComponent as ɵih, LogicStarRatingComponent as ɵii, LogicSingleTextboxComponent as ɵij, LogicCommentBoxComponent as ɵik, LogicDropdownComponent as ɵil, LogicRankingComponent as ɵim, LogicSliderComponent as ɵin, LogicMultipleTextboxComponent as ɵio, LogicDateTimeComponent as ɵip, EditorLoaderModule as ɵiq, EditorLoaderComponent as ɵir, LineLoaderModule as ɵis, LineLoaderComponent as ɵit, VLoaderModule as ɵiu, LoaderComponent$1 as ɵiv, LoaderInlineComponent as ɵiw, SmileyDialogModule as ɵix, SmileyDialogComponent as ɵiy, SnackBarModule as ɵiz, FrequencyService as ɵj, SnackBarComponent as ɵja, SmileyDialogInlineModule as ɵjb, SmileyDialogInlineComponent as ɵjc, ClickOutsideModule as ɵjd, ClickOutsideDirective$1 as ɵje, PopoverHoverModule as ɵjf, PopoverHoverComponent as ɵjg, PopoverHoverService as ɵjh, PopoverHoverDirective as ɵji, PaginationModule$1 as ɵjj, PaginationComponent$1 as ɵjk, ActionDialogModule as ɵjl, DeleteComponent as ɵjm, DeactivateComponent as ɵjn, ActiveComponent as ɵjo, DuplicateComponent as ɵjp, CreateProgramUiModule as ɵjq, TabSelector as ɵjr, TickMarkComponent as ɵjs, FormFieldComponent as ɵjt, FilePillComponent as ɵju, InputWithPillComponent as ɵjv, SwitchComponent as ɵjw, InputTrimDirective as ɵjx, RoleListComponent as ɵjy, CheckboxComponent as ɵjz, ProgramsService as ɵk, VuiFloatingBarComponent as ɵka, SearchPipe as ɵkb, UserGroupListComponent as ɵkc, ListToIdPipe as ɵkd, RefDisconnectPipe as ɵke, AssessmentPickerComponent as ɵkf, AssessmentService as ɵkg, AssessmentLoaderComponent as ɵkh, AssessmentSubLoaderComponent as ɵki, Pagination as ɵkj, DefineFrameworkListingComponent as ɵkk, FrameworkService as ɵkl, CustomFieldComponent as ɵkm, LoaderComponent as ɵkn, LoaderFrameworkComponent as ɵko, PagerPipe as ɵkp, CategoryAllSelectPipe as ɵkq, SubCatIndeterPipe as ɵkr, SearchNewPipe as ɵks, SelectedAssessmentPipe as ɵkt, AssessmentResolverPipe as ɵku, PaginationModule as ɵkv, PaginationComponent as ɵkw, NoDataModule as ɵkx, NoDataComponent as ɵky, WorkflowPolicyComponent as ɵl, PolicyService as ɵm, MoreOptionComponent as ɵn, OwnerListComponent as ɵo, UserRadioListComponent as ɵp, CategoryListComponent as ɵq, CategoryMultiSelectComponent as ɵr, FloatingBarComponent as ɵs, ResponsibilityCentersListComponent as ɵt, WorkflowPaginationComponent as ɵu, AddMultipleRiskComponent as ɵv, BulkViewComponent as ɵw, CheckpointsComponent as ɵx, ConfirmationAlertComponent as ɵy, CheckpointsQuestionsComponent as ɵz };
|
|
27175
27245
|
//# sourceMappingURL=vcomply-workflow-engine.js.map
|