sf-i-events 1.0.936 → 1.0.938
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/package.json +1 -1
- package/sf-i-events.d.ts +5 -2
- package/sf-i-events.js +436 -39
- package/src/sf-i-events.ts +396 -39
- package/src/util.ts +16 -1
- package/util.d.ts +2 -0
- package/util.js +10 -1
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> <span>Pending Approval:</span> <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> <span>Rejected:</span> <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> <span>Approved:</span> <span id="graph-approved">DASHBOARD_APPROVED</span></div>';
|
|
2407
|
-
html +=
|
|
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> <span>Suspense:</span> <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> <span>In Time:</span> <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> <span>Past Due Date:</span> <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> <span>Late Reported:</span> <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
|
<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) ? ('<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
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -13467,7 +13797,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13467
13797
|
}
|
|
13468
13798
|
}
|
|
13469
13799
|
};
|
|
13470
|
-
this.fetchEventDetails = async (listEvent, mmddyyyy, currentColumnButton, eventsContainer, flagUploadGuidance = false, listEventContainer = null, reportercomments = null, approvercomments = null, inputReportingPercentage = null, selectReportedLocation = null, documents = null, dateOfCompletion = null) => {
|
|
13800
|
+
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
13801
|
console.log('listEvent', listEvent, listEvent.id);
|
|
13472
13802
|
let url = "https://" + this.apiId + "/getalleventdetails";
|
|
13473
13803
|
//console.log('fetch calendar url', url);
|
|
@@ -13507,7 +13837,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13507
13837
|
}
|
|
13508
13838
|
}
|
|
13509
13839
|
else {
|
|
13510
|
-
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
|
|
13840
|
+
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId);
|
|
13511
13841
|
}
|
|
13512
13842
|
}
|
|
13513
13843
|
else {
|
|
@@ -13526,9 +13856,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13526
13856
|
}
|
|
13527
13857
|
}
|
|
13528
13858
|
};
|
|
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;
|
|
13859
|
+
this.renderEventDetail = (event, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId) => {
|
|
13860
|
+
var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
13531
13861
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
13862
|
+
console.log('previousid', previousId, 'nextid', nextId);
|
|
13532
13863
|
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers, docsOptional, documentType;
|
|
13533
13864
|
let entityId = "";
|
|
13534
13865
|
let locationId = "";
|
|
@@ -13579,6 +13910,14 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13579
13910
|
</div>
|
|
13580
13911
|
|
|
13581
13912
|
`;
|
|
13913
|
+
if (previousId != "" || nextId != "") {
|
|
13914
|
+
html += `
|
|
13915
|
+
<div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
|
|
13916
|
+
<button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
|
|
13917
|
+
<button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
|
|
13918
|
+
</div>
|
|
13919
|
+
`;
|
|
13920
|
+
}
|
|
13582
13921
|
if (this.selectedItemIds.length > 1) {
|
|
13583
13922
|
html += `
|
|
13584
13923
|
|
|
@@ -13963,7 +14302,25 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13963
14302
|
this._SfDetailContainer.innerHTML = '';
|
|
13964
14303
|
this._SfDetailContainer.style.display = 'none';
|
|
13965
14304
|
});
|
|
13966
|
-
(_h = this._SfDetailContainer.querySelector('
|
|
14305
|
+
(_h = this._SfDetailContainer.querySelector('#button-detail-previous')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
|
|
14306
|
+
var _a;
|
|
14307
|
+
var clickEvent = new MouseEvent("click", {
|
|
14308
|
+
"view": window,
|
|
14309
|
+
"bubbles": true,
|
|
14310
|
+
"cancelable": false
|
|
14311
|
+
});
|
|
14312
|
+
(_a = eventsContainer.querySelector('#' + previousId)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(clickEvent);
|
|
14313
|
+
});
|
|
14314
|
+
(_j = this._SfDetailContainer.querySelector('#button-detail-next')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
|
|
14315
|
+
var _a;
|
|
14316
|
+
var clickEvent = new MouseEvent("click", {
|
|
14317
|
+
"view": window,
|
|
14318
|
+
"bubbles": true,
|
|
14319
|
+
"cancelable": false
|
|
14320
|
+
});
|
|
14321
|
+
(_a = eventsContainer.querySelector('#' + nextId)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(clickEvent);
|
|
14322
|
+
});
|
|
14323
|
+
(_k = this._SfDetailContainer.querySelector('.head-basic')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
|
|
13967
14324
|
//console.log('head basic clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-basic') as HTMLDivElement).style.display);
|
|
13968
14325
|
if (this._SfDetailContainer.querySelector('.body-basic').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-basic').style.display == '') {
|
|
13969
14326
|
this._SfDetailContainer.querySelector('.body-basic').style.display = 'none';
|
|
@@ -13974,7 +14331,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13974
14331
|
this._SfDetailContainer.querySelector('.head-indicator-basic').innerHTML = '-';
|
|
13975
14332
|
}
|
|
13976
14333
|
});
|
|
13977
|
-
(
|
|
14334
|
+
(_l = this._SfDetailContainer.querySelector('.head-statute')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
|
|
13978
14335
|
//console.log('head statute clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-statute') as HTMLDivElement).style.display);
|
|
13979
14336
|
if (this._SfDetailContainer.querySelector('.body-statute').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-statute').style.display == '') {
|
|
13980
14337
|
this._SfDetailContainer.querySelector('.body-statute').style.display = 'none';
|
|
@@ -13985,7 +14342,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13985
14342
|
this._SfDetailContainer.querySelector('.head-indicator-statute').innerHTML = '-';
|
|
13986
14343
|
}
|
|
13987
14344
|
});
|
|
13988
|
-
(
|
|
14345
|
+
(_m = this._SfDetailContainer.querySelector('.head-compliance')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', () => {
|
|
13989
14346
|
if (this._SfDetailContainer.querySelector('.body-compliance').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-compliance').style.display == '') {
|
|
13990
14347
|
this._SfDetailContainer.querySelector('.body-compliance').style.display = 'none';
|
|
13991
14348
|
this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '+';
|
|
@@ -13995,7 +14352,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13995
14352
|
this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '-';
|
|
13996
14353
|
}
|
|
13997
14354
|
});
|
|
13998
|
-
(
|
|
14355
|
+
(_o = this._SfDetailContainer.querySelector('.head-grc')) === null || _o === void 0 ? void 0 : _o.addEventListener('click', () => {
|
|
13999
14356
|
if (this._SfDetailContainer.querySelector('.body-grc').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-grc').style.display == '') {
|
|
14000
14357
|
this._SfDetailContainer.querySelector('.body-grc').style.display = 'none';
|
|
14001
14358
|
this._SfDetailContainer.querySelector('.head-indicator-grc').innerHTML = '+';
|
|
@@ -14005,7 +14362,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14005
14362
|
this._SfDetailContainer.querySelector('.head-indicator-grc').innerHTML = '-';
|
|
14006
14363
|
}
|
|
14007
14364
|
});
|
|
14008
|
-
(
|
|
14365
|
+
(_p = this._SfDetailContainer.querySelector('.head-feedback')) === null || _p === void 0 ? void 0 : _p.addEventListener('click', () => {
|
|
14009
14366
|
if (this._SfDetailContainer.querySelector('.body-feedback').style.display == 'flex') {
|
|
14010
14367
|
this._SfDetailContainer.querySelector('.body-feedback').style.display = 'none';
|
|
14011
14368
|
this._SfDetailContainer.querySelector('.head-indicator-feedback').innerHTML = '+';
|
|
@@ -14015,11 +14372,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14015
14372
|
this._SfDetailContainer.querySelector('.head-indicator-feedback').innerHTML = '-';
|
|
14016
14373
|
}
|
|
14017
14374
|
});
|
|
14018
|
-
(
|
|
14375
|
+
(_q = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _q === void 0 ? void 0 : _q.addEventListener('click', () => {
|
|
14019
14376
|
this._SfDetailContainer.innerHTML = '';
|
|
14020
14377
|
this._SfDetailContainer.style.display = 'none';
|
|
14021
14378
|
});
|
|
14022
|
-
(
|
|
14379
|
+
(_r = this._SfDetailContainer.querySelector('#button-feedback')) === null || _r === void 0 ? void 0 : _r.addEventListener('click', () => {
|
|
14023
14380
|
const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
|
|
14024
14381
|
const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
|
|
14025
14382
|
const feedbackSuspenseLabel = this._SfDetailContainer.querySelector('#feedback-suspense-label');
|
|
@@ -14055,7 +14412,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14055
14412
|
// }
|
|
14056
14413
|
// console.log(body);
|
|
14057
14414
|
});
|
|
14058
|
-
(
|
|
14415
|
+
(_s = this._SfDetailContainer.querySelector('#button-feedback-cancel')) === null || _s === void 0 ? void 0 : _s.addEventListener('click', () => {
|
|
14059
14416
|
const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
|
|
14060
14417
|
const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
|
|
14061
14418
|
const feedbackSuspenseLabel = this._SfDetailContainer.querySelector('#feedback-suspense-label');
|
|
@@ -14086,7 +14443,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14086
14443
|
buttonFeedback.classList.remove('hide');
|
|
14087
14444
|
}
|
|
14088
14445
|
});
|
|
14089
|
-
(
|
|
14446
|
+
(_t = this._SfDetailContainer.querySelector('#button-feedback-confirm')) === null || _t === void 0 ? void 0 : _t.addEventListener('click', async () => {
|
|
14090
14447
|
var _a, _b, _c;
|
|
14091
14448
|
const feedbackMessage = this._SfDetailContainer.querySelector('#feedback-message');
|
|
14092
14449
|
const feedbackSuspense = this._SfDetailContainer.querySelector('#feedback-suspense');
|
|
@@ -14126,7 +14483,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14126
14483
|
buttonClose.click();
|
|
14127
14484
|
}
|
|
14128
14485
|
});
|
|
14129
|
-
(
|
|
14486
|
+
(_u = this._SfDetailContainer.querySelector('#feedback-message')) === null || _u === void 0 ? void 0 : _u.addEventListener('keyup', (e) => {
|
|
14130
14487
|
if (e.code == "Enter") {
|
|
14131
14488
|
const buttonConfirm = this._SfDetailContainer.querySelector('#button-feedback-confirm');
|
|
14132
14489
|
buttonConfirm.click();
|
|
@@ -14226,7 +14583,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14226
14583
|
selectReportingEntity.value = "";
|
|
14227
14584
|
selectReportingLocation.value = "";
|
|
14228
14585
|
}
|
|
14229
|
-
(
|
|
14586
|
+
(_v = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', async (ev) => {
|
|
14230
14587
|
var _a, _b, _c;
|
|
14231
14588
|
let buttonClick = ev.target;
|
|
14232
14589
|
buttonClick.innerHTML = "Saving...";
|
|
@@ -14365,7 +14722,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14365
14722
|
}
|
|
14366
14723
|
}
|
|
14367
14724
|
});
|
|
14368
|
-
(
|
|
14725
|
+
(_w = this._SfDetailContainer.querySelector('#button-uploader-submit-audit')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', async (ev) => {
|
|
14369
14726
|
var _a, _b;
|
|
14370
14727
|
let buttonClick = ev.target;
|
|
14371
14728
|
buttonClick.innerHTML = "Saving...";
|
|
@@ -14521,7 +14878,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14521
14878
|
else {
|
|
14522
14879
|
if (this._SfDetailContainer.querySelector('#button-uploader-submit-report') != null) {
|
|
14523
14880
|
this._SfDetailContainer.querySelector('#button-uploader-submit-report').style.visibility = 'visible';
|
|
14524
|
-
(
|
|
14881
|
+
(_x = this._SfDetailContainer.querySelector('#button-uploader-submit-report')) === null || _x === void 0 ? void 0 : _x.addEventListener('click', async (ev) => {
|
|
14525
14882
|
var _a, _b, _c, _f;
|
|
14526
14883
|
let buttonClick = ev.target;
|
|
14527
14884
|
buttonClick.innerHTML = "Saving...";
|
|
@@ -14924,7 +15281,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14924
15281
|
}
|
|
14925
15282
|
}
|
|
14926
15283
|
else if (event['reportformat'] != null && event['reportformat'].length > 0) {
|
|
14927
|
-
this.fetchReportFormat(this._SfDetailContainer, reportformatName, (
|
|
15284
|
+
this.fetchReportFormat(this._SfDetailContainer, reportformatName, (_y = event['reportformatschema']) !== null && _y !== void 0 ? _y : "", (_z = event['reportformatvalues']) !== null && _z !== void 0 ? _z : "");
|
|
14928
15285
|
}
|
|
14929
15286
|
};
|
|
14930
15287
|
this.renderCalendar = () => {
|
|
@@ -14934,11 +15291,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
14934
15291
|
var html = '';
|
|
14935
15292
|
for (var i = 0; i < 12; i++) {
|
|
14936
15293
|
const monthStatus = this.getMonthStatus(startDate.getMonth(), startDate.getFullYear());
|
|
14937
|
-
|
|
15294
|
+
console.log('monthstatus', monthStatus, startDate);
|
|
14938
15295
|
const partApproved = this.COLOR_APPROVED + ' 0%, ' + this.COLOR_APPROVED + ' ' + parseInt(monthStatus['percApproved'] + '') + '%';
|
|
14939
|
-
const partPendingApproval = this.COLOR_PENDING_APPROVAL + ' ' + parseInt(monthStatus['percApproved'] + '') + '%, ' + this.COLOR_PENDING_APPROVAL + ' ' +
|
|
14940
|
-
const partRejected = this.COLOR_REJECTED + ' ' +
|
|
14941
|
-
const partNotStarted = this.COLOR_NOT_STARTED + ' ' +
|
|
15296
|
+
const partPendingApproval = this.COLOR_PENDING_APPROVAL + ' ' + parseInt(monthStatus['percApproved'] + '') + '%, ' + this.COLOR_PENDING_APPROVAL + ' ' + (monthStatus['percApproved'] + (monthStatus['percPendingApproval']) + '') + '%';
|
|
15297
|
+
const partRejected = this.COLOR_REJECTED + ' ' + (monthStatus['percApproved'] + monthStatus['percPendingApproval'] + '') + '%, ' + this.COLOR_REJECTED + ' ' + (monthStatus['percApproved'] + monthStatus['percPendingApproval'] + monthStatus['percRejected'] + '') + '%';
|
|
15298
|
+
const partNotStarted = this.COLOR_NOT_STARTED + ' ' + (monthStatus['percApproved'] + monthStatus['percPendingApproval'] + monthStatus['percRejected'] + '') + '%, ' + this.COLOR_NOT_STARTED + ' ' + 100 + '%';
|
|
14942
15299
|
html += '<div class="calendar-item d-flex flex-col flex-grow" part="calendar-month" style="background: linear-gradient(to right, ' + partApproved + ',' + partPendingApproval + ',' + partRejected + ',' + partNotStarted + ');">';
|
|
14943
15300
|
html += '<div part="bg-calendar" class="d-flex justify-between align-center p-10">';
|
|
14944
15301
|
html += '<div part="month-title" class="title-item">' + this.monthNames[startDate.getMonth()] + ' ' + startDate.getFullYear() + '</div>';
|
|
@@ -22673,6 +23030,30 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22673
23030
|
}
|
|
22674
23031
|
}
|
|
22675
23032
|
};
|
|
23033
|
+
this.markReviewed = async (suspenseKey, year, review) => {
|
|
23034
|
+
let url = "https://" + this.apiId + "/markreviewed";
|
|
23035
|
+
//console.log('fetch calendar url', url);
|
|
23036
|
+
let urlBody = { "projectid": this.projectId, "eventid": suspenseKey.split(';')[2], "entityid": suspenseKey.split(';')[0], "locationid": suspenseKey.split(';')[1], "year": year, "mark": review };
|
|
23037
|
+
//console.log('urlbody', urlBody);
|
|
23038
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23039
|
+
const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
|
|
23040
|
+
this._SfLoader.innerHTML = '';
|
|
23041
|
+
if (xhr.status == 200) {
|
|
23042
|
+
const jsonResponse = JSON.parse(xhr.responseText);
|
|
23043
|
+
console.log('jsonResponse', jsonResponse);
|
|
23044
|
+
return jsonResponse;
|
|
23045
|
+
}
|
|
23046
|
+
else {
|
|
23047
|
+
if (xhr.status == 401) {
|
|
23048
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
23049
|
+
this.dispatchEvent(changeEvent);
|
|
23050
|
+
}
|
|
23051
|
+
else {
|
|
23052
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
23053
|
+
this.setError(jsonRespose.error);
|
|
23054
|
+
}
|
|
23055
|
+
}
|
|
23056
|
+
};
|
|
22676
23057
|
this.fetchSuspenseList = async () => {
|
|
22677
23058
|
let url = "https://" + this.apiId + "/getsuspenselist";
|
|
22678
23059
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
@@ -22844,7 +23225,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22844
23225
|
else {
|
|
22845
23226
|
view = "entity";
|
|
22846
23227
|
}
|
|
22847
|
-
path = "
|
|
23228
|
+
path = "getallcountryevents5";
|
|
22848
23229
|
let sDate = "";
|
|
22849
23230
|
let eDate = "";
|
|
22850
23231
|
//console.log('currenttab', this.getCurrentTab());
|
|
@@ -22858,7 +23239,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22858
23239
|
}
|
|
22859
23240
|
let url = "https://" + this.apiId + "/" + path;
|
|
22860
23241
|
//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 };
|
|
23242
|
+
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
23243
|
if (searchString.length > 0) {
|
|
22863
23244
|
urlBody["searchstring"] = searchString;
|
|
22864
23245
|
}
|
|
@@ -22954,7 +23335,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22954
23335
|
else {
|
|
22955
23336
|
view = "entity";
|
|
22956
23337
|
}
|
|
22957
|
-
path = "
|
|
23338
|
+
path = "getallcountryevents5";
|
|
22958
23339
|
let url = "https://" + this.apiId + "/" + path;
|
|
22959
23340
|
let temptagid = tagid;
|
|
22960
23341
|
if (temptagid == "" && locationid != "") {
|
|
@@ -23001,7 +23382,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23001
23382
|
}
|
|
23002
23383
|
};
|
|
23003
23384
|
this.fetchAndRenderNotices = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
23004
|
-
var _a;
|
|
23385
|
+
var _a, _b;
|
|
23005
23386
|
let path = "", view = "";
|
|
23006
23387
|
this.sdate = startDate;
|
|
23007
23388
|
this.edate = endDate;
|
|
@@ -23043,11 +23424,12 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23043
23424
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
23044
23425
|
console.log('jsonRespose', jsonRespose);
|
|
23045
23426
|
let notices = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
23427
|
+
this.suspenseCount = (_a = jsonRespose.suspensecount) !== null && _a !== void 0 ? _a : 0;
|
|
23046
23428
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
23047
23429
|
this.lastupdated = Util.getDateTimeStrings(new Date().getTime());
|
|
23048
23430
|
let tempEvents = this.events;
|
|
23049
23431
|
for (let mmddyyyy of Object.keys(notices)) {
|
|
23050
|
-
tempEvents[mmddyyyy] = [...((
|
|
23432
|
+
tempEvents[mmddyyyy] = [...((_b = tempEvents[mmddyyyy]) !== null && _b !== void 0 ? _b : []), ...notices[mmddyyyy]];
|
|
23051
23433
|
}
|
|
23052
23434
|
this.events = tempEvents;
|
|
23053
23435
|
this.renderAppropriateStream(this.sdate, this.edate, true);
|
|
@@ -23070,6 +23452,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23070
23452
|
}
|
|
23071
23453
|
};
|
|
23072
23454
|
this.fetchAndRenderContracts = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
23455
|
+
var _a;
|
|
23073
23456
|
let path = "", view = "";
|
|
23074
23457
|
this.sdate = startDate;
|
|
23075
23458
|
this.edate = endDate;
|
|
@@ -23111,6 +23494,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23111
23494
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
23112
23495
|
console.log('jsonRespose', jsonRespose);
|
|
23113
23496
|
let contracts = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
23497
|
+
this.suspenseCount = (_a = jsonRespose.suspensecount) !== null && _a !== void 0 ? _a : 0;
|
|
23114
23498
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
23115
23499
|
this.lastupdated = Util.getDateTimeStrings(new Date().getTime());
|
|
23116
23500
|
// let tempEvents = this.events
|
|
@@ -23139,6 +23523,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23139
23523
|
}
|
|
23140
23524
|
};
|
|
23141
23525
|
this.fetchAndRenderLicenses = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
23526
|
+
var _a;
|
|
23142
23527
|
let path = "", view = "";
|
|
23143
23528
|
this.sdate = startDate;
|
|
23144
23529
|
this.edate = endDate;
|
|
@@ -23180,6 +23565,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23180
23565
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
23181
23566
|
console.log('jsonRespose', jsonRespose);
|
|
23182
23567
|
let licenses = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
23568
|
+
this.suspenseCount = (_a = jsonRespose.suspensecount) !== null && _a !== void 0 ? _a : 0;
|
|
23183
23569
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
23184
23570
|
this.lastupdated = Util.getDateTimeStrings(new Date().getTime());
|
|
23185
23571
|
// let tempEvents = this.events
|
|
@@ -23208,6 +23594,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23208
23594
|
}
|
|
23209
23595
|
};
|
|
23210
23596
|
this.fetchAndRenderRCMResources = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
23597
|
+
var _a;
|
|
23211
23598
|
let path = "", view = "";
|
|
23212
23599
|
this.sdate = startDate;
|
|
23213
23600
|
this.edate = endDate;
|
|
@@ -23249,6 +23636,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23249
23636
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
23250
23637
|
console.log('jsonRespose', jsonRespose);
|
|
23251
23638
|
let rcmresources = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
23639
|
+
this.suspenseCount = (_a = jsonRespose.suspensecount) !== null && _a !== void 0 ? _a : 0;
|
|
23252
23640
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
23253
23641
|
this.lastupdated = Util.getDateTimeStrings(new Date().getTime());
|
|
23254
23642
|
this.events = rcmresources;
|
|
@@ -24182,6 +24570,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
24182
24570
|
});
|
|
24183
24571
|
const buttonArr = this._SfIEventsC.querySelectorAll('.button-expand');
|
|
24184
24572
|
for (var i = 0; i < buttonArr.length; i++) {
|
|
24573
|
+
let indexPrevNext = i;
|
|
24185
24574
|
buttonArr[i].addEventListener('click', (ev) => {
|
|
24186
24575
|
const id = ev.target.id;
|
|
24187
24576
|
const idArr = id.split("-");
|
|
@@ -24223,7 +24612,15 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
24223
24612
|
}
|
|
24224
24613
|
console.log('redering detail', this.myRole);
|
|
24225
24614
|
// this.renderEventDetail(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null);
|
|
24226
|
-
|
|
24615
|
+
let prevString = "";
|
|
24616
|
+
if (indexPrevNext > 0) {
|
|
24617
|
+
prevString = buttonArr[indexPrevNext - 1].id;
|
|
24618
|
+
}
|
|
24619
|
+
let nextString = "";
|
|
24620
|
+
if (indexPrevNext < buttonArr.length - 1) {
|
|
24621
|
+
nextString = buttonArr[indexPrevNext + 1].id;
|
|
24622
|
+
}
|
|
24623
|
+
this.fetchEventDetails(eventsData[role][mmdd][j], mmdd + "/" + yyyy, null, this._SfIEventsC, prevString, nextString);
|
|
24227
24624
|
});
|
|
24228
24625
|
}
|
|
24229
24626
|
const streamEventsContainer = this._SfIEventsC.querySelectorAll('.stream-events-container');
|
|
@@ -24428,7 +24825,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
24428
24825
|
day = '0' + day;
|
|
24429
24826
|
let eDate = month + "/" + day + "/" + year;
|
|
24430
24827
|
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 };
|
|
24431
|
-
let url = "https://" + this.apiId + "/
|
|
24828
|
+
let url = "https://" + this.apiId + "/getallcountryevents5";
|
|
24432
24829
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
24433
24830
|
const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
|
|
24434
24831
|
this._SfLoader.innerHTML = '';
|
|
@@ -24513,7 +24910,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
24513
24910
|
console.log('fetching compliances', sortid);
|
|
24514
24911
|
let complianceEntityId = sortid.split(';')[1];
|
|
24515
24912
|
let complianceLocationId = sortid.split(';')[2];
|
|
24516
|
-
let url = "https://" + this.apiId + "/
|
|
24913
|
+
let url = "https://" + this.apiId + "/getallcountryevents5";
|
|
24517
24914
|
let sDateObj = selectedDate;
|
|
24518
24915
|
sDateObj.setDate(selectedDate.getDate() - 60);
|
|
24519
24916
|
let day = '' + sDateObj.getDate();
|