vcomply-workflow-engine 7.3.5 → 7.3.7

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.
@@ -12366,26 +12366,24 @@ class FrequencyService {
12366
12366
  const time_arr = value.split(' ');
12367
12367
  const meridian = time_arr[1];
12368
12368
  const hr_min = time_arr[0].split(':').map(Number);
12369
- const hr = hr_min[0];
12370
- const min = hr_min[1] ? hr_min[1] : '00';
12371
- let return_time = '';
12369
+ let hr = hr_min[0];
12370
+ const min = hr_min[1] ?? 0;
12371
+ const sec = hr_min[2] ?? 0;
12372
12372
  if (meridian?.toLowerCase() == 'pm') {
12373
- if (hr == 12) {
12374
- return_time = 12 + ':' + min + ':00';
12375
- }
12376
- else if (hr < 12) {
12377
- return_time = +hr + 12 + ':' + min + ':00';
12373
+ if (hr < 12) {
12374
+ hr = hr + 12;
12378
12375
  }
12379
12376
  }
12380
12377
  else {
12381
12378
  if (hr == 12) {
12382
- return_time = '00:' + min + ':00';
12383
- }
12384
- else if (hr < 12) {
12385
- return_time = hr + ':' + min + ':00';
12379
+ hr = 0;
12386
12380
  }
12387
12381
  }
12388
- return return_time;
12382
+ return (String(hr).padStart(2, '0') +
12383
+ ':' +
12384
+ String(min).padStart(2, '0') +
12385
+ ':' +
12386
+ String(sec).padStart(2, '0'));
12389
12387
  }
12390
12388
  else {
12391
12389
  return '';
@@ -34023,12 +34021,12 @@ class WorkflowComplianceComponent {
34023
34021
  cost_of_compliance: '',
34024
34022
  created_by: entrustForm.assignors.list?.length < 1 ? 0 : this.memberId,
34025
34023
  creation_window: 0,
34026
- custom_tags: entrustForm.customFields.map((ele) => {
34024
+ custom_tags: entrustForm?.customFields?.length > 0 ? entrustForm?.customFields?.map((ele) => {
34027
34025
  return {
34028
34026
  id: ele.id,
34029
34027
  value: ele.value,
34030
34028
  };
34031
- }),
34029
+ }) : [],
34032
34030
  entity_tree: moreOptions?.RC
34033
34031
  ? this.isResponsibilityRcLinkEnabled &&
34034
34032
  this.responsibilityCenterType == 1
@@ -34047,17 +34045,17 @@ class WorkflowComplianceComponent {
34047
34045
  grc_relationship: '',
34048
34046
  if_testplan_failed: 0,
34049
34047
  impact: '',
34050
- isGroupAssignTo: entrustForm.assignees.whoCanComplete == 'ANY_ONE' ? 1 : 0,
34051
- is_key_compliance: entrustForm.responsibility.keyResponsibility ? 1 : 0,
34048
+ isGroupAssignTo: entrustForm?.assignees?.whoCanComplete == 'ANY_ONE' ? 1 : 0,
34049
+ is_key_compliance: entrustForm.responsibility?.keyResponsibility ? 1 : 0,
34052
34050
  allowEditDueDate: entrustForm?.allowEditDueDate ? true : false,
34053
34051
  library_report_id: 0,
34054
34052
  lifecycle_details: entrustForm.lifecycleDetails ?? '0000-00-00~~0',
34055
34053
  link_for_details: moreOptions?.FORMATE_EVIDENCE
34056
- ? entrustForm.formatAndEvidence.formatLinks
34054
+ ? entrustForm.formatAndEvidence?.formatLinks
34057
34055
  : [],
34058
34056
  linkages: { compliance: [] },
34059
- member_id: this.returnIds(entrustForm.assignors.list, 'uid')?.length > 0
34060
- ? this.returnIds(entrustForm.assignors.list, 'uid')[0]
34057
+ member_id: this.returnIds(entrustForm.assignors?.list, 'uid')?.length > 0
34058
+ ? this.returnIds(entrustForm.assignors?.list, 'uid')[0]
34061
34059
  : this.memberId,
34062
34060
  objective: moreOptions?.OBJECTIVE ? objective : '',
34063
34061
  on_completion_of: entrustForm.reportId ? [entrustForm.reportId] : [],
@@ -34073,38 +34071,38 @@ class WorkflowComplianceComponent {
34073
34071
  ? entrustForm.formatAndEvidence.formatFiles
34074
34072
  : [],
34075
34073
  isFormatUpload: moreOptions?.FORMATE_EVIDENCE &&
34076
- entrustForm.formatAndEvidence.formatRequired
34074
+ entrustForm.formatAndEvidence?.formatRequired
34077
34075
  ? 1
34078
34076
  : 0,
34079
34077
  report_format_link: '',
34080
- report_name: entrustForm.responsibility.name,
34081
- report_upload_flag: entrustForm.formatAndEvidence.evidenceRequired
34078
+ report_name: entrustForm.responsibility?.name,
34079
+ report_upload_flag: entrustForm.formatAndEvidence?.evidenceRequired
34082
34080
  ? 1
34083
34081
  : 0,
34084
34082
  review_after_days: moreOptions?.REVIEWER
34085
- ? entrustForm.reviewers.reviewFrequency.reviewCompleteDays === ''
34083
+ ? entrustForm.reviewers.reviewFrequency?.reviewCompleteDays === ''
34086
34084
  ? 0
34087
- : Number(entrustForm.reviewers.reviewFrequency.reviewCompleteDays)
34085
+ : Number(entrustForm.reviewers.reviewFrequency?.reviewCompleteDays)
34088
34086
  : 0,
34089
34087
  review_failed_after_days: moreOptions?.REVIEWER
34090
- ? entrustForm.reviewers.reviewFrequency.reviewNOtCompletedDays === ''
34088
+ ? entrustForm.reviewers.reviewFrequency?.reviewNOtCompletedDays === ''
34091
34089
  ? 0
34092
- : Number(entrustForm.reviewers.reviewFrequency.reviewNOtCompletedDays)
34090
+ : Number(entrustForm.reviewers.reviewFrequency?.reviewNOtCompletedDays)
34093
34091
  : 0,
34094
34092
  reviewer_arr: moreOptions?.REVIEWER
34095
34093
  ? {
34096
34094
  level1: {
34097
- reviewers: this.setReviewerPayload(this.reviewerUserList, 'list', entrustForm.reviewers.acceptedData, entrustForm.reviewers.sequentialWorkflow
34095
+ reviewers: this.setReviewerPayload(this.reviewerUserList, 'list', entrustForm.reviewers.acceptedData, entrustForm.reviewers?.sequentialWorkflow
34098
34096
  ? 'SEQUENTIAL'
34099
34097
  : 'ANYONE'),
34100
- type: entrustForm.reviewers.sequentialWorkflow
34098
+ type: entrustForm.reviewers?.sequentialWorkflow
34101
34099
  ? 'SEQUENTIAL'
34102
34100
  : 'ANYONE',
34103
34101
  },
34104
34102
  }
34105
34103
  : {},
34106
34104
  userGroupIds: {
34107
- assigneeAllGroupIds: entrustForm.assignees.whoCanComplete !== 'ANY_ONE'
34105
+ assigneeAllGroupIds: entrustForm.assignees?.whoCanComplete !== 'ANY_ONE'
34108
34106
  ? this.returnIds(entrustForm?.assigneeGroups?.list, 'ugid')
34109
34107
  : [],
34110
34108
  assigneeAnyoneGroupIds: entrustForm.assignees.whoCanComplete === 'ANY_ONE'