sf-i-events 1.0.937 → 1.0.939

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/sf-i-events.js CHANGED
@@ -1257,6 +1257,7 @@ let SfIEvents = class SfIEvents extends LitElement {
1257
1257
  this.graphFilter = "";
1258
1258
  this.recentlyReported = {};
1259
1259
  this.registerFilters = {};
1260
+ this.suspenseFlag = false;
1260
1261
  this.tablecols = [];
1261
1262
  this.isSelectedLegend = (value) => {
1262
1263
  return this.chartSelectedLegend.includes(value);
@@ -2404,7 +2405,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2404
2405
  html += '<div part="badge-dashboard" id="chip-completeness-1" class="chip stat-completeness d-flex justify-center align-center mr-10 mb-10 no-shrink"><span class="material-symbols-outlined color-pending">pending</span>&nbsp;&nbsp;<span>Pending Approval:</span>&nbsp;<span id="graph-pending-approval">DASHBOARD_PENDING_APPROVAL</span></div>';
2405
2406
  html += '<div part="badge-dashboard" id="chip-completeness-2" class="chip stat-completeness d-flex justify-center align-center mr-10 mb-10 no-shrink"><span class="material-symbols-outlined color-rejected">block</span>&nbsp;&nbsp;<span>Rejected:</span>&nbsp;<span id="graph-rejected">DASHBOARD_REJECTED</span></div>';
2406
2407
  html += '<div part="badge-dashboard" id="chip-completeness-3" class="chip stat-completeness d-flex justify-center align-center mr-10 mb-10 no-shrink"><span class="material-symbols-outlined color-done">check_circle</span>&nbsp;&nbsp;<span>Approved:</span>&nbsp;<span id="graph-approved">DASHBOARD_APPROVED</span></div>';
2407
- html += '<div part="badge-dashboard" class="mr-10 mb-10 d-flex align-center no-shrink DASHBOARD_SUSPENSE_CLASS"><span class="material-symbols-outlined color-not-started">question_mark</span>&nbsp;&nbsp;<span>Suspense:</span>&nbsp;<span id="graph-total">DASHBOARD_SUSPENSE</span></div>';
2408
+ html += `<div part="${this.suspenseFlag ? "badge-dashboard-selected" : "badge-dashboard-not-selected"}" id="chip-suspense" class="mr-10 mb-10 d-flex align-center no-shrink DASHBOARD_SUSPENSE_CLASS"><span class="material-symbols-outlined color-not-started">question_mark</span>&nbsp;&nbsp;<span>Suspense:</span>&nbsp;<span id="graph-total">DASHBOARD_SUSPENSE</span></div>`;
2408
2409
  html += '<div part="badge-dashboard" id="chip-timeliness-0" class="chip stat-timeliness justify-center align-center mr-10 mb-10 no-shrink late-statuses"><span class="material-icons color-in-time">schedule</span>&nbsp;&nbsp;<span>In Time:</span>&nbsp;<span id="graph-in-time">DASHBOARD_IN_TIME</span></div>';
2409
2410
  html += '<div part="badge-dashboard" id="chip-timeliness-1" class="chip stat-timeliness justify-center align-center mr-10 mb-10 no-shrink late-statuses"><span class="material-icons color-past-due-date">timer</span>&nbsp;&nbsp;<span>Past Due Date:</span>&nbsp;<span id="graph-past-due-date">DASHBOARD_PAST_DUE_DATE</span></div>';
2410
2411
  html += '<div part="badge-dashboard" id="chip-timeliness-2" class="chip stat-timeliness justify-center align-center mr-10 mb-10 no-shrink late-statuses"><span class="material-icons color-late-reported">report_off</span>&nbsp;&nbsp;<span>Late Reported:</span>&nbsp;<span id="graph-late-reported">DASHBOARD_LATE_REPORTED</span></div>';
@@ -2570,10 +2571,13 @@ let SfIEvents = class SfIEvents extends LitElement {
2570
2571
  const mmddSanitized = mmdd.replace(/\//g, '-');
2571
2572
  const dueDateParts = event.duedate.split('/');
2572
2573
  const isReportedLocation = event.reportedlocationsflag == true;
2574
+ const isSuspense = event.suspense == true;
2575
+ const isReviewed = event.review == true;
2573
2576
  const showCheckbox = !(hasReportFormat || isBulk || hasCustomReporting || isReportedLocation);
2574
2577
  // const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
2575
2578
  const showReportingButton = !hasReportFormat && !hasCustomReporting && event.concise != null && !isReportedLocation;
2576
2579
  const showLocationRisk = event.concise != null;
2580
+ const showReview = event.concise != null;
2577
2581
  const showLastUpdated = event.concise == null && lastUpdated.length > 0;
2578
2582
  // console.log('showReportingButton', showReportingButton)
2579
2583
  console.log('isReportedLocation', isReportedLocation, 'showCheckbox', showCheckbox, 'showReportingButton', showReportingButton, 'showLocationRisk', showLocationRisk, 'showLastUpdated', showLastUpdated);
@@ -2585,7 +2589,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2585
2589
  type="checkbox"
2586
2590
  />
2587
2591
  ${isBulk ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : ''}
2588
- ${isReportedLocation ? '<div class="material-symbols-outlined mr-10">arrow_or_edge</div>' : ''}
2592
+ ${(isReportedLocation && !isSuspense) ? '<div class="material-symbols-outlined mr-10">arrow_or_edge</div>' : ''}
2589
2593
  <sf-i-elastic-text exportparts="highlight,highlight-count"
2590
2594
  class="stream-event-title${!isBulk ? ' button-event-title' : ''}"
2591
2595
  id="stream-event-title-${mmddSanitized}-${itemNumber}-${moduleType}-${(isReportedLocation) ? 'reportedlocations' : ''}"
@@ -2608,6 +2612,16 @@ let SfIEvents = class SfIEvents extends LitElement {
2608
2612
  edit_note
2609
2613
  </button>
2610
2614
  ` : ''}
2615
+ ${showReview ? `
2616
+ <input
2617
+ type="checkbox"
2618
+ id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
2619
+ part="input-checkbox"
2620
+ class="material-icons ml-10 input-checkbox-review"
2621
+ ${isReviewed ? 'checked' : ''}
2622
+ />
2623
+ <label for="input-checkbox-review-${mmddSanitized}-${itemNumber}" part="label-checkbox" class="label-checkbox">${isReviewed ? 'Reviewed' : 'Review'}</label>
2624
+ ` : ''}
2611
2625
  ${showLastUpdated ? `
2612
2626
  &nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">
2613
2627
  ${lastUpdated}
@@ -2900,7 +2914,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2900
2914
  let approverStr = event.concise == null ? this.getApproverStringFromEvent(event) : "";
2901
2915
  let graphParam = this.getGraphParam(event);
2902
2916
  // console.log("graphParam", graphParam.split(';')[0]);
2903
- html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + '</div>';
2917
+ html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null) ? ('<input type="checkbox" id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="input-checkbox" class="material-icons mb-20 ml-10 input-checkbox-review"' + (event.review ? 'checked' : '') + '/><label for="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="label-checkbox" class="label-checkbox mb-20">' + (event.review ? 'Reviewed' : 'Review') + '</label></div>') : '</div>');
2904
2918
  // }
2905
2919
  return html;
2906
2920
  };
@@ -3873,7 +3887,7 @@ let SfIEvents = class SfIEvents extends LitElement {
3873
3887
  dateOfCompletion = "";
3874
3888
  }
3875
3889
  console.log('dateOfCompletion', dateOfCompletion);
3876
- await this.fetchEventDetails(event, mmddyyyy, null, eventsContainer, true, listReportingContainer, reportercomments, approvercomments, inputReportingPercentage, selectReportedLocation, documents, dateOfCompletion);
3890
+ await this.fetchEventDetails(event, mmddyyyy, null, eventsContainer, "", "", true, listReportingContainer, reportercomments, approvercomments, inputReportingPercentage, selectReportedLocation, documents, dateOfCompletion);
3877
3891
  });
3878
3892
  if (this.mode == "consumer" || this.mode == "next") {
3879
3893
  let inputReportingPercentage = listReportingContainer.querySelector('#input-reporter-percentage');
@@ -4630,6 +4644,24 @@ let SfIEvents = class SfIEvents extends LitElement {
4630
4644
  });
4631
4645
  }
4632
4646
  };
4647
+ this.attachReviewListeners = (eventsContainer) => {
4648
+ let inputReviews = eventsContainer.querySelectorAll('.input-checkbox-review');
4649
+ for (let inputReview of inputReviews) {
4650
+ inputReview === null || inputReview === void 0 ? void 0 : inputReview.addEventListener('click', async (ev) => {
4651
+ const id = ev.target.id;
4652
+ const idArr = id.split("-");
4653
+ const mmdd = idArr[3] + "/" + idArr[4];
4654
+ const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
4655
+ // const i = idArr[5];
4656
+ const j = idArr[5];
4657
+ console.log('review clicked', mmdd, yyyy, j, this.events[mmdd][j], ev.target.checked);
4658
+ let eventKey = this.events[mmdd][j].entityid + ';' + this.events[mmdd][j].locationid + ';' + this.events[mmdd][j].id;
4659
+ await this.markReviewed(eventKey, yyyy, ev.target.checked);
4660
+ const buttonRefresh = eventsContainer.querySelector('#button-refresh');
4661
+ buttonRefresh.click();
4662
+ });
4663
+ }
4664
+ };
4633
4665
  this.renderStreamEvents = (index, month, year, showGraph = true, showBackgroundButton = false) => {
4634
4666
  //console.log('flowgraph renderStreamEvents', this.flowGraph);
4635
4667
  const lastDay = this.getLastDayOfMonth(month, year);
@@ -4779,9 +4811,16 @@ let SfIEvents = class SfIEvents extends LitElement {
4779
4811
  buttonRefresh.addEventListener('click', async () => {
4780
4812
  this.processDateSelection(eventsContainer);
4781
4813
  });
4814
+ const chipSuspense = eventsContainer.querySelector('#chip-suspense');
4815
+ chipSuspense === null || chipSuspense === void 0 ? void 0 : chipSuspense.addEventListener('click', async () => {
4816
+ this.suspenseFlag = !this.suspenseFlag;
4817
+ this.processDateSelection(eventsContainer);
4818
+ });
4782
4819
  this.attachListReportingListeners(eventsContainer);
4820
+ this.attachReviewListeners(eventsContainer);
4783
4821
  const buttonArr = eventsContainer.querySelectorAll('.button-expand');
4784
4822
  for (var i = 0; i < buttonArr.length; i++) {
4823
+ let indexPrevNext = i;
4785
4824
  buttonArr[i].addEventListener('click', (ev) => {
4786
4825
  const id = ev.target.id;
4787
4826
  const idArr = id.split("-");
@@ -4815,13 +4854,51 @@ let SfIEvents = class SfIEvents extends LitElement {
4815
4854
  }
4816
4855
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
4817
4856
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
4818
- this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, eventsContainer);
4857
+ let prevString = "";
4858
+ let flagPrev = true;
4859
+ let indexPrev = indexPrevNext;
4860
+ while (flagPrev) {
4861
+ if (indexPrev > 0) {
4862
+ if (Util.isVisible(buttonArr[indexPrev - 1])) {
4863
+ prevString = buttonArr[indexPrev - 1].id;
4864
+ flagPrev = false;
4865
+ }
4866
+ else {
4867
+ prevString = "";
4868
+ indexPrev--;
4869
+ }
4870
+ }
4871
+ else {
4872
+ flagPrev = false;
4873
+ }
4874
+ }
4875
+ let nextString = "";
4876
+ let flagNext = true;
4877
+ let indexNext = indexPrevNext;
4878
+ while (flagNext) {
4879
+ if (indexNext < buttonArr.length - 1) {
4880
+ if (Util.isVisible(buttonArr[indexNext + 1])) {
4881
+ nextString = buttonArr[indexNext + 1].id;
4882
+ flagNext = false;
4883
+ }
4884
+ else {
4885
+ nextString = "";
4886
+ indexNext++;
4887
+ }
4888
+ }
4889
+ else {
4890
+ flagNext = false;
4891
+ }
4892
+ }
4893
+ this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, eventsContainer, prevString, nextString);
4819
4894
  }
4820
4895
  });
4821
4896
  }
4822
4897
  const titleArr = eventsContainer.querySelectorAll('.button-event-title');
4823
4898
  for (var i = 0; i < titleArr.length; i++) {
4899
+ let indexPrevNext = i;
4824
4900
  titleArr[i].addEventListener('click', (ev) => {
4901
+ var _a, _b;
4825
4902
  const id = ev.target.id;
4826
4903
  const idArr = id.split("-");
4827
4904
  const mmdd = idArr[3] + "/" + idArr[4];
@@ -4857,6 +4934,55 @@ let SfIEvents = class SfIEvents extends LitElement {
4857
4934
  this.clearButtonSelection();
4858
4935
  }
4859
4936
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
4937
+ let prevString = "";
4938
+ let flagPrev = true;
4939
+ let indexPrev = indexPrevNext;
4940
+ while (flagPrev) {
4941
+ if (indexPrev > 0) {
4942
+ if (Util.isVisible(titleArr[indexPrev - 1])) {
4943
+ prevString = titleArr[indexPrev - 1].id;
4944
+ let prevIdArr = prevString.split("-");
4945
+ if (((_a = prevIdArr[7]) !== null && _a !== void 0 ? _a : "") == "reportedlocations") {
4946
+ prevString = "";
4947
+ indexPrev--;
4948
+ }
4949
+ else {
4950
+ flagPrev = false;
4951
+ }
4952
+ }
4953
+ else {
4954
+ prevString = "";
4955
+ indexPrev--;
4956
+ }
4957
+ }
4958
+ else {
4959
+ flagPrev = false;
4960
+ }
4961
+ }
4962
+ let nextString = "";
4963
+ let flagNext = true;
4964
+ let indexNext = indexPrevNext;
4965
+ while (flagNext) {
4966
+ if (indexNext < titleArr.length - 1) {
4967
+ if (Util.isVisible(titleArr[indexNext + 1])) {
4968
+ nextString = titleArr[indexNext + 1].id;
4969
+ let nextIdArr = nextString.split("-");
4970
+ if (((_b = nextIdArr[7]) !== null && _b !== void 0 ? _b : "") == "reportedlocations") {
4971
+ nextString = "";
4972
+ indexNext++;
4973
+ }
4974
+ else {
4975
+ flagNext = false;
4976
+ }
4977
+ }
4978
+ else {
4979
+ indexNext++;
4980
+ }
4981
+ }
4982
+ else {
4983
+ flagNext = false;
4984
+ }
4985
+ }
4860
4986
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
4861
4987
  this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, eventsContainer);
4862
4988
  }
@@ -8652,9 +8778,21 @@ let SfIEvents = class SfIEvents extends LitElement {
8652
8778
  await this.renderWithFeatures(dateResult.startDate, dateResult.endDate);
8653
8779
  this.renderThis(index, showGraph, showBackgroundButton);
8654
8780
  });
8781
+ const chipSuspense = this._SfThisContainer.querySelector('#chip-suspense');
8782
+ chipSuspense === null || chipSuspense === void 0 ? void 0 : chipSuspense.addEventListener('click', async () => {
8783
+ this.suspenseFlag = !this.suspenseFlag;
8784
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
8785
+ this.currentColumnIndex = index + "";
8786
+ const dateResult = this.calculateStartAndEndDateOfThis(index);
8787
+ // await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
8788
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate);
8789
+ this.renderThis(index, showGraph, showBackgroundButton);
8790
+ });
8655
8791
  this.attachListReportingListeners(this._SfThisContainer);
8792
+ this.attachReviewListeners(this._SfThisContainer);
8656
8793
  const buttonArr = this._SfThisContainer.querySelectorAll('.button-expand');
8657
8794
  for (i = 0; i < buttonArr.length; i++) {
8795
+ let indexPrevNext = i;
8658
8796
  buttonArr[i].addEventListener('click', (ev) => {
8659
8797
  const id = ev.target.id;
8660
8798
  const idArr = id.split("-");
@@ -8686,14 +8824,52 @@ let SfIEvents = class SfIEvents extends LitElement {
8686
8824
  this.clearButtonSelection();
8687
8825
  }
8688
8826
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
8827
+ let prevString = "";
8828
+ let flagPrev = true;
8829
+ let indexPrev = indexPrevNext;
8830
+ while (flagPrev) {
8831
+ if (indexPrev > 0) {
8832
+ if (Util.isVisible(buttonArr[indexPrev - 1])) {
8833
+ prevString = buttonArr[indexPrev - 1].id;
8834
+ flagPrev = false;
8835
+ }
8836
+ else {
8837
+ prevString = "";
8838
+ indexPrev--;
8839
+ }
8840
+ }
8841
+ else {
8842
+ flagPrev = false;
8843
+ }
8844
+ }
8845
+ let nextString = "";
8846
+ let flagNext = true;
8847
+ let indexNext = indexPrevNext;
8848
+ while (flagNext) {
8849
+ if (indexNext < buttonArr.length - 1) {
8850
+ if (Util.isVisible(buttonArr[indexNext + 1])) {
8851
+ nextString = buttonArr[indexNext + 1].id;
8852
+ flagNext = false;
8853
+ }
8854
+ else {
8855
+ nextString = "";
8856
+ indexNext++;
8857
+ }
8858
+ }
8859
+ else {
8860
+ flagNext = false;
8861
+ }
8862
+ }
8689
8863
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfThisContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
8690
- this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, this._SfThisContainer.querySelector('#stream-month-' + this.currentColumnIndex), this._SfThisContainer);
8864
+ this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, this._SfThisContainer.querySelector('#stream-month-' + this.currentColumnIndex), this._SfThisContainer, prevString, nextString);
8691
8865
  }
8692
8866
  });
8693
8867
  }
8694
8868
  const titleArr = this._SfThisContainer.querySelectorAll('.button-event-title');
8695
8869
  for (var i = 0; i < titleArr.length; i++) {
8870
+ let indexPrevNext = i;
8696
8871
  titleArr[i].addEventListener('click', (ev) => {
8872
+ var _a, _b;
8697
8873
  const id = ev.target.id;
8698
8874
  const idArr = id.split("-");
8699
8875
  const mmdd = idArr[3] + "/" + idArr[4];
@@ -8729,8 +8905,57 @@ let SfIEvents = class SfIEvents extends LitElement {
8729
8905
  this.clearButtonSelection();
8730
8906
  }
8731
8907
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
8908
+ let prevString = "";
8909
+ let flagPrev = true;
8910
+ let indexPrev = indexPrevNext;
8911
+ while (flagPrev) {
8912
+ if (indexPrev > 0) {
8913
+ if (Util.isVisible(titleArr[indexPrev - 1])) {
8914
+ prevString = titleArr[indexPrev - 1].id;
8915
+ let prevIdArr = prevString.split("-");
8916
+ if (((_a = prevIdArr[7]) !== null && _a !== void 0 ? _a : "") == "reportedlocations") {
8917
+ prevString = "";
8918
+ indexPrev--;
8919
+ }
8920
+ else {
8921
+ flagPrev = false;
8922
+ }
8923
+ }
8924
+ else {
8925
+ prevString = "";
8926
+ indexPrev--;
8927
+ }
8928
+ }
8929
+ else {
8930
+ flagPrev = false;
8931
+ }
8932
+ }
8933
+ let nextString = "";
8934
+ let flagNext = true;
8935
+ let indexNext = indexPrevNext;
8936
+ while (flagNext) {
8937
+ if (indexNext < titleArr.length - 1) {
8938
+ if (Util.isVisible(titleArr[indexNext + 1])) {
8939
+ nextString = titleArr[indexNext + 1].id;
8940
+ let nextIdArr = nextString.split("-");
8941
+ if (((_b = nextIdArr[7]) !== null && _b !== void 0 ? _b : "") == "reportedlocations") {
8942
+ nextString = "";
8943
+ indexNext++;
8944
+ }
8945
+ else {
8946
+ flagNext = false;
8947
+ }
8948
+ }
8949
+ else {
8950
+ indexNext++;
8951
+ }
8952
+ }
8953
+ else {
8954
+ flagNext = false;
8955
+ }
8956
+ }
8732
8957
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
8733
- this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, this._SfThisContainer);
8958
+ this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, this._SfThisContainer, prevString, nextString);
8734
8959
  }
8735
8960
  });
8736
8961
  }
@@ -9174,9 +9399,26 @@ let SfIEvents = class SfIEvents extends LitElement {
9174
9399
  this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9175
9400
  this.renderStream(index, showGraph, showBackgroundButton);
9176
9401
  });
9402
+ const chipSuspense = this._SfStreamContainer.querySelector('#chip-suspense');
9403
+ chipSuspense === null || chipSuspense === void 0 ? void 0 : chipSuspense.addEventListener('click', async () => {
9404
+ this.suspenseFlag = !this.suspenseFlag;
9405
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
9406
+ const monthResult = this.calculateMonthFromIndex(index);
9407
+ console.log('monthResult', monthResult);
9408
+ console.log('dateresult', dateResult);
9409
+ this.currentColumnIndex = index + "";
9410
+ if (dateResult != null) {
9411
+ await this.renderWithFeatures(dateResult.startDate, dateResult.endDate, "", "yes", ("0" + monthResult).slice(-2));
9412
+ // await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate,"","yes",("0" + monthResult).slice(-2));
9413
+ }
9414
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
9415
+ this.renderStream(index, showGraph, showBackgroundButton);
9416
+ });
9177
9417
  this.attachListReportingListeners(this._SfStreamContainer);
9418
+ this.attachReviewListeners(this._SfStreamContainer);
9178
9419
  const buttonArr = this._SfStreamContainer.querySelectorAll('.button-expand');
9179
9420
  for (i = 0; i < buttonArr.length; i++) {
9421
+ let indexPrevNext = i;
9180
9422
  buttonArr[i].addEventListener('click', (ev) => {
9181
9423
  const id = ev.target.id;
9182
9424
  const idArr = id.split("-");
@@ -9210,15 +9452,54 @@ let SfIEvents = class SfIEvents extends LitElement {
9210
9452
  }
9211
9453
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
9212
9454
  //console.log('commentsinlist', (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement, this.events[mmdd][j].comments, mmdd, j);
9455
+ let prevString = "";
9456
+ let flagPrev = true;
9457
+ let indexPrev = indexPrevNext;
9458
+ while (flagPrev) {
9459
+ if (indexPrev > 0) {
9460
+ if (Util.isVisible(buttonArr[indexPrev - 1])) {
9461
+ prevString = buttonArr[indexPrev - 1].id;
9462
+ flagPrev = false;
9463
+ }
9464
+ else {
9465
+ prevString = "";
9466
+ indexPrev--;
9467
+ }
9468
+ }
9469
+ else {
9470
+ flagPrev = false;
9471
+ }
9472
+ }
9473
+ let nextString = "";
9474
+ let flagNext = true;
9475
+ let indexNext = indexPrevNext;
9476
+ while (flagNext) {
9477
+ if (indexNext < buttonArr.length - 1) {
9478
+ if (Util.isVisible(buttonArr[indexNext + 1])) {
9479
+ nextString = buttonArr[indexNext + 1].id;
9480
+ flagNext = false;
9481
+ }
9482
+ else {
9483
+ nextString = "";
9484
+ indexNext++;
9485
+ }
9486
+ }
9487
+ else {
9488
+ flagNext = false;
9489
+ }
9490
+ }
9213
9491
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
9214
9492
  // console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
9215
- this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, this._SfStreamContainer.querySelector('#stream-month-' + this.currentColumnIndex), this._SfStreamContainer);
9493
+ console.log('previous event clicked', buttonArr[indexPrevNext - 1], prevString, indexPrevNext);
9494
+ this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, this._SfStreamContainer.querySelector('#stream-month-' + this.currentColumnIndex), this._SfStreamContainer, prevString, nextString);
9216
9495
  }
9217
9496
  });
9218
9497
  }
9219
9498
  const titleArr = this._SfStreamContainer.querySelectorAll('.button-event-title');
9220
9499
  for (var i = 0; i < titleArr.length; i++) {
9500
+ let indexPrevNext = i;
9221
9501
  titleArr[i].addEventListener('click', (ev) => {
9502
+ var _a, _b;
9222
9503
  const id = ev.target.id;
9223
9504
  const idArr = id.split("-");
9224
9505
  const mmdd = idArr[3] + "/" + idArr[4];
@@ -9254,8 +9535,57 @@ let SfIEvents = class SfIEvents extends LitElement {
9254
9535
  this.clearButtonSelection();
9255
9536
  }
9256
9537
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
9538
+ let prevString = "";
9539
+ let flagPrev = true;
9540
+ let indexPrev = indexPrevNext;
9541
+ while (flagPrev) {
9542
+ if (indexPrev > 0) {
9543
+ if (Util.isVisible(titleArr[indexPrev - 1])) {
9544
+ prevString = titleArr[indexPrev - 1].id;
9545
+ let prevIdArr = prevString.split("-");
9546
+ if (((_a = prevIdArr[7]) !== null && _a !== void 0 ? _a : "") == "reportedlocations") {
9547
+ prevString = "";
9548
+ indexPrev--;
9549
+ }
9550
+ else {
9551
+ flagPrev = false;
9552
+ }
9553
+ }
9554
+ else {
9555
+ prevString = "";
9556
+ indexPrev--;
9557
+ }
9558
+ }
9559
+ else {
9560
+ flagPrev = false;
9561
+ }
9562
+ }
9563
+ let nextString = "";
9564
+ let flagNext = true;
9565
+ let indexNext = indexPrevNext;
9566
+ while (flagNext) {
9567
+ if (indexNext < titleArr.length - 1) {
9568
+ if (Util.isVisible(titleArr[indexNext + 1])) {
9569
+ nextString = titleArr[indexNext + 1].id;
9570
+ let nextIdArr = nextString.split("-");
9571
+ if (((_b = nextIdArr[7]) !== null && _b !== void 0 ? _b : "") == "reportedlocations") {
9572
+ nextString = "";
9573
+ indexNext++;
9574
+ }
9575
+ else {
9576
+ flagNext = false;
9577
+ }
9578
+ }
9579
+ else {
9580
+ indexNext++;
9581
+ }
9582
+ }
9583
+ else {
9584
+ flagNext = false;
9585
+ }
9586
+ }
9257
9587
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
9258
- this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, this._SfStreamContainer);
9588
+ this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, this._SfStreamContainer, prevString, nextString);
9259
9589
  }
9260
9590
  });
9261
9591
  }
@@ -12834,12 +13164,15 @@ let SfIEvents = class SfIEvents extends LitElement {
12834
13164
  reportingReporting.prepopulateValJson = reportingSchemaValues;
12835
13165
  reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view";
12836
13166
  reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true";
13167
+ // reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
13168
+ // reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
12837
13169
  reportingReporting.flow = "reporting";
12838
13170
  setTimeout(() => {
12839
13171
  reportingReporting.loadMode();
12840
13172
  console.log('list-customreporting', reportingSchemaJson);
12841
13173
  console.log('list-customreporting1', reportingSchemaValues);
12842
13174
  console.log('list-customreporting2', reportingReporting.mode);
13175
+ console.log('list-customreporting3', this.myRole);
12843
13176
  }, 500);
12844
13177
  }
12845
13178
  (_a = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
@@ -12893,7 +13226,7 @@ let SfIEvents = class SfIEvents extends LitElement {
12893
13226
  });
12894
13227
  if (this.mode == "consumer" || this.mode == "next") {
12895
13228
  (_f = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async (ev) => {
12896
- var _a, _b, _c, _f, _g;
13229
+ var _a, _b, _c, _f;
12897
13230
  let buttonClick = ev.target;
12898
13231
  buttonClick.innerHTML = "Saving...";
12899
13232
  const comments = this._SfDetailContainer.querySelector('#input-approver-comments').value;
@@ -12911,12 +13244,13 @@ let SfIEvents = class SfIEvents extends LitElement {
12911
13244
  }, 3000);
12912
13245
  return;
12913
13246
  }
12914
- let reportformatvalues = "";
13247
+ let reportformatvalues = {};
12915
13248
  let reportingReporting = this._SfDetailContainer.querySelector('#reporting-reporting');
12916
13249
  console.log('renew reporting', reportingReporting);
12917
13250
  if (reportingReporting != null) {
12918
- reportformatvalues = (_a = JSON.stringify(reportingReporting.selectedValues())) !== null && _a !== void 0 ? _a : "";
13251
+ reportformatvalues = reportingReporting.selectedValues();
12919
13252
  }
13253
+ console.log('reportformatvalues', Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues)));
12920
13254
  var clickEvent = new MouseEvent("click", {
12921
13255
  "view": window,
12922
13256
  "bubbles": true,
@@ -12927,7 +13261,7 @@ let SfIEvents = class SfIEvents extends LitElement {
12927
13261
  let flagBulk = false;
12928
13262
  if (this.selectedItemIds.length <= 1) {
12929
13263
  console.log('mmddyyyy', mmddyyyy);
12930
- if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, (_b = listEvent.module) !== null && _b !== void 0 ? _b : "compliance")) {
13264
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, (_a = listEvent.module) !== null && _a !== void 0 ? _a : "compliance")) {
12931
13265
  if (approved) {
12932
13266
  await this.renewRCMResource(listEvent, reportformatvalues);
12933
13267
  }
@@ -12937,7 +13271,7 @@ let SfIEvents = class SfIEvents extends LitElement {
12937
13271
  for (var p = 0; p < this.events[mmdd].length; p++) {
12938
13272
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
12939
13273
  this.events[mmdd][p].approved = approved;
12940
- this.events[mmdd][p].terminated = (_c = (JSON.parse(reportformatvalues).terminated)) !== null && _c !== void 0 ? _c : false;
13274
+ this.events[mmdd][p].terminated = (_b = (reportformatvalues.terminated)) !== null && _b !== void 0 ? _b : false;
12941
13275
  this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
12942
13276
  this.events[mmdd][p].lastupdated = new Date().toString();
12943
13277
  }
@@ -12973,7 +13307,7 @@ let SfIEvents = class SfIEvents extends LitElement {
12973
13307
  "userid": this.userProfileId,
12974
13308
  "userrole": this.myRole,
12975
13309
  "year": yearStr,
12976
- "module": (_f = listEvent.module) !== null && _f !== void 0 ? _f : "compliance"
13310
+ "module": (_c = listEvent.module) !== null && _c !== void 0 ? _c : "compliance"
12977
13311
  });
12978
13312
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
12979
13313
  // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
@@ -13024,7 +13358,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13024
13358
  "bubbles": true,
13025
13359
  "cancelable": false
13026
13360
  });
13027
- (_g = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _g === void 0 ? void 0 : _g.dispatchEvent(clickEvent);
13361
+ (_f = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _f === void 0 ? void 0 : _f.dispatchEvent(clickEvent);
13028
13362
  // if(currentColumnButton != null) {
13029
13363
  // currentColumnButton.click();
13030
13364
  // }
@@ -13467,7 +13801,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13467
13801
  }
13468
13802
  }
13469
13803
  };
13470
- this.fetchEventDetails = async (listEvent, mmddyyyy, currentColumnButton, eventsContainer, flagUploadGuidance = false, listEventContainer = null, reportercomments = null, approvercomments = null, inputReportingPercentage = null, selectReportedLocation = null, documents = null, dateOfCompletion = null) => {
13804
+ this.fetchEventDetails = async (listEvent, mmddyyyy, currentColumnButton, eventsContainer, previousId = "", nextId = "", flagUploadGuidance = false, listEventContainer = null, reportercomments = null, approvercomments = null, inputReportingPercentage = null, selectReportedLocation = null, documents = null, dateOfCompletion = null) => {
13471
13805
  console.log('listEvent', listEvent, listEvent.id);
13472
13806
  let url = "https://" + this.apiId + "/getalleventdetails";
13473
13807
  //console.log('fetch calendar url', url);
@@ -13507,7 +13841,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13507
13841
  }
13508
13842
  }
13509
13843
  else {
13510
- this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
13844
+ this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId);
13511
13845
  }
13512
13846
  }
13513
13847
  else {
@@ -13526,9 +13860,10 @@ let SfIEvents = class SfIEvents extends LitElement {
13526
13860
  }
13527
13861
  }
13528
13862
  };
13529
- this.renderEventDetail = (event, mmddyyyy, currentColumnButton, eventsContainer) => {
13530
- var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
13863
+ this.renderEventDetail = (event, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId) => {
13864
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
13531
13865
  console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
13866
+ console.log('previousid', previousId, 'nextid', nextId);
13532
13867
  let comments, docs, approved, /*dateOfCompletion,*/ makercheckers, docsOptional, documentType;
13533
13868
  let entityId = "";
13534
13869
  let locationId = "";
@@ -13579,6 +13914,14 @@ let SfIEvents = class SfIEvents extends LitElement {
13579
13914
  </div>
13580
13915
 
13581
13916
  `;
13917
+ if (previousId != "" || nextId != "") {
13918
+ html += `
13919
+ <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
13920
+ <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
13921
+ <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
13922
+ </div>
13923
+ `;
13924
+ }
13582
13925
  if (this.selectedItemIds.length > 1) {
13583
13926
  html += `
13584
13927
 
@@ -13963,7 +14306,25 @@ let SfIEvents = class SfIEvents extends LitElement {
13963
14306
  this._SfDetailContainer.innerHTML = '';
13964
14307
  this._SfDetailContainer.style.display = 'none';
13965
14308
  });
13966
- (_h = this._SfDetailContainer.querySelector('.head-basic')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
14309
+ (_h = this._SfDetailContainer.querySelector('#button-detail-previous')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
14310
+ var _a;
14311
+ var clickEvent = new MouseEvent("click", {
14312
+ "view": window,
14313
+ "bubbles": true,
14314
+ "cancelable": false
14315
+ });
14316
+ (_a = eventsContainer.querySelector('#' + previousId)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(clickEvent);
14317
+ });
14318
+ (_j = this._SfDetailContainer.querySelector('#button-detail-next')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
14319
+ var _a;
14320
+ var clickEvent = new MouseEvent("click", {
14321
+ "view": window,
14322
+ "bubbles": true,
14323
+ "cancelable": false
14324
+ });
14325
+ (_a = eventsContainer.querySelector('#' + nextId)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(clickEvent);
14326
+ });
14327
+ (_k = this._SfDetailContainer.querySelector('.head-basic')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
13967
14328
  //console.log('head basic clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-basic') as HTMLDivElement).style.display);
13968
14329
  if (this._SfDetailContainer.querySelector('.body-basic').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-basic').style.display == '') {
13969
14330
  this._SfDetailContainer.querySelector('.body-basic').style.display = 'none';
@@ -13974,7 +14335,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13974
14335
  this._SfDetailContainer.querySelector('.head-indicator-basic').innerHTML = '-';
13975
14336
  }
13976
14337
  });
13977
- (_j = this._SfDetailContainer.querySelector('.head-statute')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
14338
+ (_l = this._SfDetailContainer.querySelector('.head-statute')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
13978
14339
  //console.log('head statute clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-statute') as HTMLDivElement).style.display);
13979
14340
  if (this._SfDetailContainer.querySelector('.body-statute').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-statute').style.display == '') {
13980
14341
  this._SfDetailContainer.querySelector('.body-statute').style.display = 'none';
@@ -13985,7 +14346,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13985
14346
  this._SfDetailContainer.querySelector('.head-indicator-statute').innerHTML = '-';
13986
14347
  }
13987
14348
  });
13988
- (_k = this._SfDetailContainer.querySelector('.head-compliance')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
14349
+ (_m = this._SfDetailContainer.querySelector('.head-compliance')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', () => {
13989
14350
  if (this._SfDetailContainer.querySelector('.body-compliance').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-compliance').style.display == '') {
13990
14351
  this._SfDetailContainer.querySelector('.body-compliance').style.display = 'none';
13991
14352
  this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '+';
@@ -13995,7 +14356,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13995
14356
  this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '-';
13996
14357
  }
13997
14358
  });
13998
- (_l = this._SfDetailContainer.querySelector('.head-grc')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
14359
+ (_o = this._SfDetailContainer.querySelector('.head-grc')) === null || _o === void 0 ? void 0 : _o.addEventListener('click', () => {
13999
14360
  if (this._SfDetailContainer.querySelector('.body-grc').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-grc').style.display == '') {
14000
14361
  this._SfDetailContainer.querySelector('.body-grc').style.display = 'none';
14001
14362
  this._SfDetailContainer.querySelector('.head-indicator-grc').innerHTML = '+';
@@ -14005,7 +14366,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14005
14366
  this._SfDetailContainer.querySelector('.head-indicator-grc').innerHTML = '-';
14006
14367
  }
14007
14368
  });
14008
- (_m = this._SfDetailContainer.querySelector('.head-feedback')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', () => {
14369
+ (_p = this._SfDetailContainer.querySelector('.head-feedback')) === null || _p === void 0 ? void 0 : _p.addEventListener('click', () => {
14009
14370
  if (this._SfDetailContainer.querySelector('.body-feedback').style.display == 'flex') {
14010
14371
  this._SfDetailContainer.querySelector('.body-feedback').style.display = 'none';
14011
14372
  this._SfDetailContainer.querySelector('.head-indicator-feedback').innerHTML = '+';
@@ -14015,11 +14376,11 @@ let SfIEvents = class SfIEvents extends LitElement {
14015
14376
  this._SfDetailContainer.querySelector('.head-indicator-feedback').innerHTML = '-';
14016
14377
  }
14017
14378
  });
14018
- (_o = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _o === void 0 ? void 0 : _o.addEventListener('click', () => {
14379
+ (_q = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _q === void 0 ? void 0 : _q.addEventListener('click', () => {
14019
14380
  this._SfDetailContainer.innerHTML = '';
14020
14381
  this._SfDetailContainer.style.display = 'none';
14021
14382
  });
14022
- (_p = this._SfDetailContainer.querySelector('#button-feedback')) === null || _p === void 0 ? void 0 : _p.addEventListener('click', () => {
14383
+ (_r = this._SfDetailContainer.querySelector('#button-feedback')) === null || _r === void 0 ? void 0 : _r.addEventListener('click', () => {
14023
14384
  const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
14024
14385
  const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
14025
14386
  const feedbackSuspenseLabel = this._SfDetailContainer.querySelector('#feedback-suspense-label');
@@ -14055,7 +14416,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14055
14416
  // }
14056
14417
  // console.log(body);
14057
14418
  });
14058
- (_q = this._SfDetailContainer.querySelector('#button-feedback-cancel')) === null || _q === void 0 ? void 0 : _q.addEventListener('click', () => {
14419
+ (_s = this._SfDetailContainer.querySelector('#button-feedback-cancel')) === null || _s === void 0 ? void 0 : _s.addEventListener('click', () => {
14059
14420
  const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
14060
14421
  const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
14061
14422
  const feedbackSuspenseLabel = this._SfDetailContainer.querySelector('#feedback-suspense-label');
@@ -14086,7 +14447,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14086
14447
  buttonFeedback.classList.remove('hide');
14087
14448
  }
14088
14449
  });
14089
- (_r = this._SfDetailContainer.querySelector('#button-feedback-confirm')) === null || _r === void 0 ? void 0 : _r.addEventListener('click', async () => {
14450
+ (_t = this._SfDetailContainer.querySelector('#button-feedback-confirm')) === null || _t === void 0 ? void 0 : _t.addEventListener('click', async () => {
14090
14451
  var _a, _b, _c;
14091
14452
  const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
14092
14453
  const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
@@ -14126,7 +14487,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14126
14487
  buttonClose.click();
14127
14488
  }
14128
14489
  });
14129
- (_s = this._SfDetailContainer.querySelector('#feedback-message')) === null || _s === void 0 ? void 0 : _s.addEventListener('keyup', (e) => {
14490
+ (_u = this._SfDetailContainer.querySelector('#feedback-message')) === null || _u === void 0 ? void 0 : _u.addEventListener('keyup', (e) => {
14130
14491
  if (e.code == "Enter") {
14131
14492
  const buttonConfirm = this._SfDetailContainer.querySelector('#button-feedback-confirm');
14132
14493
  buttonConfirm.click();
@@ -14226,7 +14587,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14226
14587
  selectReportingEntity.value = "";
14227
14588
  selectReportingLocation.value = "";
14228
14589
  }
14229
- (_t = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _t === void 0 ? void 0 : _t.addEventListener('click', async (ev) => {
14590
+ (_v = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', async (ev) => {
14230
14591
  var _a, _b, _c;
14231
14592
  let buttonClick = ev.target;
14232
14593
  buttonClick.innerHTML = "Saving...";
@@ -14365,7 +14726,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14365
14726
  }
14366
14727
  }
14367
14728
  });
14368
- (_u = this._SfDetailContainer.querySelector('#button-uploader-submit-audit')) === null || _u === void 0 ? void 0 : _u.addEventListener('click', async (ev) => {
14729
+ (_w = this._SfDetailContainer.querySelector('#button-uploader-submit-audit')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', async (ev) => {
14369
14730
  var _a, _b;
14370
14731
  let buttonClick = ev.target;
14371
14732
  buttonClick.innerHTML = "Saving...";
@@ -14521,7 +14882,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14521
14882
  else {
14522
14883
  if (this._SfDetailContainer.querySelector('#button-uploader-submit-report') != null) {
14523
14884
  this._SfDetailContainer.querySelector('#button-uploader-submit-report').style.visibility = 'visible';
14524
- (_v = this._SfDetailContainer.querySelector('#button-uploader-submit-report')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', async (ev) => {
14885
+ (_x = this._SfDetailContainer.querySelector('#button-uploader-submit-report')) === null || _x === void 0 ? void 0 : _x.addEventListener('click', async (ev) => {
14525
14886
  var _a, _b, _c, _f;
14526
14887
  let buttonClick = ev.target;
14527
14888
  buttonClick.innerHTML = "Saving...";
@@ -14924,7 +15285,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14924
15285
  }
14925
15286
  }
14926
15287
  else if (event['reportformat'] != null && event['reportformat'].length > 0) {
14927
- this.fetchReportFormat(this._SfDetailContainer, reportformatName, (_w = event['reportformatschema']) !== null && _w !== void 0 ? _w : "", (_x = event['reportformatvalues']) !== null && _x !== void 0 ? _x : "");
15288
+ this.fetchReportFormat(this._SfDetailContainer, reportformatName, (_y = event['reportformatschema']) !== null && _y !== void 0 ? _y : "", (_z = event['reportformatvalues']) !== null && _z !== void 0 ? _z : "");
14928
15289
  }
14929
15290
  };
14930
15291
  this.renderCalendar = () => {
@@ -22673,6 +23034,30 @@ let SfIEvents = class SfIEvents extends LitElement {
22673
23034
  }
22674
23035
  }
22675
23036
  };
23037
+ this.markReviewed = async (suspenseKey, year, review) => {
23038
+ let url = "https://" + this.apiId + "/markreviewed";
23039
+ //console.log('fetch calendar url', url);
23040
+ let urlBody = { "projectid": this.projectId, "eventid": suspenseKey.split(';')[2], "entityid": suspenseKey.split(';')[0], "locationid": suspenseKey.split(';')[1], "year": year, "mark": review };
23041
+ //console.log('urlbody', urlBody);
23042
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
23043
+ const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
23044
+ this._SfLoader.innerHTML = '';
23045
+ if (xhr.status == 200) {
23046
+ const jsonResponse = JSON.parse(xhr.responseText);
23047
+ console.log('jsonResponse', jsonResponse);
23048
+ return jsonResponse;
23049
+ }
23050
+ else {
23051
+ if (xhr.status == 401) {
23052
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
23053
+ this.dispatchEvent(changeEvent);
23054
+ }
23055
+ else {
23056
+ const jsonRespose = JSON.parse(xhr.responseText);
23057
+ this.setError(jsonRespose.error);
23058
+ }
23059
+ }
23060
+ };
22676
23061
  this.fetchSuspenseList = async () => {
22677
23062
  let url = "https://" + this.apiId + "/getsuspenselist";
22678
23063
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -22844,7 +23229,7 @@ let SfIEvents = class SfIEvents extends LitElement {
22844
23229
  else {
22845
23230
  view = "entity";
22846
23231
  }
22847
- path = "getallcountryevents4";
23232
+ path = "getallcountryevents5";
22848
23233
  let sDate = "";
22849
23234
  let eDate = "";
22850
23235
  //console.log('currenttab', this.getCurrentTab());
@@ -22858,7 +23243,7 @@ let SfIEvents = class SfIEvents extends LitElement {
22858
23243
  }
22859
23244
  let url = "https://" + this.apiId + "/" + path;
22860
23245
  //console.log('fetch calendar url', url);
22861
- let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": this.entityId, "countryid": this.countryId, "functionid": this.functionId, "locationid": this.locationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": view, "year": year, "list": list, "month": month };
23246
+ let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": this.entityId, "countryid": this.countryId, "functionid": this.functionId, "locationid": this.locationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": view, "year": year, "list": list, "month": month, "suspense": this.suspenseFlag };
22862
23247
  if (searchString.length > 0) {
22863
23248
  urlBody["searchstring"] = searchString;
22864
23249
  }
@@ -22954,7 +23339,7 @@ let SfIEvents = class SfIEvents extends LitElement {
22954
23339
  else {
22955
23340
  view = "entity";
22956
23341
  }
22957
- path = "getallcountryevents4";
23342
+ path = "getallcountryevents5";
22958
23343
  let url = "https://" + this.apiId + "/" + path;
22959
23344
  let temptagid = tagid;
22960
23345
  if (temptagid == "" && locationid != "") {
@@ -24189,6 +24574,7 @@ let SfIEvents = class SfIEvents extends LitElement {
24189
24574
  });
24190
24575
  const buttonArr = this._SfIEventsC.querySelectorAll('.button-expand');
24191
24576
  for (var i = 0; i < buttonArr.length; i++) {
24577
+ let indexPrevNext = i;
24192
24578
  buttonArr[i].addEventListener('click', (ev) => {
24193
24579
  const id = ev.target.id;
24194
24580
  const idArr = id.split("-");
@@ -24230,7 +24616,15 @@ let SfIEvents = class SfIEvents extends LitElement {
24230
24616
  }
24231
24617
  console.log('redering detail', this.myRole);
24232
24618
  // this.renderEventDetail(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null);
24233
- this.fetchEventDetails(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null, this._SfIEventsC);
24619
+ let prevString = "";
24620
+ if (indexPrevNext > 0) {
24621
+ prevString = buttonArr[indexPrevNext - 1].id;
24622
+ }
24623
+ let nextString = "";
24624
+ if (indexPrevNext < buttonArr.length - 1) {
24625
+ nextString = buttonArr[indexPrevNext + 1].id;
24626
+ }
24627
+ this.fetchEventDetails(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null, this._SfIEventsC, prevString, nextString);
24234
24628
  });
24235
24629
  }
24236
24630
  const streamEventsContainer = this._SfIEventsC.querySelectorAll('.stream-events-container');
@@ -24435,7 +24829,7 @@ let SfIEvents = class SfIEvents extends LitElement {
24435
24829
  day = '0' + day;
24436
24830
  let eDate = month + "/" + day + "/" + year;
24437
24831
  let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": complianceLocationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
24438
- let url = "https://" + this.apiId + "/getallcountryevents4";
24832
+ let url = "https://" + this.apiId + "/getallcountryevents5";
24439
24833
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
24440
24834
  const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
24441
24835
  this._SfLoader.innerHTML = '';
@@ -24520,7 +24914,7 @@ let SfIEvents = class SfIEvents extends LitElement {
24520
24914
  console.log('fetching compliances', sortid);
24521
24915
  let complianceEntityId = sortid.split(';')[1];
24522
24916
  let complianceLocationId = sortid.split(';')[2];
24523
- let url = "https://" + this.apiId + "/getallcountryevents4";
24917
+ let url = "https://" + this.apiId + "/getallcountryevents5";
24524
24918
  let sDateObj = selectedDate;
24525
24919
  sDateObj.setDate(selectedDate.getDate() - 60);
24526
24920
  let day = '' + sDateObj.getDate();