vcomply-workflow-engine 2.6.1 → 2.6.4

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.
@@ -815,7 +815,7 @@
815
815
  sizeChange: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }]
816
816
  };
817
817
 
818
- /******************************************************************************
818
+ /*! *****************************************************************************
819
819
  Copyright (c) Microsoft Corporation.
820
820
 
821
821
  Permission to use, copy, modify, and/or distribute this software for any
@@ -977,11 +977,7 @@
977
977
  var __createBinding = Object.create ? (function (o, m, k, k2) {
978
978
  if (k2 === undefined)
979
979
  k2 = k;
980
- var desc = Object.getOwnPropertyDescriptor(m, k);
981
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
982
- desc = { enumerable: true, get: function () { return m[k]; } };
983
- }
984
- Object.defineProperty(o, k2, desc);
980
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
985
981
  }) : (function (o, m, k, k2) {
986
982
  if (k2 === undefined)
987
983
  k2 = k;
@@ -1054,7 +1050,7 @@
1054
1050
  ar[i] = from[i];
1055
1051
  }
1056
1052
  }
1057
- return to.concat(ar || Array.prototype.slice.call(from));
1053
+ return to.concat(ar || from);
1058
1054
  }
1059
1055
  function __await(v) {
1060
1056
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -1135,11 +1131,6 @@
1135
1131
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
1136
1132
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
1137
1133
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1138
- }
1139
- function __classPrivateFieldIn(state, receiver) {
1140
- if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
1141
- throw new TypeError("Cannot use 'in' operator on non-object");
1142
- return typeof state === "function" ? receiver === state : state.has(receiver);
1143
1134
  }
1144
1135
 
1145
1136
  var AddRiskService = /** @class */ (function () {
@@ -2667,8 +2658,204 @@
2667
2658
  { type: Configurations, decorators: [{ type: i0.Optional }] }
2668
2659
  ]; };
2669
2660
 
2661
+ var ProgramsService = /** @class */ (function () {
2662
+ function ProgramsService(http, authService, config) {
2663
+ this.http = http;
2664
+ this.authService = authService;
2665
+ if (config) {
2666
+ this.env = config.envConfig;
2667
+ }
2668
+ }
2669
+ ProgramsService.prototype.getRoles = function () {
2670
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2671
+ return this.http.get(this.env.organizationGet + 'roles/getProgramRoles&bypass-businessCycle=true', { headers: headers });
2672
+ };
2673
+ /**
2674
+ * Uploads the given file to server
2675
+ * @param payload payload File data to be uploaded
2676
+ * @param path path Path of file to be uploaded
2677
+ * @returns response after uploading a file
2678
+ */
2679
+ ProgramsService.prototype.uploadFiles = function (payload, path) {
2680
+ // {
2681
+ // reportProgress: true,
2682
+ // observe: 'events'}
2683
+ var ORG_PATH = "o/" + path;
2684
+ return this.http.post(this.env.fileUploadEndPoint + ORG_PATH + '&ngsw-bypass=true', payload);
2685
+ };
2686
+ ProgramsService.prototype.getResponsibilityCenterList = function () {
2687
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2688
+ return this.http.get(this.env.complianceGet + 'responsibilityCenterTree&bypass-businessCycle=true', {
2689
+ headers: headers,
2690
+ }).pipe(rxjs.retry(2));
2691
+ };
2692
+ ProgramsService.prototype.fetchRoleUsers = function (roles, page, searchKey) {
2693
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2694
+ var queryString = '';
2695
+ if (page) {
2696
+ queryString += "&page=" + page;
2697
+ }
2698
+ ;
2699
+ if (searchKey) { }
2700
+ return this.http.post(this.env.organizationPost + 'roles/getUserDetails&limit=30&bypass-businessCycle=true' + queryString, { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
2701
+ };
2702
+ ProgramsService.prototype.fetchAllRoleUsers = function (roles) {
2703
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2704
+ return this.http.post(this.env.organizationPost + 'roles/getUserDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
2705
+ };
2706
+ ProgramsService.prototype.fetchAllRoleGroups = function (roles) {
2707
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2708
+ return this.http.post(this.env.organizationPost + 'roles/getGroupDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
2709
+ };
2710
+ ProgramsService.prototype.fetchAllOrgUser = function () {
2711
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2712
+ //https://devapi.v-comply.com/organization/?mode=organisationUsersList&paginationType=small&admin=1
2713
+ return this.http.get(this.env.organizationGet + 'organisationUsersList&paginationType=small&bypass-businessCycle=true', { headers: headers }).pipe(rxjs.retry(2));
2714
+ };
2715
+ ProgramsService.prototype.fetchComplianceGroups = function () {
2716
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2717
+ //https://devapi.v-comply.com/organization/?mode=groupsList&status=1&type=compliance
2718
+ return this.http.get(this.env.organizationGet + 'groupsList&status=1&type=compliance&bypass-businessCycle=true', { headers: headers }).pipe(rxjs.retry(2));
2719
+ };
2720
+ ProgramsService.prototype.getBusinessCycle = function () {
2721
+ var _a, _b;
2722
+ var businessCycle = JSON.parse((_a = localStorage.getItem("businessCycle")) !== null && _a !== void 0 ? _a : '');
2723
+ return {
2724
+ selected_cycle: businessCycle
2725
+ ? businessCycle.selectedCycle.start_date +
2726
+ "-" +
2727
+ businessCycle.selectedCycle.end_date
2728
+ : "",
2729
+ start_date: businessCycle ? businessCycle.selectedCycle.start_date : "",
2730
+ end_date: businessCycle ? businessCycle.selectedCycle.end_date : "",
2731
+ selected_cycle_arr: businessCycle
2732
+ ? (_b = businessCycle === null || businessCycle === void 0 ? void 0 : businessCycle.selectedCycle) === null || _b === void 0 ? void 0 : _b.selected_cycle_arr
2733
+ : [],
2734
+ };
2735
+ };
2736
+ ProgramsService.prototype.saveProgram = function (payload) {
2737
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
2738
+ return this.http.post(this.env.programEndpoint + '/category/?isBusinessCycle=true', payload, { headers: headers });
2739
+ };
2740
+ ProgramsService.prototype.buildPayload = function (formData, instance) {
2741
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
2742
+ console.log("Component Instance", instance);
2743
+ var form = formData === null || formData === void 0 ? void 0 : formData.value;
2744
+ console.log("Form Value", form);
2745
+ var payload = {
2746
+ mode: 'program',
2747
+ name: (_a = form === null || form === void 0 ? void 0 : form.program_name.trim()) !== null && _a !== void 0 ? _a : '',
2748
+ 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 : [] },
2749
+ 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 : [] },
2750
+ roles: form.program_roles.map(function (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 }; }),
2751
+ owners: (_f = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners, 'member_id')) !== null && _f !== void 0 ? _f : [],
2752
+ owners_group: (_g = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners_group, 'group_id')) !== null && _g !== void 0 ? _g : [],
2753
+ all_user_in_role: (_h = form === null || form === void 0 ? void 0 : form.all_user_in_role) !== null && _h !== void 0 ? _h : false,
2754
+ programType: (_j = form === null || form === void 0 ? void 0 : form.program_type) !== null && _j !== void 0 ? _j : 0,
2755
+ // state:0,
2756
+ state: (_k = form === null || form === void 0 ? void 0 : form.program_state) !== null && _k !== void 0 ? _k : 0,
2757
+ approvers: (_l = this.listToId(form === null || form === void 0 ? void 0 : form.program_approver, 'member_id')) !== null && _l !== void 0 ? _l : [],
2758
+ calculate_past_upcoming_event: (_m = form === null || form === void 0 ? void 0 : form.performance_calculation) !== null && _m !== void 0 ? _m : '',
2759
+ program_frequency: (form === null || form === void 0 ? void 0 : form.recurring_frequency) ? 1 : 0,
2760
+ lock_scope: (form === null || form === void 0 ? void 0 : form.lock_scope_change) ? 1 : 0,
2761
+ rc_ids: this.listToId(form === null || form === void 0 ? void 0 : form.rc, 'item_id'),
2762
+ assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee, 'member_id'),
2763
+ assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee_group, 'group_id'),
2764
+ default_assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee, 'member_id'),
2765
+ default_assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee_group, 'group_id'),
2766
+ default_assignee_type: form === null || form === void 0 ? void 0 : form.assignee_completion_criteria,
2767
+ reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer, 'member_id'),
2768
+ reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer_group, 'group_id'),
2769
+ default_reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer, 'member_id'),
2770
+ default_reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer_group, 'group_id'),
2771
+ default_reviewers_type: form === null || form === void 0 ? void 0 : form.reviewer_completion_criteria,
2772
+ 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: [] },
2773
+ 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'),
2774
+ 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') },
2775
+ assessment: this.generateAssessment(form.program_assessments),
2776
+ evidence_upload_flag: (form === null || form === void 0 ? void 0 : form.evidence_required) ? 1 : 0,
2777
+ is_key_evidence: form === null || form === void 0 ? void 0 : form.allow_any_file_key_evidence,
2778
+ custom_fields: (_o = form === null || form === void 0 ? void 0 : form.custom_fields) !== null && _o !== void 0 ? _o : [],
2779
+ framework: (_p = this.getFramework(form === null || form === void 0 ? void 0 : form.framework)) !== null && _p !== void 0 ? _p : [],
2780
+ _id: instance.mode === 'EDIT' ? instance.programId : undefined,
2781
+ };
2782
+ console.log("payload", payload);
2783
+ return payload;
2784
+ };
2785
+ ProgramsService.prototype.generateAssessment = function (assessment) {
2786
+ if (assessment && (assessment === null || assessment === void 0 ? void 0 : assessment.length)) {
2787
+ return assessment.map(function (cat) { var _a; return Object.assign(Object.assign({}, cat), { assessmentIds: (_a = cat.assessmentIds) === null || _a === void 0 ? void 0 : _a.map(function (assess) { return assess.id; }) }); });
2788
+ }
2789
+ else {
2790
+ return [];
2791
+ }
2792
+ };
2793
+ ProgramsService.prototype.getFramework = function (input) {
2794
+ console.log("generator", input);
2795
+ if (input) {
2796
+ return [{
2797
+ _id: input === null || input === void 0 ? void 0 : input._id,
2798
+ framework_name: input === null || input === void 0 ? void 0 : input.framework_name,
2799
+ type: input === null || input === void 0 ? void 0 : input.type,
2800
+ in_scope: this.listToId(input === null || input === void 0 ? void 0 : input.in_scope, '_id'),
2801
+ out_scope: this.listToId(input === null || input === void 0 ? void 0 : input.out_scope, '_id')
2802
+ }];
2803
+ }
2804
+ else {
2805
+ return [];
2806
+ }
2807
+ };
2808
+ ProgramsService.prototype.listToId = function (list, key) {
2809
+ if (list && (list === null || list === void 0 ? void 0 : list.length)) {
2810
+ return list.map(function (ele) { return ele[key]; });
2811
+ }
2812
+ else {
2813
+ return [];
2814
+ }
2815
+ };
2816
+ /**
2817
+ *
2818
+ * @param id : program object id
2819
+ * @returns
2820
+ */
2821
+ ProgramsService.prototype.getProgram = function (id) {
2822
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
2823
+ return this.http.get(this.env.programEndpoint + '/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', { headers: headers });
2824
+ };
2825
+ /**
2826
+ *
2827
+ * @param payload payload which need to be updated
2828
+ * @param id program object id
2829
+ * @returns
2830
+ */
2831
+ ProgramsService.prototype.updateProgram = function (payload, id) {
2832
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
2833
+ return this.http.post(this.env.programEndpoint + '/category/editCategory/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', payload, { headers: headers });
2834
+ };
2835
+ ProgramsService.prototype.getMemeberByIds = function (ids) {
2836
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2837
+ return this.http.post(this.env.organizationPost + 'memberDetailsbyIds&bypass-businessCycle=true', { member_id: ids }, { headers: headers }).pipe(rxjs.retry(2));
2838
+ };
2839
+ ProgramsService.prototype.getMemberByGroups = function (ids) {
2840
+ var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
2841
+ return this.http.post(this.env.organizationPost + 'groupDetailsbyIds&bypass-businessCycle=true', { group_ids: ids }, { headers: headers }).pipe(rxjs.retry(2));
2842
+ };
2843
+ return ProgramsService;
2844
+ }());
2845
+ ProgramsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ProgramsService_Factory() { return new ProgramsService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(Configurations, 8)); }, token: ProgramsService, providedIn: "root" });
2846
+ ProgramsService.decorators = [
2847
+ { type: i0.Injectable, args: [{
2848
+ providedIn: 'root'
2849
+ },] }
2850
+ ];
2851
+ ProgramsService.ctorParameters = function () { return [
2852
+ { type: i1.HttpClient },
2853
+ { type: AuthService },
2854
+ { type: Configurations, decorators: [{ type: i0.Optional }] }
2855
+ ]; };
2856
+
2670
2857
  var WorkflowComplianceComponent = /** @class */ (function () {
2671
- function WorkflowComplianceComponent(authService, responsibilityService, frequencyService, uiKitService, snackBar, permission) {
2858
+ function WorkflowComplianceComponent(authService, responsibilityService, frequencyService, uiKitService, snackBar, permission, programService) {
2672
2859
  var _this = this;
2673
2860
  this.authService = authService;
2674
2861
  this.responsibilityService = responsibilityService;
@@ -2676,6 +2863,7 @@
2676
2863
  this.uiKitService = uiKitService;
2677
2864
  this.snackBar = snackBar;
2678
2865
  this.permission = permission;
2866
+ this.programService = programService;
2679
2867
  this.mode = 'CREATE';
2680
2868
  this.responsibilityId = '';
2681
2869
  this.frameworkDetails = [];
@@ -2997,6 +3185,14 @@
2997
3185
  this.responsibilityService.getResponsibilityCenterList(params).subscribe(function (res) {
2998
3186
  _this.responsibilityCentersList = res;
2999
3187
  _this.rcListLoaded = true;
3188
+ var ids = _this.returnIds(_this.responsibilityForm.rc, 'item_id');
3189
+ var RC = _this.responsibilityCentersList.filter(function (element) { return ids.includes(element.item_id); });
3190
+ if (RC === null || RC === void 0 ? void 0 : RC.length) {
3191
+ _this.responsibilityForm.rc = RC;
3192
+ }
3193
+ else {
3194
+ _this.responsibilityForm.rc = [];
3195
+ }
3000
3196
  if (_this.openedFrom === 'RISK_TREATMENT') {
3001
3197
  _this.responsibilityForm.rc = _this.setList(_this.responsibilityCentersList, [_this.selectedRC], 'item_id');
3002
3198
  _this.moreOptions.RC = true;
@@ -3081,13 +3277,13 @@
3081
3277
  });
3082
3278
  };
3083
3279
  WorkflowComplianceComponent.prototype.filterListsAccordingToProgram = function (program_id) {
3084
- this.responsibilityForm.rc = [];
3085
- this.responsibilityForm.assignees.list = [];
3086
- this.responsibilityForm.reviewers.list = [];
3087
- this.responsibilityForm.overseers.list = [];
3088
- this.responsibilityForm.overseers.notifyList = [];
3089
- this.responsibilityForm.assessment = { assessment_id: "", category_id: "" };
3090
- this.groupsList = [];
3280
+ // this.responsibilityForm.rc = [];
3281
+ // this.responsibilityForm.assignees.list = [];
3282
+ // this.responsibilityForm.reviewers.list = [];
3283
+ // this.responsibilityForm.overseers.list = [];
3284
+ // this.responsibilityForm.overseers.notifyList = [];
3285
+ // this.responsibilityForm.assessment = { assessment_id: "", category_id: "" }
3286
+ // this.groupsList = [];
3091
3287
  this.unSubscribeProgram.next();
3092
3288
  this.unSubscribeProgram.complete();
3093
3289
  if (program_id) {
@@ -3103,6 +3299,26 @@
3103
3299
  this.getAssignorsList();
3104
3300
  }
3105
3301
  };
3302
+ WorkflowComplianceComponent.prototype.getProgramDetails = function (programId) {
3303
+ var _this = this;
3304
+ this.loader = true;
3305
+ this.programService.getProgram(programId).subscribe(function (res) {
3306
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3307
+ 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)) {
3308
+ var categoryAssessment = res === null || res === void 0 ? void 0 : res.assessment.filter(function (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); });
3309
+ 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)) {
3310
+ var 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);
3311
+ if (!isExist) {
3312
+ _this.responsibilityForm.assessment = { assessment_id: "", category_id: "" };
3313
+ }
3314
+ }
3315
+ else {
3316
+ _this.responsibilityForm.assessment = { assessment_id: "", category_id: "" };
3317
+ }
3318
+ }
3319
+ _this.loader = false;
3320
+ });
3321
+ };
3106
3322
  WorkflowComplianceComponent.prototype.getListsAccordingToProgram = function (program_id) {
3107
3323
  this.getPeopleListAgainstPID(program_id);
3108
3324
  this.getRCList(program_id);
@@ -3159,6 +3375,7 @@
3159
3375
  params = params.append('program_ids', program_id);
3160
3376
  }
3161
3377
  this.responsibilityService.getOrganizationPeople(params).subscribe(function (res) {
3378
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
3162
3379
  _this.assigneesList = res.assignee.map(function (user) {
3163
3380
  user.member_name = user.employee_name;
3164
3381
  return user;
@@ -3176,7 +3393,7 @@
3176
3393
  reviewersList: __spreadArray([], __read(new Set(_this.reviewersList))),
3177
3394
  overseersList: __spreadArray([], __read(new Set(_this.overseersList))),
3178
3395
  };
3179
- if (_this.responsibilityForm.program[0].default_assignee_ids) {
3396
+ if (_this.responsibilityForm.program[0].default_assignee_ids || _this.responsibilityForm.assignees.list.length) {
3180
3397
  if (_this.responsibilityForm.assignees.list.length) {
3181
3398
  var ids = _this.returnIds(_this.responsibilityForm.assignees.list, 'my_member_id');
3182
3399
  var allIds_1 = __spreadArray(__spreadArray([], __read(new Set(ids))), __read(new Set(_this.responsibilityForm.program[0].default_assignee_ids)));
@@ -3184,6 +3401,9 @@
3184
3401
  if (assignors.length) {
3185
3402
  _this.responsibilityForm.assignees.list = assignors;
3186
3403
  }
3404
+ else {
3405
+ _this.responsibilityForm.assignees.list = [];
3406
+ }
3187
3407
  }
3188
3408
  else {
3189
3409
  var assignors = _this.assigneesList.filter(function (element) { return _this.responsibilityForm.program[0].default_assignee_ids.includes(element.my_member_id); });
@@ -3192,25 +3412,61 @@
3192
3412
  }
3193
3413
  }
3194
3414
  }
3415
+ else {
3416
+ _this.responsibilityForm.assignees.list = [];
3417
+ }
3195
3418
  var checkedMoreOptions = [];
3196
- if (_this.responsibilityForm.program[0].default_reviewers) {
3197
- var reviewers = _this.reviewersList.filter(function (element) { return _this.responsibilityForm.program[0].default_reviewers.includes(element.my_member_id); });
3419
+ 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)) {
3420
+ var ids = _this.returnIds(_this.responsibilityForm.reviewers.list, 'my_member_id');
3421
+ var allIds_2 = __spreadArray(__spreadArray([], __read(new Set(ids))), __read(new Set(_this.responsibilityForm.program[0].default_reviewers)));
3422
+ var reviewers = _this.reviewersList.filter(function (element) { return allIds_2.includes(element.my_member_id); });
3423
+ // const reviewers = this.reviewersList.filter((element: any) => this.responsibilityForm.program[0].default_reviewers.includes(element.my_member_id));
3198
3424
  if (reviewers.length) {
3199
3425
  _this.responsibilityForm.reviewers.list = reviewers;
3200
3426
  _this.moreOptions.REVIEWER = true;
3201
3427
  }
3428
+ else {
3429
+ _this.responsibilityForm.reviewers.list = [];
3430
+ }
3202
3431
  }
3203
- if (_this.responsibilityForm.program[0].default_overseers) {
3204
- var overseers = _this.overseersList.filter(function (element) { return _this.responsibilityForm.program[0].default_overseers.cc_email.includes(element.my_member_id); });
3205
- var notifyOverseers = _this.overseersList.filter(function (element) { return _this.responsibilityForm.program[0].default_overseers.failure_cc_email.includes(element.my_member_id); });
3206
- if (overseers.length) {
3207
- _this.responsibilityForm.overseers.list = overseers;
3432
+ else {
3433
+ _this.responsibilityForm.reviewers.list = [];
3434
+ }
3435
+ 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)) {
3436
+ var 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');
3437
+ var allDefaultCCIds_1 = __spreadArray(__spreadArray([], __read(new Set(ids))), __read(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)));
3438
+ var overseersCC = (_s = _this.overseersList) === null || _s === void 0 ? void 0 : _s.filter(function (element) { return allDefaultCCIds_1 === null || allDefaultCCIds_1 === void 0 ? void 0 : allDefaultCCIds_1.includes(element === null || element === void 0 ? void 0 : element.my_member_id); });
3439
+ // const overseers = this.overseersList.filter((element: any) => this.responsibilityForm.program[0].default_overseers.cc_email.includes(element.my_member_id));
3440
+ var notifyListIds = _this.returnIds(_this.responsibilityForm.overseers.notifyList, 'my_member_id');
3441
+ var allDefaultCCFailureIds_1 = __spreadArray(__spreadArray([], __read(new Set(notifyListIds))), __read(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)));
3442
+ var overseersCCFailure = (_w = _this.overseersList) === null || _w === void 0 ? void 0 : _w.filter(function (element) { return allDefaultCCFailureIds_1 === null || allDefaultCCFailureIds_1 === void 0 ? void 0 : allDefaultCCFailureIds_1.includes(element === null || element === void 0 ? void 0 : element.my_member_id); });
3443
+ // const notifyOverseers = this.overseersList.filter((element: any) => this.responsibilityForm.program[0].default_overseers.failure_cc_email.includes(element.my_member_id));
3444
+ // if (overseers.length) {
3445
+ // this.responsibilityForm.overseers.list = overseers;
3446
+ // this.moreOptions.OVERSEER = true;
3447
+ // }
3448
+ // if (notifyOverseers.length) {
3449
+ // this.responsibilityForm.overseers.notifyList = notifyOverseers;
3450
+ // this.moreOptions.OVERSEER = true;
3451
+ // }
3452
+ if (overseersCC.length) {
3453
+ _this.responsibilityForm.overseers.list = overseersCC;
3208
3454
  _this.moreOptions.OVERSEER = true;
3209
3455
  }
3210
- if (notifyOverseers.length) {
3211
- _this.responsibilityForm.overseers.notifyList = notifyOverseers;
3456
+ else {
3457
+ _this.responsibilityForm.overseers.list = [];
3458
+ }
3459
+ if (overseersCCFailure.length) {
3460
+ _this.responsibilityForm.overseers.notifyList = overseersCCFailure;
3212
3461
  _this.moreOptions.OVERSEER = true;
3213
3462
  }
3463
+ else {
3464
+ _this.responsibilityForm.overseers.notifyList = [];
3465
+ }
3466
+ }
3467
+ else {
3468
+ _this.responsibilityForm.overseers.list = [];
3469
+ _this.responsibilityForm.overseers.notifyList = [];
3214
3470
  }
3215
3471
  for (var key in _this.moreOptions) {
3216
3472
  if (_this.moreOptions[key]) {
@@ -3253,8 +3509,8 @@
3253
3509
  });
3254
3510
  if (_this.responsibilityForm.assignees.list.length) {
3255
3511
  var ids = _this.returnIds(_this.responsibilityForm.assignees.list, 'my_member_id');
3256
- var allIds_2 = __spreadArray(__spreadArray([], __read(new Set(ids))), __read(new Set(memberIds_1)));
3257
- var assignors = _this.assigneesList.filter(function (element) { return allIds_2.includes(element.my_member_id); });
3512
+ var allIds_3 = __spreadArray(__spreadArray([], __read(new Set(ids))), __read(new Set(memberIds_1)));
3513
+ var assignors = _this.assigneesList.filter(function (element) { return allIds_3.includes(element.my_member_id); });
3258
3514
  if (assignors.length) {
3259
3515
  _this.responsibilityForm.assignees.list = assignors;
3260
3516
  }
@@ -3504,7 +3760,7 @@
3504
3760
  };
3505
3761
  WorkflowComplianceComponent.prototype.saveSelectedList = function (type, selectedItems) {
3506
3762
  var _this = this;
3507
- 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;
3763
+ 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;
3508
3764
  switch (type) {
3509
3765
  case 'assignors':
3510
3766
  if (this.invalidType === 'whom') {
@@ -3576,21 +3832,22 @@
3576
3832
  this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_j = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _j === void 0 ? void 0 : _j.category_id])));
3577
3833
  }
3578
3834
  else {
3835
+ ((_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;
3579
3836
  this.responsibilityForm.category = (selectedItems.categories) ? selectedItems.categories : [];
3580
3837
  this.responsibilityForm.program = [];
3581
3838
  this.responsibilityForm.category_id = '';
3582
3839
  this.responsibilityForm.program_selected_ids = [];
3583
3840
  this.responsibilityForm.customTags = [];
3584
3841
  this.responsibilityForm.program = (selectedItems.program) ? [selectedItems.program] : [];
3585
- var categoryId = (_k = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _k === void 0 ? void 0 : _k.toString();
3586
- if ((_l = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _l === void 0 ? void 0 : _l.length) {
3587
- this.responsibilityForm.category_id = ((_m = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _m === void 0 ? void 0 : _m.category_id) + ',' + categoryId;
3842
+ var categoryId = (_m = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _m === void 0 ? void 0 : _m.toString();
3843
+ if ((_o = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories) === null || _o === void 0 ? void 0 : _o.length) {
3844
+ this.responsibilityForm.category_id = ((_p = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _p === void 0 ? void 0 : _p.category_id) + ',' + categoryId;
3588
3845
  }
3589
3846
  else {
3590
- this.responsibilityForm.category_id = (_p = (_o = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _o === void 0 ? void 0 : _o.category_id) === null || _p === void 0 ? void 0 : _p.toString();
3847
+ 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();
3591
3848
  }
3592
- this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_q = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _q === void 0 ? void 0 : _q.category_id])));
3593
- var programCustomTags = ((_r = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _r === void 0 ? void 0 : _r.custom_tags) ? JSON.parse((_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _s === void 0 ? void 0 : _s.custom_tags) : [];
3849
+ this.responsibilityForm.program_selected_ids = __spreadArray(__spreadArray([], __read(new Set(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.categories))), __read(new Set([(_s = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _s === void 0 ? void 0 : _s.category_id])));
3850
+ var 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) : [];
3594
3851
  programCustomTags === null || programCustomTags === void 0 ? void 0 : programCustomTags.forEach(function (tag) {
3595
3852
  var tagData = JSON === null || JSON === void 0 ? void 0 : JSON.parse(tag);
3596
3853
  var index = _this.responsibilityForm.customTags.findIndex(function (tagElement) { return tagElement.tag_name == tagData.tag_name; });
@@ -3598,12 +3855,12 @@
3598
3855
  _this.responsibilityForm.customTags.push(tagData);
3599
3856
  }
3600
3857
  });
3601
- this.responsibilityForm.formatAndEvidence.evidenceRequired = ((_t = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _t === void 0 ? void 0 : _t.evidence_upload_flag) ? true : false;
3602
- if ((_u = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _u === void 0 ? void 0 : _u.evidence_upload_flag) {
3858
+ 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;
3859
+ if ((_w = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _w === void 0 ? void 0 : _w.evidence_upload_flag) {
3603
3860
  this.moreOptions.FORMATE_EVIDENCE = true;
3604
3861
  }
3605
- if (!(((_v = this.selectedProgram) === null || _v === void 0 ? void 0 : _v.programType) === 0 && ((_x = (_w = this.selectedProgram) === null || _w === void 0 ? void 0 : _w.name) === null || _x === void 0 ? void 0 : _x.toLowerCase()) === 'uncategorized')) {
3606
- if ((_y = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _y === void 0 ? void 0 : _y._id) {
3862
+ 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')) {
3863
+ if ((_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.program) === null || _0 === void 0 ? void 0 : _0._id) {
3607
3864
  this.filterListsAccordingToProgram(selectedItems.program._id);
3608
3865
  }
3609
3866
  else {
@@ -3655,10 +3912,10 @@
3655
3912
  this.responsibilityForm.riskMatrix = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.riskMatrix;
3656
3913
  break;
3657
3914
  case 'formate_evidence':
3658
- this.responsibilityForm.formatAndEvidence.formatRequired = (_z = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _z !== void 0 ? _z : false;
3659
- this.responsibilityForm.formatAndEvidence.formatFiles = (_0 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _0 !== void 0 ? _0 : [];
3660
- this.responsibilityForm.formatAndEvidence.formatLinks = (_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _1 !== void 0 ? _1 : [];
3661
- this.responsibilityForm.formatAndEvidence.evidenceRequired = (_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _2 !== void 0 ? _2 : false;
3915
+ this.responsibilityForm.formatAndEvidence.formatRequired = (_1 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isFormateUploaded) !== null && _1 !== void 0 ? _1 : false;
3916
+ this.responsibilityForm.formatAndEvidence.formatFiles = (_2 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.files) !== null && _2 !== void 0 ? _2 : [];
3917
+ this.responsibilityForm.formatAndEvidence.formatLinks = (_3 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.links) !== null && _3 !== void 0 ? _3 : [];
3918
+ this.responsibilityForm.formatAndEvidence.evidenceRequired = (_4 = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.isEvidenceRequired) !== null && _4 !== void 0 ? _4 : false;
3662
3919
  break;
3663
3920
  case 'reviewFrequency':
3664
3921
  this.responsibilityForm.reviewers.reviewFrequency = {
@@ -4848,7 +5105,8 @@
4848
5105
  { type: FrequencyService },
4849
5106
  { type: UiKitService },
4850
5107
  { type: SnackBarService },
4851
- { type: AuthService }
5108
+ { type: AuthService },
5109
+ { type: ProgramsService }
4852
5110
  ]; };
4853
5111
  WorkflowComplianceComponent.propDecorators = {
4854
5112
  mode: [{ type: i0.Input }],
@@ -24704,202 +24962,6 @@
24704
24962
  closeEvent: [{ type: i0.Output }]
24705
24963
  };
24706
24964
 
24707
- var ProgramsService = /** @class */ (function () {
24708
- function ProgramsService(http, authService, config) {
24709
- this.http = http;
24710
- this.authService = authService;
24711
- if (config) {
24712
- this.env = config.envConfig;
24713
- }
24714
- }
24715
- ProgramsService.prototype.getRoles = function () {
24716
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24717
- return this.http.get(this.env.organizationGet + 'roles/getProgramRoles&bypass-businessCycle=true', { headers: headers });
24718
- };
24719
- /**
24720
- * Uploads the given file to server
24721
- * @param payload payload File data to be uploaded
24722
- * @param path path Path of file to be uploaded
24723
- * @returns response after uploading a file
24724
- */
24725
- ProgramsService.prototype.uploadFiles = function (payload, path) {
24726
- // {
24727
- // reportProgress: true,
24728
- // observe: 'events'}
24729
- var ORG_PATH = "o/" + path;
24730
- return this.http.post(this.env.fileUploadEndPoint + ORG_PATH + '&ngsw-bypass=true', payload);
24731
- };
24732
- ProgramsService.prototype.getResponsibilityCenterList = function () {
24733
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24734
- return this.http.get(this.env.complianceGet + 'responsibilityCenterTree&bypass-businessCycle=true', {
24735
- headers: headers,
24736
- }).pipe(rxjs.retry(2));
24737
- };
24738
- ProgramsService.prototype.fetchRoleUsers = function (roles, page, searchKey) {
24739
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24740
- var queryString = '';
24741
- if (page) {
24742
- queryString += "&page=" + page;
24743
- }
24744
- ;
24745
- if (searchKey) { }
24746
- return this.http.post(this.env.organizationPost + 'roles/getUserDetails&limit=30&bypass-businessCycle=true' + queryString, { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
24747
- };
24748
- ProgramsService.prototype.fetchAllRoleUsers = function (roles) {
24749
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24750
- return this.http.post(this.env.organizationPost + 'roles/getUserDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
24751
- };
24752
- ProgramsService.prototype.fetchAllRoleGroups = function (roles) {
24753
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24754
- return this.http.post(this.env.organizationPost + 'roles/getGroupDetails&type=all&bypass-businessCycle=true', { role_ids: roles !== null && roles !== void 0 ? roles : [] }, { headers: headers }).pipe(rxjs.retry(2));
24755
- };
24756
- ProgramsService.prototype.fetchAllOrgUser = function () {
24757
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24758
- //https://devapi.v-comply.com/organization/?mode=organisationUsersList&paginationType=small&admin=1
24759
- return this.http.get(this.env.organizationGet + 'organisationUsersList&paginationType=small&bypass-businessCycle=true', { headers: headers }).pipe(rxjs.retry(2));
24760
- };
24761
- ProgramsService.prototype.fetchComplianceGroups = function () {
24762
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24763
- //https://devapi.v-comply.com/organization/?mode=groupsList&status=1&type=compliance
24764
- return this.http.get(this.env.organizationGet + 'groupsList&status=1&type=compliance&bypass-businessCycle=true', { headers: headers }).pipe(rxjs.retry(2));
24765
- };
24766
- ProgramsService.prototype.getBusinessCycle = function () {
24767
- var _a, _b;
24768
- var businessCycle = JSON.parse((_a = localStorage.getItem("businessCycle")) !== null && _a !== void 0 ? _a : '');
24769
- return {
24770
- selected_cycle: businessCycle
24771
- ? businessCycle.selectedCycle.start_date +
24772
- "-" +
24773
- businessCycle.selectedCycle.end_date
24774
- : "",
24775
- start_date: businessCycle ? businessCycle.selectedCycle.start_date : "",
24776
- end_date: businessCycle ? businessCycle.selectedCycle.end_date : "",
24777
- selected_cycle_arr: businessCycle
24778
- ? (_b = businessCycle === null || businessCycle === void 0 ? void 0 : businessCycle.selectedCycle) === null || _b === void 0 ? void 0 : _b.selected_cycle_arr
24779
- : [],
24780
- };
24781
- };
24782
- ProgramsService.prototype.saveProgram = function (payload) {
24783
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
24784
- return this.http.post(this.env.programEndpoint + '/category/?isBusinessCycle=true', payload, { headers: headers });
24785
- };
24786
- ProgramsService.prototype.buildPayload = function (formData, instance) {
24787
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24788
- console.log("Component Instance", instance);
24789
- var form = formData === null || formData === void 0 ? void 0 : formData.value;
24790
- console.log("Form Value", form);
24791
- var payload = {
24792
- mode: 'program',
24793
- name: (_a = form === null || form === void 0 ? void 0 : form.program_name.trim()) !== null && _a !== void 0 ? _a : '',
24794
- 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 : [] },
24795
- 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 : [] },
24796
- roles: form.program_roles.map(function (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 }; }),
24797
- owners: (_f = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners, 'member_id')) !== null && _f !== void 0 ? _f : [],
24798
- owners_group: (_g = this.listToId(form === null || form === void 0 ? void 0 : form.program_owners_group, 'group_id')) !== null && _g !== void 0 ? _g : [],
24799
- all_user_in_role: (_h = form === null || form === void 0 ? void 0 : form.all_user_in_role) !== null && _h !== void 0 ? _h : false,
24800
- programType: (_j = form === null || form === void 0 ? void 0 : form.program_type) !== null && _j !== void 0 ? _j : 0,
24801
- // state:0,
24802
- state: (_k = form === null || form === void 0 ? void 0 : form.program_state) !== null && _k !== void 0 ? _k : 0,
24803
- approvers: (_l = this.listToId(form === null || form === void 0 ? void 0 : form.program_approver, 'member_id')) !== null && _l !== void 0 ? _l : [],
24804
- calculate_past_upcoming_event: (_m = form === null || form === void 0 ? void 0 : form.performance_calculation) !== null && _m !== void 0 ? _m : '',
24805
- program_frequency: (form === null || form === void 0 ? void 0 : form.recurring_frequency) ? 1 : 0,
24806
- lock_scope: (form === null || form === void 0 ? void 0 : form.lock_scope_change) ? 1 : 0,
24807
- rc_ids: this.listToId(form === null || form === void 0 ? void 0 : form.rc, 'item_id'),
24808
- assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee, 'member_id'),
24809
- assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_assignee_group, 'group_id'),
24810
- default_assignee_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee, 'member_id'),
24811
- default_assignee_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_assignee_group, 'group_id'),
24812
- default_assignee_type: form === null || form === void 0 ? void 0 : form.assignee_completion_criteria,
24813
- reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer, 'member_id'),
24814
- reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_reviewer_group, 'group_id'),
24815
- default_reviewers: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer, 'member_id'),
24816
- default_reviewer_group_ids: this.listToId(form === null || form === void 0 ? void 0 : form.program_default_reviewer_group, 'group_id'),
24817
- default_reviewers_type: form === null || form === void 0 ? void 0 : form.reviewer_completion_criteria,
24818
- 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: [] },
24819
- 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'),
24820
- 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') },
24821
- assessment: this.generateAssessment(form.program_assessments),
24822
- evidence_upload_flag: (form === null || form === void 0 ? void 0 : form.evidence_required) ? 1 : 0,
24823
- is_key_evidence: form === null || form === void 0 ? void 0 : form.allow_any_file_key_evidence,
24824
- custom_fields: (_o = form === null || form === void 0 ? void 0 : form.custom_fields) !== null && _o !== void 0 ? _o : [],
24825
- framework: (_p = this.getFramework(form === null || form === void 0 ? void 0 : form.framework)) !== null && _p !== void 0 ? _p : [],
24826
- _id: instance.mode === 'EDIT' ? instance.programId : undefined,
24827
- };
24828
- console.log("payload", payload);
24829
- return payload;
24830
- };
24831
- ProgramsService.prototype.generateAssessment = function (assessment) {
24832
- if (assessment && (assessment === null || assessment === void 0 ? void 0 : assessment.length)) {
24833
- return assessment.map(function (cat) { var _a; return Object.assign(Object.assign({}, cat), { assessmentIds: (_a = cat.assessmentIds) === null || _a === void 0 ? void 0 : _a.map(function (assess) { return assess.id; }) }); });
24834
- }
24835
- else {
24836
- return [];
24837
- }
24838
- };
24839
- ProgramsService.prototype.getFramework = function (input) {
24840
- console.log("generator", input);
24841
- if (input) {
24842
- return [{
24843
- _id: input === null || input === void 0 ? void 0 : input._id,
24844
- framework_name: input === null || input === void 0 ? void 0 : input.framework_name,
24845
- type: input === null || input === void 0 ? void 0 : input.type,
24846
- in_scope: this.listToId(input === null || input === void 0 ? void 0 : input.in_scope, '_id'),
24847
- out_scope: this.listToId(input === null || input === void 0 ? void 0 : input.out_scope, '_id')
24848
- }];
24849
- }
24850
- else {
24851
- return [];
24852
- }
24853
- };
24854
- ProgramsService.prototype.listToId = function (list, key) {
24855
- if (list && (list === null || list === void 0 ? void 0 : list.length)) {
24856
- return list.map(function (ele) { return ele[key]; });
24857
- }
24858
- else {
24859
- return [];
24860
- }
24861
- };
24862
- /**
24863
- *
24864
- * @param id : program object id
24865
- * @returns
24866
- */
24867
- ProgramsService.prototype.getProgram = function (id) {
24868
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
24869
- return this.http.get(this.env.programEndpoint + '/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', { headers: headers });
24870
- };
24871
- /**
24872
- *
24873
- * @param payload payload which need to be updated
24874
- * @param id program object id
24875
- * @returns
24876
- */
24877
- ProgramsService.prototype.updateProgram = function (payload, id) {
24878
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken()).set('x-business-cycle', JSON.stringify((this.getBusinessCycle())));
24879
- return this.http.post(this.env.programEndpoint + '/category/editCategory/' + id + '?isBusinessCycle=true&bypass-businessCycle=true', payload, { headers: headers });
24880
- };
24881
- ProgramsService.prototype.getMemeberByIds = function (ids) {
24882
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24883
- return this.http.post(this.env.organizationPost + 'memberDetailsbyIds&bypass-businessCycle=true', { member_id: ids }, { headers: headers }).pipe(rxjs.retry(2));
24884
- };
24885
- ProgramsService.prototype.getMemberByGroups = function (ids) {
24886
- var headers = new i1.HttpHeaders().set('token', this.authService.getAuthorizationToken());
24887
- return this.http.post(this.env.organizationPost + 'groupDetailsbyIds&bypass-businessCycle=true', { group_ids: ids }, { headers: headers }).pipe(rxjs.retry(2));
24888
- };
24889
- return ProgramsService;
24890
- }());
24891
- ProgramsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ProgramsService_Factory() { return new ProgramsService(i0__namespace.ɵɵinject(i1__namespace.HttpClient), i0__namespace.ɵɵinject(AuthService), i0__namespace.ɵɵinject(Configurations, 8)); }, token: ProgramsService, providedIn: "root" });
24892
- ProgramsService.decorators = [
24893
- { type: i0.Injectable, args: [{
24894
- providedIn: 'root'
24895
- },] }
24896
- ];
24897
- ProgramsService.ctorParameters = function () { return [
24898
- { type: i1.HttpClient },
24899
- { type: AuthService },
24900
- { type: Configurations, decorators: [{ type: i0.Optional }] }
24901
- ]; };
24902
-
24903
24965
  var CONSTANTS = {
24904
24966
  categoryType: [
24905
24967
  { label: 'REGULATIONS', value: 1 },
@@ -28650,75 +28712,75 @@
28650
28712
  exports.WorkflowEngineService = WorkflowEngineService;
28651
28713
  exports.ɵa = UiKitService;
28652
28714
  exports.ɵb = SnackBarService;
28653
- exports.ɵba = ReviewFrequencyComponent;
28654
- exports.ɵbb = FrequencyContainerComponent;
28655
- exports.ɵbc = FrequencyDailyComponent;
28656
- exports.ɵbd = FrequencyWeeklyComponent;
28657
- exports.ɵbe = FrequencyMonthlyComponent;
28658
- exports.ɵbf = FrequencyQuarterlyComponent;
28659
- exports.ɵbg = FrequencyBiannualComponent;
28660
- exports.ɵbh = FrequencyAnnualComponent;
28661
- exports.ɵbi = FrequencyOneTimeComponent;
28662
- exports.ɵbj = FrequencyRandomComponent;
28663
- exports.ɵbk = FrequencyOnCompletionOfComponent;
28664
- exports.ɵbl = FrequencyOngoingComponent;
28665
- exports.ɵbm = FrequencyTopComponent;
28666
- exports.ɵbn = FrequencyLifecycleComponent;
28667
- exports.ɵbo = FrequencyDueDateComponent;
28668
- exports.ɵbp = FrequencyCheckboxListComponent;
28669
- exports.ɵbq = FrequencyRadioListComponent;
28670
- exports.ɵbr = GroupUsersListComponent;
28671
- exports.ɵbs = AddMultipleResponsibilityComponent;
28672
- exports.ɵbt = FrequencyBulkService;
28673
- exports.ɵbu = BulkResponsibilityViewComponent;
28674
- exports.ɵbv = CheckpointsPolicyContainerComponent;
28675
- exports.ɵbw = CheckpointsPolicyListComponent;
28676
- exports.ɵbx = CheckpointsPolicyQuestionsComponent;
28677
- exports.ɵby = WorkflowSurveyFormComponent;
28678
- exports.ɵbz = LogAnIssueComponent;
28715
+ exports.ɵba = CheckpointsListComponent;
28716
+ exports.ɵbb = ReviewFrequencyComponent;
28717
+ exports.ɵbc = FrequencyContainerComponent;
28718
+ exports.ɵbd = FrequencyDailyComponent;
28719
+ exports.ɵbe = FrequencyWeeklyComponent;
28720
+ exports.ɵbf = FrequencyMonthlyComponent;
28721
+ exports.ɵbg = FrequencyQuarterlyComponent;
28722
+ exports.ɵbh = FrequencyBiannualComponent;
28723
+ exports.ɵbi = FrequencyAnnualComponent;
28724
+ exports.ɵbj = FrequencyOneTimeComponent;
28725
+ exports.ɵbk = FrequencyRandomComponent;
28726
+ exports.ɵbl = FrequencyOnCompletionOfComponent;
28727
+ exports.ɵbm = FrequencyOngoingComponent;
28728
+ exports.ɵbn = FrequencyTopComponent;
28729
+ exports.ɵbo = FrequencyLifecycleComponent;
28730
+ exports.ɵbp = FrequencyDueDateComponent;
28731
+ exports.ɵbq = FrequencyCheckboxListComponent;
28732
+ exports.ɵbr = FrequencyRadioListComponent;
28733
+ exports.ɵbs = GroupUsersListComponent;
28734
+ exports.ɵbt = AddMultipleResponsibilityComponent;
28735
+ exports.ɵbu = FrequencyBulkService;
28736
+ exports.ɵbv = BulkResponsibilityViewComponent;
28737
+ exports.ɵbw = CheckpointsPolicyContainerComponent;
28738
+ exports.ɵbx = CheckpointsPolicyListComponent;
28739
+ exports.ɵby = CheckpointsPolicyQuestionsComponent;
28740
+ exports.ɵbz = WorkflowSurveyFormComponent;
28679
28741
  exports.ɵc = AuthService;
28680
- exports.ɵca = LogIssueService;
28681
- exports.ɵcb = FilterPipe;
28682
- exports.ɵcc = CheckboxListComponent;
28683
- exports.ɵcd = RadioListComponent;
28684
- exports.ɵce = ListMapperPipe;
28685
- exports.ɵcf = CreateDocumentsComponent;
28686
- exports.ɵcg = SearchPipe$1;
28687
- exports.ɵch = UserFilterPipe;
28688
- exports.ɵci = FrameworkListComponent;
28689
- exports.ɵcj = ParentTableComponent;
28690
- exports.ɵck = DataTypePipe;
28691
- exports.ɵcl = CheckpointFloatingBarComponent;
28692
- exports.ɵcm = FormatAndEvidenceComponent;
28693
- exports.ɵcn = RiskClassificationComponent;
28694
- exports.ɵco = DragDropDirective;
28695
- exports.ɵcp = AutofocusDirective;
28696
- exports.ɵcq = ScrollInViewDirective;
28697
- exports.ɵcr = spaceTrimDirective;
28698
- exports.ɵcs = ShortMergePipe;
28699
- exports.ɵct = SpaceBreakerPipe;
28700
- exports.ɵcu = FormatHtmlPipe;
28701
- exports.ɵcv = WithinDataPipe;
28702
- exports.ɵcw = ResponsibilityRiskSelectorComponent;
28703
- exports.ɵcx = ConditionalFocusDirective;
28704
- exports.ɵcy = ListLoaderComponent;
28705
- exports.ɵcz = ArrayFilterPipe;
28742
+ exports.ɵca = LogAnIssueComponent;
28743
+ exports.ɵcb = LogIssueService;
28744
+ exports.ɵcc = FilterPipe;
28745
+ exports.ɵcd = CheckboxListComponent;
28746
+ exports.ɵce = RadioListComponent;
28747
+ exports.ɵcf = ListMapperPipe;
28748
+ exports.ɵcg = CreateDocumentsComponent;
28749
+ exports.ɵch = SearchPipe$1;
28750
+ exports.ɵci = UserFilterPipe;
28751
+ exports.ɵcj = FrameworkListComponent;
28752
+ exports.ɵck = ParentTableComponent;
28753
+ exports.ɵcl = DataTypePipe;
28754
+ exports.ɵcm = CheckpointFloatingBarComponent;
28755
+ exports.ɵcn = FormatAndEvidenceComponent;
28756
+ exports.ɵco = RiskClassificationComponent;
28757
+ exports.ɵcp = DragDropDirective;
28758
+ exports.ɵcq = AutofocusDirective;
28759
+ exports.ɵcr = ScrollInViewDirective;
28760
+ exports.ɵcs = spaceTrimDirective;
28761
+ exports.ɵct = ShortMergePipe;
28762
+ exports.ɵcu = SpaceBreakerPipe;
28763
+ exports.ɵcv = FormatHtmlPipe;
28764
+ exports.ɵcw = WithinDataPipe;
28765
+ exports.ɵcx = ResponsibilityRiskSelectorComponent;
28766
+ exports.ɵcy = ConditionalFocusDirective;
28767
+ exports.ɵcz = ListLoaderComponent;
28706
28768
  exports.ɵd = TokenDecoderService;
28707
- exports.ɵda = AuditCategoryListComponent;
28708
- exports.ɵdb = DocumentSectionComponent;
28709
- exports.ɵdc = WorkflowAssessmentComponent;
28710
- exports.ɵdd = AssessmentService$2;
28711
- exports.ɵde = ImportAnAssessmentComponent;
28712
- exports.ɵdf = AssessmentListComponent;
28713
- exports.ɵdg = AssessmentService$1;
28714
- exports.ɵdh = RadioListWithPaginationComponent;
28715
- exports.ɵdi = LinkTreatmentLoaderComponent;
28716
- exports.ɵdj = AssessmentListLoaderComponent;
28717
- exports.ɵdk = AssessmentListSubLoaderComponent;
28718
- exports.ɵdl = UncategorizedFilterPipe;
28719
- exports.ɵdm = ProgramListingComponent;
28720
- exports.ɵdn = WorkflowProgramComponent;
28721
- exports.ɵdo = ProgramsService;
28769
+ exports.ɵda = ArrayFilterPipe;
28770
+ exports.ɵdb = AuditCategoryListComponent;
28771
+ exports.ɵdc = DocumentSectionComponent;
28772
+ exports.ɵdd = WorkflowAssessmentComponent;
28773
+ exports.ɵde = AssessmentService$2;
28774
+ exports.ɵdf = ImportAnAssessmentComponent;
28775
+ exports.ɵdg = AssessmentListComponent;
28776
+ exports.ɵdh = AssessmentService$1;
28777
+ exports.ɵdi = RadioListWithPaginationComponent;
28778
+ exports.ɵdj = LinkTreatmentLoaderComponent;
28779
+ exports.ɵdk = AssessmentListLoaderComponent;
28780
+ exports.ɵdl = AssessmentListSubLoaderComponent;
28781
+ exports.ɵdm = UncategorizedFilterPipe;
28782
+ exports.ɵdn = ProgramListingComponent;
28783
+ exports.ɵdo = WorkflowProgramComponent;
28722
28784
  exports.ɵdp = RolesListComponent;
28723
28785
  exports.ɵdq = FrameworkListTableComponent;
28724
28786
  exports.ɵdr = FrameworkResponsibilityTableComponent;
@@ -28892,7 +28954,7 @@
28892
28954
  exports.ɵjx = InputTrimDirective;
28893
28955
  exports.ɵjy = RoleListComponent;
28894
28956
  exports.ɵjz = CheckboxComponent;
28895
- exports.ɵk = WorkflowPolicyComponent;
28957
+ exports.ɵk = ProgramsService;
28896
28958
  exports.ɵka = VuiFloatingBarComponent;
28897
28959
  exports.ɵkb = SearchPipe;
28898
28960
  exports.ɵkc = UserGroupListComponent;
@@ -28918,21 +28980,21 @@
28918
28980
  exports.ɵkw = PaginationComponent;
28919
28981
  exports.ɵkx = NoDataModule;
28920
28982
  exports.ɵky = NoDataComponent;
28921
- exports.ɵl = PolicyService;
28922
- exports.ɵm = MoreOptionComponent;
28923
- exports.ɵn = OwnerListComponent;
28924
- exports.ɵo = UserRadioListComponent;
28925
- exports.ɵp = CategoryListComponent;
28926
- exports.ɵq = CategoryMultiSelectComponent;
28927
- exports.ɵr = FloatingBarComponent;
28928
- exports.ɵs = ResponsibilityCentersListComponent;
28929
- exports.ɵt = WorkflowPaginationComponent;
28930
- exports.ɵu = AddMultipleRiskComponent;
28931
- exports.ɵv = BulkViewComponent;
28932
- exports.ɵw = CheckpointsComponent;
28933
- exports.ɵx = ConfirmationAlertComponent;
28934
- exports.ɵy = CheckpointsQuestionsComponent;
28935
- exports.ɵz = CheckpointsListComponent;
28983
+ exports.ɵl = WorkflowPolicyComponent;
28984
+ exports.ɵm = PolicyService;
28985
+ exports.ɵn = MoreOptionComponent;
28986
+ exports.ɵo = OwnerListComponent;
28987
+ exports.ɵp = UserRadioListComponent;
28988
+ exports.ɵq = CategoryListComponent;
28989
+ exports.ɵr = CategoryMultiSelectComponent;
28990
+ exports.ɵs = FloatingBarComponent;
28991
+ exports.ɵt = ResponsibilityCentersListComponent;
28992
+ exports.ɵu = WorkflowPaginationComponent;
28993
+ exports.ɵv = AddMultipleRiskComponent;
28994
+ exports.ɵw = BulkViewComponent;
28995
+ exports.ɵx = CheckpointsComponent;
28996
+ exports.ɵy = ConfirmationAlertComponent;
28997
+ exports.ɵz = CheckpointsQuestionsComponent;
28936
28998
 
28937
28999
  Object.defineProperty(exports, '__esModule', { value: true });
28938
29000