sf-i-events 1.0.940 → 1.0.942

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
@@ -1084,7 +1084,7 @@
1084
1084
  disablesignoff="yes" disableclientresponse="yes">
1085
1085
 
1086
1086
  </sf-i-events> -->
1087
- <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
1087
+ <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
1088
1088
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
1089
1089
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
1090
1090
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -1112,7 +1112,7 @@
1112
1112
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
1113
1113
  </div>
1114
1114
 
1115
- </sf-i-events> -->
1115
+ </sf-i-events>
1116
1116
  <script>
1117
1117
 
1118
1118
  function setCookie(name, value, days) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.940",
4
+ "version": "1.0.942",
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
@@ -769,6 +769,7 @@ export declare class SfIEvents extends LitElement {
769
769
  uploadReviewsBulk: (bulkBody: any) => Promise<void>;
770
770
  uploadReport: (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string | undefined, reportformatschema: string | undefined, module: string | undefined, percentage: string | undefined, makercheckers: any, reportedlocations?: string) => Promise<boolean>;
771
771
  uploadReportsBulk: (bulkBody: any, showSuccess?: boolean) => Promise<void>;
772
+ sendSuggestions: (eventid: string, eventdelta: any) => Promise<boolean>;
772
773
  uploadMapping: () => Promise<void>;
773
774
  uploadEvents: () => Promise<void>;
774
775
  uploadReprogramTrigger: (eventid: string, timestamp: string) => Promise<void>;
package/sf-i-events.js CHANGED
@@ -2616,13 +2616,13 @@ let SfIEvents = class SfIEvents extends LitElement {
2616
2616
  ${isReviewed ? `<button
2617
2617
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
2618
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
2619
+ class="material-symbols-outlined d-flex align-center ml-10 button-icon-review">
2620
+ flag_check
2621
2621
  </button>` : `<button
2622
2622
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
2623
2623
  part="button-icon-review"
2624
- class="ml-10 button-icon-review">
2625
- Mark Reviewed
2624
+ class="d-flex align-center ml-10 button-icon-review">
2625
+ <span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood
2626
2626
  </button>`}
2627
2627
  ` : ''}
2628
2628
 
@@ -2918,7 +2918,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2918
2918
  let approverStr = event.concise == null ? this.getApproverStringFromEvent(event) : "";
2919
2919
  let graphParam = this.getGraphParam(event);
2920
2920
  // console.log("graphParam", graphParam.split(';')[0]);
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>';
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="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood</button>')) : '') + '</div>';
2922
2922
  // }
2923
2923
  return html;
2924
2924
  };
@@ -13262,7 +13262,9 @@ let SfIEvents = class SfIEvents extends LitElement {
13262
13262
  if (reportingReporting != null) {
13263
13263
  reportformatvalues = reportingReporting.selectedValues();
13264
13264
  }
13265
- console.log('reportformatvalues', reportformatvalues, Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues)));
13265
+ let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues));
13266
+ console.log('reportformatvalues', reportformatvalues, comparedObj);
13267
+ // await this.sendSuggestions(listEvent.id, comparedObj);
13266
13268
  // return;
13267
13269
  var clickEvent = new MouseEvent("click", {
13268
13270
  "view": window,
@@ -13921,20 +13923,27 @@ let SfIEvents = class SfIEvents extends LitElement {
13921
13923
  var html = `
13922
13924
 
13923
13925
  <div part="compliance-detail-title" class="d-flex justify-between">
13926
+ ${(previousId != "" || nextId != "") ? `
13927
+ <div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
13928
+ <button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
13929
+ <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
13930
+ </div>
13931
+ ` : `
13924
13932
  <button part="button-icon" class="material-icons invisible">close</button>
13933
+ `}
13925
13934
  <h3 part="results-title" class="m-0">Compliance Details</h3>
13926
13935
  <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
13927
13936
  </div>
13928
13937
 
13929
13938
  `;
13930
- if (previousId != "" || nextId != "") {
13931
- html += `
13932
- <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
13933
- <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
13934
- <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
13935
- </div>
13936
- `;
13937
- }
13939
+ // if (previousId != "" || nextId != "") {
13940
+ // html += `
13941
+ // <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
13942
+ // <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
13943
+ // <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
13944
+ // </div>
13945
+ // `
13946
+ // }
13938
13947
  if (this.selectedItemIds.length > 1) {
13939
13948
  html += `
13940
13949
 
@@ -22013,6 +22022,47 @@ let SfIEvents = class SfIEvents extends LitElement {
22013
22022
  }, 3000);
22014
22023
  }
22015
22024
  };
22025
+ this.sendSuggestions = async (eventid, eventdelta) => {
22026
+ let url = "https://" + this.apiId + "/sendsuggestions";
22027
+ const body = {
22028
+ "projectid": this.projectId,
22029
+ "objectid": eventid,
22030
+ "objectdelta": JSON.stringify(eventdelta),
22031
+ };
22032
+ let retValue = true;
22033
+ console.log('uploading suggestion', body);
22034
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
22035
+ const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
22036
+ this._SfLoader.innerHTML = '';
22037
+ if (xhr.status == 200) {
22038
+ // const jsonRespose = JSON.parse(xhr.responseText);
22039
+ //console.log('jsonResponse sync', jsonRespose);
22040
+ this.setSuccess("Report uploaded successfully!");
22041
+ setTimeout(() => {
22042
+ this.clearMessages();
22043
+ // this.showChosenMapping();
22044
+ // this.fetchEventMap();
22045
+ // if(this.myRole == this.TAB_REPORTER) {
22046
+ // this.renderMappingTabs(this.TAB_REPORTER);
22047
+ // } else {
22048
+ // this.renderMappingTabs(this.TAB_APPROVER);
22049
+ // }
22050
+ }, 2000);
22051
+ }
22052
+ else {
22053
+ if (xhr.status == 401) {
22054
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
22055
+ this.dispatchEvent(changeEvent);
22056
+ }
22057
+ const jsonRespose = JSON.parse(xhr.responseText);
22058
+ this.setError(jsonRespose.error);
22059
+ setTimeout(() => {
22060
+ this.clearMessages();
22061
+ }, 3000);
22062
+ retValue = false;
22063
+ }
22064
+ return retValue;
22065
+ };
22016
22066
  this.uploadMapping = async () => {
22017
22067
  let url = "https://" + this.apiId + "/mapevents";
22018
22068
  const mapping = this.transformMappingsForUpload({
@@ -22333,7 +22383,7 @@ let SfIEvents = class SfIEvents extends LitElement {
22333
22383
  this._SfDetailContainer.querySelector('#button-show-definition').addEventListener('click', (_e) => {
22334
22384
  this._SfDetailContainer.querySelector('#container-definition').innerHTML = '<div class="m-20"><div part="detail-head" class="mb-10"><strong>Definitions</strong></div><sf-i-uploader class="gone" id="sf-i-definitions" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;]" extract="no" mandatory="" mode="view" maximize="yes"></sf-i-uploader></div>';
22335
22385
  this._SfDetailContainer.querySelector('#sf-i-definitions').classList.remove('gone');
22336
- this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify(JSON.parse('[' + attachmentKey + ']'));
22386
+ this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify([attachmentKey]);
22337
22387
  this._SfDetailContainer.querySelector('#sf-i-definitions').loadMode();
22338
22388
  });
22339
22389
  }
@@ -4847,13 +4847,13 @@ export class SfIEvents extends LitElement {
4847
4847
  ${isReviewed ? `<button
4848
4848
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
4849
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
4850
+ class="material-symbols-outlined d-flex align-center ml-10 button-icon-review">
4851
+ flag_check
4852
4852
  </button>` : `<button
4853
4853
  id="input-checkbox-review-${mmddSanitized}-${itemNumber}"
4854
4854
  part="button-icon-review"
4855
- class="ml-10 button-icon-review">
4856
- Mark Reviewed
4855
+ class="d-flex align-center ml-10 button-icon-review">
4856
+ <span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood
4857
4857
  </button>`}
4858
4858
  ` : ''}
4859
4859
 
@@ -5191,7 +5191,7 @@ export class SfIEvents extends LitElement {
5191
5191
 
5192
5192
  let graphParam = this.getGraphParam(event);
5193
5193
  // console.log("graphParam", graphParam.split(';')[0]);
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>';
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="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood</button>')) : '') + '</div>';
5195
5195
  // }
5196
5196
 
5197
5197
  return html;
@@ -17112,7 +17112,9 @@ export class SfIEvents extends LitElement {
17112
17112
  if (reportingReporting != null) {
17113
17113
  reportformatvalues = reportingReporting!.selectedValues()
17114
17114
  }
17115
- console.log('reportformatvalues', reportformatvalues, Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues)))
17115
+ let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues))
17116
+ console.log('reportformatvalues', reportformatvalues, comparedObj)
17117
+ // await this.sendSuggestions(listEvent.id, comparedObj);
17116
17118
  // return;
17117
17119
  var clickEvent = new MouseEvent("click", {
17118
17120
  "view": window,
@@ -17855,21 +17857,28 @@ export class SfIEvents extends LitElement {
17855
17857
  var html = `
17856
17858
 
17857
17859
  <div part="compliance-detail-title" class="d-flex justify-between">
17860
+ ${(previousId != "" || nextId != "") ? `
17861
+ <div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
17862
+ <button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
17863
+ <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
17864
+ </div>
17865
+ ` : `
17858
17866
  <button part="button-icon" class="material-icons invisible">close</button>
17867
+ `}
17859
17868
  <h3 part="results-title" class="m-0">Compliance Details</h3>
17860
17869
  <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
17861
17870
  </div>
17862
17871
 
17863
17872
  `;
17864
17873
 
17865
- if (previousId != "" || nextId != "") {
17866
- html += `
17867
- <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
17868
- <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
17869
- <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
17870
- </div>
17871
- `
17872
- }
17874
+ // if (previousId != "" || nextId != "") {
17875
+ // html += `
17876
+ // <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
17877
+ // <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
17878
+ // <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
17879
+ // </div>
17880
+ // `
17881
+ // }
17873
17882
 
17874
17883
  if (this.selectedItemIds.length > 1) {
17875
17884
 
@@ -27844,6 +27853,50 @@ export class SfIEvents extends LitElement {
27844
27853
  }
27845
27854
  }
27846
27855
 
27856
+ sendSuggestions = async (eventid: string, eventdelta:any) => {
27857
+ let url = "https://" + this.apiId + "/sendsuggestions";
27858
+
27859
+ const body = {
27860
+ "projectid": this.projectId,
27861
+ "objectid": eventid,
27862
+ "objectdelta": JSON.stringify(eventdelta),
27863
+ }
27864
+ let retValue = true;
27865
+ console.log('uploading suggestion', body);
27866
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
27867
+ const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
27868
+ this._SfLoader.innerHTML = '';
27869
+ if (xhr.status == 200) {
27870
+
27871
+ // const jsonRespose = JSON.parse(xhr.responseText);
27872
+ //console.log('jsonResponse sync', jsonRespose);
27873
+ this.setSuccess("Report uploaded successfully!");
27874
+ setTimeout(() => {
27875
+ this.clearMessages()
27876
+ // this.showChosenMapping();
27877
+ // this.fetchEventMap();
27878
+ // if(this.myRole == this.TAB_REPORTER) {
27879
+ // this.renderMappingTabs(this.TAB_REPORTER);
27880
+ // } else {
27881
+ // this.renderMappingTabs(this.TAB_APPROVER);
27882
+ // }
27883
+ }, 2000);
27884
+
27885
+ } else {
27886
+ if (xhr.status == 401) {
27887
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
27888
+ this.dispatchEvent(changeEvent);
27889
+ }
27890
+ const jsonRespose = JSON.parse(xhr.responseText);
27891
+ this.setError(jsonRespose.error);
27892
+ setTimeout(() => {
27893
+ this.clearMessages();
27894
+ }, 3000);
27895
+ retValue = false;
27896
+ }
27897
+ return retValue;
27898
+ }
27899
+
27847
27900
  uploadMapping = async () => {
27848
27901
 
27849
27902
  let url = "https://" + this.apiId + "/mapevents";
@@ -28264,7 +28317,7 @@ export class SfIEvents extends LitElement {
28264
28317
  ((this._SfDetailContainer as HTMLDivElement).querySelector('#button-show-definition') as HTMLButtonElement)!.addEventListener('click', (_e: any) => {
28265
28318
  (this._SfDetailContainer as HTMLDivElement).querySelector('#container-definition')!.innerHTML = '<div class="m-20"><div part="detail-head" class="mb-10"><strong>Definitions</strong></div><sf-i-uploader class="gone" id="sf-i-definitions" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;]" extract="no" mandatory="" mode="view" maximize="yes"></sf-i-uploader></div>';
28266
28319
  ((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).classList.remove('gone');
28267
- ((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).prepopulatedInputArr = JSON.stringify(JSON.parse('[' + attachmentKey + ']'));
28320
+ ((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).prepopulatedInputArr = JSON.stringify([attachmentKey]);
28268
28321
  ((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).loadMode();
28269
28322
  });
28270
28323