sf-i-events 1.0.698 → 1.0.700
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 +35 -7
- package/src/sf-i-events.ts +36 -8
package/package.json
CHANGED
package/sf-i-events.js
CHANGED
|
@@ -132,7 +132,6 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
132
132
|
margin: 2px;
|
|
133
133
|
padding: 20px;
|
|
134
134
|
border: solid 5px gray;
|
|
135
|
-
border-style: groove;
|
|
136
135
|
background-color: #efefef;
|
|
137
136
|
}
|
|
138
137
|
.certificate-section {
|
|
@@ -6808,11 +6807,40 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
6808
6807
|
this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
|
|
6809
6808
|
});
|
|
6810
6809
|
(_c = this._SfDetailContainer.querySelector('#button-auto-approve')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6810
|
+
if (this.selectedItemIds.length === 0) {
|
|
6811
|
+
await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
|
|
6812
|
+
this.setSuccess('Auto-Approved successfully!');
|
|
6813
|
+
setTimeout(() => {
|
|
6814
|
+
this.clearMessages();
|
|
6815
|
+
}, 3000);
|
|
6816
|
+
}
|
|
6817
|
+
else {
|
|
6818
|
+
let bulkBodyReview = [];
|
|
6819
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6820
|
+
const selectedId = this.selectedItemIds[k];
|
|
6821
|
+
//console.log('selectedid', selectedId);
|
|
6822
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
6823
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
6824
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
6825
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
6826
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
6827
|
+
bulkBodyReview.push({
|
|
6828
|
+
"mmddyyyy": mmddyyyy,
|
|
6829
|
+
"projectid": this.projectId,
|
|
6830
|
+
"type": "review",
|
|
6831
|
+
"eventid": eventId,
|
|
6832
|
+
"comments": "Auto approved",
|
|
6833
|
+
"approved": true,
|
|
6834
|
+
"entityid": entityId,
|
|
6835
|
+
"locationid": locationId,
|
|
6836
|
+
"username": this.userName,
|
|
6837
|
+
"userid": this.userProfileId,
|
|
6838
|
+
"userrole": this.myRole,
|
|
6839
|
+
"year": this.calendarStartYYYY
|
|
6840
|
+
});
|
|
6841
|
+
}
|
|
6842
|
+
await this.uploadReviewsBulk(bulkBodyReview);
|
|
6843
|
+
}
|
|
6816
6844
|
//console.log('deleted', resultDelete);
|
|
6817
6845
|
if (this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
6818
6846
|
this.processDateSelection(this._SfCustomContainer);
|
|
@@ -7134,7 +7162,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7134
7162
|
if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
7135
7163
|
this.events[mmdd][p].approved = true;
|
|
7136
7164
|
// this.events[mmdd][p].documents = docs
|
|
7137
|
-
this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto
|
|
7165
|
+
this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString() });
|
|
7138
7166
|
this.events[mmdd][p].lastupdated = new Date().toISOString();
|
|
7139
7167
|
}
|
|
7140
7168
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -135,7 +135,6 @@ export class SfIEvents extends LitElement {
|
|
|
135
135
|
margin: 2px;
|
|
136
136
|
padding: 20px;
|
|
137
137
|
border: solid 5px gray;
|
|
138
|
-
border-style: groove;
|
|
139
138
|
background-color: #efefef;
|
|
140
139
|
}
|
|
141
140
|
.certificate-section {
|
|
@@ -10156,12 +10155,41 @@ export class SfIEvents extends LitElement {
|
|
|
10156
10155
|
|
|
10157
10156
|
});
|
|
10158
10157
|
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10158
|
+
if(this.selectedItemIds.length === 0) {
|
|
10159
|
+
await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
|
|
10160
|
+
this.setSuccess('Auto-Approved successfully!')
|
|
10161
|
+
setTimeout(() => {
|
|
10162
|
+
this.clearMessages()
|
|
10163
|
+
}, 3000);
|
|
10164
|
+
}else{
|
|
10165
|
+
let bulkBodyReview = []
|
|
10166
|
+
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
10167
|
+
|
|
10168
|
+
const selectedId = this.selectedItemIds[k];
|
|
10169
|
+
//console.log('selectedid', selectedId);
|
|
10170
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
10171
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
10172
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
10173
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
10174
|
+
|
|
10175
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
10176
|
+
bulkBodyReview.push({
|
|
10177
|
+
"mmddyyyy": mmddyyyy,
|
|
10178
|
+
"projectid": this.projectId,
|
|
10179
|
+
"type": "review",
|
|
10180
|
+
"eventid": eventId,
|
|
10181
|
+
"comments": "Auto approved",
|
|
10182
|
+
"approved": true,
|
|
10183
|
+
"entityid": entityId,
|
|
10184
|
+
"locationid": locationId,
|
|
10185
|
+
"username": this.userName,
|
|
10186
|
+
"userid": this.userProfileId,
|
|
10187
|
+
"userrole": this.myRole,
|
|
10188
|
+
"year": this.calendarStartYYYY
|
|
10189
|
+
})
|
|
10190
|
+
}
|
|
10191
|
+
await this.uploadReviewsBulk(bulkBodyReview);
|
|
10192
|
+
}
|
|
10165
10193
|
//console.log('deleted', resultDelete);
|
|
10166
10194
|
if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
10167
10195
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
@@ -10547,7 +10575,7 @@ export class SfIEvents extends LitElement {
|
|
|
10547
10575
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
10548
10576
|
this.events[mmdd][p].approved = true
|
|
10549
10577
|
// this.events[mmdd][p].documents = docs
|
|
10550
|
-
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto
|
|
10578
|
+
this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString()})
|
|
10551
10579
|
this.events[mmdd][p].lastupdated = new Date().toISOString()
|
|
10552
10580
|
}
|
|
10553
10581
|
}
|