sf-i-events 1.0.702 → 1.0.704

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # sf-i-events
2
2
 
3
- Work in progress
3
+ L1
package/dev/index.html CHANGED
@@ -754,7 +754,7 @@
754
754
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
755
755
  </div>
756
756
 
757
- </sf-i-events>
757
+ </sf-i-events> -->
758
758
  <!--
759
759
  <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" 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" eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]" eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]" eventpreviewfields="[&quot;obligation&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
760
760
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.702",
4
+ "version": "1.0.704",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
package/sf-i-events.d.ts CHANGED
@@ -439,7 +439,7 @@ export declare class SfIEvents extends LitElement {
439
439
  getComplianceStatus: (completeness: string, timeliness: string) => "scheduled" | "not-complied" | "partially-complied" | "complied";
440
440
  numcalled: number;
441
441
  updateStats: (event: any, partStatus: string, lateStatus: string, complianceStatus: string) => void;
442
- renderCalendarGraphs: (showGraph: boolean) => string;
442
+ renderCalendarGraphs: (showGraph: boolean, parametersTitle: string) => string;
443
443
  renderCalendarContainerDivStart: (index: number) => string;
444
444
  renderCalendarContainerDivEnd: () => string;
445
445
  renderCalendarEventSummary: () => string;
@@ -458,7 +458,7 @@ export declare class SfIEvents extends LitElement {
458
458
  renderStatusString: (partStatus: string, lateStatus: string, complianceStatus: string) => string;
459
459
  getGraphParam: (event: any) => string;
460
460
  renderCalendarAnnotations: (event: any) => string;
461
- renderEvents: (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate?: any) => string;
461
+ renderEvents: (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any, parametersTitle: string) => string;
462
462
  renderStreamEvents: (index: number, month: number, year: number, showGraph?: boolean) => string;
463
463
  renderThisEvents: (index: number, startDate: Date, showGraph?: boolean) => string;
464
464
  renderRangeEvents: (firstDate: Date, count: number, eventsContainer: HTMLDivElement) => void;
@@ -755,6 +755,7 @@ export declare class SfIEvents extends LitElement {
755
755
  renderAppropriateStream: (startDate: string, endDate: string, showGraph?: boolean) => void;
756
756
  fetchRegisters: (searchString?: string) => Promise<any>;
757
757
  fetchAndYearlyRenderUserCalendar_2: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string) => Promise<void>;
758
+ fetchBulkReportingData: () => Promise<void>;
758
759
  fetchUserCalendar: () => Promise<void>;
759
760
  fetchCalendar: () => Promise<void>;
760
761
  fetchReprogramAdhoc: () => Promise<void>;
package/sf-i-events.js CHANGED
@@ -2074,10 +2074,11 @@ let SfIEvents = class SfIEvents extends LitElement {
2074
2074
  this.updateLocationStats(event['locationname'], partStatus, lateStatus, complianceStatus);
2075
2075
  this.updateSubcategoryStats(event['subcategory'], partStatus, lateStatus, complianceStatus);
2076
2076
  };
2077
- this.renderCalendarGraphs = (showGraph) => {
2077
+ this.renderCalendarGraphs = (showGraph, parametersTitle) => {
2078
2078
  //console.log('flowGraph', this.flowGraph);
2079
2079
  var html = '';
2080
2080
  html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
2081
+ html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4></div>';
2081
2082
  if (showGraph) {
2082
2083
  html += '<div part="stream-event-chart-selection" class="mb-20">';
2083
2084
  html += '<div part="td-head" class="mb-5">Select Chart</div>';
@@ -2224,7 +2225,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2224
2225
  html += '<div class="stream-events-container flex-grow">';
2225
2226
  html += '<div class="hidden-tags hide">' + JSON.stringify(event['tags']) + '</div>';
2226
2227
  html += '<div class="hidden-title hide"><table><thead><th part="badge-filtered"><i>not filtered</i></th></thead></table></div>';
2227
- html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + ('<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '" class="button-select mr-10 ' + ((event.reportformat != null && event.reportformat.length > 0) ? 'hide' : '') + '" type="checkbox"/>') + '<sf-i-elastic-text text="' + event['obligationtitle'] + '" minLength="100"></sf-i-elastic-text>' + (lastUpdated.length > 0 ? ('&nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
2228
+ html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + ((event.isbulk == null || event.isbulk == false) ? ('<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '" class="button-select mr-10 ' + ((event.reportformat != null && event.reportformat.length > 0) ? 'hide' : '') + '" type="checkbox"/>') : ('')) + '<sf-i-elastic-text text="' + event['obligationtitle'] + '" minLength="100"></sf-i-elastic-text>' + (lastUpdated.length > 0 ? ('&nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
2228
2229
  if (remarks.length > 0) {
2229
2230
  html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
2230
2231
  }
@@ -2260,6 +2261,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2260
2261
  html += '<table class="stream-events-container-table" part="' + partStatus + '">';
2261
2262
  html += '<thead>';
2262
2263
  html += '<th part="td-head">';
2264
+ // if(event.isbulk == null || event.isbulk == false) html += 'Open'
2263
2265
  html += 'Open';
2264
2266
  html += '</th>';
2265
2267
  html += '<th part="td-head">';
@@ -2294,6 +2296,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2294
2296
  html += 'Comments';
2295
2297
  html += '</th>';
2296
2298
  }
2299
+ console.log('rendering last updated', event.lastupdated);
2297
2300
  if (event.lastupdated != null && (event.lastupdated).length > 0) {
2298
2301
  html += '<th part="td-head">';
2299
2302
  html += 'Updated';
@@ -2325,7 +2328,12 @@ let SfIEvents = class SfIEvents extends LitElement {
2325
2328
  var html = '';
2326
2329
  html += '<tbody>';
2327
2330
  html += '<td id="td-expand-' + i + '" part="td-body">';
2328
- html += '<button id="button-unmapped-expand-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-small" class="material-icons button-expand mr-10">open_in_new</button>';
2331
+ if (event.isbulk == null || !event.isbulk) {
2332
+ html += '<button id="button-unmapped-expand-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-small" class="material-icons button-expand mr-10">open_in_new</button>';
2333
+ }
2334
+ else {
2335
+ html += '<div class="lds-dual-ring1"></div>';
2336
+ }
2329
2337
  html += '</td>';
2330
2338
  html += '<td part="td-body">';
2331
2339
  html += this.renderStatusHtml(partStatus, lateStatus, complianceStatus, i);
@@ -2473,7 +2481,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2473
2481
  html += '<div class="d-flex"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + '</div>';
2474
2482
  return html;
2475
2483
  };
2476
- this.renderEvents = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null) => {
2484
+ this.renderEvents = (_firstDay, _endDay, iInit, iLast, showGraph, index, month, period, firstDate = null, parametersTitle) => {
2477
2485
  var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0;
2478
2486
  var html = '';
2479
2487
  this.selectedItemIds = [];
@@ -2487,7 +2495,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2487
2495
  this.clearGraphData();
2488
2496
  this.clearSelectedGraphParam();
2489
2497
  this.clearSelectedLegend();
2490
- html += this.renderCalendarGraphs(showGraph);
2498
+ html += this.renderCalendarGraphs(showGraph, parametersTitle);
2491
2499
  html += this.renderCalendarContainerDivStart(index);
2492
2500
  html += this.renderCalendarEventSummary();
2493
2501
  // csvCols += 'Period,Status,Id,ObligationTitle,Obligation,Duedate'
@@ -2680,7 +2688,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2680
2688
  let endDay = new Date(year, month, 1);
2681
2689
  endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay + 1);
2682
2690
  var period = ("0" + (month + 1)).slice(-2) + "/" + ("0" + 1).slice(-2) + '/' + new Date().getFullYear() + ' - ' + ("0" + (month + 1)).slice(-2) + "/" + ("0" + lastDay).slice(-2) + '/' + new Date().getFullYear();
2683
- return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, month, period);
2691
+ return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, month, period, null, this.monthNames[month] + " " + year);
2684
2692
  };
2685
2693
  this.renderThisEvents = (index, startDate, showGraph = true) => {
2686
2694
  var firstDate = new Date();
@@ -2701,7 +2709,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2701
2709
  let endDay = new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate());
2702
2710
  endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay + 1);
2703
2711
  var period = ("0" + (firstDate.getMonth() + 1)).slice(-2) + "/" + ("0" + 1).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (firstDate.getMonth() + 1)).slice(-2) + "/" + ("0" + count).slice(-2) + '/' + firstDate.getFullYear();
2704
- return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, (firstDate.getMonth()), period);
2712
+ return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, (firstDate.getMonth()), period, null, "This " + (index === 0 ? "Week" : "Month"));
2705
2713
  };
2706
2714
  this.renderRangeEvents = (firstDate, count, eventsContainer) => {
2707
2715
  var lastDate = new Date(firstDate.getTime());
@@ -2712,7 +2720,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2712
2720
  endDay === null || endDay === void 0 ? void 0 : endDay.setDate(endDay.getDate() + lastDay + 1);
2713
2721
  var period = ("0" + (firstDate.getMonth() + 1)).slice(-2) + "/" + ("0" + firstDate.getDate()).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (lastDate.getMonth() + 1)).slice(-2) + "/" + ("0" + lastDate.getDate()).slice(-2) + '/' + lastDate.getFullYear();
2714
2722
  //console.log('rangeperiod', period)
2715
- var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate);
2723
+ var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate, "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
2716
2724
  eventsContainer.querySelector('.calendar-right-data').innerHTML = html;
2717
2725
  this.attachTimelineFilterHandlers(eventsContainer);
2718
2726
  const radioExpander = eventsContainer.querySelector('#graph-radios-expander');
@@ -6352,15 +6360,17 @@ let SfIEvents = class SfIEvents extends LitElement {
6352
6360
  }
6353
6361
  };
6354
6362
  this.renderEventDetail = (event, mmddyyyy, currentColumnButton) => {
6355
- var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6356
- console.log('event details', event, mmddyyyy);
6363
+ var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
6364
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
6357
6365
  let comments, docs, approved, dateOfCompletion, makercheckers, docsOptional, documentType;
6358
6366
  let entityId = "";
6359
6367
  let locationId = "";
6360
6368
  let statuteName = "";
6361
6369
  let reportformatName = "";
6370
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
6362
6371
  entityId = event.entityid;
6363
6372
  locationId = event.locationid;
6373
+ let completeness = this.getCompletenessStatus(event);
6364
6374
  comments = event['comments'] == null ? [] : (event['comments']);
6365
6375
  docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
6366
6376
  approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
@@ -6652,6 +6662,9 @@ let SfIEvents = class SfIEvents extends LitElement {
6652
6662
  html += '<br />';
6653
6663
  if (makercheckers.length > 0) {
6654
6664
  html += '<div part="td-head" class="td-head d-flex justify-center align-center"><span class="material-symbols-outlined">check_small</span><div>&nbsp;Auto-approve Enabled</div></div>';
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" part="button" id="button-auto-approve">Auto Approve</button></div>';
6667
+ }
6655
6668
  }
6656
6669
  html += '</div>';
6657
6670
  html += '</div>';
@@ -6794,11 +6807,62 @@ let SfIEvents = class SfIEvents extends LitElement {
6794
6807
  });
6795
6808
  this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
6796
6809
  });
6797
- (_c = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', () => {
6810
+ (_c = this._SfDetailContainer.querySelector('#button-auto-approve')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
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
+ }
6845
+ //console.log('deleted', resultDelete);
6846
+ if (this.getCurrentTab() == this.TAB_CUSTOM) {
6847
+ this.processDateSelection(this._SfCustomContainer);
6848
+ }
6849
+ else {
6850
+ if (currentColumnButton != null) {
6851
+ currentColumnButton.click();
6852
+ }
6853
+ }
6854
+ var clickEvent = new MouseEvent("click", {
6855
+ "view": window,
6856
+ "bubbles": true,
6857
+ "cancelable": false
6858
+ });
6859
+ this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
6860
+ });
6861
+ (_f = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', () => {
6798
6862
  this._SfDetailContainer.innerHTML = '';
6799
6863
  this._SfDetailContainer.style.display = 'none';
6800
6864
  });
6801
- (_f = this._SfDetailContainer.querySelector('.head-basic')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', () => {
6865
+ (_g = this._SfDetailContainer.querySelector('.head-basic')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
6802
6866
  //console.log('head basic clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-basic') as HTMLDivElement).style.display);
6803
6867
  if (this._SfDetailContainer.querySelector('.body-basic').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-basic').style.display == '') {
6804
6868
  this._SfDetailContainer.querySelector('.body-basic').style.display = 'none';
@@ -6809,7 +6873,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6809
6873
  this._SfDetailContainer.querySelector('.head-indicator-basic').innerHTML = '-';
6810
6874
  }
6811
6875
  });
6812
- (_g = this._SfDetailContainer.querySelector('.head-statute')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', () => {
6876
+ (_h = this._SfDetailContainer.querySelector('.head-statute')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
6813
6877
  //console.log('head statute clicked', ((this._SfDetailContainer as HTMLDivElement).querySelector('.body-statute') as HTMLDivElement).style.display);
6814
6878
  if (this._SfDetailContainer.querySelector('.body-statute').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-statute').style.display == '') {
6815
6879
  this._SfDetailContainer.querySelector('.body-statute').style.display = 'none';
@@ -6820,7 +6884,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6820
6884
  this._SfDetailContainer.querySelector('.head-indicator-statute').innerHTML = '-';
6821
6885
  }
6822
6886
  });
6823
- (_h = this._SfDetailContainer.querySelector('.head-compliance')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', () => {
6887
+ (_j = this._SfDetailContainer.querySelector('.head-compliance')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
6824
6888
  if (this._SfDetailContainer.querySelector('.body-compliance').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-compliance').style.display == '') {
6825
6889
  this._SfDetailContainer.querySelector('.body-compliance').style.display = 'none';
6826
6890
  this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '+';
@@ -6830,7 +6894,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6830
6894
  this._SfDetailContainer.querySelector('.head-indicator-compliance').innerHTML = '-';
6831
6895
  }
6832
6896
  });
6833
- (_j = this._SfDetailContainer.querySelector('.head-grc')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
6897
+ (_k = this._SfDetailContainer.querySelector('.head-grc')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
6834
6898
  if (this._SfDetailContainer.querySelector('.body-grc').style.display == 'flex' || this._SfDetailContainer.querySelector('.body-grc').style.display == '') {
6835
6899
  this._SfDetailContainer.querySelector('.body-grc').style.display = 'none';
6836
6900
  this._SfDetailContainer.querySelector('.head-indicator-grc').innerHTML = '+';
@@ -6841,7 +6905,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6841
6905
  }
6842
6906
  });
6843
6907
  if (this.mode == "consumer" || this.mode == "next") {
6844
- (_k = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async () => {
6908
+ (_l = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', async () => {
6845
6909
  const comments = this._SfDetailContainer.querySelector('#input-approver-comments').value;
6846
6910
  const approved = this._SfDetailContainer.querySelector('#input-approve-yes').checked;
6847
6911
  var clickEvent = new MouseEvent("click", {
@@ -6854,6 +6918,12 @@ let SfIEvents = class SfIEvents extends LitElement {
6854
6918
  if (this.selectedItemIds.length === 0) {
6855
6919
  // console.log('mmddyyyy', mmddyyyy)
6856
6920
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved);
6921
+ for (var p = 0; p < this.events[mmdd].length; p++) {
6922
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
6923
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString() });
6924
+ this.events[mmdd][p].lastupdated = new Date().toISOString();
6925
+ }
6926
+ }
6857
6927
  }
6858
6928
  else {
6859
6929
  let bulkBodyReview = [];
@@ -6885,6 +6955,19 @@ let SfIEvents = class SfIEvents extends LitElement {
6885
6955
  // this.clearMessages();
6886
6956
  }
6887
6957
  await this.uploadReviewsBulk(bulkBodyReview);
6958
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
6959
+ const selectedId = this.selectedItemIds[k];
6960
+ //console.log('selectedid', selectedId);
6961
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
6962
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
6963
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
6964
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
6965
+ for (var p = 0; p < this.events[mmdd].length; p++) {
6966
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
6967
+ this.events[mmdd][p].isbulk = true;
6968
+ }
6969
+ }
6970
+ }
6888
6971
  }
6889
6972
  if (this.mode == "next") {
6890
6973
  // this.fetchNext(this.nextPage)
@@ -6899,13 +6982,23 @@ let SfIEvents = class SfIEvents extends LitElement {
6899
6982
  this.processFindSelection(this._SfFindContainer, searchString);
6900
6983
  }
6901
6984
  else {
6902
- if (currentColumnButton != null) {
6903
- currentColumnButton.click();
6985
+ this.renderAppropriateStream(this.sdate, this.edate, true);
6986
+ var clickEvent = new MouseEvent("click", {
6987
+ "view": window,
6988
+ "bubbles": true,
6989
+ "cancelable": false
6990
+ });
6991
+ this._SfDetailContainer.querySelector('#button-detail-close').dispatchEvent(clickEvent);
6992
+ if (this.selectedItemIds.length > 0) {
6993
+ this.fetchBulkReportingData();
6904
6994
  }
6995
+ // if(currentColumnButton != null) {
6996
+ // currentColumnButton.click();
6997
+ // }
6905
6998
  }
6906
6999
  }
6907
7000
  });
6908
- (_l = this._SfDetailContainer.querySelector('#button-uploader-submit-audit')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', async () => {
7001
+ (_m = this._SfDetailContainer.querySelector('#button-uploader-submit-audit')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', async () => {
6909
7002
  const comments = this._SfDetailContainer.querySelector('#input-auditor-comments').value;
6910
7003
  const approved = this._SfDetailContainer.querySelector('#input-approve-yes').checked;
6911
7004
  if (comments.trim().length === 0) {
@@ -6917,6 +7010,13 @@ let SfIEvents = class SfIEvents extends LitElement {
6917
7010
  else {
6918
7011
  if (this.selectedItemIds.length === 0) {
6919
7012
  await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved);
7013
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7014
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
7015
+ this.events[mmdd][p].approved = approved;
7016
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString() });
7017
+ this.events[mmdd][p].lastupdated = new Date().toISOString();
7018
+ }
7019
+ }
6920
7020
  }
6921
7021
  else {
6922
7022
  let bulkBodyAudit = [];
@@ -6945,6 +7045,19 @@ let SfIEvents = class SfIEvents extends LitElement {
6945
7045
  // await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
6946
7046
  }
6947
7047
  await this.uploadAuditsBulk(bulkBodyAudit);
7048
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
7049
+ const selectedId = this.selectedItemIds[k];
7050
+ //console.log('selectedid', selectedId);
7051
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
7052
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
7053
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
7054
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
7055
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7056
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
7057
+ this.events[mmdd][p].isbulk = true;
7058
+ }
7059
+ }
7060
+ }
6948
7061
  }
6949
7062
  var clickEvent = new MouseEvent("click", {
6950
7063
  "view": window,
@@ -6964,9 +7077,13 @@ let SfIEvents = class SfIEvents extends LitElement {
6964
7077
  this.processFindSelection(this._SfFindContainer, searchString);
6965
7078
  }
6966
7079
  else {
6967
- if (currentColumnButton != null) {
6968
- currentColumnButton.click();
7080
+ this.renderAppropriateStream(this.sdate, this.edate, true);
7081
+ if (this.selectedItemIds.length > 0) {
7082
+ this.fetchBulkReportingData();
6969
7083
  }
7084
+ // if(currentColumnButton != null) {
7085
+ // currentColumnButton.click();
7086
+ // }
6970
7087
  }
6971
7088
  }
6972
7089
  }
@@ -6980,7 +7097,7 @@ let SfIEvents = class SfIEvents extends LitElement {
6980
7097
  else {
6981
7098
  if (this._SfDetailContainer.querySelector('#button-uploader-submit-report') != null) {
6982
7099
  this._SfDetailContainer.querySelector('#button-uploader-submit-report').style.visibility = 'visible';
6983
- (_m = this._SfDetailContainer.querySelector('#button-uploader-submit-report')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', async () => {
7100
+ (_o = this._SfDetailContainer.querySelector('#button-uploader-submit-report')) === null || _o === void 0 ? void 0 : _o.addEventListener('click', async () => {
6984
7101
  var _a, _b;
6985
7102
  const reportercomments = this._SfDetailContainer.querySelector('#input-reporter-comments').value;
6986
7103
  //console.log('reporter comments 1', reportercomments);
@@ -7032,8 +7149,24 @@ let SfIEvents = class SfIEvents extends LitElement {
7032
7149
  // console.log('reportformatvalues', reportformatvalues)
7033
7150
  // console.log('reportformatschema',reportformatschema)
7034
7151
  await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema);
7152
+ console.log('this.events', this.events);
7153
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7154
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
7155
+ this.events[mmdd][p].documents = docs;
7156
+ this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toISOString() });
7157
+ this.events[mmdd][p].lastupdated = new Date().toISOString();
7158
+ }
7159
+ }
7035
7160
  if (makercheckers.length > 0) {
7036
7161
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
7162
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7163
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
7164
+ this.events[mmdd][p].approved = true;
7165
+ // this.events[mmdd][p].documents = docs
7166
+ this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString() });
7167
+ this.events[mmdd][p].lastupdated = new Date().toISOString();
7168
+ }
7169
+ }
7037
7170
  }
7038
7171
  }
7039
7172
  else {
@@ -7092,6 +7225,19 @@ let SfIEvents = class SfIEvents extends LitElement {
7092
7225
  if (bulkBodyReview.length > 0) {
7093
7226
  await this.uploadReviewsBulk(bulkBodyReview);
7094
7227
  }
7228
+ for (var k = 0; k < this.selectedItemIds.length; k++) {
7229
+ const selectedId = this.selectedItemIds[k];
7230
+ //console.log('selectedid', selectedId);
7231
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
7232
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
7233
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
7234
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
7235
+ for (var p = 0; p < this.events[mmdd].length; p++) {
7236
+ if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
7237
+ this.events[mmdd][p].isbulk = true;
7238
+ }
7239
+ }
7240
+ }
7095
7241
  }
7096
7242
  if (this.mode == "next") {
7097
7243
  this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus);
@@ -7105,9 +7251,13 @@ let SfIEvents = class SfIEvents extends LitElement {
7105
7251
  this.processFindSelection(this._SfFindContainer, searchString);
7106
7252
  }
7107
7253
  else {
7108
- if (currentColumnButton != null) {
7109
- currentColumnButton.click();
7254
+ this.renderAppropriateStream(this.sdate, this.edate, true);
7255
+ if (this.selectedItemIds.length > 0) {
7256
+ this.fetchBulkReportingData();
7110
7257
  }
7258
+ // if(currentColumnButton != null) {
7259
+ // currentColumnButton.click();
7260
+ // }
7111
7261
  }
7112
7262
  }
7113
7263
  }
@@ -7197,7 +7347,7 @@ let SfIEvents = class SfIEvents extends LitElement {
7197
7347
  }
7198
7348
  this.fetchStatuteDefinitionDetails(statuteName);
7199
7349
  if (event['reportformat'] != null && event['reportformat'].length > 0) {
7200
- this.fetchReportFormat(reportformatName, (_o = event['reportformatschema']) !== null && _o !== void 0 ? _o : "", (_p = event['reportformatvalues']) !== null && _p !== void 0 ? _p : "");
7350
+ this.fetchReportFormat(reportformatName, (_p = event['reportformatschema']) !== null && _p !== void 0 ? _p : "", (_q = event['reportformatvalues']) !== null && _q !== void 0 ? _q : "");
7201
7351
  }
7202
7352
  };
7203
7353
  this.renderCalendar = () => {
@@ -11962,7 +12112,8 @@ let SfIEvents = class SfIEvents extends LitElement {
11962
12112
  graphparamnames2[i].style.display = 'block';
11963
12113
  if (graphparamnames3 != null && graphparamnames3[i] != null)
11964
12114
  graphparamnames3[i].style.display = 'block';
11965
- eventTitles[i].style.display = 'flex';
12115
+ if (eventTitles[i] != null)
12116
+ eventTitles[i].style.display = 'flex';
11966
12117
  if (eventSubTitles[i] != null) {
11967
12118
  eventSubTitles[i].style.display = 'flex';
11968
12119
  }
@@ -13059,7 +13210,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13059
13210
  }
13060
13211
  };
13061
13212
  this.uploadAudit = async (entityId, locationId, mmddyyyy, eventid, comments, approved) => {
13062
- let url = "https://" + this.apiId + "/uploadaudit";
13213
+ let url = "https://" + this.apiId + "/uploadaudit1";
13063
13214
  const body = {
13064
13215
  "mmddyyyy": mmddyyyy,
13065
13216
  "projectid": this.projectId,
@@ -13095,7 +13246,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13095
13246
  }
13096
13247
  };
13097
13248
  this.uploadAuditsBulk = async (bulkBody) => {
13098
- let url = "https://" + this.apiId + "/uploadauditsbulk";
13249
+ let url = "https://" + this.apiId + "/uploadauditsbulk1";
13099
13250
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
13100
13251
  const xhr = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization));
13101
13252
  this._SfLoader.innerHTML = '';
@@ -13111,7 +13262,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13111
13262
  }
13112
13263
  };
13113
13264
  this.uploadReview = async (entityId, locationId, mmddyyyy, eventid, comments, approved) => {
13114
- let url = "https://" + this.apiId + "/uploadreview";
13265
+ let url = "https://" + this.apiId + "/uploadreview1";
13115
13266
  const body = {
13116
13267
  "mmddyyyy": mmddyyyy,
13117
13268
  "projectid": this.projectId,
@@ -13149,7 +13300,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13149
13300
  ``;
13150
13301
  };
13151
13302
  this.uploadReviewsBulk = async (bulkBody) => {
13152
- let url = "https://" + this.apiId + "/uploadreviewsbulk";
13303
+ let url = "https://" + this.apiId + "/uploadreviewsbulk1";
13153
13304
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
13154
13305
  const xhr = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization));
13155
13306
  this._SfLoader.innerHTML = '';
@@ -14473,6 +14624,7 @@ let SfIEvents = class SfIEvents extends LitElement {
14473
14624
  this.events = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
14474
14625
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
14475
14626
  this.renderAppropriateStream(startDate, endDate, list == "no");
14627
+ this.fetchBulkReportingData();
14476
14628
  // this.events = {}
14477
14629
  // this.events = {...JSON.parse(JSON.stringify(jsonRespose.data.events))};
14478
14630
  // let lastEvaluatedKey = jsonRespose.lastEvaluatedKey;
@@ -14520,6 +14672,38 @@ let SfIEvents = class SfIEvents extends LitElement {
14520
14672
  }
14521
14673
  }
14522
14674
  };
14675
+ this.fetchBulkReportingData = async () => {
14676
+ let path = "getbulkreportjobs";
14677
+ let urlBody = { "projectid": this.projectId };
14678
+ let url = "https://" + this.apiId + "/" + path;
14679
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
14680
+ const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
14681
+ this._SfLoader.innerHTML = '';
14682
+ if (xhr.status == 200) {
14683
+ const jsonRespose = JSON.parse(xhr.responseText);
14684
+ console.log('bulk reports jsonRespose', jsonRespose);
14685
+ if (jsonRespose.result == true) {
14686
+ for (let sortid of Object.keys(jsonRespose.data)) {
14687
+ let sortidArr = sortid.split(';');
14688
+ let mmddyyyy = sortidArr[0];
14689
+ let entityid = sortidArr[1];
14690
+ let locationid = sortidArr[2];
14691
+ let eventid = sortidArr[3];
14692
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1];
14693
+ console.log('mmdd', mmdd, Object.keys(this.events));
14694
+ for (let i = 0; i < this.events[mmdd].length; i++) {
14695
+ if (this.events[mmdd][i].entityid == entityid && this.events[mmdd][i].locationid == locationid && this.events[mmdd][i].id == eventid) {
14696
+ this.events[mmdd][i].isbulk = true;
14697
+ break;
14698
+ }
14699
+ }
14700
+ }
14701
+ if (Object.keys(jsonRespose.data).length > 0) {
14702
+ this.renderAppropriateStream(this.sdate, this.edate, true);
14703
+ }
14704
+ }
14705
+ }
14706
+ };
14523
14707
  this.fetchUserCalendar = async () => {
14524
14708
  let url = "https://" + this.apiId + "/getuserevents";
14525
14709
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -16296,6 +16480,32 @@ SfIEvents.styles = css `
16296
16480
 
16297
16481
  }
16298
16482
 
16483
+ .lds-dual-ring1 {
16484
+ display: inline-block;
16485
+ width: 15px;
16486
+ height: 15px;
16487
+ }
16488
+ .lds-dual-ring1:after {
16489
+ content: " ";
16490
+ display: block;
16491
+ width: 15px;
16492
+ height: 15px;
16493
+ margin: 0px;
16494
+ border-radius: 50%;
16495
+ border: 2px solid #fff;
16496
+ border-color: #666 #ddd #666 #ddd;
16497
+ animation: lds-dual-ring 0.8s linear infinite;
16498
+ }
16499
+
16500
+ @keyframes lds-dual-ring1 {
16501
+ 0% {
16502
+ transform: rotate(0deg);
16503
+ }
16504
+ 100% {
16505
+ transform: rotate(360deg);
16506
+ }
16507
+ }
16508
+
16299
16509
  sf-i-uploader::part(button-icon) {
16300
16510
  border-width: 0px;
16301
16511
  border-radius: 5px;
@@ -1602,6 +1602,32 @@ export class SfIEvents extends LitElement {
1602
1602
 
1603
1603
  }
1604
1604
 
1605
+ .lds-dual-ring1 {
1606
+ display: inline-block;
1607
+ width: 15px;
1608
+ height: 15px;
1609
+ }
1610
+ .lds-dual-ring1:after {
1611
+ content: " ";
1612
+ display: block;
1613
+ width: 15px;
1614
+ height: 15px;
1615
+ margin: 0px;
1616
+ border-radius: 50%;
1617
+ border: 2px solid #fff;
1618
+ border-color: #666 #ddd #666 #ddd;
1619
+ animation: lds-dual-ring 0.8s linear infinite;
1620
+ }
1621
+
1622
+ @keyframes lds-dual-ring1 {
1623
+ 0% {
1624
+ transform: rotate(0deg);
1625
+ }
1626
+ 100% {
1627
+ transform: rotate(360deg);
1628
+ }
1629
+ }
1630
+
1605
1631
  sf-i-uploader::part(button-icon) {
1606
1632
  border-width: 0px;
1607
1633
  border-radius: 5px;
@@ -4077,13 +4103,14 @@ export class SfIEvents extends LitElement {
4077
4103
 
4078
4104
  }
4079
4105
 
4080
- renderCalendarGraphs = (showGraph: boolean) => {
4106
+ renderCalendarGraphs = (showGraph: boolean, parametersTitle: string) => {
4081
4107
 
4082
4108
  //console.log('flowGraph', this.flowGraph);
4083
4109
 
4084
4110
  var html = '';
4085
4111
 
4086
4112
  html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
4113
+ html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4></div>';
4087
4114
  if(showGraph) {
4088
4115
  html += '<div part="stream-event-chart-selection" class="mb-20">';
4089
4116
  html += '<div part="td-head" class="mb-5">Select Chart</div>';
@@ -4274,7 +4301,7 @@ export class SfIEvents extends LitElement {
4274
4301
  html += '<div class="stream-events-container flex-grow">';
4275
4302
  html += '<div class="hidden-tags hide">'+JSON.stringify(event['tags'])+'</div>'
4276
4303
  html += '<div class="hidden-title hide"><table><thead><th part="badge-filtered"><i>not filtered</i></th></thead></table></div>'
4277
- html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + ('<input id="button-select-'+mmdd.replace('/', '-')+'-'+itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g,'_') + '" class="button-select mr-10 ' + ((event.reportformat != null && event.reportformat.length > 0) ? 'hide' : '') + '" type="checkbox"/>') + '<sf-i-elastic-text text="'+event['obligationtitle']+'" minLength="100"></sf-i-elastic-text>' + (lastUpdated.length > 0 ? ('&nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
4304
+ html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + ((event.isbulk == null || event.isbulk == false) ? ('<input id="button-select-'+mmdd.replace('/', '-')+'-'+itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g,'_') + '" class="button-select mr-10 ' + ((event.reportformat != null && event.reportformat.length > 0) ? 'hide' : '') + '" type="checkbox"/>') : ('')) + '<sf-i-elastic-text text="'+event['obligationtitle']+'" minLength="100"></sf-i-elastic-text>' + (lastUpdated.length > 0 ? ('&nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
4278
4305
  if(remarks.length > 0) {
4279
4306
  html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">'+remarks+', occurred on '+occurrenceDate+'</div>';
4280
4307
  }
@@ -4327,6 +4354,7 @@ export class SfIEvents extends LitElement {
4327
4354
  html += '<table class="stream-events-container-table" part="'+partStatus+'">';
4328
4355
  html += '<thead>';
4329
4356
  html += '<th part="td-head">';
4357
+ // if(event.isbulk == null || event.isbulk == false) html += 'Open'
4330
4358
  html += 'Open'
4331
4359
  html += '</th>';
4332
4360
  html += '<th part="td-head">';
@@ -4362,6 +4390,7 @@ export class SfIEvents extends LitElement {
4362
4390
  html += 'Comments'
4363
4391
  html += '</th>';
4364
4392
  }
4393
+ console.log('rendering last updated', event.lastupdated)
4365
4394
  if(event.lastupdated != null && (event.lastupdated).length > 0) {
4366
4395
  html += '<th part="td-head">';
4367
4396
  html += 'Updated'
@@ -4399,7 +4428,11 @@ export class SfIEvents extends LitElement {
4399
4428
 
4400
4429
  html += '<tbody>';
4401
4430
  html += '<td id="td-expand-'+i+'" part="td-body">';
4402
- html += '<button id="button-unmapped-expand-'+mmdd.replace('/', '-')+'-'+j+'" part="button-icon-small" class="material-icons button-expand mr-10">open_in_new</button>'
4431
+ if(event.isbulk == null || !event.isbulk){
4432
+ html += '<button id="button-unmapped-expand-'+mmdd.replace('/', '-')+'-'+j+'" part="button-icon-small" class="material-icons button-expand mr-10">open_in_new</button>'
4433
+ }else{
4434
+ html += '<div class="lds-dual-ring1"></div>';
4435
+ }
4403
4436
  html += '</td>';
4404
4437
  html += '<td part="td-body">';
4405
4438
  html += this.renderStatusHtml(partStatus, lateStatus, complianceStatus, i);
@@ -4575,7 +4608,7 @@ export class SfIEvents extends LitElement {
4575
4608
 
4576
4609
  }
4577
4610
 
4578
- renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null) => {
4611
+ renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string) => {
4579
4612
  var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0;
4580
4613
  var html = '';
4581
4614
  this.selectedItemIds = [];
@@ -4593,7 +4626,7 @@ export class SfIEvents extends LitElement {
4593
4626
  this.clearSelectedLegend();
4594
4627
 
4595
4628
 
4596
- html += this.renderCalendarGraphs(showGraph);
4629
+ html += this.renderCalendarGraphs(showGraph, parametersTitle);
4597
4630
  html += this.renderCalendarContainerDivStart(index)
4598
4631
  html += this.renderCalendarEventSummary();
4599
4632
 
@@ -4837,7 +4870,7 @@ export class SfIEvents extends LitElement {
4837
4870
  endDay?.setDate(endDay.getDate() + lastDay + 1);
4838
4871
  var period = ("0" + (month+1)).slice(-2) + "/" + ("0" + 1).slice(-2) + '/' + new Date().getFullYear() + ' - ' + ("0" + (month+1)).slice(-2) + "/" + ("0" + lastDay).slice(-2) + '/' + new Date().getFullYear()
4839
4872
 
4840
- return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, month, period);
4873
+ return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, month, period, null, this.monthNames[month] + " " + year);
4841
4874
 
4842
4875
  }
4843
4876
 
@@ -4871,7 +4904,7 @@ export class SfIEvents extends LitElement {
4871
4904
 
4872
4905
  var period = ("0" + (firstDate.getMonth()+1)).slice(-2) + "/" + ("0" + 1).slice(-2) + '/' + firstDate.getFullYear() + ' - ' + ("0" + (firstDate.getMonth()+1)).slice(-2) + "/" + ("0" + count).slice(-2) + '/' + firstDate.getFullYear()
4873
4906
 
4874
- return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, (firstDate.getMonth()), period);
4907
+ return this.renderEvents(firstDay, endDay, 1, lastDay, showGraph, index, (firstDate.getMonth()), period, null, "This " + (index === 0 ? "Week" : "Month"));
4875
4908
 
4876
4909
  }
4877
4910
 
@@ -4890,7 +4923,7 @@ export class SfIEvents extends LitElement {
4890
4923
 
4891
4924
  //console.log('rangeperiod', period)
4892
4925
 
4893
- var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate);
4926
+ var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
4894
4927
 
4895
4928
  eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
4896
4929
 
@@ -9559,16 +9592,17 @@ export class SfIEvents extends LitElement {
9559
9592
  }
9560
9593
 
9561
9594
  renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null) => {
9562
- console.log('event details', event, mmddyyyy);
9595
+ console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
9563
9596
 
9564
9597
  let comments, docs, approved, dateOfCompletion, makercheckers: Array<string>, docsOptional, documentType;
9565
9598
  let entityId: string = "";
9566
9599
  let locationId: string = "";
9567
9600
  let statuteName: string = "";
9568
9601
  let reportformatName: string = "";
9569
-
9602
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
9570
9603
  entityId = event.entityid;
9571
9604
  locationId = event.locationid;
9605
+ let completeness = this.getCompletenessStatus(event);
9572
9606
  comments = event['comments'] == null ? [] : (event['comments']);
9573
9607
  docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
9574
9608
  approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
@@ -9939,6 +9973,10 @@ export class SfIEvents extends LitElement {
9939
9973
  html += '<br />';
9940
9974
  if(makercheckers.length > 0) {
9941
9975
  html += '<div part="td-head" class="td-head d-flex justify-center align-center"><span class="material-symbols-outlined">check_small</span><div>&nbsp;Auto-approve Enabled</div></div>';
9976
+
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" part="button" id="button-auto-approve">Auto Approve</button></div>';
9979
+ }
9942
9980
  }
9943
9981
  html += '</div>';
9944
9982
  html += '</div>';
@@ -10116,6 +10154,59 @@ export class SfIEvents extends LitElement {
10116
10154
  });
10117
10155
  ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
10118
10156
 
10157
+ });
10158
+ (this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
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
+ }
10194
+ //console.log('deleted', resultDelete);
10195
+ if(this.getCurrentTab() == this.TAB_CUSTOM) {
10196
+ this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
10197
+ } else {
10198
+ if(currentColumnButton != null) {
10199
+ currentColumnButton.click();
10200
+ }
10201
+ }
10202
+
10203
+ var clickEvent = new MouseEvent("click", {
10204
+ "view": window,
10205
+ "bubbles": true,
10206
+ "cancelable": false
10207
+ });
10208
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
10209
+
10119
10210
  });
10120
10211
 
10121
10212
  (this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
@@ -10190,7 +10281,13 @@ export class SfIEvents extends LitElement {
10190
10281
  if(this.selectedItemIds.length === 0) {
10191
10282
  // console.log('mmddyyyy', mmddyyyy)
10192
10283
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
10193
-
10284
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10285
+ if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10286
+
10287
+ this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
10288
+ this.events[mmdd][p].lastupdated = new Date().toISOString()
10289
+ }
10290
+ }
10194
10291
  } else {
10195
10292
  let bulkBodyReview = []
10196
10293
  for(var k = 0; k < this.selectedItemIds.length; k++) {
@@ -10226,6 +10323,21 @@ export class SfIEvents extends LitElement {
10226
10323
  }
10227
10324
  await this.uploadReviewsBulk(bulkBodyReview);
10228
10325
 
10326
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
10327
+
10328
+ const selectedId = this.selectedItemIds[k];
10329
+ //console.log('selectedid', selectedId);
10330
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
10331
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
10332
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10333
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10334
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10335
+ if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10336
+
10337
+ this.events[mmdd][p].isbulk = true
10338
+ }
10339
+ }
10340
+ }
10229
10341
  }
10230
10342
 
10231
10343
  if(this.mode == "next"){
@@ -10238,9 +10350,19 @@ export class SfIEvents extends LitElement {
10238
10350
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10239
10351
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10240
10352
  } else {
10241
- if(currentColumnButton != null) {
10242
- currentColumnButton.click();
10353
+ this.renderAppropriateStream(this.sdate,this.edate, true);
10354
+ var clickEvent = new MouseEvent("click", {
10355
+ "view": window,
10356
+ "bubbles": true,
10357
+ "cancelable": false
10358
+ });
10359
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
10360
+ if(this.selectedItemIds.length > 0) {
10361
+ this.fetchBulkReportingData();
10243
10362
  }
10363
+ // if(currentColumnButton != null) {
10364
+ // currentColumnButton.click();
10365
+ // }
10244
10366
  }
10245
10367
  }
10246
10368
 
@@ -10263,7 +10385,13 @@ export class SfIEvents extends LitElement {
10263
10385
  if(this.selectedItemIds.length === 0) {
10264
10386
 
10265
10387
  await this.uploadAudit(entityId, locationId, mmddyyyy, event["id"], comments, approved)
10266
-
10388
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10389
+ if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10390
+ this.events[mmdd][p].approved = approved
10391
+ this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toISOString()})
10392
+ this.events[mmdd][p].lastupdated = new Date().toISOString()
10393
+ }
10394
+ }
10267
10395
  } else {
10268
10396
  let bulkBodyAudit = []
10269
10397
  for(var k = 0; k < this.selectedItemIds.length; k++) {
@@ -10296,6 +10424,21 @@ export class SfIEvents extends LitElement {
10296
10424
  }
10297
10425
 
10298
10426
  await this.uploadAuditsBulk(bulkBodyAudit);
10427
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
10428
+
10429
+ const selectedId = this.selectedItemIds[k];
10430
+ //console.log('selectedid', selectedId);
10431
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
10432
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
10433
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10434
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10435
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10436
+ if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10437
+
10438
+ this.events[mmdd][p].isbulk = true
10439
+ }
10440
+ }
10441
+ }
10299
10442
 
10300
10443
  }
10301
10444
 
@@ -10314,9 +10457,13 @@ export class SfIEvents extends LitElement {
10314
10457
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10315
10458
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10316
10459
  } else {
10317
- if(currentColumnButton != null) {
10318
- currentColumnButton.click();
10460
+ this.renderAppropriateStream(this.sdate,this.edate,true);
10461
+ if(this.selectedItemIds.length > 0) {
10462
+ this.fetchBulkReportingData();
10319
10463
  }
10464
+ // if(currentColumnButton != null) {
10465
+ // currentColumnButton.click();
10466
+ // }
10320
10467
  }
10321
10468
  }
10322
10469
 
@@ -10414,10 +10561,25 @@ export class SfIEvents extends LitElement {
10414
10561
  // console.log('reportformatvalues', reportformatvalues)
10415
10562
  // console.log('reportformatschema',reportformatschema)
10416
10563
  await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema)
10564
+ console.log('this.events', this.events);
10565
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10566
+ if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10567
+ this.events[mmdd][p].documents = docs
10568
+ this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toISOString()})
10569
+ this.events[mmdd][p].lastupdated = new Date().toISOString()
10570
+ }
10571
+ }
10417
10572
  if(makercheckers.length > 0) {
10418
10573
 
10419
10574
  await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], "Auto approved", true);
10420
-
10575
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10576
+ if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10577
+ this.events[mmdd][p].approved = true
10578
+ // this.events[mmdd][p].documents = docs
10579
+ this.events[mmdd][p].comments.push({'author': 'Auditor', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toISOString()})
10580
+ this.events[mmdd][p].lastupdated = new Date().toISOString()
10581
+ }
10582
+ }
10421
10583
  }
10422
10584
 
10423
10585
  } else {
@@ -10483,6 +10645,21 @@ export class SfIEvents extends LitElement {
10483
10645
  if(bulkBodyReview.length > 0){
10484
10646
  await this.uploadReviewsBulk(bulkBodyReview)
10485
10647
  }
10648
+ for(var k = 0; k < this.selectedItemIds.length; k++) {
10649
+
10650
+ const selectedId = this.selectedItemIds[k];
10651
+ //console.log('selectedid', selectedId);
10652
+ entityId = selectedId.split('-')[7].replace(/_/g, '-');
10653
+ locationId = selectedId.split('-')[8].replace(/_/g, '-');
10654
+ const eventId = selectedId.split('-')[9].replace(/_/g, '-');
10655
+ mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
10656
+ for( var p = 0 ; p < this.events[mmdd].length; p ++){
10657
+ if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
10658
+
10659
+ this.events[mmdd][p].isbulk = true
10660
+ }
10661
+ }
10662
+ }
10486
10663
 
10487
10664
  }
10488
10665
 
@@ -10495,9 +10672,13 @@ export class SfIEvents extends LitElement {
10495
10672
  const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
10496
10673
  this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
10497
10674
  } else {
10498
- if(currentColumnButton != null) {
10499
- currentColumnButton.click();
10675
+ this.renderAppropriateStream(this.sdate,this.edate,true)
10676
+ if(this.selectedItemIds.length > 0) {
10677
+ this.fetchBulkReportingData();
10500
10678
  }
10679
+ // if(currentColumnButton != null) {
10680
+ // currentColumnButton.click();
10681
+ // }
10501
10682
  }
10502
10683
  }
10503
10684
 
@@ -16781,7 +16962,7 @@ export class SfIEvents extends LitElement {
16781
16962
  (graphparamnames1[i] as HTMLDivElement).style.display = 'block';
16782
16963
  if(graphparamnames2 != null && graphparamnames2[i] != null) (graphparamnames2[i] as HTMLDivElement).style.display = 'block';
16783
16964
  if(graphparamnames3 != null && graphparamnames3[i] != null) (graphparamnames3[i] as HTMLDivElement).style.display = 'block';
16784
- (eventTitles[i] as HTMLDivElement).style.display = 'flex';
16965
+ if(eventTitles[i] != null)(eventTitles[i] as HTMLDivElement).style.display = 'flex';
16785
16966
  if(eventSubTitles[i] != null) {
16786
16967
  (eventSubTitles[i] as HTMLDivElement).style.display = 'flex';
16787
16968
  }
@@ -18185,7 +18366,7 @@ export class SfIEvents extends LitElement {
18185
18366
  }
18186
18367
 
18187
18368
  uploadAudit = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any) => {
18188
- let url = "https://"+this.apiId+"/uploadaudit";
18369
+ let url = "https://"+this.apiId+"/uploadaudit1";
18189
18370
 
18190
18371
  const body = {
18191
18372
  "mmddyyyy": mmddyyyy,
@@ -18223,7 +18404,7 @@ export class SfIEvents extends LitElement {
18223
18404
  }
18224
18405
  }
18225
18406
  uploadAuditsBulk = async (bulkBody: any) => {
18226
- let url = "https://"+this.apiId+"/uploadauditsbulk";
18407
+ let url = "https://"+this.apiId+"/uploadauditsbulk1";
18227
18408
 
18228
18409
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18229
18410
  const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
@@ -18242,7 +18423,7 @@ export class SfIEvents extends LitElement {
18242
18423
  }
18243
18424
 
18244
18425
  uploadReview = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any) => {
18245
- let url = "https://"+this.apiId+"/uploadreview";
18426
+ let url = "https://"+this.apiId+"/uploadreview1";
18246
18427
 
18247
18428
  const body = {
18248
18429
  "mmddyyyy": mmddyyyy,
@@ -18282,7 +18463,7 @@ export class SfIEvents extends LitElement {
18282
18463
  }``
18283
18464
  }
18284
18465
  uploadReviewsBulk = async (bulkBody: any) => {
18285
- let url = "https://"+this.apiId+"/uploadreviewsbulk";
18466
+ let url = "https://"+this.apiId+"/uploadreviewsbulk1";
18286
18467
 
18287
18468
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
18288
18469
  const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
@@ -20138,7 +20319,7 @@ export class SfIEvents extends LitElement {
20138
20319
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
20139
20320
 
20140
20321
  this.renderAppropriateStream(startDate, endDate, list == "no");
20141
-
20322
+ this.fetchBulkReportingData();
20142
20323
  // this.events = {}
20143
20324
  // this.events = {...JSON.parse(JSON.stringify(jsonRespose.data.events))};
20144
20325
 
@@ -20213,6 +20394,40 @@ export class SfIEvents extends LitElement {
20213
20394
  }
20214
20395
 
20215
20396
  }
20397
+
20398
+ fetchBulkReportingData = async() => {
20399
+ let path = "getbulkreportjobs"
20400
+ let urlBody :any = {"projectid": this.projectId}
20401
+ let url = "https://"+this.apiId+"/"+ path;
20402
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
20403
+ const xhr : any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
20404
+ this._SfLoader.innerHTML = '';
20405
+ if(xhr.status == 200) {
20406
+
20407
+ const jsonRespose = JSON.parse(xhr.responseText);
20408
+ console.log('bulk reports jsonRespose', jsonRespose);
20409
+ if(jsonRespose.result == true){
20410
+ for(let sortid of Object.keys(jsonRespose.data)){
20411
+ let sortidArr = sortid.split(';')
20412
+ let mmddyyyy = sortidArr[0]
20413
+ let entityid = sortidArr[1]
20414
+ let locationid = sortidArr[2]
20415
+ let eventid = sortidArr[3]
20416
+ let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
20417
+ console.log('mmdd', mmdd, Object.keys(this.events));
20418
+ for (let i = 0 ; i < this.events[mmdd].length; i ++){
20419
+ if(this.events[mmdd][i].entityid == entityid && this.events[mmdd][i].locationid == locationid && this.events[mmdd][i].id == eventid){
20420
+ this.events[mmdd][i].isbulk = true;
20421
+ break
20422
+ }
20423
+ }
20424
+ }
20425
+ if(Object.keys(jsonRespose.data).length > 0){
20426
+ this.renderAppropriateStream(this.sdate,this.edate,true)
20427
+ }
20428
+ }
20429
+ }
20430
+ }
20216
20431
 
20217
20432
  fetchUserCalendar = async() => {
20218
20433
 
package/src/util.ts CHANGED
@@ -219,7 +219,7 @@ const validateName = (name: string) => {
219
219
  if (interval > 1) {
220
220
  return Math.floor(interval) + " minutes later";
221
221
  }
222
- return Math.floor(Math.abs(seconds)) + " seconds later";
222
+ return Math.floor(Math.abs(seconds)) + " seconds";
223
223
 
224
224
  }
225
225
  }
package/util.js CHANGED
@@ -191,7 +191,7 @@ const timeSince = (date) => {
191
191
  if (interval > 1) {
192
192
  return Math.floor(interval) + " minutes later";
193
193
  }
194
- return Math.floor(Math.abs(seconds)) + " seconds later";
194
+ return Math.floor(Math.abs(seconds)) + " seconds";
195
195
  }
196
196
  };
197
197
  function readCookie(key) {