sf-i-events 1.0.852 → 1.0.854

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.852",
4
+ "version": "1.0.854",
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
@@ -438,6 +438,7 @@ export declare class SfIEvents extends LitElement {
438
438
  insertDates: (month: number, year: number) => string;
439
439
  insertDayNames: () => string;
440
440
  getYearFromMonthAndCalendarStart: (mm: string) => string;
441
+ getAboutToExpire: (mmdd: string, event: any) => boolean;
441
442
  getPastDueDate: (mmdd: string) => boolean;
442
443
  getLateExecuted: (mmdd: string, event: any) => boolean;
443
444
  getLateReported: (mmdd: string, event: any) => boolean;
@@ -463,7 +464,7 @@ export declare class SfIEvents extends LitElement {
463
464
  renderLatestCompliance: (mmddyyyy: string, event: any) => any;
464
465
  getCompletenessStatus: (event: any) => "rejected" | "not-started" | "pending-approval" | "approved";
465
466
  getTimelinessStatus: (mmdd: string, event: any, completeness: string) => "late-executed" | "late-reported" | "late-approved" | "past-due-date" | "in-time";
466
- getComplianceStatus: (completeness: string, timeliness: string, percentage?: string, event?: any) => "active" | "expired" | "scheduled" | "not-complied" | "partially-complied" | "complied" | "complied-with-gaps" | "reported-non-compliance";
467
+ getComplianceStatus: (completeness: string, timeliness: string, percentage?: string, event?: any, mmdd?: string) => "active" | "expired" | "scheduled" | "not-complied" | "partially-complied" | "complied" | "complied-with-gaps" | "reported-non-compliance" | "about-to-expire";
467
468
  numcalled: number;
468
469
  updateStats: (event: any, partStatus: string, lateStatus: string, complianceStatus: string) => void;
469
470
  renderCalendarGraphs: (showGraph: boolean, parametersTitle: string, showBackgroundButton: boolean) => string;
package/sf-i-events.js CHANGED
@@ -1660,6 +1660,24 @@ let SfIEvents = class SfIEvents extends LitElement {
1660
1660
  }
1661
1661
  return yyyy;
1662
1662
  };
1663
+ this.getAboutToExpire = (mmdd, event) => {
1664
+ // console.log('about to expire', mmdd, event.duedate)
1665
+ const tsDoc = new Date(parseInt(event.duedate)).getTime();
1666
+ const dd = mmdd.substring(3, 5);
1667
+ const mm = mmdd.substring(0, 2);
1668
+ var yyyy = this.getYearFromMonthAndCalendarStart(mm);
1669
+ var date = new Date();
1670
+ date.setMonth(parseInt(mm) - 1);
1671
+ date.setDate(parseInt(dd));
1672
+ date.setFullYear(parseInt(yyyy));
1673
+ const tsCurr = date.getTime();
1674
+ console.log('about to expire', mmdd, tsDoc, tsCurr);
1675
+ if ((tsDoc - tsCurr) < (30 * 24 * 60 * 1000)) { // less than 60 days
1676
+ //console.log('late executed', true)
1677
+ return true;
1678
+ }
1679
+ return false;
1680
+ };
1663
1681
  this.getPastDueDate = (mmdd) => {
1664
1682
  const dd = mmdd.substring(3, 5);
1665
1683
  const mm = mmdd.substring(0, 2);
@@ -2113,11 +2131,16 @@ let SfIEvents = class SfIEvents extends LitElement {
2113
2131
  }
2114
2132
  }
2115
2133
  };
2116
- this.getComplianceStatus = (completeness, timeliness, percentage, event = {}) => {
2134
+ this.getComplianceStatus = (completeness, timeliness, percentage, event = {}, mmdd = "") => {
2117
2135
  if (event.module == "agreement") {
2118
2136
  if (completeness == "not-started") {
2119
2137
  if (timeliness == "in-time") {
2120
- return "active";
2138
+ if (this.getAboutToExpire(mmdd, event)) {
2139
+ return "about-to-expire";
2140
+ }
2141
+ else {
2142
+ return "active";
2143
+ }
2121
2144
  }
2122
2145
  else {
2123
2146
  return "expired";
@@ -2229,7 +2252,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2229
2252
  if (this.getFeatures().length > 1) {
2230
2253
  html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>';
2231
2254
  html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">';
2232
- html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>';
2255
+ html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons invisible">check</button></div>';
2233
2256
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
2234
2257
  // part="input-select-feature-label">all</label></div>`
2235
2258
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
@@ -2315,7 +2338,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2315
2338
  if (this.getFeatures().length > 1) {
2316
2339
  html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>';
2317
2340
  html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">';
2318
- html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>';
2341
+ html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons invisible">check</button></div>';
2319
2342
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
2320
2343
  // part="input-select-feature-label">all</label></div>`
2321
2344
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
@@ -8195,6 +8218,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8195
8218
  // (this._SfDetailContainer as HTMLDivElement).style.display = 'block';
8196
8219
  //console.log('commentsinlist', (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement, this.events[mmdd][j].comments, mmdd, j);
8197
8220
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
8221
+ console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
8198
8222
  this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, this._SfStreamContainer.querySelector('#stream-month-' + this.currentColumnIndex), this._SfStreamContainer);
8199
8223
  }
8200
8224
  });
@@ -3657,6 +3657,35 @@ export class SfIEvents extends LitElement {
3657
3657
 
3658
3658
  }
3659
3659
 
3660
+ getAboutToExpire = (mmdd: string, event: any) => {
3661
+
3662
+ // console.log('about to expire', mmdd, event.duedate)
3663
+
3664
+ const tsDoc = new Date(parseInt(event.duedate)).getTime();
3665
+
3666
+ const dd = mmdd.substring(3, 5);
3667
+ const mm = mmdd.substring(0, 2);
3668
+
3669
+ var yyyy = this.getYearFromMonthAndCalendarStart(mm);
3670
+
3671
+ var date = new Date();
3672
+ date.setMonth(parseInt(mm) - 1);
3673
+ date.setDate(parseInt(dd));
3674
+ date.setFullYear(parseInt(yyyy));
3675
+
3676
+ const tsCurr = date.getTime();
3677
+
3678
+ console.log('about to expire', mmdd, tsDoc, tsCurr)
3679
+
3680
+ if ((tsDoc - tsCurr) < (30 * 24 * 60 * 1000)) { // less than 60 days
3681
+ //console.log('late executed', true)
3682
+ return true;
3683
+ }
3684
+
3685
+ return false;
3686
+
3687
+ }
3688
+
3660
3689
  getPastDueDate = (mmdd: string) => {
3661
3690
 
3662
3691
  const dd = mmdd.substring(3, 5);
@@ -4232,12 +4261,16 @@ export class SfIEvents extends LitElement {
4232
4261
 
4233
4262
  }
4234
4263
 
4235
- getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}) => {
4264
+ getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}, mmdd: string = "") => {
4236
4265
  if (event.module == "agreement") {
4237
4266
  if (completeness == "not-started") {
4238
4267
 
4239
4268
  if (timeliness == "in-time") {
4240
- return "active";
4269
+ if(this.getAboutToExpire(mmdd, event)) {
4270
+ return "about-to-expire";
4271
+ }else{
4272
+ return "active";
4273
+ }
4241
4274
  } else {
4242
4275
  return "expired";
4243
4276
  }
@@ -4354,7 +4387,7 @@ export class SfIEvents extends LitElement {
4354
4387
  if (this.getFeatures().length > 1) {
4355
4388
  html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>'
4356
4389
  html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">'
4357
- html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>'
4390
+ html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons invisible">check</button></div>'
4358
4391
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
4359
4392
  // part="input-select-feature-label">all</label></div>`
4360
4393
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
@@ -4446,7 +4479,7 @@ export class SfIEvents extends LitElement {
4446
4479
  if (this.getFeatures().length > 1) {
4447
4480
  html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>'
4448
4481
  html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">'
4449
- html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>'
4482
+ html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons invisible">check</button></div>'
4450
4483
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
4451
4484
  // part="input-select-feature-label">all</label></div>`
4452
4485
  // html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
@@ -11429,6 +11462,7 @@ export class SfIEvents extends LitElement {
11429
11462
 
11430
11463
 
11431
11464
  // this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
11465
+ console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
11432
11466
  this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-' + this.currentColumnIndex) as HTMLButtonElement, this._SfStreamContainer as HTMLDivElement);
11433
11467
  }
11434
11468