sf-i-events 1.0.765 → 1.0.767
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 +2 -2
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -0
- package/sf-i-events.js +156 -85
- package/src/sf-i-events.ts +152 -85
package/dev/index.html
CHANGED
|
@@ -631,10 +631,10 @@
|
|
|
631
631
|
<!-- <sf-i-events projectid="c7d18a84-c2df-4dc2-b75f-5820549f5e5c" projectname="Chitale" mode="onboarding" locations="{"India":{"Maharashtra":["Reg_Offce","SHRIKRISHNA","SHEDNO25","SHEDNO31","SHEDNO44","CBM_SADAN","RANJE_CBM","ISHITA_TOWER","CBM_ANAND","CBM_SADAN_WH","CBM_ANAND_SHED25","CBM_KATRAJ","CBM_KHADKI","CBM_PANVEL","CBM_NAGPUR","CBM_ISHITA","Dugdhalaya","ExpressStores_MH","FranchiseStore_MH"],"Goa":["ExpressStores_Goa"]},"United States of America":{"USA":["North_Carolina"]}}" contractstartdate="01/04/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
|
|
632
632
|
|
|
633
633
|
</sf-i-events> -->
|
|
634
|
-
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="
|
|
634
|
+
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Chief Compliance Officer" userprofileid="5fe96caa-1a44-4a2d-921a-920d29433eca" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="functionhead" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
|
|
635
635
|
|
|
636
636
|
<div slot="uploader">
|
|
637
|
-
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="
|
|
637
|
+
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
638
638
|
</div>
|
|
639
639
|
<div slot="reporting">
|
|
640
640
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -711,6 +711,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
711
711
|
uploadAudit: (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module?: string) => Promise<void>;
|
|
712
712
|
uploadAuditsBulk: (bulkBody: any) => Promise<void>;
|
|
713
713
|
uploadReview: (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module?: string) => Promise<void>;
|
|
714
|
+
uploadReportsReviewsBulk: (bulkBody: any) => Promise<void>;
|
|
714
715
|
uploadReviewsBulk: (bulkBody: any) => Promise<void>;
|
|
715
716
|
uploadReport: (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues?: string, reportformatschema?: string, module?: string) => Promise<void>;
|
|
716
717
|
uploadReportsBulk: (bulkBody: any) => Promise<void>;
|
package/sf-i-events.js
CHANGED
|
@@ -3445,37 +3445,23 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3445
3445
|
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
3446
3446
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
3447
3447
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
3448
|
-
bulkBody.push({
|
|
3449
|
-
"mmddyyyy": mmddyyyy,
|
|
3450
|
-
"projectid": this.projectId,
|
|
3451
|
-
"type": "report",
|
|
3452
|
-
"eventid": eventId,
|
|
3453
|
-
"comments": reportercomments,
|
|
3454
|
-
"dateofcompletion": reporterdoc,
|
|
3455
|
-
"entityid": entityId,
|
|
3456
|
-
"locationid": locationId,
|
|
3457
|
-
"event": null,
|
|
3458
|
-
"docs": JSON.stringify(docs),
|
|
3459
|
-
"username": this.userName,
|
|
3460
|
-
"reportformatvalues": reportformatvalues,
|
|
3461
|
-
"reportformatschema": reportformatschema,
|
|
3462
|
-
"userid": this.userProfileId,
|
|
3463
|
-
"userrole": this.myRole,
|
|
3464
|
-
"year": this.calendarStartYYYY,
|
|
3465
|
-
"module": event.isnotice != null ? "notices" : "events"
|
|
3466
|
-
});
|
|
3467
3448
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
3468
3449
|
if (parseInt(makercheckersL) > 0) {
|
|
3469
3450
|
bulkBodyReview.push({
|
|
3470
3451
|
"mmddyyyy": mmddyyyy,
|
|
3471
3452
|
"projectid": this.projectId,
|
|
3472
|
-
"type": "
|
|
3453
|
+
"type": "report",
|
|
3473
3454
|
"eventid": eventId,
|
|
3474
|
-
"comments":
|
|
3475
|
-
"
|
|
3455
|
+
"comments": reportercomments,
|
|
3456
|
+
"dateofcompletion": reporterdoc,
|
|
3476
3457
|
"entityid": entityId,
|
|
3477
3458
|
"locationid": locationId,
|
|
3459
|
+
"event": null,
|
|
3460
|
+
"docs": JSON.stringify(docs),
|
|
3461
|
+
"approved": true,
|
|
3478
3462
|
"username": this.userName,
|
|
3463
|
+
"reportformatvalues": reportformatvalues,
|
|
3464
|
+
"reportformatschema": reportformatschema,
|
|
3479
3465
|
"userid": this.userProfileId,
|
|
3480
3466
|
"userrole": this.myRole,
|
|
3481
3467
|
"year": this.calendarStartYYYY,
|
|
@@ -3483,14 +3469,38 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3483
3469
|
});
|
|
3484
3470
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
3485
3471
|
}
|
|
3472
|
+
else {
|
|
3473
|
+
bulkBody.push({
|
|
3474
|
+
"mmddyyyy": mmddyyyy,
|
|
3475
|
+
"projectid": this.projectId,
|
|
3476
|
+
"type": "report",
|
|
3477
|
+
"eventid": eventId,
|
|
3478
|
+
"comments": reportercomments,
|
|
3479
|
+
"dateofcompletion": reporterdoc,
|
|
3480
|
+
"entityid": entityId,
|
|
3481
|
+
"locationid": locationId,
|
|
3482
|
+
"event": null,
|
|
3483
|
+
"docs": JSON.stringify(docs),
|
|
3484
|
+
"username": this.userName,
|
|
3485
|
+
"reportformatvalues": reportformatvalues,
|
|
3486
|
+
"reportformatschema": reportformatschema,
|
|
3487
|
+
"userid": this.userProfileId,
|
|
3488
|
+
"userrole": this.myRole,
|
|
3489
|
+
"year": this.calendarStartYYYY,
|
|
3490
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3486
3493
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
3487
3494
|
// await this.sleep(2000);
|
|
3488
3495
|
// this.clearMessages();
|
|
3489
3496
|
}
|
|
3490
|
-
await this.uploadReportsBulk(bulkBody);
|
|
3497
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
3491
3498
|
// await this.fetchBulkReportingData();
|
|
3499
|
+
if (bulkBody.length > 0) {
|
|
3500
|
+
await this.uploadReportsBulk(bulkBody);
|
|
3501
|
+
}
|
|
3492
3502
|
if (bulkBodyReview.length > 0) {
|
|
3493
|
-
await this.
|
|
3503
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview);
|
|
3494
3504
|
}
|
|
3495
3505
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
3496
3506
|
const selectedId = this.selectedItemIds[k];
|
|
@@ -6503,15 +6513,19 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6503
6513
|
(_g = this._SfCustomContainer.querySelector('#button-year-to-date')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
|
|
6504
6514
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6505
6515
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6506
|
-
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
6507
|
-
|
|
6516
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6517
|
+
;
|
|
6518
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6519
|
+
;
|
|
6508
6520
|
this.processDateSelection(this._SfCustomContainer);
|
|
6509
6521
|
});
|
|
6510
6522
|
(_h = this._SfCustomContainer.querySelector('#button-year-to-date-mobile')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
|
|
6511
6523
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6512
6524
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6513
|
-
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
6514
|
-
|
|
6525
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6526
|
+
;
|
|
6527
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6528
|
+
;
|
|
6515
6529
|
this.processDateSelection(this._SfCustomContainer);
|
|
6516
6530
|
});
|
|
6517
6531
|
(_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
|
|
@@ -6545,7 +6559,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6545
6559
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6546
6560
|
}
|
|
6547
6561
|
else {
|
|
6548
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
6562
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6549
6563
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
6550
6564
|
}
|
|
6551
6565
|
this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
|
|
@@ -6571,7 +6585,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6571
6585
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6572
6586
|
}
|
|
6573
6587
|
else {
|
|
6574
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
6588
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6575
6589
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
6576
6590
|
}
|
|
6577
6591
|
this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
|
|
@@ -6678,15 +6692,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6678
6692
|
(_g = this._SfCustomContainer.querySelector('#button-year-to-date')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
|
|
6679
6693
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6680
6694
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6681
|
-
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
6682
|
-
this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
6695
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6696
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6683
6697
|
this.processDateSelectionViewer(this._SfCustomContainer);
|
|
6684
6698
|
});
|
|
6685
6699
|
(_h = this._SfCustomContainer.querySelector('#button-year-to-date-mobile')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
|
|
6686
6700
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6687
6701
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
6688
|
-
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
6689
|
-
|
|
6702
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6703
|
+
;
|
|
6704
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
6705
|
+
;
|
|
6690
6706
|
this.processDateSelectionViewer(this._SfCustomContainer);
|
|
6691
6707
|
});
|
|
6692
6708
|
(_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
|
|
@@ -6720,7 +6736,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6720
6736
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6721
6737
|
}
|
|
6722
6738
|
else {
|
|
6723
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
6739
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6724
6740
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
6725
6741
|
}
|
|
6726
6742
|
this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
|
|
@@ -6746,7 +6762,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6746
6762
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6747
6763
|
}
|
|
6748
6764
|
else {
|
|
6749
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
6765
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
6750
6766
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
6751
6767
|
}
|
|
6752
6768
|
this._SfCustomContainer.querySelector('#stream-start-date').value = startDate;
|
|
@@ -8735,37 +8751,23 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8735
8751
|
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
8736
8752
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
8737
8753
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
8738
|
-
bulkBody.push({
|
|
8739
|
-
"mmddyyyy": mmddyyyy,
|
|
8740
|
-
"projectid": this.projectId,
|
|
8741
|
-
"type": "report",
|
|
8742
|
-
"eventid": eventId,
|
|
8743
|
-
"comments": reportercomments,
|
|
8744
|
-
"dateofcompletion": reporterdoc,
|
|
8745
|
-
"entityid": entityId,
|
|
8746
|
-
"locationid": locationId,
|
|
8747
|
-
"event": null,
|
|
8748
|
-
"docs": JSON.stringify(docs),
|
|
8749
|
-
"username": this.userName,
|
|
8750
|
-
"reportformatvalues": reportformatvalues,
|
|
8751
|
-
"reportformatschema": reportformatschema,
|
|
8752
|
-
"userid": this.userProfileId,
|
|
8753
|
-
"userrole": this.myRole,
|
|
8754
|
-
"year": this.calendarStartYYYY,
|
|
8755
|
-
"module": listEvent.isnotice != null ? "notices" : "events"
|
|
8756
|
-
});
|
|
8757
8754
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
8758
8755
|
if (parseInt(makercheckersL) > 0) {
|
|
8759
8756
|
bulkBodyReview.push({
|
|
8760
8757
|
"mmddyyyy": mmddyyyy,
|
|
8761
8758
|
"projectid": this.projectId,
|
|
8762
|
-
"type": "
|
|
8759
|
+
"type": "report",
|
|
8763
8760
|
"eventid": eventId,
|
|
8764
|
-
"comments":
|
|
8765
|
-
"
|
|
8761
|
+
"comments": reportercomments,
|
|
8762
|
+
"dateofcompletion": reporterdoc,
|
|
8766
8763
|
"entityid": entityId,
|
|
8767
8764
|
"locationid": locationId,
|
|
8765
|
+
"event": null,
|
|
8766
|
+
"docs": JSON.stringify(docs),
|
|
8767
|
+
"approved": true,
|
|
8768
8768
|
"username": this.userName,
|
|
8769
|
+
"reportformatvalues": reportformatvalues,
|
|
8770
|
+
"reportformatschema": reportformatschema,
|
|
8769
8771
|
"userid": this.userProfileId,
|
|
8770
8772
|
"userrole": this.myRole,
|
|
8771
8773
|
"year": this.calendarStartYYYY,
|
|
@@ -8773,15 +8775,40 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8773
8775
|
});
|
|
8774
8776
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
8775
8777
|
}
|
|
8778
|
+
else {
|
|
8779
|
+
bulkBody.push({
|
|
8780
|
+
"mmddyyyy": mmddyyyy,
|
|
8781
|
+
"projectid": this.projectId,
|
|
8782
|
+
"type": "report",
|
|
8783
|
+
"eventid": eventId,
|
|
8784
|
+
"comments": reportercomments,
|
|
8785
|
+
"dateofcompletion": reporterdoc,
|
|
8786
|
+
"entityid": entityId,
|
|
8787
|
+
"locationid": locationId,
|
|
8788
|
+
"event": null,
|
|
8789
|
+
"docs": JSON.stringify(docs),
|
|
8790
|
+
"username": this.userName,
|
|
8791
|
+
"reportformatvalues": reportformatvalues,
|
|
8792
|
+
"reportformatschema": reportformatschema,
|
|
8793
|
+
"userid": this.userProfileId,
|
|
8794
|
+
"userrole": this.myRole,
|
|
8795
|
+
"year": this.calendarStartYYYY,
|
|
8796
|
+
"module": listEvent.isnotice != null ? "notices" : "events"
|
|
8797
|
+
});
|
|
8798
|
+
}
|
|
8776
8799
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
8777
8800
|
// await this.sleep(2000);
|
|
8778
8801
|
// this.clearMessages();
|
|
8779
8802
|
}
|
|
8780
|
-
await this.uploadReportsBulk(bulkBody);
|
|
8781
|
-
await this.fetchBulkReportingData();
|
|
8803
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
8804
|
+
// await this.fetchBulkReportingData();
|
|
8805
|
+
if (bulkBody.length > 0) {
|
|
8806
|
+
await this.uploadReportsBulk(bulkBody);
|
|
8807
|
+
}
|
|
8782
8808
|
if (bulkBodyReview.length > 0) {
|
|
8783
|
-
await this.
|
|
8809
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview);
|
|
8784
8810
|
}
|
|
8811
|
+
await this.fetchBulkReportingData();
|
|
8785
8812
|
console.log('uploadReport bulk');
|
|
8786
8813
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
8787
8814
|
const selectedId = this.selectedItemIds[k];
|
|
@@ -9813,37 +9840,42 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9813
9840
|
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
9814
9841
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
9815
9842
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
9816
|
-
bulkBody.push({
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
})
|
|
9843
|
+
// bulkBody.push({
|
|
9844
|
+
// "mmddyyyy": mmddyyyy,
|
|
9845
|
+
// "projectid": this.projectId,
|
|
9846
|
+
// "type": "report",
|
|
9847
|
+
// "eventid": eventId,
|
|
9848
|
+
// "comments": reportercomments,
|
|
9849
|
+
// "dateofcompletion": reporterdoc,
|
|
9850
|
+
// "entityid": entityId,
|
|
9851
|
+
// "locationid": locationId,
|
|
9852
|
+
// "event": null,
|
|
9853
|
+
// "docs": JSON.stringify(docs),
|
|
9854
|
+
// "username": this.userName,
|
|
9855
|
+
// "reportformatvalues": reportformatvalues,
|
|
9856
|
+
// "reportformatschema": reportformatschema,
|
|
9857
|
+
// "userid": this.userProfileId,
|
|
9858
|
+
// "userrole": this.myRole,
|
|
9859
|
+
// "year": this.calendarStartYYYY,
|
|
9860
|
+
// "module": event.isnotice != null ? "notices" : "events"
|
|
9861
|
+
// })
|
|
9835
9862
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
9836
9863
|
if (parseInt(makercheckersL) > 0) {
|
|
9837
9864
|
bulkBodyReview.push({
|
|
9838
9865
|
"mmddyyyy": mmddyyyy,
|
|
9839
9866
|
"projectid": this.projectId,
|
|
9840
|
-
"type": "
|
|
9867
|
+
"type": "report",
|
|
9841
9868
|
"eventid": eventId,
|
|
9842
|
-
"comments":
|
|
9843
|
-
"
|
|
9869
|
+
"comments": reportercomments,
|
|
9870
|
+
"dateofcompletion": reporterdoc,
|
|
9844
9871
|
"entityid": entityId,
|
|
9845
9872
|
"locationid": locationId,
|
|
9873
|
+
"event": null,
|
|
9874
|
+
"docs": JSON.stringify(docs),
|
|
9875
|
+
"approved": true,
|
|
9846
9876
|
"username": this.userName,
|
|
9877
|
+
"reportformatvalues": reportformatvalues,
|
|
9878
|
+
"reportformatschema": reportformatschema,
|
|
9847
9879
|
"userid": this.userProfileId,
|
|
9848
9880
|
"userrole": this.myRole,
|
|
9849
9881
|
"year": this.calendarStartYYYY,
|
|
@@ -9851,14 +9883,37 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9851
9883
|
});
|
|
9852
9884
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
9853
9885
|
}
|
|
9886
|
+
else {
|
|
9887
|
+
bulkBody.push({
|
|
9888
|
+
"mmddyyyy": mmddyyyy,
|
|
9889
|
+
"projectid": this.projectId,
|
|
9890
|
+
"type": "report",
|
|
9891
|
+
"eventid": eventId,
|
|
9892
|
+
"comments": reportercomments,
|
|
9893
|
+
"dateofcompletion": reporterdoc,
|
|
9894
|
+
"entityid": entityId,
|
|
9895
|
+
"locationid": locationId,
|
|
9896
|
+
"event": null,
|
|
9897
|
+
"docs": JSON.stringify(docs),
|
|
9898
|
+
"username": this.userName,
|
|
9899
|
+
"reportformatvalues": reportformatvalues,
|
|
9900
|
+
"reportformatschema": reportformatschema,
|
|
9901
|
+
"userid": this.userProfileId,
|
|
9902
|
+
"userrole": this.myRole,
|
|
9903
|
+
"year": this.calendarStartYYYY,
|
|
9904
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
9905
|
+
});
|
|
9906
|
+
}
|
|
9854
9907
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
9855
9908
|
// await this.sleep(2000);
|
|
9856
9909
|
// this.clearMessages();
|
|
9857
9910
|
}
|
|
9858
|
-
|
|
9911
|
+
if (bulkBody.length > 0) {
|
|
9912
|
+
await this.uploadReportsBulk(bulkBody);
|
|
9913
|
+
}
|
|
9859
9914
|
// await this.fetchBulkReportingData();
|
|
9860
9915
|
if (bulkBodyReview.length > 0) {
|
|
9861
|
-
await this.
|
|
9916
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview);
|
|
9862
9917
|
}
|
|
9863
9918
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
9864
9919
|
const selectedId = this.selectedItemIds[k];
|
|
@@ -16194,6 +16249,22 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16194
16249
|
this.setError(jsonRespose.error);
|
|
16195
16250
|
}
|
|
16196
16251
|
};
|
|
16252
|
+
this.uploadReportsReviewsBulk = async (bulkBody) => {
|
|
16253
|
+
let url = "https://" + this.apiId + "/uploadreportsreviewsbulk1";
|
|
16254
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
16255
|
+
const xhr = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization));
|
|
16256
|
+
this._SfLoader.innerHTML = '';
|
|
16257
|
+
if (xhr.status == 200) {
|
|
16258
|
+
this.setSuccess("Bulk upload initiated. Processing will occur in the background, and you'll receive an email notification once it's complete.");
|
|
16259
|
+
setTimeout(() => {
|
|
16260
|
+
this.clearMessages();
|
|
16261
|
+
}, 10000);
|
|
16262
|
+
}
|
|
16263
|
+
else {
|
|
16264
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
16265
|
+
this.setError(jsonRespose.error);
|
|
16266
|
+
}
|
|
16267
|
+
};
|
|
16197
16268
|
this.uploadReviewsBulk = async (bulkBody) => {
|
|
16198
16269
|
let url = "https://" + this.apiId + "/uploadreviewsbulk1";
|
|
16199
16270
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
package/src/sf-i-events.ts
CHANGED
|
@@ -5806,37 +5806,24 @@ export class SfIEvents extends LitElement {
|
|
|
5806
5806
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
5807
5807
|
|
|
5808
5808
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
5809
|
-
|
|
5810
|
-
"mmddyyyy": mmddyyyy,
|
|
5811
|
-
"projectid": this.projectId,
|
|
5812
|
-
"type": "report",
|
|
5813
|
-
"eventid": eventId,
|
|
5814
|
-
"comments": reportercomments,
|
|
5815
|
-
"dateofcompletion": reporterdoc,
|
|
5816
|
-
"entityid": entityId,
|
|
5817
|
-
"locationid": locationId,
|
|
5818
|
-
"event": null,
|
|
5819
|
-
"docs": JSON.stringify(docs),
|
|
5820
|
-
"username": this.userName,
|
|
5821
|
-
"reportformatvalues": reportformatvalues,
|
|
5822
|
-
"reportformatschema": reportformatschema,
|
|
5823
|
-
"userid": this.userProfileId,
|
|
5824
|
-
"userrole": this.myRole,
|
|
5825
|
-
"year": this.calendarStartYYYY,
|
|
5826
|
-
"module": event.isnotice != null ? "notices" : "events"
|
|
5827
|
-
})
|
|
5809
|
+
|
|
5828
5810
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
5829
5811
|
if(parseInt(makercheckersL) > 0) {
|
|
5830
5812
|
bulkBodyReview.push({
|
|
5831
5813
|
"mmddyyyy": mmddyyyy,
|
|
5832
5814
|
"projectid": this.projectId,
|
|
5833
|
-
"type": "
|
|
5815
|
+
"type": "report",
|
|
5834
5816
|
"eventid": eventId,
|
|
5835
|
-
"comments":
|
|
5836
|
-
"
|
|
5817
|
+
"comments": reportercomments,
|
|
5818
|
+
"dateofcompletion": reporterdoc,
|
|
5837
5819
|
"entityid": entityId,
|
|
5838
5820
|
"locationid": locationId,
|
|
5821
|
+
"event": null,
|
|
5822
|
+
"docs": JSON.stringify(docs),
|
|
5823
|
+
"approved": true,
|
|
5839
5824
|
"username": this.userName,
|
|
5825
|
+
"reportformatvalues": reportformatvalues,
|
|
5826
|
+
"reportformatschema": reportformatschema,
|
|
5840
5827
|
"userid": this.userProfileId,
|
|
5841
5828
|
"userrole": this.myRole,
|
|
5842
5829
|
"year": this.calendarStartYYYY,
|
|
@@ -5844,6 +5831,26 @@ export class SfIEvents extends LitElement {
|
|
|
5844
5831
|
} )
|
|
5845
5832
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
5846
5833
|
|
|
5834
|
+
}else{
|
|
5835
|
+
bulkBody.push({
|
|
5836
|
+
"mmddyyyy": mmddyyyy,
|
|
5837
|
+
"projectid": this.projectId,
|
|
5838
|
+
"type": "report",
|
|
5839
|
+
"eventid": eventId,
|
|
5840
|
+
"comments": reportercomments,
|
|
5841
|
+
"dateofcompletion": reporterdoc,
|
|
5842
|
+
"entityid": entityId,
|
|
5843
|
+
"locationid": locationId,
|
|
5844
|
+
"event": null,
|
|
5845
|
+
"docs": JSON.stringify(docs),
|
|
5846
|
+
"username": this.userName,
|
|
5847
|
+
"reportformatvalues": reportformatvalues,
|
|
5848
|
+
"reportformatschema": reportformatschema,
|
|
5849
|
+
"userid": this.userProfileId,
|
|
5850
|
+
"userrole": this.myRole,
|
|
5851
|
+
"year": this.calendarStartYYYY,
|
|
5852
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
5853
|
+
})
|
|
5847
5854
|
}
|
|
5848
5855
|
|
|
5849
5856
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
@@ -5851,11 +5858,15 @@ export class SfIEvents extends LitElement {
|
|
|
5851
5858
|
// this.clearMessages();
|
|
5852
5859
|
|
|
5853
5860
|
}
|
|
5854
|
-
await this.uploadReportsBulk(bulkBody);
|
|
5861
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
5855
5862
|
|
|
5856
5863
|
// await this.fetchBulkReportingData();
|
|
5864
|
+
if(bulkBody.length > 0){
|
|
5865
|
+
await this.uploadReportsBulk(bulkBody);
|
|
5866
|
+
}
|
|
5867
|
+
|
|
5857
5868
|
if(bulkBodyReview.length > 0){
|
|
5858
|
-
await this.
|
|
5869
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
5859
5870
|
}
|
|
5860
5871
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
5861
5872
|
|
|
@@ -9499,16 +9510,16 @@ export class SfIEvents extends LitElement {
|
|
|
9499
9510
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date')?.addEventListener('click', () => {
|
|
9500
9511
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9501
9512
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9502
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9503
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9513
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9514
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9504
9515
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
9505
9516
|
});
|
|
9506
9517
|
|
|
9507
9518
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date-mobile')?.addEventListener('click', () => {
|
|
9508
9519
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9509
9520
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9510
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9511
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9521
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9522
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9512
9523
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
9513
9524
|
});
|
|
9514
9525
|
|
|
@@ -9550,7 +9561,7 @@ export class SfIEvents extends LitElement {
|
|
|
9550
9561
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9551
9562
|
|
|
9552
9563
|
} else {
|
|
9553
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
9564
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9554
9565
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
9555
9566
|
}
|
|
9556
9567
|
|
|
@@ -9583,7 +9594,7 @@ export class SfIEvents extends LitElement {
|
|
|
9583
9594
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9584
9595
|
|
|
9585
9596
|
} else {
|
|
9586
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
9597
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9587
9598
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
9588
9599
|
}
|
|
9589
9600
|
|
|
@@ -9711,16 +9722,16 @@ export class SfIEvents extends LitElement {
|
|
|
9711
9722
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date')?.addEventListener('click', () => {
|
|
9712
9723
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9713
9724
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9714
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
9715
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate());
|
|
9725
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" + (new Date().getMonth() + 1)).slice(-2) + '-' + ("0" +(new Date().getDate())).slice(-2);
|
|
9726
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);
|
|
9716
9727
|
this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
|
|
9717
9728
|
});
|
|
9718
9729
|
|
|
9719
9730
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-year-to-date-mobile')?.addEventListener('click', () => {
|
|
9720
9731
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9721
9732
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
9722
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9723
|
-
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate())
|
|
9733
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9734
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = new Date().getFullYear() + '-' + ("0" +(new Date().getMonth() + 1)).slice(-2) + '-' + ("0" + (new Date().getDate())).slice(-2);;
|
|
9724
9735
|
this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
|
|
9725
9736
|
});
|
|
9726
9737
|
|
|
@@ -9762,7 +9773,7 @@ export class SfIEvents extends LitElement {
|
|
|
9762
9773
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9763
9774
|
|
|
9764
9775
|
} else {
|
|
9765
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
9776
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9766
9777
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
9767
9778
|
}
|
|
9768
9779
|
|
|
@@ -9795,7 +9806,7 @@ export class SfIEvents extends LitElement {
|
|
|
9795
9806
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9796
9807
|
|
|
9797
9808
|
} else {
|
|
9798
|
-
startDate = this.calendarStartYYYY + '-' + '01' + '-' + "01";
|
|
9809
|
+
startDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '01' + '-' + "01";
|
|
9799
9810
|
endDate = (parseInt(this.calendarStartYYYY) + 1) + '-' + '04' + '-' + "01";
|
|
9800
9811
|
}
|
|
9801
9812
|
|
|
@@ -12295,37 +12306,24 @@ export class SfIEvents extends LitElement {
|
|
|
12295
12306
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
12296
12307
|
|
|
12297
12308
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
12298
|
-
|
|
12299
|
-
"mmddyyyy": mmddyyyy,
|
|
12300
|
-
"projectid": this.projectId,
|
|
12301
|
-
"type": "report",
|
|
12302
|
-
"eventid": eventId,
|
|
12303
|
-
"comments": reportercomments,
|
|
12304
|
-
"dateofcompletion": reporterdoc,
|
|
12305
|
-
"entityid": entityId,
|
|
12306
|
-
"locationid": locationId,
|
|
12307
|
-
"event": null,
|
|
12308
|
-
"docs": JSON.stringify(docs),
|
|
12309
|
-
"username": this.userName,
|
|
12310
|
-
"reportformatvalues": reportformatvalues,
|
|
12311
|
-
"reportformatschema": reportformatschema,
|
|
12312
|
-
"userid": this.userProfileId,
|
|
12313
|
-
"userrole": this.myRole,
|
|
12314
|
-
"year": this.calendarStartYYYY,
|
|
12315
|
-
"module": listEvent.isnotice != null ? "notices" : "events"
|
|
12316
|
-
})
|
|
12309
|
+
|
|
12317
12310
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
12318
12311
|
if(parseInt(makercheckersL) > 0) {
|
|
12319
12312
|
bulkBodyReview.push({
|
|
12320
12313
|
"mmddyyyy": mmddyyyy,
|
|
12321
12314
|
"projectid": this.projectId,
|
|
12322
|
-
"type": "
|
|
12315
|
+
"type": "report",
|
|
12323
12316
|
"eventid": eventId,
|
|
12324
|
-
"comments":
|
|
12325
|
-
"
|
|
12317
|
+
"comments": reportercomments,
|
|
12318
|
+
"dateofcompletion": reporterdoc,
|
|
12326
12319
|
"entityid": entityId,
|
|
12327
12320
|
"locationid": locationId,
|
|
12321
|
+
"event": null,
|
|
12322
|
+
"docs": JSON.stringify(docs),
|
|
12323
|
+
"approved": true,
|
|
12328
12324
|
"username": this.userName,
|
|
12325
|
+
"reportformatvalues": reportformatvalues,
|
|
12326
|
+
"reportformatschema": reportformatschema,
|
|
12329
12327
|
"userid": this.userProfileId,
|
|
12330
12328
|
"userrole": this.myRole,
|
|
12331
12329
|
"year": this.calendarStartYYYY,
|
|
@@ -12333,6 +12331,26 @@ export class SfIEvents extends LitElement {
|
|
|
12333
12331
|
} )
|
|
12334
12332
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
12335
12333
|
|
|
12334
|
+
}else{
|
|
12335
|
+
bulkBody.push({
|
|
12336
|
+
"mmddyyyy": mmddyyyy,
|
|
12337
|
+
"projectid": this.projectId,
|
|
12338
|
+
"type": "report",
|
|
12339
|
+
"eventid": eventId,
|
|
12340
|
+
"comments": reportercomments,
|
|
12341
|
+
"dateofcompletion": reporterdoc,
|
|
12342
|
+
"entityid": entityId,
|
|
12343
|
+
"locationid": locationId,
|
|
12344
|
+
"event": null,
|
|
12345
|
+
"docs": JSON.stringify(docs),
|
|
12346
|
+
"username": this.userName,
|
|
12347
|
+
"reportformatvalues": reportformatvalues,
|
|
12348
|
+
"reportformatschema": reportformatschema,
|
|
12349
|
+
"userid": this.userProfileId,
|
|
12350
|
+
"userrole": this.myRole,
|
|
12351
|
+
"year": this.calendarStartYYYY,
|
|
12352
|
+
"module": listEvent.isnotice != null ? "notices" : "events"
|
|
12353
|
+
})
|
|
12336
12354
|
}
|
|
12337
12355
|
|
|
12338
12356
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
@@ -12341,11 +12359,16 @@ export class SfIEvents extends LitElement {
|
|
|
12341
12359
|
|
|
12342
12360
|
}
|
|
12343
12361
|
|
|
12344
|
-
await this.uploadReportsBulk(bulkBody);
|
|
12345
|
-
await this.fetchBulkReportingData();
|
|
12362
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
12363
|
+
// await this.fetchBulkReportingData();
|
|
12364
|
+
if(bulkBody.length > 0){
|
|
12365
|
+
await this.uploadReportsBulk(bulkBody);
|
|
12366
|
+
}
|
|
12367
|
+
|
|
12346
12368
|
if(bulkBodyReview.length > 0){
|
|
12347
|
-
await this.
|
|
12369
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
12348
12370
|
}
|
|
12371
|
+
await this.fetchBulkReportingData();
|
|
12349
12372
|
console.log('uploadReport bulk')
|
|
12350
12373
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
12351
12374
|
|
|
@@ -13556,37 +13579,42 @@ export class SfIEvents extends LitElement {
|
|
|
13556
13579
|
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
13557
13580
|
|
|
13558
13581
|
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
13559
|
-
bulkBody.push({
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
})
|
|
13582
|
+
// bulkBody.push({
|
|
13583
|
+
// "mmddyyyy": mmddyyyy,
|
|
13584
|
+
// "projectid": this.projectId,
|
|
13585
|
+
// "type": "report",
|
|
13586
|
+
// "eventid": eventId,
|
|
13587
|
+
// "comments": reportercomments,
|
|
13588
|
+
// "dateofcompletion": reporterdoc,
|
|
13589
|
+
// "entityid": entityId,
|
|
13590
|
+
// "locationid": locationId,
|
|
13591
|
+
// "event": null,
|
|
13592
|
+
// "docs": JSON.stringify(docs),
|
|
13593
|
+
// "username": this.userName,
|
|
13594
|
+
// "reportformatvalues": reportformatvalues,
|
|
13595
|
+
// "reportformatschema": reportformatschema,
|
|
13596
|
+
// "userid": this.userProfileId,
|
|
13597
|
+
// "userrole": this.myRole,
|
|
13598
|
+
// "year": this.calendarStartYYYY,
|
|
13599
|
+
// "module": event.isnotice != null ? "notices" : "events"
|
|
13600
|
+
// })
|
|
13578
13601
|
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
13579
13602
|
if(parseInt(makercheckersL) > 0) {
|
|
13580
13603
|
bulkBodyReview.push({
|
|
13581
13604
|
"mmddyyyy": mmddyyyy,
|
|
13582
13605
|
"projectid": this.projectId,
|
|
13583
|
-
"type": "
|
|
13606
|
+
"type": "report",
|
|
13584
13607
|
"eventid": eventId,
|
|
13585
|
-
"comments":
|
|
13586
|
-
"
|
|
13608
|
+
"comments": reportercomments,
|
|
13609
|
+
"dateofcompletion": reporterdoc,
|
|
13587
13610
|
"entityid": entityId,
|
|
13588
13611
|
"locationid": locationId,
|
|
13612
|
+
"event": null,
|
|
13613
|
+
"docs": JSON.stringify(docs),
|
|
13614
|
+
"approved": true,
|
|
13589
13615
|
"username": this.userName,
|
|
13616
|
+
"reportformatvalues": reportformatvalues,
|
|
13617
|
+
"reportformatschema": reportformatschema,
|
|
13590
13618
|
"userid": this.userProfileId,
|
|
13591
13619
|
"userrole": this.myRole,
|
|
13592
13620
|
"year": this.calendarStartYYYY,
|
|
@@ -13594,6 +13622,26 @@ export class SfIEvents extends LitElement {
|
|
|
13594
13622
|
} )
|
|
13595
13623
|
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
13596
13624
|
|
|
13625
|
+
}else{
|
|
13626
|
+
bulkBody.push({
|
|
13627
|
+
"mmddyyyy": mmddyyyy,
|
|
13628
|
+
"projectid": this.projectId,
|
|
13629
|
+
"type": "report",
|
|
13630
|
+
"eventid": eventId,
|
|
13631
|
+
"comments": reportercomments,
|
|
13632
|
+
"dateofcompletion": reporterdoc,
|
|
13633
|
+
"entityid": entityId,
|
|
13634
|
+
"locationid": locationId,
|
|
13635
|
+
"event": null,
|
|
13636
|
+
"docs": JSON.stringify(docs),
|
|
13637
|
+
"username": this.userName,
|
|
13638
|
+
"reportformatvalues": reportformatvalues,
|
|
13639
|
+
"reportformatschema": reportformatschema,
|
|
13640
|
+
"userid": this.userProfileId,
|
|
13641
|
+
"userrole": this.myRole,
|
|
13642
|
+
"year": this.calendarStartYYYY,
|
|
13643
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
13644
|
+
})
|
|
13597
13645
|
}
|
|
13598
13646
|
|
|
13599
13647
|
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
@@ -13602,10 +13650,12 @@ export class SfIEvents extends LitElement {
|
|
|
13602
13650
|
|
|
13603
13651
|
}
|
|
13604
13652
|
|
|
13605
|
-
|
|
13653
|
+
if(bulkBody.length > 0){
|
|
13654
|
+
await this.uploadReportsBulk(bulkBody);
|
|
13655
|
+
}
|
|
13606
13656
|
// await this.fetchBulkReportingData();
|
|
13607
13657
|
if(bulkBodyReview.length > 0){
|
|
13608
|
-
await this.
|
|
13658
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
13609
13659
|
}
|
|
13610
13660
|
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
13611
13661
|
|
|
@@ -21669,6 +21719,23 @@ export class SfIEvents extends LitElement {
|
|
|
21669
21719
|
this.setError(jsonRespose.error);
|
|
21670
21720
|
}
|
|
21671
21721
|
}
|
|
21722
|
+
uploadReportsReviewsBulk = async (bulkBody: any) => {
|
|
21723
|
+
let url = "https://"+this.apiId+"/uploadreportsreviewsbulk1";
|
|
21724
|
+
|
|
21725
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
21726
|
+
const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
|
|
21727
|
+
this._SfLoader.innerHTML = '';
|
|
21728
|
+
if(xhr.status == 200) {
|
|
21729
|
+
this.setSuccess("Bulk upload initiated. Processing will occur in the background, and you'll receive an email notification once it's complete.");
|
|
21730
|
+
setTimeout(() => {
|
|
21731
|
+
this.clearMessages()
|
|
21732
|
+
}, 10000);
|
|
21733
|
+
|
|
21734
|
+
} else {
|
|
21735
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
21736
|
+
this.setError(jsonRespose.error);
|
|
21737
|
+
}
|
|
21738
|
+
}
|
|
21672
21739
|
uploadReviewsBulk = async (bulkBody: any) => {
|
|
21673
21740
|
let url = "https://"+this.apiId+"/uploadreviewsbulk1";
|
|
21674
21741
|
|