sf-i-events 1.0.686 → 1.0.688

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.686",
4
+ "version": "1.0.688",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
package/sf-i-events.js CHANGED
@@ -6353,12 +6353,13 @@ let SfIEvents = class SfIEvents extends LitElement {
6353
6353
  };
6354
6354
  this.renderEventDetail = (event, mmddyyyy, currentColumnButton) => {
6355
6355
  var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6356
- console.log('event details', event, mmddyyyy);
6356
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
6357
6357
  let comments, docs, approved, dateOfCompletion, makercheckers, docsOptional, documentType;
6358
6358
  let entityId = "";
6359
6359
  let locationId = "";
6360
6360
  let statuteName = "";
6361
6361
  let reportformatName = "";
6362
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
6362
6363
  entityId = event.entityid;
6363
6364
  locationId = event.locationid;
6364
6365
  comments = event['comments'] == null ? [] : (event['comments']);
@@ -6854,6 +6855,12 @@ let SfIEvents = class SfIEvents extends LitElement {
6854
6855
  if (this.selectedItemIds.length === 0) {
6855
6856
  // console.log('mmddyyyy', mmddyyyy)
6856
6857
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved);
6858
+ for (var p = 0; p < this.events[mmdd].length; p++) {
6859
+ if (this.events[mmdd][p].id == event.id) {
6860
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString() });
6861
+ this.events[mmdd][p].lastupdated = new Date().getTime();
6862
+ }
6863
+ }
6857
6864
  }
6858
6865
  else {
6859
6866
  let bulkBodyReview = [];
@@ -6899,9 +6906,16 @@ let SfIEvents = class SfIEvents extends LitElement {
6899
6906
  this.processFindSelection(this._SfFindContainer, searchString);
6900
6907
  }
6901
6908
  else {
6902
- if (currentColumnButton != null) {
6903
- currentColumnButton.click();
6904
- }
6909
+ this.renderAppropriateStream(this.sdate, this.edate, true);
6910
+ var clickEvent = new MouseEvent("click", {
6911
+ "view": window,
6912
+ "bubbles": true,
6913
+ "cancelable": false
6914
+ });
6915
+ this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
6916
+ // if(currentColumnButton != null) {
6917
+ // currentColumnButton.click();
6918
+ // }
6905
6919
  }
6906
6920
  }
6907
6921
  });
@@ -6917,6 +6931,13 @@ let SfIEvents = class SfIEvents extends LitElement {
6917
6931
  else {
6918
6932
  if (this.selectedItemIds.length === 0) {
6919
6933
  await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved);
6934
+ for (var p = 0; p < this.events[mmdd].length; p++) {
6935
+ if (this.events[mmdd][p].id == event.id) {
6936
+ this.events[mmdd][p].approved = approved;
6937
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString() });
6938
+ this.events[mmdd][p].lastupdated = new Date().getTime();
6939
+ }
6940
+ }
6920
6941
  }
6921
6942
  else {
6922
6943
  let bulkBodyAudit = [];
@@ -6964,9 +6985,10 @@ let SfIEvents = class SfIEvents extends LitElement {
6964
6985
  this.processFindSelection(this._SfFindContainer, searchString);
6965
6986
  }
6966
6987
  else {
6967
- if (currentColumnButton != null) {
6968
- currentColumnButton.click();
6969
- }
6988
+ this.renderAppropriateStream(this.sdate, this.edate, true);
6989
+ // if(currentColumnButton != null) {
6990
+ // currentColumnButton.click();
6991
+ // }
6970
6992
  }
6971
6993
  }
6972
6994
  }
@@ -7032,8 +7054,21 @@ let SfIEvents = class SfIEvents extends LitElement {
7032
7054
  // console.log('reportformatvalues', reportformatvalues)
7033
7055
  // console.log('reportformatschema',reportformatschema)
7034
7056
  await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema);
7057
+ console.log('this.events', this.events);
7058
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7059
+ if (this.events[mmdd][p].id == event.id) {
7060
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toISOString() });
7061
+ }
7062
+ }
7035
7063
  if (makercheckers.length > 0) {
7036
7064
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
7065
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7066
+ if (this.events[mmdd][p].id == event.id) {
7067
+ this.events[mmdd][p].approved = true;
7068
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto Approved (Approved: Yes})`, 'timestamp': new Date().toISOString() });
7069
+ this.events[mmdd][p].lastupdated = new Date().getTime();
7070
+ }
7071
+ }
7037
7072
  }
7038
7073
  }
7039
7074
  else {
@@ -7105,9 +7140,10 @@ let SfIEvents = class SfIEvents extends LitElement {
7105
7140
  this.processFindSelection(this._SfFindContainer, searchString);
7106
7141
  }
7107
7142
  else {
7108
- if (currentColumnButton != null) {
7109
- currentColumnButton.click();
7110
- }
7143
+ this.renderAppropriateStream(this.sdate, this.edate, true);
7144
+ // if(currentColumnButton != null) {
7145
+ // currentColumnButton.click();
7146
+ // }
7111
7147
  }
7112
7148
  }
7113
7149
  }
@@ -9559,14 +9559,14 @@ export class SfIEvents extends LitElement {
9559
9559
  }
9560
9560
 
9561
9561
  renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null) => {
9562
- console.log('event details', event, mmddyyyy);
9562
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
9563
9563
 
9564
9564
  let comments, docs, approved, dateOfCompletion, makercheckers: Array<string>, docsOptional, documentType;
9565
9565
  let entityId: string = "";
9566
9566
  let locationId: string = "";
9567
9567
  let statuteName: string = "";
9568
9568
  let reportformatName: string = "";
9569
-
9569
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
9570
9570
  entityId = event.entityid;
9571
9571
  locationId = event.locationid;
9572
9572
  comments = event['comments'] == null ? [] : (event['comments']);
@@ -10190,7 +10190,13 @@ export class SfIEvents extends LitElement {
10190
10190
  if(this.selectedItemIds.length === 0) {
10191
10191
  // console.log('mmddyyyy', mmddyyyy)
10192
10192
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
10193
-
10193
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10194
+ if(this.events[mmdd][p].id == event.id){
10195
+
10196
+ this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
10197
+ this.events[mmdd][p].lastupdated = new Date().getTime()
10198
+ }
10199
+ }
10194
10200
  } else {
10195
10201
  let bulkBodyReview = []
10196
10202
  for(var k = 0; k < this.selectedItemIds.length; k++) {
@@ -10225,7 +10231,6 @@ export class SfIEvents extends LitElement {
10225
10231
 
10226
10232
  }
10227
10233
  await this.uploadReviewsBulk(bulkBodyReview);
10228
-
10229
10234
  }
10230
10235
 
10231
10236
  if(this.mode == "next"){
@@ -10238,9 +10243,16 @@ export class SfIEvents extends LitElement {
10238
10243
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10239
10244
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10240
10245
  } else {
10241
- if(currentColumnButton != null) {
10242
- currentColumnButton.click();
10243
- }
10246
+ this.renderAppropriateStream(this.sdate,this.edate, true);
10247
+ var clickEvent = new MouseEvent("click", {
10248
+ "view": window,
10249
+ "bubbles": true,
10250
+ "cancelable": false
10251
+ });
10252
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
10253
+ // if(currentColumnButton != null) {
10254
+ // currentColumnButton.click();
10255
+ // }
10244
10256
  }
10245
10257
  }
10246
10258
 
@@ -10263,7 +10275,13 @@ export class SfIEvents extends LitElement {
10263
10275
  if(this.selectedItemIds.length === 0) {
10264
10276
 
10265
10277
  await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved)
10266
-
10278
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10279
+ if(this.events[mmdd][p].id == event.id){
10280
+ this.events[mmdd][p].approved = approved
10281
+ this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
10282
+ this.events[mmdd][p].lastupdated = new Date().getTime()
10283
+ }
10284
+ }
10267
10285
  } else {
10268
10286
  let bulkBodyAudit = []
10269
10287
  for(var k = 0; k < this.selectedItemIds.length; k++) {
@@ -10314,9 +10332,10 @@ export class SfIEvents extends LitElement {
10314
10332
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10315
10333
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10316
10334
  } else {
10317
- if(currentColumnButton != null) {
10318
- currentColumnButton.click();
10319
- }
10335
+ this.renderAppropriateStream(this.sdate,this.edate,true);
10336
+ // if(currentColumnButton != null) {
10337
+ // currentColumnButton.click();
10338
+ // }
10320
10339
  }
10321
10340
  }
10322
10341
 
@@ -10414,10 +10433,22 @@ export class SfIEvents extends LitElement {
10414
10433
  // console.log('reportformatvalues', reportformatvalues)
10415
10434
  // console.log('reportformatschema',reportformatschema)
10416
10435
  await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema)
10436
+ console.log('this.events', this.events);
10437
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10438
+ if(this.events[mmdd][p].id == event.id){
10439
+ this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toISOString()})
10440
+ }
10441
+ }
10417
10442
  if(makercheckers.length > 0) {
10418
10443
 
10419
10444
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
10420
-
10445
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10446
+ if(this.events[mmdd][p].id == event.id){
10447
+ this.events[mmdd][p].approved = true
10448
+ this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto Approved (Approved: Yes})`, 'timestamp': new Date().toISOString()})
10449
+ this.events[mmdd][p].lastupdated = new Date().getTime()
10450
+ }
10451
+ }
10421
10452
  }
10422
10453
 
10423
10454
  } else {
@@ -10495,9 +10526,10 @@ export class SfIEvents extends LitElement {
10495
10526
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10496
10527
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10497
10528
  } else {
10498
- if(currentColumnButton != null) {
10499
- currentColumnButton.click();
10500
- }
10529
+ this.renderAppropriateStream(this.sdate,this.edate,true)
10530
+ // if(currentColumnButton != null) {
10531
+ // currentColumnButton.click();
10532
+ // }
10501
10533
  }
10502
10534
  }
10503
10535