sf-i-events 1.0.697 → 1.0.699
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.js +36 -7
- package/src/sf-i-events.ts +37 -8
package/package.json
CHANGED
package/sf-i-events.js
CHANGED
|
@@ -6663,7 +6663,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6663
6663
|
if (makercheckers.length > 0) {
|
|
6664
6664
|
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><span class="material-symbols-outlined">check_small</span><div> Auto-approve Enabled</div></div>';
|
|
6665
6665
|
if (completeness == "pending-approval" && this.enableDeleteLatestReport) {
|
|
6666
|
-
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><button class="mt-5
|
|
6666
|
+
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><button class="mt-5" part="button" id="button-auto-approve">Auto Approve</button></div>';
|
|
6667
6667
|
}
|
|
6668
6668
|
}
|
|
6669
6669
|
html += '</div>';
|
|
@@ -6808,11 +6808,40 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6808
6808
|
this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
|
|
6809
6809
|
});
|
|
6810
6810
|
(_c = this._SfDetailContainer.querySelector('#button-auto-approve')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6811
|
+
if (this.selectedItemIds.length === 0) {
|
|
6812
|
+
await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
|
|
6813
|
+
this.setSuccess('Auto-Approved successfully!');
|
|
6814
|
+
setTimeout(() => {
|
|
6815
|
+
this.clearMessages();
|
|
6816
|
+
}, 3000);
|
|
6817
|
+
}
|
|
6818
|
+
else {
|
|
6819
|
+
let bulkBodyReview = [];
|
|
6820
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6821
|
+
const selectedId = this.selectedItemIds[k];
|
|
6822
|
+
//console.log('selectedid', selectedId);
|
|
6823
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
6824
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
6825
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
6826
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
6827
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
6828
|
+
bulkBodyReview.push({
|
|
6829
|
+
"mmddyyyy": mmddyyyy,
|
|
6830
|
+
"projectid": this.projectId,
|
|
6831
|
+
"type": "review",
|
|
6832
|
+
"eventid": eventId,
|
|
6833
|
+
"comments": "Auto approved",
|
|
6834
|
+
"approved": true,
|
|
6835
|
+
"entityid": entityId,
|
|
6836
|
+
"locationid": locationId,
|
|
6837
|
+
"username": this.userName,
|
|
6838
|
+
"userid": this.userProfileId,
|
|
6839
|
+
"userrole": this.myRole,
|
|
6840
|
+
"year": this.calendarStartYYYY
|
|
6841
|
+
});
|
|
6842
|
+
}
|
|
6843
|
+
await this.uploadReviewsBulk(bulkBodyReview);
|
|
6844
|
+
}
|
|
6816
6845
|
//console.log('deleted', resultDelete);
|
|
6817
6846
|
if (this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
6818
6847
|
this.processDateSelection(this._SfCustomContainer);
|
|
@@ -7134,7 +7163,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7134
7163
|
if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
7135
7164
|
this.events[mmdd][p].approved = true;
|
|
7136
7165
|
// this.events[mmdd][p].documents = docs
|
|
7137
|
-
this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto
|
|
7166
|
+
this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString() });
|
|
7138
7167
|
this.events[mmdd][p].lastupdated = new Date().toISOString();
|
|
7139
7168
|
}
|
|
7140
7169
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -9975,7 +9975,7 @@ export class SfIEvents extends LitElement {
|
|
|
9975
9975
|
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><span class="material-symbols-outlined">check_small</span><div> Auto-approve Enabled</div></div>';
|
|
9976
9976
|
|
|
9977
9977
|
if(completeness == "pending-approval" && this.enableDeleteLatestReport) {
|
|
9978
|
-
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><button class="mt-5
|
|
9978
|
+
html += '<div part="td-head" class="td-head d-flex justify-center align-center"><button class="mt-5" part="button" id="button-auto-approve">Auto Approve</button></div>';
|
|
9979
9979
|
}
|
|
9980
9980
|
}
|
|
9981
9981
|
html += '</div>';
|
|
@@ -10156,12 +10156,41 @@ export class SfIEvents extends LitElement {
|
|
|
10156
10156
|
|
|
10157
10157
|
});
|
|
10158
10158
|
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10159
|
+
if(this.selectedItemIds.length === 0) {
|
|
10160
|
+
await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
|
|
10161
|
+
this.setSuccess('Auto-Approved successfully!')
|
|
10162
|
+
setTimeout(() => {
|
|
10163
|
+
this.clearMessages()
|
|
10164
|
+
}, 3000);
|
|
10165
|
+
}else{
|
|
10166
|
+
let bulkBodyReview = []
|
|
10167
|
+
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
10168
|
+
|
|
10169
|
+
const selectedId = this.selectedItemIds[k];
|
|
10170
|
+
//console.log('selectedid', selectedId);
|
|
10171
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
10172
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
10173
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
10174
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
10175
|
+
|
|
10176
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
10177
|
+
bulkBodyReview.push({
|
|
10178
|
+
"mmddyyyy": mmddyyyy,
|
|
10179
|
+
"projectid": this.projectId,
|
|
10180
|
+
"type": "review",
|
|
10181
|
+
"eventid": eventId,
|
|
10182
|
+
"comments": "Auto approved",
|
|
10183
|
+
"approved": true,
|
|
10184
|
+
"entityid": entityId,
|
|
10185
|
+
"locationid": locationId,
|
|
10186
|
+
"username": this.userName,
|
|
10187
|
+
"userid": this.userProfileId,
|
|
10188
|
+
"userrole": this.myRole,
|
|
10189
|
+
"year": this.calendarStartYYYY
|
|
10190
|
+
})
|
|
10191
|
+
}
|
|
10192
|
+
await this.uploadReviewsBulk(bulkBodyReview);
|
|
10193
|
+
}
|
|
10165
10194
|
//console.log('deleted', resultDelete);
|
|
10166
10195
|
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
10167
10196
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
@@ -10547,7 +10576,7 @@ export class SfIEvents extends LitElement {
|
|
|
10547
10576
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
10548
10577
|
this.events[mmdd][p].approved = true
|
|
10549
10578
|
// this.events[mmdd][p].documents = docs
|
|
10550
|
-
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto
|
|
10579
|
+
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString()})
|
|
10551
10580
|
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
10552
10581
|
}
|
|
10553
10582
|
}
|