sf-i-events 1.0.938 → 1.0.940

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/dev/index.html CHANGED
@@ -25,7 +25,8 @@
25
25
  import { SfISubSelect } from 'https://esm.run/sf-i-sub-select@1.0.83/sf-i-sub-select.js';
26
26
  import { SfIForm } from 'https://esm.run/sf-i-form@1.0.185/sf-i-form.js';
27
27
  import { SfIElasticText } from 'https://esm.run/sf-i-elastic-text@1.0.18/sf-i-elastic-text.js';
28
- import { SfIUploader } from 'https://esm.run/sf-i-uploader@1.0.125/sf-i-uploader.js';
28
+ // import { SfIUploader } from 'https://esm.run/sf-i-uploader@1.0.125/sf-i-uploader.js';
29
+ import { SfIUploader } from '../../sf-i-uploader/sf-i-uploader.js';
29
30
  import { SfIMultitextarea } from 'https://esm.run/sf-i-multitextarea@1.0.23/sf-i-multitextarea.js';
30
31
  // import { SfIReporting } from 'https://esm.run/sf-i-reporting@1.0.89/sf-i-reporting.js';
31
32
  import { SfIReporting } from '../../sf-i-reporting/sf-i-reporting.js';
@@ -1082,6 +1083,35 @@
1082
1083
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile"
1083
1084
  disablesignoff="yes" disableclientresponse="yes">
1084
1085
 
1086
+ </sf-i-events> -->
1087
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
1088
+ apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
1089
+ apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
1090
+ apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
1091
+ apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws"
1092
+ apiidagreements="swago3unro2te55ikvjuqwcrr40wluqh.lambda-url.us-east-1.on.aws"
1093
+ apiidlicenses="lbtsbsctcdsyah4qdszkv4rctq0tnvel.lambda-url.us-east-1.on.aws"
1094
+ apiidrcmresources="jra3sghasmaxn5aiq7rtv6pjzq0oeuaw.lambda-url.us-east-1.on.aws" fill="solid"
1095
+ username="Madhura Zende Internal" userprofileid="8d3edbb1-8318-4525-978a-ecc4c5a8e713"
1096
+ projectid="d7d4d17e-3e20-4eaa-a06a-fb1c87f26532" projectname="FlaggGRC Global"
1097
+ countryid="c48d7cc1-62df-41b3-807a-5744973db3d9" selectedcriteria="Country - India" myrole="approver"
1098
+ showregisterexport="false" features="[&quot;rcmresources&quot;]"
1099
+ 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;}]"
1100
+ 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;}]"
1101
+ eventpreviewfields="[&quot;obligation&quot;]"
1102
+ eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]"
1103
+ calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
1104
+
1105
+ <div slot="uploader">
1106
+ <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
1107
+ allowedextensions="[&quot;jpg&quot;,&quot;jpeg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;,&quot;zip&quot;]"
1108
+ extract="yes" projectid="d7d4d17e-3e20-4eaa-a06a-fb1c87f26532" maxsize="31457280"
1109
+ allowdownload="yes"></sf-i-uploader>
1110
+ </div>
1111
+ <div slot="reporting">
1112
+ <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
1113
+ </div>
1114
+
1085
1115
  </sf-i-events> -->
1086
1116
  <script>
1087
1117
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.938",
4
+ "version": "1.0.940",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
@@ -60,7 +60,7 @@
60
60
  "sf-i-elastic-text": "^1.0.17",
61
61
  "sf-i-form": "^1.0.186",
62
62
  "sf-i-multitextarea": "^1.0.7",
63
- "sf-i-reporting": "^1.0.89",
63
+ "sf-i-reporting": "^1.0.117",
64
64
  "sf-i-select": "^1.0.80",
65
65
  "sf-i-sub-select": "^1.0.68",
66
66
  "sf-i-uploader": "^1.0.123",
package/sf-i-events.js CHANGED
@@ -2613,15 +2613,19 @@ let SfIEvents = class SfIEvents extends LitElement {
2613
2613
  </button>
2614
2614
  ` : ''}
2615
2615
  ${showReview ? `
2616
- <input
2617
- type="checkbox"
2616
+ ${isReviewed ? `<button
2618
2617
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
2619
- part="input-checkbox"
2620
- class="material-icons ml-10 input-checkbox-review"
2621
- ${isReviewed ? 'checked' : ''}
2622
- />
2623
- <label for="input-checkbox-review-${mmddSanitized}-${itemNumber}" part="label-checkbox" class="label-checkbox">${isReviewed ? 'Reviewed' : 'Review'}</label>
2618
+ part="button-icon-reviewed"
2619
+ class="d-flex align-center ml-10 button-icon-review">
2620
+ <span class="material-symbols-outlined" title="Mark as not reviewed">flag_check</span>&nbsp;&nbsp;Reviewed
2621
+ </button>` : `<button
2622
+ id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
2623
+ part="button-icon-review"
2624
+ class="ml-10 button-icon-review">
2625
+ Mark Reviewed
2626
+ </button>`}
2624
2627
  ` : ''}
2628
+
2625
2629
  ${showLastUpdated ? `
2626
2630
  &nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">
2627
2631
  ${lastUpdated}
@@ -2914,7 +2918,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2914
2918
  let approverStr = event.concise == null ? this.getApproverStringFromEvent(event) : "";
2915
2919
  let graphParam = this.getGraphParam(event);
2916
2920
  // console.log("graphParam", graphParam.split(';')[0]);
2917
- html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + ((event.module == "compliances" || event.module == null) ? ('<input type="checkbox" id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="input-checkbox" class="material-icons mb-20 ml-10 input-checkbox-review"' + (event.review ? 'checked' : '') + '/><label for="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="label-checkbox" class="label-checkbox mb-20">' + (event.review ? 'Reviewed' : 'Review') + '</label></div>') : '</div>');
2921
+ html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as not reviewed">flag_check</span>&nbsp;&nbsp;Reviewed</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="mb-20 ml-10 button-icon-review">Mark Reviewed</button>')) : '') + '</div>';
2918
2922
  // }
2919
2923
  return html;
2920
2924
  };
@@ -4645,9 +4649,9 @@ let SfIEvents = class SfIEvents extends LitElement {
4645
4649
  }
4646
4650
  };
4647
4651
  this.attachReviewListeners = (eventsContainer) => {
4648
- let inputReviews = eventsContainer.querySelectorAll('.input-checkbox-review');
4649
- for (let inputReview of inputReviews) {
4650
- inputReview === null || inputReview === void 0 ? void 0 : inputReview.addEventListener('click', async (ev) => {
4652
+ let buttonReviews = eventsContainer.querySelectorAll('.button-icon-review');
4653
+ for (let buttonReview of buttonReviews) {
4654
+ buttonReview === null || buttonReview === void 0 ? void 0 : buttonReview.addEventListener('click', async (ev) => {
4651
4655
  const id = ev.target.id;
4652
4656
  const idArr = id.split("-");
4653
4657
  const mmdd = idArr[3] + "/" + idArr[4];
@@ -4656,9 +4660,17 @@ let SfIEvents = class SfIEvents extends LitElement {
4656
4660
  const j = idArr[5];
4657
4661
  console.log('review clicked', mmdd, yyyy, j, this.events[mmdd][j], ev.target.checked);
4658
4662
  let eventKey = this.events[mmdd][j].entityid + ';' + this.events[mmdd][j].locationid + ';' + this.events[mmdd][j].id;
4659
- await this.markReviewed(eventKey, yyyy, ev.target.checked);
4660
- const buttonRefresh = eventsContainer.querySelector('#button-refresh');
4661
- buttonRefresh.click();
4663
+ for (var p = 0; p < Object.keys(this.events).length; p++) {
4664
+ let tempMmDd = Object.keys(this.events)[p];
4665
+ for (var q = 0; q < this.events[tempMmDd].length; q++) {
4666
+ let tempEventKey = this.events[tempMmDd][q].entityid + ';' + this.events[tempMmDd][q].locationid + ';' + this.events[tempMmDd][q].id;
4667
+ if (tempEventKey == eventKey) {
4668
+ this.events[tempMmDd][q].review = ev.target.innerHTML.indexOf('flag_check') < 0;
4669
+ }
4670
+ }
4671
+ }
4672
+ this.markReviewed(eventKey, yyyy, ev.target.innerHTML.indexOf('flag_check') < 0);
4673
+ this.renderAppropriateStream(this.sdate, this.edate, true);
4662
4674
  });
4663
4675
  }
4664
4676
  };
@@ -13164,12 +13176,15 @@ let SfIEvents = class SfIEvents extends LitElement {
13164
13176
  reportingReporting.prepopulateValJson = reportingSchemaValues;
13165
13177
  reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view";
13166
13178
  reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true";
13179
+ // reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
13180
+ // reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
13167
13181
  reportingReporting.flow = "reporting";
13168
13182
  setTimeout(() => {
13169
13183
  reportingReporting.loadMode();
13170
13184
  console.log('list-customreporting', reportingSchemaJson);
13171
13185
  console.log('list-customreporting1', reportingSchemaValues);
13172
13186
  console.log('list-customreporting2', reportingReporting.mode);
13187
+ console.log('list-customreporting3', this.myRole);
13173
13188
  }, 500);
13174
13189
  }
13175
13190
  (_a = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
@@ -13223,7 +13238,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13223
13238
  });
13224
13239
  if (this.mode == "consumer" || this.mode == "next") {
13225
13240
  (_f = this._SfDetailContainer.querySelector('#button-uploader-submit-approve')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async (ev) => {
13226
- var _a, _b, _c, _f, _g;
13241
+ var _a, _b, _c, _f;
13227
13242
  let buttonClick = ev.target;
13228
13243
  buttonClick.innerHTML = "Saving...";
13229
13244
  const comments = this._SfDetailContainer.querySelector('#input-approver-comments').value;
@@ -13241,12 +13256,14 @@ let SfIEvents = class SfIEvents extends LitElement {
13241
13256
  }, 3000);
13242
13257
  return;
13243
13258
  }
13244
- let reportformatvalues = "";
13259
+ let reportformatvalues = {};
13245
13260
  let reportingReporting = this._SfDetailContainer.querySelector('#reporting-reporting');
13246
13261
  console.log('renew reporting', reportingReporting);
13247
13262
  if (reportingReporting != null) {
13248
- reportformatvalues = (_a = JSON.stringify(reportingReporting.selectedValues())) !== null && _a !== void 0 ? _a : "";
13263
+ reportformatvalues = reportingReporting.selectedValues();
13249
13264
  }
13265
+ console.log('reportformatvalues', reportformatvalues, Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues)));
13266
+ // return;
13250
13267
  var clickEvent = new MouseEvent("click", {
13251
13268
  "view": window,
13252
13269
  "bubbles": true,
@@ -13257,7 +13274,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13257
13274
  let flagBulk = false;
13258
13275
  if (this.selectedItemIds.length <= 1) {
13259
13276
  console.log('mmddyyyy', mmddyyyy);
13260
- if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, (_b = listEvent.module) !== null && _b !== void 0 ? _b : "compliance")) {
13277
+ if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, (_a = listEvent.module) !== null && _a !== void 0 ? _a : "compliance")) {
13261
13278
  if (approved) {
13262
13279
  await this.renewRCMResource(listEvent, reportformatvalues);
13263
13280
  }
@@ -13267,7 +13284,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13267
13284
  for (var p = 0; p < this.events[mmdd].length; p++) {
13268
13285
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
13269
13286
  this.events[mmdd][p].approved = approved;
13270
- this.events[mmdd][p].terminated = (_c = (JSON.parse(reportformatvalues).terminated)) !== null && _c !== void 0 ? _c : false;
13287
+ this.events[mmdd][p].terminated = (_b = (reportformatvalues.terminated)) !== null && _b !== void 0 ? _b : false;
13271
13288
  this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
13272
13289
  this.events[mmdd][p].lastupdated = new Date().toString();
13273
13290
  }
@@ -13303,7 +13320,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13303
13320
  "userid": this.userProfileId,
13304
13321
  "userrole": this.myRole,
13305
13322
  "year": yearStr,
13306
- "module": (_f = listEvent.module) !== null && _f !== void 0 ? _f : "compliance"
13323
+ "module": (_c = listEvent.module) !== null && _c !== void 0 ? _c : "compliance"
13307
13324
  });
13308
13325
  // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
13309
13326
  // this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
@@ -13354,7 +13371,7 @@ let SfIEvents = class SfIEvents extends LitElement {
13354
13371
  "bubbles": true,
13355
13372
  "cancelable": false
13356
13373
  });
13357
- (_g = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _g === void 0 ? void 0 : _g.dispatchEvent(clickEvent);
13374
+ (_f = this._SfDetailContainer.querySelector('#button-detail-close')) === null || _f === void 0 ? void 0 : _f.dispatchEvent(clickEvent);
13358
13375
  // if(currentColumnButton != null) {
13359
13376
  // currentColumnButton.click();
13360
13377
  // }
@@ -20548,7 +20565,7 @@ let SfIEvents = class SfIEvents extends LitElement {
20548
20565
  let graphparamname1Arr = graphparamnames1[i].innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ').split(' • ');
20549
20566
  let filterFound = false;
20550
20567
  for (let tempFilterStr of graphparamname1Arr) {
20551
- console.log('graphparamname1Arr', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
20568
+ // console.log('graphparamname1Arr', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
20552
20569
  if (tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') || this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == "") {
20553
20570
  filterFound = true;
20554
20571
  break;
@@ -4844,15 +4844,19 @@ export class SfIEvents extends LitElement {
4844
4844
  </button>
4845
4845
  ` : ''}
4846
4846
  ${showReview ? `
4847
- <input
4848
- type="checkbox"
4847
+ ${isReviewed ? `<button
4849
4848
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
4850
- part="input-checkbox"
4851
- class="material-icons ml-10 input-checkbox-review"
4852
- ${isReviewed ? 'checked' : ''}
4853
- />
4854
- <label for="input-checkbox-review-${mmddSanitized}-${itemNumber}" part="label-checkbox" class="label-checkbox">${isReviewed ? 'Reviewed' : 'Review'}</label>
4849
+ part="button-icon-reviewed"
4850
+ class="d-flex align-center ml-10 button-icon-review">
4851
+ <span class="material-symbols-outlined" title="Mark as not reviewed">flag_check</span>&nbsp;&nbsp;Reviewed
4852
+ </button>` : `<button
4853
+ id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
4854
+ part="button-icon-review"
4855
+ class="ml-10 button-icon-review">
4856
+ Mark Reviewed
4857
+ </button>`}
4855
4858
  ` : ''}
4859
+
4856
4860
  ${showLastUpdated ? `
4857
4861
  &nbsp;&nbsp;<div part="event-last-updated-time" class="d-flex align-center">
4858
4862
  ${lastUpdated}
@@ -5187,7 +5191,7 @@ export class SfIEvents extends LitElement {
5187
5191
 
5188
5192
  let graphParam = this.getGraphParam(event);
5189
5193
  // console.log("graphParam", graphParam.split(';')[0]);
5190
- html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + ((event.module == "compliances" || event.module == null) ? ('<input type="checkbox" id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="input-checkbox" class="material-icons mb-20 ml-10 input-checkbox-review"' + (event.review ? 'checked' : '') + '/><label for="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="label-checkbox" class="label-checkbox mb-20">' + (event.review ? 'Reviewed' : 'Review') + '</label></div>') : '</div>');
5194
+ html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as not reviewed">flag_check</span>&nbsp;&nbsp;Reviewed</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="mb-20 ml-10 button-icon-review">Mark Reviewed</button>')) : '') + '</div>';
5191
5195
  // }
5192
5196
 
5193
5197
  return html;
@@ -7065,9 +7069,9 @@ export class SfIEvents extends LitElement {
7065
7069
  }
7066
7070
 
7067
7071
  attachReviewListeners = (eventsContainer: HTMLDivElement) => {
7068
- let inputReviews = eventsContainer.querySelectorAll('.input-checkbox-review') as NodeListOf<HTMLInputElement>
7069
- for (let inputReview of inputReviews) {
7070
- inputReview?.addEventListener('click', async (ev: any) => {
7072
+ let buttonReviews = eventsContainer.querySelectorAll('.button-icon-review') as NodeListOf<HTMLButtonElement>
7073
+ for (let buttonReview of buttonReviews) {
7074
+ buttonReview?.addEventListener('click', async (ev: any) => {
7071
7075
  const id = ev.target.id;
7072
7076
  const idArr = id.split("-")
7073
7077
  const mmdd = idArr[3] + "/" + idArr[4];
@@ -7076,9 +7080,17 @@ export class SfIEvents extends LitElement {
7076
7080
  const j = idArr[5];
7077
7081
  console.log('review clicked', mmdd, yyyy, j, this.events[mmdd][j], ev.target.checked);
7078
7082
  let eventKey = this.events[mmdd][j].entityid + ';' + this.events[mmdd][j].locationid + ';' + this.events[mmdd][j].id;
7079
- await this.markReviewed(eventKey, yyyy, ev.target.checked);
7080
- const buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
7081
- buttonRefresh.click();
7083
+ for(var p = 0; p < Object.keys(this.events).length; p++) {
7084
+ let tempMmDd = Object.keys(this.events)[p];
7085
+ for(var q = 0; q < this.events[tempMmDd].length; q++) {
7086
+ let tempEventKey = this.events[tempMmDd][q].entityid + ';' + this.events[tempMmDd][q].locationid + ';' + this.events[tempMmDd][q].id;
7087
+ if(tempEventKey == eventKey) {
7088
+ this.events[tempMmDd][q].review = ev.target.innerHTML.indexOf('flag_check') < 0
7089
+ }
7090
+ }
7091
+ }
7092
+ this.markReviewed(eventKey, yyyy, ev.target.innerHTML.indexOf('flag_check') < 0);
7093
+ this.renderAppropriateStream(this.sdate, this.edate, true);
7082
7094
  })
7083
7095
  }
7084
7096
  }
@@ -17005,12 +17017,15 @@ export class SfIEvents extends LitElement {
17005
17017
  if (reportingSchemaValues != "") reportingReporting.prepopulateValJson = reportingSchemaValues
17006
17018
  reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
17007
17019
  reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
17020
+ // reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
17021
+ // reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
17008
17022
  reportingReporting.flow = "reporting"
17009
17023
  setTimeout(() => {
17010
17024
  reportingReporting.loadMode();
17011
17025
  console.log('list-customreporting', reportingSchemaJson);
17012
17026
  console.log('list-customreporting1', reportingSchemaValues);
17013
17027
  console.log('list-customreporting2', reportingReporting.mode);
17028
+ console.log('list-customreporting3', this.myRole);
17014
17029
  }, 500)
17015
17030
  }
17016
17031
 
@@ -17091,12 +17106,14 @@ export class SfIEvents extends LitElement {
17091
17106
  }, 3000);
17092
17107
  return;
17093
17108
  }
17094
- let reportformatvalues = ""
17109
+ let reportformatvalues: any = {}
17095
17110
  let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
17096
17111
  console.log('renew reporting', reportingReporting)
17097
17112
  if (reportingReporting != null) {
17098
- reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
17113
+ reportformatvalues = reportingReporting!.selectedValues()
17099
17114
  }
17115
+ console.log('reportformatvalues', reportformatvalues, Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues)))
17116
+ // return;
17100
17117
  var clickEvent = new MouseEvent("click", {
17101
17118
  "view": window,
17102
17119
  "bubbles": true,
@@ -17117,7 +17134,7 @@ export class SfIEvents extends LitElement {
17117
17134
  for (var p = 0; p < this.events[mmdd].length; p++) {
17118
17135
  if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
17119
17136
  this.events[mmdd][p].approved = approved
17120
- this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
17137
+ this.events[mmdd][p].terminated = (reportformatvalues.terminated) ?? false
17121
17138
  this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
17122
17139
  this.events[mmdd][p].lastupdated = new Date().toString()
17123
17140
  }
@@ -26065,7 +26082,7 @@ export class SfIEvents extends LitElement {
26065
26082
  let graphparamname1Arr = (graphparamnames1[i] as HTMLDivElement).innerHTML.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ').split(' • ');
26066
26083
  let filterFound = false;
26067
26084
  for (let tempFilterStr of graphparamname1Arr) {
26068
- console.log('graphparamname1Arr', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
26085
+ // console.log('graphparamname1Arr', tempFilterStr, this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '), tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' '));
26069
26086
  if (tempFilterStr == this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') || this.graphParam.toLowerCase().replace('&amp;', '&').replace(/-/g, ' ') == "") {
26070
26087
  filterFound = true;
26071
26088
  break;
package/src/util.ts CHANGED
@@ -589,8 +589,67 @@ function isVisible(el: HTMLElement): boolean {
589
589
  );
590
590
  }
591
591
 
592
+ function compareObjects (obj1: any, obj2: any): any {
593
+ if (obj1 === obj2) return {};
594
+
595
+ // If both are arrays
596
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
597
+ const maxLength = Math.max(obj1.length, obj2.length);
598
+ const result: any[] = [];
599
+
600
+ for (let i = 0; i < maxLength; i++) {
601
+ if (i >= obj1.length) {
602
+ result[i] = obj2[i]; // new item
603
+ } else if (i >= obj2.length) {
604
+ result[i] = undefined; // removed item
605
+ } else {
606
+ const diff = compareObjects(obj1[i], obj2[i]);
607
+ if (Object.keys(diff).length > 0) {
608
+ result[i] = diff;
609
+ }
610
+ }
611
+ }
612
+
613
+ return result.filter(v => v !== undefined).length > 0 ? result : {};
614
+ }
615
+ // If both are objects
616
+ if (
617
+ typeof obj1 === "object" &&
618
+ obj1 !== null &&
619
+ typeof obj2 === "object" &&
620
+ obj2 !== null
621
+ ) {
622
+ const keys = new Set([...Object.keys(obj1), ...Object.keys(obj2)]);
623
+ const diff: Record<string, any> = {};
624
+
625
+ for (const key of keys) {
626
+ if (!(key in obj1)) {
627
+ diff[key] = [null,(obj2 as any)[key]];
628
+ } else if (!(key in obj2)) {
629
+ diff[key] = [(obj1 as any)[key], null];
630
+ } else {
631
+ const valueDiff = compareObjects((obj1 as any)[key], (obj2 as any)[key]);
632
+ if (
633
+ typeof valueDiff === "object" &&
634
+ valueDiff !== null &&
635
+ Object.keys(valueDiff).length === 0
636
+ ) {
637
+ continue;
638
+ }
639
+ if (valueDiff !== undefined) {
640
+ diff[key] = valueDiff;
641
+ }
642
+ }
643
+ }
644
+
645
+ return Object.keys(diff).length > 0 ? diff : {};
646
+ }
647
+
648
+ // Primitive comparison
649
+ return obj1 !== obj2 ? [obj1,obj2] : [];
650
+ }
592
651
  const exportFunctions = {
593
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible
652
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
594
653
  };
595
654
 
596
655
  export default exportFunctions;
package/util.d.ts CHANGED
@@ -24,6 +24,7 @@ declare function getFeatures(): any;
24
24
  export declare const downloadExcelFromCSV: (csvString: string, fileName: string | undefined, title: string, projectname: string) => void;
25
25
  declare function isJSONParsable(str: unknown): boolean;
26
26
  declare function isVisible(el: HTMLElement): boolean;
27
+ declare function compareObjects(obj1: any, obj2: any): any;
27
28
  declare const exportFunctions: {
28
29
  callApiPresignedDelete: typeof callApiPresignedDelete;
29
30
  callApiPresignedGet: typeof callApiPresignedGet;
@@ -53,6 +54,7 @@ declare const exportFunctions: {
53
54
  downloadExcelFromCSV: (csvString: string, fileName: string | undefined, title: string, projectname: string) => void;
54
55
  isJSONParsable: typeof isJSONParsable;
55
56
  isVisible: typeof isVisible;
57
+ compareObjects: typeof compareObjects;
56
58
  };
57
59
  export default exportFunctions;
58
60
  //# sourceMappingURL=util.d.ts.map
package/util.js CHANGED
@@ -495,8 +495,62 @@ function isVisible(el) {
495
495
  style.visibility !== "hidden" &&
496
496
  style.opacity !== "0");
497
497
  }
498
+ function compareObjects(obj1, obj2) {
499
+ if (obj1 === obj2)
500
+ return {};
501
+ // If both are arrays
502
+ if (Array.isArray(obj1) && Array.isArray(obj2)) {
503
+ const maxLength = Math.max(obj1.length, obj2.length);
504
+ const result = [];
505
+ for (let i = 0; i < maxLength; i++) {
506
+ if (i >= obj1.length) {
507
+ result[i] = obj2[i]; // new item
508
+ }
509
+ else if (i >= obj2.length) {
510
+ result[i] = undefined; // removed item
511
+ }
512
+ else {
513
+ const diff = compareObjects(obj1[i], obj2[i]);
514
+ if (Object.keys(diff).length > 0) {
515
+ result[i] = diff;
516
+ }
517
+ }
518
+ }
519
+ return result.filter(v => v !== undefined).length > 0 ? result : {};
520
+ }
521
+ // If both are objects
522
+ if (typeof obj1 === "object" &&
523
+ obj1 !== null &&
524
+ typeof obj2 === "object" &&
525
+ obj2 !== null) {
526
+ const keys = new Set([...Object.keys(obj1), ...Object.keys(obj2)]);
527
+ const diff = {};
528
+ for (const key of keys) {
529
+ if (!(key in obj1)) {
530
+ diff[key] = [null, obj2[key]];
531
+ }
532
+ else if (!(key in obj2)) {
533
+ diff[key] = [obj1[key], null];
534
+ }
535
+ else {
536
+ const valueDiff = compareObjects(obj1[key], obj2[key]);
537
+ if (typeof valueDiff === "object" &&
538
+ valueDiff !== null &&
539
+ Object.keys(valueDiff).length === 0) {
540
+ continue;
541
+ }
542
+ if (valueDiff !== undefined) {
543
+ diff[key] = valueDiff;
544
+ }
545
+ }
546
+ }
547
+ return Object.keys(diff).length > 0 ? diff : {};
548
+ }
549
+ // Primitive comparison
550
+ return obj1 !== obj2 ? [obj1, obj2] : [];
551
+ }
498
552
  const exportFunctions = {
499
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible
553
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
500
554
  };
501
555
  export default exportFunctions;
502
556
  //# sourceMappingURL=util.js.map