sf-i-events 1.0.966 → 1.0.968
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/dev/index.html +76 -31
- package/package.json +1 -1
- package/sf-i-events.d.ts +11 -10
- package/sf-i-events.js +279 -83
- package/src/sf-i-events.ts +278 -89
package/src/sf-i-events.ts
CHANGED
|
@@ -4842,7 +4842,7 @@ export class SfIEvents extends LitElement {
|
|
|
4842
4842
|
|
|
4843
4843
|
}
|
|
4844
4844
|
|
|
4845
|
-
renderCalendarRowDivItemDivStart = (mmdd: string, event: any, itemNumber: number, partStatus: string, bgStatus: string) => {
|
|
4845
|
+
renderCalendarRowDivItemDivStart = (mmdd: string, event: any, itemNumber: number, partStatus: string, bgStatus: string, fromDrilldown: boolean) => {
|
|
4846
4846
|
|
|
4847
4847
|
var html = '';
|
|
4848
4848
|
|
|
@@ -4899,7 +4899,7 @@ export class SfIEvents extends LitElement {
|
|
|
4899
4899
|
const isReviewed = event.review == true
|
|
4900
4900
|
const showCheckbox = !(hasReportFormat || isBulk || hasCustomReporting || isReportedLocation);
|
|
4901
4901
|
// const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
|
|
4902
|
-
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.concise != null && !isReportedLocation;
|
|
4902
|
+
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.concise != null && !isReportedLocation && !fromDrilldown;
|
|
4903
4903
|
const showLocationRisk = event.concise != null;
|
|
4904
4904
|
const configHome = Util.getProjectConfigHome();
|
|
4905
4905
|
const showReview = event.concise != null && configHome.features != null && configHome.features.indexOf("understood") >= 0;
|
|
@@ -5276,7 +5276,7 @@ export class SfIEvents extends LitElement {
|
|
|
5276
5276
|
return graphParam;
|
|
5277
5277
|
}
|
|
5278
5278
|
|
|
5279
|
-
renderCalendarAnnotations = (event: any, mmdd: string, j: number) => {
|
|
5279
|
+
renderCalendarAnnotations = (event: any, mmdd: string, j: number, fromDrilldown: boolean) => {
|
|
5280
5280
|
|
|
5281
5281
|
var html = '';
|
|
5282
5282
|
|
|
@@ -5289,7 +5289,7 @@ export class SfIEvents extends LitElement {
|
|
|
5289
5289
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
5290
5290
|
const configHome = Util.getProjectConfigHome();
|
|
5291
5291
|
const configFlag = configHome.features != null && configHome.features.indexOf("understood") >= 0
|
|
5292
|
-
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.module == "compliances" || event.module == null) && 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 && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span> Mark Understood</button>')) : '') + '</div>';
|
|
5292
|
+
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.module == "compliances" || event.module == null) && event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true)) && !fromDrilldown) ? ('<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 && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span> Mark Understood</button>')) : '') + '</div>';
|
|
5293
5293
|
// }
|
|
5294
5294
|
|
|
5295
5295
|
return html;
|
|
@@ -5691,13 +5691,13 @@ export class SfIEvents extends LitElement {
|
|
|
5691
5691
|
}
|
|
5692
5692
|
}
|
|
5693
5693
|
|
|
5694
|
-
html += this.renderCalendarRowDivItemDivStart(mmdd, this.events[mmdd][j], j, partStatus, bgStatus);
|
|
5694
|
+
html += this.renderCalendarRowDivItemDivStart(mmdd, this.events[mmdd][j], j, partStatus, bgStatus, fromDrilldown);
|
|
5695
5695
|
// if (this.events[mmdd][j]["countryname"] != null) {
|
|
5696
5696
|
if (this.events[mmdd][j]["concise"] == null) {
|
|
5697
5697
|
html += this.renderCalendarRowDivItemDivTableHead(this.events[mmdd][j], partStatus);
|
|
5698
5698
|
html += this.renderCalendarRowDivItemDivTableBody(this.events[mmdd][j], partStatus, lateStatus, complianceStatus, mmdd, i, j);
|
|
5699
5699
|
}
|
|
5700
|
-
html += this.renderCalendarAnnotations(this.events[mmdd][j], mmdd, j);
|
|
5700
|
+
html += this.renderCalendarAnnotations(this.events[mmdd][j], mmdd, j, fromDrilldown);
|
|
5701
5701
|
html += '<div class="list-reporting-container d-flex flex-col hide" part="list-reporting-container" id="list-reporting-container-' + mmdd.replace(/\//g, '-') + '-' + j + '"></div>'
|
|
5702
5702
|
html += this.renderCalendarRowDivItemDivEnd();
|
|
5703
5703
|
|
|
@@ -10499,13 +10499,13 @@ export class SfIEvents extends LitElement {
|
|
|
10499
10499
|
this.renderOnboardingCalendar(calendarJobs);
|
|
10500
10500
|
}
|
|
10501
10501
|
|
|
10502
|
-
loadOnboardingSuspense = async () => {
|
|
10502
|
+
loadOnboardingSuspense = async (year: string = this.getCurrentYearGeneric()) => {
|
|
10503
10503
|
this.hideTabContainers();
|
|
10504
10504
|
(this._SfOnboardingSuspenseContainer as HTMLDivElement).style.display = 'flex';
|
|
10505
10505
|
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
10506
|
-
const suspenseList = await this.fetchSuspenseList();
|
|
10506
|
+
const suspenseList = await this.fetchSuspenseList(year);
|
|
10507
10507
|
console.log('suspenseList', suspenseList);
|
|
10508
|
-
this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList);
|
|
10508
|
+
this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList, year);
|
|
10509
10509
|
}
|
|
10510
10510
|
|
|
10511
10511
|
calculateStartAndEndDateOfPast = (index: number = 0) => {
|
|
@@ -14224,46 +14224,9 @@ export class SfIEvents extends LitElement {
|
|
|
14224
14224
|
html += `
|
|
14225
14225
|
<div id="list-container" class="list-container m-20 pb-20" part="list-container"></div>
|
|
14226
14226
|
`;
|
|
14227
|
-
// html += `
|
|
14228
|
-
// <sf-i-events id="statistics-drilldown" name="Statistics" apiid="dwqyez2puoxmu.cloudfront.net/event" exportparts="detail-container" mode="viewer"
|
|
14229
|
-
// apiidtags="${this.apiIdTags}"
|
|
14230
|
-
// apiidusers="${this.apiIdUsers}"
|
|
14231
|
-
// apiidstatutes="${this.apiIdStatutes}"
|
|
14232
|
-
// apiiddefinitions="${this.apiIdDefinitions}"
|
|
14233
|
-
// apiidreportformats="${this.apiidReportformats}"
|
|
14234
|
-
// apiidnotices="${this.apiIdNotices}"
|
|
14235
|
-
// apiidagreements="${this.apiIdAgreements}"
|
|
14236
|
-
// apiidlicenses="${this.apiIdLicenses}" username="${username}"
|
|
14237
|
-
// userprofileid="${userid}" projectid="${this.projectId}"
|
|
14238
|
-
// projectname="${this.projectName}" ${filterString}
|
|
14239
|
-
// myrole="${rolestr}" showregisterexport="false"
|
|
14240
|
-
// features="${this.features.replace(/"/g, """)}"
|
|
14241
|
-
// selectedfeatures="${JSON.stringify(this.selectedFeatures).replace(/"/g, """)}"
|
|
14242
|
-
// eventfielddependencies="${this.eventFieldDependencies.replace(/"/g, """)}"
|
|
14243
|
-
// eventfields="${this.eventFields.replace(/"/g, """)}"
|
|
14244
|
-
// eventpreviewfields="${this.eventPreviewFields.replace(/"/g, """)}"
|
|
14245
|
-
// eventhidefields="${this.eventHideFields.replace(/"/g, """)}"
|
|
14246
|
-
// calendarstartdd="${this.calendarStartDD}" calendarstartmm="${this.calendarStartMM}" calendarstartyyyy="${this.calendarStartYYYY}"
|
|
14247
|
-
// sdate="${this.sdate}" edate="${this.edate}"
|
|
14248
|
-
// flowgraphcompleteness="${this.FLOW_GRAPH_COMPLETENESS}">
|
|
14249
|
-
|
|
14250
|
-
// <div slot="uploader">
|
|
14251
|
-
// <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
|
|
14252
|
-
// allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]"
|
|
14253
|
-
// extract="yes" projectid="${this.projectId}" maxsize="31457280"
|
|
14254
|
-
// allowdownload="yes"></sf-i-uploader>
|
|
14255
|
-
// </div>
|
|
14256
|
-
// <div slot="reporting">
|
|
14257
|
-
// <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
14258
|
-
// </div>
|
|
14259
|
-
|
|
14260
|
-
// </sf-i-events>
|
|
14261
|
-
// `;
|
|
14262
14227
|
(this._SfDetailListContainer as HTMLDivElement).style.display = 'block';
|
|
14263
14228
|
(this._SfDetailListContainer as HTMLDivElement).innerHTML = html;
|
|
14264
14229
|
|
|
14265
|
-
// this.renderRangeEvents(new Date(this.sdate), ((new Date(this.edate).getTime()) - new Date(this.sdate).getTime()) / (1000 * 60 * 60 * 24), (this._SfDetailListContainer as HTMLDivElement).querySelector('.list-container') as HTMLDivElement);
|
|
14266
|
-
|
|
14267
14230
|
const lastDay = ((new Date(this.edate).getTime()) - new Date(this.sdate).getTime()) / (1000 * 60 * 60 * 24)
|
|
14268
14231
|
let firstDay = new Date((new Date(this.sdate)).getFullYear(), (new Date(this.sdate)).getMonth(), (new Date(this.sdate)).getDate());
|
|
14269
14232
|
let endDay = new Date((new Date(this.sdate)).getFullYear(), (new Date(this.sdate)).getMonth(), (new Date(this.sdate)).getDate());
|
|
@@ -14295,13 +14258,175 @@ export class SfIEvents extends LitElement {
|
|
|
14295
14258
|
|
|
14296
14259
|
});
|
|
14297
14260
|
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14261
|
+
const buttonArr = (this._SfDetailListContainer as HTMLDivElement).querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
|
|
14262
|
+
|
|
14263
|
+
for (i = 0; i < buttonArr.length; i++) {
|
|
14264
|
+
let indexPrevNext = i;
|
|
14265
|
+
buttonArr[i].addEventListener('click', (ev: any) => {
|
|
14266
|
+
const id = ev.target.id;
|
|
14267
|
+
const idArr = id.split("-")
|
|
14268
|
+
const mmdd = idArr[3] + "/" + idArr[4];
|
|
14269
|
+
const j = idArr[5];
|
|
14270
|
+
const module = idArr[6];
|
|
14271
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
14272
|
+
if (module === "notice") {
|
|
14273
|
+
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14274
|
+
} else if (module === "contract") {
|
|
14275
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14276
|
+
} else if (module === "license") {
|
|
14277
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14278
|
+
} else if (module === "rcmresource") {
|
|
14279
|
+
this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14280
|
+
} else {
|
|
14281
|
+
let found = false;
|
|
14282
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14283
|
+
console.log('selectedItems', this.selectedItemIds[k], idArr[3] + '-' + idArr[4] + '-' + idArr[5], this.selectedItemIds[k].indexOf(idArr[3] + '-' + idArr[4] + '-' + idArr[5]));
|
|
14284
|
+
if (this.selectedItemIds[k].indexOf(idArr[3] + '-' + idArr[4] + '-' + idArr[5]) >= 0) {
|
|
14285
|
+
found = true;
|
|
14286
|
+
}
|
|
14287
|
+
}
|
|
14288
|
+
if (!found) {
|
|
14289
|
+
this.selectedItemIds = [];
|
|
14290
|
+
this.clearButtonSelection();
|
|
14291
|
+
}
|
|
14292
|
+
|
|
14293
|
+
// (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
|
|
14294
|
+
|
|
14295
|
+
//console.log('commentsinlist', (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement, this.events[mmdd][j].comments, mmdd, j);
|
|
14296
|
+
|
|
14297
|
+
|
|
14298
|
+
let prevString = "";
|
|
14299
|
+
let flagPrev = true;
|
|
14300
|
+
let indexPrev = indexPrevNext
|
|
14301
|
+
while (flagPrev) {
|
|
14302
|
+
if (indexPrev > 0) {
|
|
14303
|
+
if (Util.isVisible((buttonArr[indexPrev - 1] as HTMLButtonElement))) {
|
|
14304
|
+
prevString = (buttonArr[indexPrev - 1] as HTMLButtonElement).id;
|
|
14305
|
+
flagPrev = false;
|
|
14306
|
+
} else {
|
|
14307
|
+
prevString = "";
|
|
14308
|
+
indexPrev--
|
|
14309
|
+
}
|
|
14310
|
+
} else {
|
|
14311
|
+
flagPrev = false;
|
|
14312
|
+
}
|
|
14313
|
+
}
|
|
14314
|
+
let nextString = "";
|
|
14315
|
+
let flagNext = true;
|
|
14316
|
+
let indexNext = indexPrevNext
|
|
14317
|
+
while (flagNext) {
|
|
14318
|
+
if (indexNext < buttonArr.length - 1) {
|
|
14319
|
+
if (Util.isVisible((buttonArr[indexNext + 1] as HTMLButtonElement))) {
|
|
14320
|
+
nextString = (buttonArr[indexNext + 1] as HTMLButtonElement).id;
|
|
14321
|
+
flagNext = false;
|
|
14322
|
+
} else {
|
|
14323
|
+
nextString = "";
|
|
14324
|
+
indexNext++
|
|
14325
|
+
}
|
|
14326
|
+
} else {
|
|
14327
|
+
flagNext = false;
|
|
14328
|
+
}
|
|
14329
|
+
}
|
|
14330
|
+
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
14331
|
+
// console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
|
|
14332
|
+
console.log('previous event clicked', buttonArr[indexPrevNext - 1], prevString, indexPrevNext);
|
|
14333
|
+
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-' + this.currentColumnIndex) as HTMLButtonElement, this._SfStreamContainer as HTMLDivElement, prevString, nextString, false, null, null, null, null, null, null, null, true);
|
|
14334
|
+
}
|
|
14335
|
+
|
|
14336
|
+
})
|
|
14337
|
+
|
|
14338
|
+
}
|
|
14339
|
+
|
|
14340
|
+
const titleArr = (this._SfDetailListContainer as HTMLDivElement).querySelectorAll('.button-event-title') as NodeListOf<HTMLButtonElement>;
|
|
14341
|
+
|
|
14342
|
+
for (var i = 0; i < titleArr.length; i++) {
|
|
14343
|
+
let indexPrevNext = i;
|
|
14344
|
+
titleArr[i].addEventListener('click', (ev: any) => {
|
|
14345
|
+
|
|
14346
|
+
const id = ev.target.id;
|
|
14347
|
+
const idArr = id.split("-")
|
|
14348
|
+
const mmdd = idArr[3] + "/" + idArr[4];
|
|
14349
|
+
const j = idArr[5];
|
|
14350
|
+
const module = idArr[6];
|
|
14351
|
+
const flag = idArr[7];
|
|
14352
|
+
if (flag != null && flag == "reportedlocations") {
|
|
14353
|
+
return;
|
|
14354
|
+
}
|
|
14355
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
14356
|
+
if (module === "notice") {
|
|
14357
|
+
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14358
|
+
} else if (module === "contract") {
|
|
14359
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14360
|
+
} else if (module === "license") {
|
|
14361
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14362
|
+
} else if (module === "rcmresource") {
|
|
14363
|
+
this.fetchRCMResourceDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
14364
|
+
} else {
|
|
14365
|
+
let found = false;
|
|
14366
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14367
|
+
if (this.selectedItemIds[k].indexOf(idArr[3] + '-' + idArr[4] + '-' + idArr[5]) >= 0) {
|
|
14368
|
+
found = true;
|
|
14369
|
+
}
|
|
14370
|
+
}
|
|
14371
|
+
if (!found) {
|
|
14372
|
+
this.selectedItemIds = [];
|
|
14373
|
+
this.selectedItems = [];
|
|
14374
|
+
this.clearButtonSelection();
|
|
14375
|
+
}
|
|
14376
|
+
|
|
14377
|
+
// (this._SfDetailContainer as HTMLDivElement).style.display = 'block'
|
|
14378
|
+
|
|
14379
|
+
|
|
14380
|
+
let prevString = "";
|
|
14381
|
+
let flagPrev = true;
|
|
14382
|
+
let indexPrev = indexPrevNext
|
|
14383
|
+
while (flagPrev) {
|
|
14384
|
+
if (indexPrev > 0) {
|
|
14385
|
+
if (Util.isVisible((titleArr[indexPrev - 1] as HTMLButtonElement))) {
|
|
14386
|
+
prevString = (titleArr[indexPrev - 1] as HTMLButtonElement).id;
|
|
14387
|
+
let prevIdArr = prevString.split("-")
|
|
14388
|
+
if ((prevIdArr[7] ?? "") == "reportedlocations") {
|
|
14389
|
+
prevString = "";
|
|
14390
|
+
indexPrev--;
|
|
14391
|
+
} else {
|
|
14392
|
+
flagPrev = false;
|
|
14393
|
+
}
|
|
14394
|
+
} else {
|
|
14395
|
+
prevString = "";
|
|
14396
|
+
indexPrev--;
|
|
14397
|
+
}
|
|
14398
|
+
} else {
|
|
14399
|
+
flagPrev = false;
|
|
14400
|
+
}
|
|
14401
|
+
}
|
|
14402
|
+
let nextString = "";
|
|
14403
|
+
let flagNext = true;
|
|
14404
|
+
let indexNext = indexPrevNext
|
|
14405
|
+
while (flagNext) {
|
|
14406
|
+
if (indexNext < titleArr.length - 1) {
|
|
14407
|
+
if (Util.isVisible((titleArr[indexNext + 1] as HTMLButtonElement))) {
|
|
14408
|
+
nextString = (titleArr[indexNext + 1] as HTMLButtonElement).id;
|
|
14409
|
+
let nextIdArr = nextString.split("-")
|
|
14410
|
+
if ((nextIdArr[7] ?? "") == "reportedlocations") {
|
|
14411
|
+
nextString = "";
|
|
14412
|
+
indexNext++;
|
|
14413
|
+
} else {
|
|
14414
|
+
flagNext = false;
|
|
14415
|
+
}
|
|
14416
|
+
} else {
|
|
14417
|
+
indexNext++;
|
|
14418
|
+
}
|
|
14419
|
+
} else {
|
|
14420
|
+
flagNext = false;
|
|
14421
|
+
}
|
|
14422
|
+
}
|
|
14423
|
+
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, null);
|
|
14424
|
+
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, null, (this._SfStreamContainer as HTMLDivElement), prevString, nextString, false, null, null, null, null, null, null, null, true);
|
|
14425
|
+
}
|
|
14426
|
+
})
|
|
14427
|
+
|
|
14428
|
+
}
|
|
14429
|
+
|
|
14305
14430
|
}
|
|
14306
14431
|
renderEventDetailShort = (compliance: any) => {
|
|
14307
14432
|
var html = `
|
|
@@ -18049,7 +18174,7 @@ export class SfIEvents extends LitElement {
|
|
|
18049
18174
|
}
|
|
18050
18175
|
}
|
|
18051
18176
|
|
|
18052
|
-
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string = "", nextId: string = "", flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null, reportercomments: string | null = null, approvercomments: string | null = null, inputReportingPercentage: string | null = null, selectReportedLocation: string | null = null, documents: any | null = null, dateOfCompletion: string | null = null) => {
|
|
18177
|
+
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string = "", nextId: string = "", flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null, reportercomments: string | null = null, approvercomments: string | null = null, inputReportingPercentage: string | null = null, selectReportedLocation: string | null = null, documents: any | null = null, dateOfCompletion: string | null = null, fromDrilldown: boolean = false) => {
|
|
18053
18178
|
console.log('listEvent', listEvent, listEvent.id)
|
|
18054
18179
|
let url = "https://" + this.apiId + "/getalleventdetails";
|
|
18055
18180
|
|
|
@@ -18091,7 +18216,7 @@ export class SfIEvents extends LitElement {
|
|
|
18091
18216
|
this.renderListReporting(listEventContainer, data, mmddyyyy, eventsContainer)
|
|
18092
18217
|
}
|
|
18093
18218
|
} else {
|
|
18094
|
-
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId);
|
|
18219
|
+
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer, previousId, nextId, fromDrilldown);
|
|
18095
18220
|
}
|
|
18096
18221
|
|
|
18097
18222
|
} else {
|
|
@@ -18113,7 +18238,7 @@ export class SfIEvents extends LitElement {
|
|
|
18113
18238
|
}
|
|
18114
18239
|
}
|
|
18115
18240
|
|
|
18116
|
-
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string, nextId: string) => {
|
|
18241
|
+
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string, nextId: string, fromDrilldown: boolean) => {
|
|
18117
18242
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
18118
18243
|
console.log('previousid', previousId, 'nextid', nextId);
|
|
18119
18244
|
console.log('confighome', Util.getProjectConfigHome())
|
|
@@ -18473,7 +18598,7 @@ export class SfIEvents extends LitElement {
|
|
|
18473
18598
|
html += '</div>';
|
|
18474
18599
|
|
|
18475
18600
|
if (this.mode == "consumer" || this.mode == "next" || this.mode == "viewer") {
|
|
18476
|
-
if (this.mode != "viewer") {
|
|
18601
|
+
if (this.mode != "viewer" && !fromDrilldown) {
|
|
18477
18602
|
html += '<div part="reporting-view-container" id="reporting-view-container">'
|
|
18478
18603
|
html += this.renderReporting(event, mmddyyyy);
|
|
18479
18604
|
html += "</div>"
|
|
@@ -22462,7 +22587,21 @@ export class SfIEvents extends LitElement {
|
|
|
22462
22587
|
|
|
22463
22588
|
}
|
|
22464
22589
|
|
|
22465
|
-
|
|
22590
|
+
getAllPastFiscals = (startDate: Date) => {
|
|
22591
|
+
let retArr = []
|
|
22592
|
+
let date = new Date()
|
|
22593
|
+
while (date.getTime() > startDate.getTime()) {
|
|
22594
|
+
if (date.getMonth() < 3) {
|
|
22595
|
+
retArr.push(date.getFullYear() - 1)
|
|
22596
|
+
} else {
|
|
22597
|
+
retArr.push(date.getFullYear())
|
|
22598
|
+
}
|
|
22599
|
+
date.setFullYear(date.getFullYear() - 1)
|
|
22600
|
+
}
|
|
22601
|
+
return retArr;
|
|
22602
|
+
}
|
|
22603
|
+
|
|
22604
|
+
renderOnboardingSuspense = (sourceArray: any, suspenseList: any, year: string) => {
|
|
22466
22605
|
|
|
22467
22606
|
console.log('sourceList', sourceArray);
|
|
22468
22607
|
console.log('suspenseList', suspenseList);
|
|
@@ -22492,8 +22631,13 @@ export class SfIEvents extends LitElement {
|
|
|
22492
22631
|
changed++;
|
|
22493
22632
|
}
|
|
22494
22633
|
}
|
|
22495
|
-
|
|
22496
|
-
|
|
22634
|
+
let pastFiscals = [parseInt(this.getCurrentYearGeneric())]
|
|
22635
|
+
if(this.contractStartDate != null) {
|
|
22636
|
+
pastFiscals = this.getAllPastFiscals(new Date(this.contractStartDate));
|
|
22637
|
+
}
|
|
22638
|
+
html += (`<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="mapped-stats-title" part="results-title" class="d-flex align-center m-0">${status} ${tagged} in Suspense List out of ${sourceArray.data.mappings.mappings.length}</h4><h6 class="ml-20" part="onboarding-suspense-year-label">Year</h6><select id="select-year" part="input">${pastFiscals.map((fiscal) => {
|
|
22639
|
+
return `<option value="${fiscal}"${fiscal == parseInt(year) ? " selected" : ""}>${fiscal}-${(fiscal % 100) + 1}</option>`
|
|
22640
|
+
})}</select></div>`);
|
|
22497
22641
|
|
|
22498
22642
|
|
|
22499
22643
|
if (changed > 0) {
|
|
@@ -22646,6 +22790,11 @@ export class SfIEvents extends LitElement {
|
|
|
22646
22790
|
html += '</div>';
|
|
22647
22791
|
|
|
22648
22792
|
(this._SfOnboardingSuspenseContainer as HTMLDivElement).innerHTML = html;
|
|
22793
|
+
const inputYear = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('#select-year') as HTMLSelectElement;
|
|
22794
|
+
inputYear.addEventListener('change', (e: any) => {
|
|
22795
|
+
const selectedYear = e.currentTarget.value;
|
|
22796
|
+
this.loadOnboardingSuspense(selectedYear);
|
|
22797
|
+
})
|
|
22649
22798
|
|
|
22650
22799
|
const buttonApply = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
|
|
22651
22800
|
buttonApply.addEventListener('click', () => {
|
|
@@ -22659,15 +22808,15 @@ export class SfIEvents extends LitElement {
|
|
|
22659
22808
|
tempSuspenseList[suspenseKey] = true
|
|
22660
22809
|
}
|
|
22661
22810
|
}
|
|
22662
|
-
this.renderOnboardingSuspense(sourceArray, tempSuspenseList)
|
|
22811
|
+
this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year)
|
|
22663
22812
|
})
|
|
22664
22813
|
|
|
22665
22814
|
const buttonSave = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
|
|
22666
22815
|
buttonSave.addEventListener('click', async () => {
|
|
22667
22816
|
console.log('saving suspense', suspenseList, Object.keys(suspenseList).length);
|
|
22668
|
-
let response = await this.uploadMappedSuspense(suspenseList)
|
|
22817
|
+
let response = await this.uploadMappedSuspense(suspenseList, year)
|
|
22669
22818
|
console.log('suspense save response', response);
|
|
22670
|
-
this.loadOnboardingSuspense()
|
|
22819
|
+
this.loadOnboardingSuspense(year)
|
|
22671
22820
|
})
|
|
22672
22821
|
|
|
22673
22822
|
const buttonToggleMoreBack = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-toggle-more-back') as HTMLButtonElement;
|
|
@@ -22701,6 +22850,9 @@ export class SfIEvents extends LitElement {
|
|
|
22701
22850
|
tempCsvObj['cols_' + colKey] = dataArr[j]
|
|
22702
22851
|
}
|
|
22703
22852
|
}
|
|
22853
|
+
let suspenseKey = tempCsvObj.entityid + ';' + tempCsvObj.locationid + ';' + tempCsvObj.id;
|
|
22854
|
+
tempCsvObj.suspense = (suspenseList[suspenseKey] != null && suspenseList[suspenseKey] != false) ? true : false;
|
|
22855
|
+
|
|
22704
22856
|
csvArray[i] = tempCsvObj
|
|
22705
22857
|
}
|
|
22706
22858
|
console.log('csv array', csvArray)
|
|
@@ -22751,7 +22903,7 @@ export class SfIEvents extends LitElement {
|
|
|
22751
22903
|
},
|
|
22752
22904
|
() => {
|
|
22753
22905
|
this.clearMessages();
|
|
22754
|
-
this.renderOnboardingSuspense(sourceArray, tempSuspenseList);
|
|
22906
|
+
this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year);
|
|
22755
22907
|
}
|
|
22756
22908
|
])
|
|
22757
22909
|
// let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
|
|
@@ -28028,7 +28180,7 @@ export class SfIEvents extends LitElement {
|
|
|
28028
28180
|
await this.uploadOnboardingMapping(data, 'countries');
|
|
28029
28181
|
}
|
|
28030
28182
|
|
|
28031
|
-
uploadMappedSuspense = async (data: any) => {
|
|
28183
|
+
uploadMappedSuspense = async (data: any, year: string) => {
|
|
28032
28184
|
|
|
28033
28185
|
//console.log('uploading..', data);
|
|
28034
28186
|
|
|
@@ -28037,6 +28189,7 @@ export class SfIEvents extends LitElement {
|
|
|
28037
28189
|
const body = {
|
|
28038
28190
|
"projectid": this.projectId,
|
|
28039
28191
|
"data": JSON.stringify(data),
|
|
28192
|
+
"year": year
|
|
28040
28193
|
}
|
|
28041
28194
|
|
|
28042
28195
|
let authorization: any = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
@@ -30102,11 +30255,13 @@ export class SfIEvents extends LitElement {
|
|
|
30102
30255
|
}
|
|
30103
30256
|
}
|
|
30104
30257
|
|
|
30105
|
-
fetchSuspenseList = async () => {
|
|
30258
|
+
fetchSuspenseList = async (year: string = "") => {
|
|
30106
30259
|
|
|
30107
30260
|
let url = "https://" + this.apiId + "/getsuspenselist1";
|
|
30108
30261
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
30109
|
-
|
|
30262
|
+
if (year == "") {
|
|
30263
|
+
year = this.getCurrentYearGeneric();
|
|
30264
|
+
}
|
|
30110
30265
|
const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "year": year }, url, this._SfLoader, authorization)) as any;
|
|
30111
30266
|
this._SfLoader.innerHTML = '';
|
|
30112
30267
|
if (xhr.status == 200) {
|
|
@@ -30816,7 +30971,7 @@ export class SfIEvents extends LitElement {
|
|
|
30816
30971
|
this.edate = endDate;
|
|
30817
30972
|
|
|
30818
30973
|
|
|
30819
|
-
path = "
|
|
30974
|
+
path = "getstatistics1";
|
|
30820
30975
|
|
|
30821
30976
|
let sDate = "";
|
|
30822
30977
|
let eDate = "";
|
|
@@ -32047,15 +32202,15 @@ export class SfIEvents extends LitElement {
|
|
|
32047
32202
|
|
|
32048
32203
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
32049
32204
|
console.log('this.myroles', this.myroles)
|
|
32050
|
-
const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId }, url, this._SfLoader, authorization)) as any;
|
|
32205
|
+
const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId, "year": this.calendarStartYYYY }, url, this._SfLoader, authorization)) as any;
|
|
32051
32206
|
this._SfLoader.innerHTML = '';
|
|
32052
32207
|
if (xhr.status == 200) {
|
|
32053
32208
|
|
|
32054
32209
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
32055
32210
|
let arrReports = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
32056
32211
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
|
|
32057
|
-
console.log('reports response', arrReports);
|
|
32058
|
-
console.log('report', arrReports
|
|
32212
|
+
console.log('reports response', Object.keys(arrReports).length);
|
|
32213
|
+
console.log('report', arrReports);
|
|
32059
32214
|
this.renderReports(arrReports)
|
|
32060
32215
|
} else {
|
|
32061
32216
|
if (xhr.status == 401) {
|
|
@@ -32094,6 +32249,7 @@ export class SfIEvents extends LitElement {
|
|
|
32094
32249
|
html += '<th part="td-head">Comments</th>'
|
|
32095
32250
|
html += '<th part="td-head">LastUpdated</th>'
|
|
32096
32251
|
html += '<th part="td-head">CompletionDate</th>'
|
|
32252
|
+
html += '<th part="td-head">Location</th>'
|
|
32097
32253
|
html += '<th part="td-head">Compliance</th>'
|
|
32098
32254
|
html += '</tr>';
|
|
32099
32255
|
|
|
@@ -32105,25 +32261,31 @@ export class SfIEvents extends LitElement {
|
|
|
32105
32261
|
html += `<td part="td-body">${report['comments'].length}</td>`;
|
|
32106
32262
|
html += `<td part="td-body">${Util.getDateTimeStrings(new Date(report['lastupdated']).getTime())}</td>`;
|
|
32107
32263
|
html += `<td part="td-body">${new Date(parseInt(report['dateofcompletion'])).toLocaleDateString('en-US', { timeZone: 'Asia/Kolkata' })}</td>`;
|
|
32108
|
-
|
|
32109
|
-
|
|
32110
|
-
// const jsonReportEvent = JSON.parse(report['comments'].reportevent);
|
|
32111
|
-
console.log('jsonReportEvent', report['event']);
|
|
32264
|
+
let locationname = ""
|
|
32265
|
+
let eventHtml = ""
|
|
32112
32266
|
if (report['event'] != null) {
|
|
32113
|
-
|
|
32114
|
-
html += '<tr>';
|
|
32267
|
+
locationname = JSON.parse(report['event'])['locationname'] ?? "";
|
|
32115
32268
|
for (var i = 0; i < Object.keys(JSON.parse(report['event'])).length; i++) {
|
|
32116
|
-
|
|
32117
32269
|
if (!this.EXCLUDE_COLS_FROM_REGS.includes(Object.keys(JSON.parse(report['event']))[i].toLowerCase())) {
|
|
32118
32270
|
|
|
32119
|
-
|
|
32120
|
-
|
|
32121
|
-
|
|
32122
|
-
|
|
32271
|
+
eventHtml += '<td part="td-body-register">';
|
|
32272
|
+
eventHtml += ('<span part="td-head" style="padding-left: 0px !important">' + Object.keys(JSON.parse(report['event']))[i] + '</span>');
|
|
32273
|
+
eventHtml += ('<span part="td-body"><sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(report['event'])[Object.keys(JSON.parse(report['event']))[i]] + '" lineSize="4" minLength="60"></sf-i-elastic-text>' + '</span>');
|
|
32274
|
+
eventHtml += '</td>';
|
|
32123
32275
|
|
|
32124
32276
|
}
|
|
32125
32277
|
|
|
32126
32278
|
}
|
|
32279
|
+
}
|
|
32280
|
+
html += `<td part="td-body">${locationname}</td>`;
|
|
32281
|
+
html += '<th part="td-head">';
|
|
32282
|
+
|
|
32283
|
+
// const jsonReportEvent = JSON.parse(report['comments'].reportevent);
|
|
32284
|
+
// console.log('jsonReportEvent', report['event']);
|
|
32285
|
+
if (report['event'] != null) {
|
|
32286
|
+
html += '<table>';
|
|
32287
|
+
html += '<tr>';
|
|
32288
|
+
html += eventHtml;
|
|
32127
32289
|
html += '</tr>';
|
|
32128
32290
|
html += '</table>';
|
|
32129
32291
|
}
|
|
@@ -32268,15 +32430,42 @@ export class SfIEvents extends LitElement {
|
|
|
32268
32430
|
html += '<button id="button-reports-date-selector-back" part="button-icon" class="button-icon"><span class="material-icons">keyboard_backspace</span></button>'
|
|
32269
32431
|
html += '</div>'
|
|
32270
32432
|
html += '<label part="input-label" class="mt-20">Select Date</label>'
|
|
32271
|
-
html +=
|
|
32433
|
+
html += `<input id="input-compliance-date" part="input-text" class="input-text mb-20" type="date" />`
|
|
32434
|
+
html += `<sf-i-form id="input-location-tags" name="Tags" label="Select Location" apiId="${this.apiIdTags}" mode="select" searchPhrase="${this.projectName}&Location" selectProjection="name" ignoreProjections="["updatetype","project","tagtype","shortid","shortnumid","lastmodifiedby","lastmodifiedtime"]" mandatory></sf-i-form>`
|
|
32272
32435
|
// html += '<button id="button-reports-date-selector-back" class="button-back" part="button">back</button>';
|
|
32273
32436
|
html += '</div>';
|
|
32274
32437
|
(this._SfIEventsC.querySelector('#reports-data') as HTMLDivElement).innerHTML = html;
|
|
32275
32438
|
let inputComplianceDate = (this._SfIEventsC.querySelector('#input-compliance-date') as HTMLInputElement)
|
|
32439
|
+
let inputLocationForm = (this._SfIEventsC.querySelector('#input-location-tags') as SfIForm);
|
|
32440
|
+
|
|
32276
32441
|
inputComplianceDate.addEventListener('change', (ev: any) => {
|
|
32277
32442
|
let selectedDate = new Date((ev.target as HTMLInputElement).value)
|
|
32278
|
-
|
|
32443
|
+
let selectedLocation = inputLocationForm.selectedValues()[0];
|
|
32444
|
+
if (selectedLocation == null || selectedLocation == '') {
|
|
32445
|
+
return;
|
|
32446
|
+
// let locationId = sortid.split(';')[2]
|
|
32447
|
+
// selectedLocation = locationId;
|
|
32448
|
+
}
|
|
32449
|
+
this.fetchReportCompliances(selectedDate, selectedLocation, sortid)
|
|
32279
32450
|
})
|
|
32451
|
+
let locationId = sortid.split(';')[2]
|
|
32452
|
+
inputLocationForm.selectedSearchId = locationId;
|
|
32453
|
+
inputLocationForm.loadMode();
|
|
32454
|
+
inputLocationForm.addEventListener('valueChanged', (ev: any) => {
|
|
32455
|
+
let form = ev.target as SfIForm
|
|
32456
|
+
let selectedDate = new Date((inputComplianceDate as HTMLInputElement).value)
|
|
32457
|
+
if (selectedDate.toString() == 'Invalid Date') {
|
|
32458
|
+
return;
|
|
32459
|
+
// let mmddyyyy = sortid.split(';')[0];
|
|
32460
|
+
// let mm = mmddyyyy.split('/')[0];
|
|
32461
|
+
// let dd = mmddyyyy.split('/')[1];
|
|
32462
|
+
// let yyyy = mmddyyyy.split('/')[2];
|
|
32463
|
+
// selectedDate = new Date(parseInt(yyyy), parseInt(mm) - 1, parseInt(dd));
|
|
32464
|
+
}
|
|
32465
|
+
let selectedLocation = form.selectedValues()[0];
|
|
32466
|
+
this.fetchReportCompliances(selectedDate, selectedLocation, sortid)
|
|
32467
|
+
})
|
|
32468
|
+
|
|
32280
32469
|
let buttonBack = (this._SfIEventsC.querySelector('#button-reports-date-selector-back') as HTMLButtonElement)
|
|
32281
32470
|
buttonBack.addEventListener('click', () => {
|
|
32282
32471
|
this.fetchReports()
|
|
@@ -32284,10 +32473,10 @@ export class SfIEvents extends LitElement {
|
|
|
32284
32473
|
|
|
32285
32474
|
}
|
|
32286
32475
|
|
|
32287
|
-
fetchReportCompliances = async (selectedDate: Date, sortid: string) => {
|
|
32476
|
+
fetchReportCompliances = async (selectedDate: Date, locationid: string, sortid: string) => {
|
|
32288
32477
|
console.log('fetching compliances', sortid)
|
|
32289
32478
|
let complianceEntityId = sortid.split(';')[1]
|
|
32290
|
-
let complianceLocationId = sortid.split(';')[2]
|
|
32479
|
+
// let complianceLocationId = sortid.split(';')[2]
|
|
32291
32480
|
let url = "https://" + this.apiId + "/getallcountryevents5";
|
|
32292
32481
|
let sDateObj = selectedDate
|
|
32293
32482
|
sDateObj.setDate(selectedDate.getDate() - 60)
|
|
@@ -32310,7 +32499,7 @@ export class SfIEvents extends LitElement {
|
|
|
32310
32499
|
day = '0' + day;
|
|
32311
32500
|
let eDate = month + "/" + day + "/" + year
|
|
32312
32501
|
//console.log('fetch calendar url', url);
|
|
32313
|
-
let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid":
|
|
32502
|
+
let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": locationid, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
|
|
32314
32503
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
32315
32504
|
const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
|
|
32316
32505
|
this._SfLoader.innerHTML = '';
|
|
@@ -32321,7 +32510,7 @@ export class SfIEvents extends LitElement {
|
|
|
32321
32510
|
let arrCompliances = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
32322
32511
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
|
|
32323
32512
|
console.log('receivedCompliacnes', arrCompliances)
|
|
32324
|
-
this.
|
|
32513
|
+
this.renderReportsCompliances(arrCompliances, sortid);
|
|
32325
32514
|
} else {
|
|
32326
32515
|
if (xhr.status == 401) {
|
|
32327
32516
|
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
@@ -32344,7 +32533,7 @@ export class SfIEvents extends LitElement {
|
|
|
32344
32533
|
}
|
|
32345
32534
|
}
|
|
32346
32535
|
|
|
32347
|
-
|
|
32536
|
+
renderReportsCompliances = (compliancesData: any, sortid: string) => {
|
|
32348
32537
|
let eventsData: any = {}
|
|
32349
32538
|
let complianceId = sortid.split(';')[3]
|
|
32350
32539
|
console.log('renderReportsComplainces', compliancesData, complianceId);
|