sf-i-events 1.0.967 → 1.0.968

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
@@ -1100,7 +1100,7 @@
1100
1100
  </div>
1101
1101
 
1102
1102
  </sf-i-events> -->
1103
- <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event" mode="consumer"
1103
+ <!-- <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event" mode="consumer"
1104
1104
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
1105
1105
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
1106
1106
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -1127,15 +1127,15 @@
1127
1127
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
1128
1128
  </div>
1129
1129
 
1130
- </sf-i-events>
1131
- <!-- <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding"
1130
+ </sf-i-events> -->
1131
+ <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding"
1132
1132
  locations="{&quot;India&quot;:{&quot;Maharashtra&quot;:[&quot;Pune&quot;,&quot;Mumbai&quot;],&quot;Telangana&quot;:[&quot;Telangana&quot;]},&quot;Canada&quot;:{&quot;CanadaSO&quot;:[&quot;CanadaLO&quot;]},&quot;Singapore&quot;:{&quot;SingaporeSO&quot;:[&quot;Orchard&quot;,&quot;Raffles&quot;,&quot;Robinson&quot;,&quot;Tanjong&quot;,&quot;Tras&quot;]},&quot;United Kingdom&quot;:{&quot;UnitedSO&quot;:[&quot;UnitedLO&quot;]},&quot;United States of America&quot;:{&quot;AmericaSO&quot;:[&quot;AmericaLO&quot;]}}"
1133
1133
  contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech"
1134
1134
  apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance"
1135
1135
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile"
1136
1136
  disablesignoff="yes" disableclientresponse="yes">
1137
1137
 
1138
- </sf-i-events> -->
1138
+ </sf-i-events>
1139
1139
  <!-- <sf-i-events projectid="a81b6ae1-98de-4b72-8cf0-9aaee5b61891" projectname="Khaitan" mode="onboarding" locations="{}"
1140
1140
  contractstartdate="01/01/2025" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech"
1141
1141
  apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance"
@@ -1202,6 +1202,44 @@
1202
1202
  </div>
1203
1203
 
1204
1204
  </sf-i-events> -->
1205
+ <!-- <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event-api" mode="consumer"
1206
+ apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
1207
+ apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
1208
+ apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
1209
+ apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws"
1210
+ apiidagreements="swago3unro2te55ikvjuqwcrr40wluqh.lambda-url.us-east-1.on.aws"
1211
+ apiidlicenses="lbtsbsctcdsyah4qdszkv4rctq0tnvel.lambda-url.us-east-1.on.aws"
1212
+ apiidrcmresources="jra3sghasmaxn5aiq7rtv6pjzq0oeuaw.lambda-url.us-east-1.on.aws" fill="solid"
1213
+ username="Ankur Singhal" userprofileid="010834e8-108e-4a87-b58d-f5b429f184be"
1214
+ projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" projectname="Signode"
1215
+ countryid="4ab8901c-4407-4c4d-a2c7-df1a690aa0a3" selectedcriteria="Country - India" myrole="viewer"
1216
+ showregisterexport="false" features="[&quot;contracts&quot;]"
1217
+ 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;}]"
1218
+ 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;}]"
1219
+ eventpreviewfields="[&quot;obligation&quot;]"
1220
+ eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]"
1221
+ calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
1222
+
1223
+ <div slot="uploader">
1224
+ <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3"
1225
+ 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;]"
1226
+ extract="yes" projectid="f0f17ddb-546a-45f5-8a94-a5689fde8e64" maxsize="31457280"
1227
+ allowdownload="yes"></sf-i-uploader>
1228
+ </div>
1229
+ <div slot="reporting">
1230
+ <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
1231
+ </div>
1232
+
1233
+ </sf-i-events> -->
1234
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" mode="reports" fill="pattern"
1235
+ username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410"
1236
+ projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" calendarstartyyyy="2025"
1237
+ myrole="reporter">
1238
+ </sf-i-events> -->
1239
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" mode="reports" fill="pattern"
1240
+ username="Pushti Goenka" userprofileid="8ac7f984-a9e2-46ef-a815-c5116f3e4638"
1241
+ projectid="7f928276-a9ff-4bcd-a8db-874f618a92ea" projectname="Transvolt" calendarstartyyyy="2025" myrole="reporter">
1242
+ </sf-i-events> -->
1205
1243
  <script>
1206
1244
 
1207
1245
  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.967",
4
+ "version": "1.0.968",
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
@@ -582,7 +582,7 @@ export declare class SfIEvents extends LitElement {
582
582
  loadOnboardingReportedLocations: () => Promise<void>;
583
583
  loadOnboardingSignoff: () => Promise<void>;
584
584
  loadOnboardingCalendar: () => Promise<void>;
585
- loadOnboardingSuspense: () => Promise<void>;
585
+ loadOnboardingSuspense: (year?: string) => Promise<void>;
586
586
  calculateStartAndEndDateOfPast: (index?: number) => {
587
587
  startDate: string;
588
588
  endDate: string;
@@ -664,7 +664,8 @@ export declare class SfIEvents extends LitElement {
664
664
  refreshCalendar: () => Promise<void>;
665
665
  renderNewOnboarding: () => void;
666
666
  renderOnboardingSignoff: (signoff: any) => void;
667
- renderOnboardingSuspense: (sourceArray: any, suspenseList: any) => void;
667
+ getAllPastFiscals: (startDate: Date) => number[];
668
+ renderOnboardingSuspense: (sourceArray: any, suspenseList: any, year: string) => void;
668
669
  renderOnboardingSuspenseOld: (_suspenseList: any) => void;
669
670
  renderOnboardingCalendar: (_calendarJobs: any) => void;
670
671
  renderOnboardingTriggers: (mappedTriggers: any, mappedSerializedAlertSchedules: any, triggersJobs: any) => void;
@@ -763,7 +764,7 @@ export declare class SfIEvents extends LitElement {
763
764
  uploadLocationsMapping: (data: any) => Promise<void>;
764
765
  uploadEntitiesMapping: (data: any) => Promise<void>;
765
766
  uploadCountriesMapping: (data: any) => Promise<void>;
766
- uploadMappedSuspense: (data: any) => Promise<any>;
767
+ uploadMappedSuspense: (data: any, year: string) => Promise<any>;
767
768
  uploadOnboardingMapping: (data: any, onboardingstep: string) => Promise<void>;
768
769
  uploadToPresignedUrl: (data: any, url: string) => Promise<void>;
769
770
  uploadCompliancesMapping: (data: any) => Promise<void>;
@@ -852,7 +853,7 @@ export declare class SfIEvents extends LitElement {
852
853
  fetchCalendarJobs: () => Promise<any>;
853
854
  deleteFromSuspense: (suspenseKey: any, year: string) => Promise<any>;
854
855
  markReviewed: (suspenseKey: any, year: string, review: boolean) => Promise<any>;
855
- fetchSuspenseList: () => Promise<any>;
856
+ fetchSuspenseList: (year?: string) => Promise<any>;
856
857
  fetchDetail: (value: any) => Promise<void>;
857
858
  fetchGetMappedCalendar: (year: string) => Promise<any>;
858
859
  sleepFunction: (ms: number) => Promise<unknown>;
@@ -894,8 +895,8 @@ export declare class SfIEvents extends LitElement {
894
895
  fetchReports: () => Promise<void>;
895
896
  renderReports: (reportsData: any) => void;
896
897
  renderDateSelector: (sortid: string) => void;
897
- fetchReportCompliances: (selectedDate: Date, sortid: string) => Promise<void>;
898
- renderReportsComplainces: (compliancesData: any, sortid: string) => void;
898
+ fetchReportCompliances: (selectedDate: Date, locationid: string, sortid: string) => Promise<void>;
899
+ renderReportsCompliances: (compliancesData: any, sortid: string) => void;
899
900
  submitUpdateReporting: (mmddyyyy: string, sortid: string) => Promise<void>;
900
901
  loadMode: () => Promise<void>;
901
902
  constructor();
package/sf-i-events.js CHANGED
@@ -7631,13 +7631,13 @@ let SfIEvents = class SfIEvents extends LitElement {
7631
7631
  const calendarJobs = await this.fetchCalendarJobs();
7632
7632
  this.renderOnboardingCalendar(calendarJobs);
7633
7633
  };
7634
- this.loadOnboardingSuspense = async () => {
7634
+ this.loadOnboardingSuspense = async (year = this.getCurrentYearGeneric()) => {
7635
7635
  this.hideTabContainers();
7636
7636
  this._SfOnboardingSuspenseContainer.style.display = 'flex';
7637
7637
  const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
7638
- const suspenseList = await this.fetchSuspenseList();
7638
+ const suspenseList = await this.fetchSuspenseList(year);
7639
7639
  console.log('suspenseList', suspenseList);
7640
- this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList);
7640
+ this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList, year);
7641
7641
  };
7642
7642
  this.calculateStartAndEndDateOfPast = (index = 0) => {
7643
7643
  //console.log('calculating start and end of past');
@@ -17844,7 +17844,21 @@ let SfIEvents = class SfIEvents extends LitElement {
17844
17844
  this.loadOnboardingSignoff();
17845
17845
  });
17846
17846
  };
17847
- this.renderOnboardingSuspense = (sourceArray, suspenseList) => {
17847
+ this.getAllPastFiscals = (startDate) => {
17848
+ let retArr = [];
17849
+ let date = new Date();
17850
+ while (date.getTime() > startDate.getTime()) {
17851
+ if (date.getMonth() < 3) {
17852
+ retArr.push(date.getFullYear() - 1);
17853
+ }
17854
+ else {
17855
+ retArr.push(date.getFullYear());
17856
+ }
17857
+ date.setFullYear(date.getFullYear() - 1);
17858
+ }
17859
+ return retArr;
17860
+ };
17861
+ this.renderOnboardingSuspense = (sourceArray, suspenseList, year) => {
17848
17862
  console.log('sourceList', sourceArray);
17849
17863
  console.log('suspenseList', suspenseList);
17850
17864
  let sourceCols = ["shortid", "obligationtitle", "obligationtype"];
@@ -17870,7 +17884,13 @@ let SfIEvents = class SfIEvents extends LitElement {
17870
17884
  changed++;
17871
17885
  }
17872
17886
  }
17873
- html += ('<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="mapped-stats-title" part="results-title" class="d-flex align-center m-0">' + status + '&nbsp;&nbsp; ' + tagged + ' in Suspense List out of ' + sourceArray.data.mappings.mappings.length + '</h4></div>');
17887
+ let pastFiscals = [parseInt(this.getCurrentYearGeneric())];
17888
+ if (this.contractStartDate != null) {
17889
+ pastFiscals = this.getAllPastFiscals(new Date(this.contractStartDate));
17890
+ }
17891
+ html += (`<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="mapped-stats-title" part="results-title" class="d-flex align-center m-0">${status}&nbsp;&nbsp; ${tagged} in Suspense List out of ${sourceArray.data.mappings.mappings.length}</h4><h6 class="ml-20" part="onboarding-suspense-year-label">Year</h6><select id="select-year" part="input">${pastFiscals.map((fiscal) => {
17892
+ return `<option value="${fiscal}"${fiscal == parseInt(year) ? " selected" : ""}>${fiscal}-${(fiscal % 100) + 1}</option>`;
17893
+ })}</select></div>`);
17874
17894
  if (changed > 0) {
17875
17895
  html += ('<div class="left-sticky d-flex justify-between align-center mr-10"><h4 part="results-title" class="d-flex align-center m-0"><span class="color-pending material-icons">pending</span>&nbsp;&nbsp;' + changed + ' Items changed</h4></div>');
17876
17896
  }
@@ -17993,6 +18013,11 @@ let SfIEvents = class SfIEvents extends LitElement {
17993
18013
  // html += '</div>';
17994
18014
  html += '</div>';
17995
18015
  this._SfOnboardingSuspenseContainer.innerHTML = html;
18016
+ const inputYear = this._SfOnboardingSuspenseContainer.querySelector('#select-year');
18017
+ inputYear.addEventListener('change', (e) => {
18018
+ const selectedYear = e.currentTarget.value;
18019
+ this.loadOnboardingSuspense(selectedYear);
18020
+ });
17996
18021
  const buttonApply = this._SfOnboardingSuspenseContainer.querySelector('.button-apply');
17997
18022
  buttonApply.addEventListener('click', () => {
17998
18023
  let inputSuspenseCheckboxes = this._SfOnboardingSuspenseContainer.querySelectorAll('.suspense-input');
@@ -18005,14 +18030,14 @@ let SfIEvents = class SfIEvents extends LitElement {
18005
18030
  tempSuspenseList[suspenseKey] = true;
18006
18031
  }
18007
18032
  }
18008
- this.renderOnboardingSuspense(sourceArray, tempSuspenseList);
18033
+ this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year);
18009
18034
  });
18010
18035
  const buttonSave = this._SfOnboardingSuspenseContainer.querySelector('.button-save');
18011
18036
  buttonSave.addEventListener('click', async () => {
18012
18037
  console.log('saving suspense', suspenseList, Object.keys(suspenseList).length);
18013
- let response = await this.uploadMappedSuspense(suspenseList);
18038
+ let response = await this.uploadMappedSuspense(suspenseList, year);
18014
18039
  console.log('suspense save response', response);
18015
- this.loadOnboardingSuspense();
18040
+ this.loadOnboardingSuspense(year);
18016
18041
  });
18017
18042
  const buttonToggleMoreBack = this._SfOnboardingSuspenseContainer.querySelector('.button-toggle-more-back');
18018
18043
  const buttonToggleMore = this._SfOnboardingSuspenseContainer.querySelector('.button-toggle-more');
@@ -18090,7 +18115,7 @@ let SfIEvents = class SfIEvents extends LitElement {
18090
18115
  },
18091
18116
  () => {
18092
18117
  this.clearMessages();
18093
- this.renderOnboardingSuspense(sourceArray, tempSuspenseList);
18118
+ this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year);
18094
18119
  }
18095
18120
  ]);
18096
18121
  // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
@@ -22343,12 +22368,13 @@ let SfIEvents = class SfIEvents extends LitElement {
22343
22368
  this.uploadCountriesMapping = async (data) => {
22344
22369
  await this.uploadOnboardingMapping(data, 'countries');
22345
22370
  };
22346
- this.uploadMappedSuspense = async (data) => {
22371
+ this.uploadMappedSuspense = async (data, year) => {
22347
22372
  //console.log('uploading..', data);
22348
22373
  let url = "https://" + this.apiId + "/updatemappedsuspense";
22349
22374
  const body = {
22350
22375
  "projectid": this.projectId,
22351
22376
  "data": JSON.stringify(data),
22377
+ "year": year
22352
22378
  };
22353
22379
  let authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
22354
22380
  let xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
@@ -23972,10 +23998,12 @@ let SfIEvents = class SfIEvents extends LitElement {
23972
23998
  }
23973
23999
  }
23974
24000
  };
23975
- this.fetchSuspenseList = async () => {
24001
+ this.fetchSuspenseList = async (year = "") => {
23976
24002
  let url = "https://" + this.apiId + "/getsuspenselist1";
23977
24003
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
23978
- const year = this.getCurrentYearGeneric();
24004
+ if (year == "") {
24005
+ year = this.getCurrentYearGeneric();
24006
+ }
23979
24007
  const xhr = (await this.prepareXhr({ "projectid": this.projectId, "year": year }, url, this._SfLoader, authorization));
23980
24008
  this._SfLoader.innerHTML = '';
23981
24009
  if (xhr.status == 200) {
@@ -24582,7 +24610,7 @@ let SfIEvents = class SfIEvents extends LitElement {
24582
24610
  let path = "";
24583
24611
  this.sdate = startDate;
24584
24612
  this.edate = endDate;
24585
- path = "getstatistics";
24613
+ path = "getstatistics1";
24586
24614
  let sDate = "";
24587
24615
  let eDate = "";
24588
24616
  //console.log('currenttab', this.getCurrentTab());
@@ -25634,14 +25662,14 @@ let SfIEvents = class SfIEvents extends LitElement {
25634
25662
  let url = "https://" + this.apiId + "/getreports";
25635
25663
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
25636
25664
  console.log('this.myroles', this.myroles);
25637
- const xhr = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId }, url, this._SfLoader, authorization));
25665
+ const xhr = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId, "year": this.calendarStartYYYY }, url, this._SfLoader, authorization));
25638
25666
  this._SfLoader.innerHTML = '';
25639
25667
  if (xhr.status == 200) {
25640
25668
  const jsonRespose = JSON.parse(xhr.responseText);
25641
25669
  let arrReports = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
25642
25670
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
25643
- console.log('reports response', arrReports);
25644
- console.log('report', arrReports['3/31/*,30;c989a44e-7d3d-427e-b712-90eacf585075;38dc8c53-643f-4fee-83fe-f15239606277;0a5fb99f-c36f-46c0-85b4-7fa3d48fa134']);
25671
+ console.log('reports response', Object.keys(arrReports).length);
25672
+ console.log('report', arrReports);
25645
25673
  this.renderReports(arrReports);
25646
25674
  }
25647
25675
  else {
@@ -25656,6 +25684,7 @@ let SfIEvents = class SfIEvents extends LitElement {
25656
25684
  }
25657
25685
  };
25658
25686
  this.renderReports = (reportsData) => {
25687
+ var _a;
25659
25688
  let html = '<div class="d-flex flex-col w-100-m-0">';
25660
25689
  html += '<div part="stream-event-list" class="d-flex flex-col align-stretch">';
25661
25690
  for (let reportKey of Object.keys(reportsData)) {
@@ -25676,6 +25705,7 @@ let SfIEvents = class SfIEvents extends LitElement {
25676
25705
  html += '<th part="td-head">Comments</th>';
25677
25706
  html += '<th part="td-head">LastUpdated</th>';
25678
25707
  html += '<th part="td-head">CompletionDate</th>';
25708
+ html += '<th part="td-head">Location</th>';
25679
25709
  html += '<th part="td-head">Compliance</th>';
25680
25710
  html += '</tr>';
25681
25711
  html += '<tr>';
@@ -25686,20 +25716,27 @@ let SfIEvents = class SfIEvents extends LitElement {
25686
25716
  html += `<td part="td-body">${report['comments'].length}</td>`;
25687
25717
  html += `<td part="td-body">${Util.getDateTimeStrings(new Date(report['lastupdated']).getTime())}</td>`;
25688
25718
  html += `<td part="td-body">${new Date(parseInt(report['dateofcompletion'])).toLocaleDateString('en-US', { timeZone: 'Asia/Kolkata' })}</td>`;
25689
- html += '<th part="td-head">';
25690
- // const jsonReportEvent = JSON.parse(report['comments'].reportevent);
25691
- console.log('jsonReportEvent', report['event']);
25719
+ let locationname = "";
25720
+ let eventHtml = "";
25692
25721
  if (report['event'] != null) {
25693
- html += '<table>';
25694
- html += '<tr>';
25722
+ locationname = (_a = JSON.parse(report['event'])['locationname']) !== null && _a !== void 0 ? _a : "";
25695
25723
  for (var i = 0; i < Object.keys(JSON.parse(report['event'])).length; i++) {
25696
25724
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(Object.keys(JSON.parse(report['event']))[i].toLowerCase())) {
25697
- html += '<td part="td-body-register">';
25698
- html += ('<span part="td-head" style="padding-left: 0px !important">' + Object.keys(JSON.parse(report['event']))[i] + '</span>');
25699
- html += ('<span part="td-body"><sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(report['event'])[Object.keys(JSON.parse(report['event']))[i]] + '" lineSize="4" minLength="60"></sf-i-elastic-text>' + '</span>');
25700
- html += '</td>';
25725
+ eventHtml += '<td part="td-body-register">';
25726
+ eventHtml += ('<span part="td-head" style="padding-left: 0px !important">' + Object.keys(JSON.parse(report['event']))[i] + '</span>');
25727
+ eventHtml += ('<span part="td-body"><sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(report['event'])[Object.keys(JSON.parse(report['event']))[i]] + '" lineSize="4" minLength="60"></sf-i-elastic-text>' + '</span>');
25728
+ eventHtml += '</td>';
25701
25729
  }
25702
25730
  }
25731
+ }
25732
+ html += `<td part="td-body">${locationname}</td>`;
25733
+ html += '<th part="td-head">';
25734
+ // const jsonReportEvent = JSON.parse(report['comments'].reportevent);
25735
+ // console.log('jsonReportEvent', report['event']);
25736
+ if (report['event'] != null) {
25737
+ html += '<table>';
25738
+ html += '<tr>';
25739
+ html += eventHtml;
25703
25740
  html += '</tr>';
25704
25741
  html += '</table>';
25705
25742
  }
@@ -25828,24 +25865,49 @@ let SfIEvents = class SfIEvents extends LitElement {
25828
25865
  html += '<button id="button-reports-date-selector-back" part="button-icon" class="button-icon"><span class="material-icons">keyboard_backspace</span></button>';
25829
25866
  html += '</div>';
25830
25867
  html += '<label part="input-label" class="mt-20">Select Date</label>';
25831
- html += '<input part="input" id="input-compliance-date" type="date" class="w-100-m-0" mandatory="" autocomplete="off" style="display: block;">';
25868
+ html += `<input id="input-compliance-date" part="input-text" class="input-text mb-20" type="date" />`;
25869
+ html += `<sf-i-form id="input-location-tags" name="Tags" label="Select Location" apiId="${this.apiIdTags}" mode="select" searchPhrase="${this.projectName}&Location" selectProjection="name" ignoreProjections="[&quot;updatetype&quot;,&quot;project&quot;,&quot;tagtype&quot;,&quot;shortid&quot;,&quot;shortnumid&quot;,&quot;lastmodifiedby&quot;,&quot;lastmodifiedtime&quot;]" mandatory></sf-i-form>`;
25832
25870
  // html += '<button id="button-reports-date-selector-back" class="button-back" part="button">back</button>';
25833
25871
  html += '</div>';
25834
25872
  this._SfIEventsC.querySelector('#reports-data').innerHTML = html;
25835
25873
  let inputComplianceDate = this._SfIEventsC.querySelector('#input-compliance-date');
25874
+ let inputLocationForm = this._SfIEventsC.querySelector('#input-location-tags');
25836
25875
  inputComplianceDate.addEventListener('change', (ev) => {
25837
25876
  let selectedDate = new Date(ev.target.value);
25838
- this.fetchReportCompliances(selectedDate, sortid);
25877
+ let selectedLocation = inputLocationForm.selectedValues()[0];
25878
+ if (selectedLocation == null || selectedLocation == '') {
25879
+ return;
25880
+ // let locationId = sortid.split(';')[2]
25881
+ // selectedLocation = locationId;
25882
+ }
25883
+ this.fetchReportCompliances(selectedDate, selectedLocation, sortid);
25884
+ });
25885
+ let locationId = sortid.split(';')[2];
25886
+ inputLocationForm.selectedSearchId = locationId;
25887
+ inputLocationForm.loadMode();
25888
+ inputLocationForm.addEventListener('valueChanged', (ev) => {
25889
+ let form = ev.target;
25890
+ let selectedDate = new Date(inputComplianceDate.value);
25891
+ if (selectedDate.toString() == 'Invalid Date') {
25892
+ return;
25893
+ // let mmddyyyy = sortid.split(';')[0];
25894
+ // let mm = mmddyyyy.split('/')[0];
25895
+ // let dd = mmddyyyy.split('/')[1];
25896
+ // let yyyy = mmddyyyy.split('/')[2];
25897
+ // selectedDate = new Date(parseInt(yyyy), parseInt(mm) - 1, parseInt(dd));
25898
+ }
25899
+ let selectedLocation = form.selectedValues()[0];
25900
+ this.fetchReportCompliances(selectedDate, selectedLocation, sortid);
25839
25901
  });
25840
25902
  let buttonBack = this._SfIEventsC.querySelector('#button-reports-date-selector-back');
25841
25903
  buttonBack.addEventListener('click', () => {
25842
25904
  this.fetchReports();
25843
25905
  });
25844
25906
  };
25845
- this.fetchReportCompliances = async (selectedDate, sortid) => {
25907
+ this.fetchReportCompliances = async (selectedDate, locationid, sortid) => {
25846
25908
  console.log('fetching compliances', sortid);
25847
25909
  let complianceEntityId = sortid.split(';')[1];
25848
- let complianceLocationId = sortid.split(';')[2];
25910
+ // let complianceLocationId = sortid.split(';')[2]
25849
25911
  let url = "https://" + this.apiId + "/getallcountryevents5";
25850
25912
  let sDateObj = selectedDate;
25851
25913
  sDateObj.setDate(selectedDate.getDate() - 60);
@@ -25868,7 +25930,7 @@ let SfIEvents = class SfIEvents extends LitElement {
25868
25930
  day = '0' + day;
25869
25931
  let eDate = month + "/" + day + "/" + year;
25870
25932
  //console.log('fetch calendar url', url);
25871
- let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": complianceLocationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
25933
+ let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": locationid, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
25872
25934
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
25873
25935
  const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
25874
25936
  this._SfLoader.innerHTML = '';
@@ -25878,7 +25940,7 @@ let SfIEvents = class SfIEvents extends LitElement {
25878
25940
  let arrCompliances = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
25879
25941
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
25880
25942
  console.log('receivedCompliacnes', arrCompliances);
25881
- this.renderReportsComplainces(arrCompliances, sortid);
25943
+ this.renderReportsCompliances(arrCompliances, sortid);
25882
25944
  }
25883
25945
  else {
25884
25946
  if (xhr.status == 401) {
@@ -25899,7 +25961,7 @@ let SfIEvents = class SfIEvents extends LitElement {
25899
25961
  }
25900
25962
  }
25901
25963
  };
25902
- this.renderReportsComplainces = (compliancesData, sortid) => {
25964
+ this.renderReportsCompliances = (compliancesData, sortid) => {
25903
25965
  let eventsData = {};
25904
25966
  let complianceId = sortid.split(';')[3];
25905
25967
  console.log('renderReportsComplainces', compliancesData, complianceId);
@@ -10499,13 +10499,13 @@ export class SfIEvents extends LitElement {
10499
10499
  this.renderOnboardingCalendar(calendarJobs);
10500
10500
  }
10501
10501
 
10502
- loadOnboardingSuspense = async () => {
10502
+ loadOnboardingSuspense = async (year: string = this.getCurrentYearGeneric()) => {
10503
10503
  this.hideTabContainers();
10504
10504
  (this._SfOnboardingSuspenseContainer as HTMLDivElement).style.display = 'flex';
10505
10505
  const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10506
- const suspenseList = await this.fetchSuspenseList();
10506
+ const suspenseList = await this.fetchSuspenseList(year);
10507
10507
  console.log('suspenseList', suspenseList);
10508
- this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList);
10508
+ this.renderOnboardingSuspense(mappedSerializedLocations, suspenseList, year);
10509
10509
  }
10510
10510
 
10511
10511
  calculateStartAndEndDateOfPast = (index: number = 0) => {
@@ -22587,7 +22587,21 @@ export class SfIEvents extends LitElement {
22587
22587
 
22588
22588
  }
22589
22589
 
22590
- renderOnboardingSuspense = (sourceArray: any, suspenseList: any) => {
22590
+ getAllPastFiscals = (startDate: Date) => {
22591
+ let retArr = []
22592
+ let date = new Date()
22593
+ while (date.getTime() > startDate.getTime()) {
22594
+ if (date.getMonth() < 3) {
22595
+ retArr.push(date.getFullYear() - 1)
22596
+ } else {
22597
+ retArr.push(date.getFullYear())
22598
+ }
22599
+ date.setFullYear(date.getFullYear() - 1)
22600
+ }
22601
+ return retArr;
22602
+ }
22603
+
22604
+ renderOnboardingSuspense = (sourceArray: any, suspenseList: any, year: string) => {
22591
22605
 
22592
22606
  console.log('sourceList', sourceArray);
22593
22607
  console.log('suspenseList', suspenseList);
@@ -22617,8 +22631,13 @@ export class SfIEvents extends LitElement {
22617
22631
  changed++;
22618
22632
  }
22619
22633
  }
22620
-
22621
- html += ('<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="mapped-stats-title" part="results-title" class="d-flex align-center m-0">' + status + '&nbsp;&nbsp; ' + tagged + ' in Suspense List out of ' + sourceArray.data.mappings.mappings.length + '</h4></div>');
22634
+ let pastFiscals = [parseInt(this.getCurrentYearGeneric())]
22635
+ if(this.contractStartDate != null) {
22636
+ pastFiscals = this.getAllPastFiscals(new Date(this.contractStartDate));
22637
+ }
22638
+ html += (`<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="mapped-stats-title" part="results-title" class="d-flex align-center m-0">${status}&nbsp;&nbsp; ${tagged} in Suspense List out of ${sourceArray.data.mappings.mappings.length}</h4><h6 class="ml-20" part="onboarding-suspense-year-label">Year</h6><select id="select-year" part="input">${pastFiscals.map((fiscal) => {
22639
+ return `<option value="${fiscal}"${fiscal == parseInt(year) ? " selected" : ""}>${fiscal}-${(fiscal % 100) + 1}</option>`
22640
+ })}</select></div>`);
22622
22641
 
22623
22642
 
22624
22643
  if (changed > 0) {
@@ -22771,6 +22790,11 @@ export class SfIEvents extends LitElement {
22771
22790
  html += '</div>';
22772
22791
 
22773
22792
  (this._SfOnboardingSuspenseContainer as HTMLDivElement).innerHTML = html;
22793
+ const inputYear = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('#select-year') as HTMLSelectElement;
22794
+ inputYear.addEventListener('change', (e: any) => {
22795
+ const selectedYear = e.currentTarget.value;
22796
+ this.loadOnboardingSuspense(selectedYear);
22797
+ })
22774
22798
 
22775
22799
  const buttonApply = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22776
22800
  buttonApply.addEventListener('click', () => {
@@ -22784,15 +22808,15 @@ export class SfIEvents extends LitElement {
22784
22808
  tempSuspenseList[suspenseKey] = true
22785
22809
  }
22786
22810
  }
22787
- this.renderOnboardingSuspense(sourceArray, tempSuspenseList)
22811
+ this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year)
22788
22812
  })
22789
22813
 
22790
22814
  const buttonSave = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22791
22815
  buttonSave.addEventListener('click', async () => {
22792
22816
  console.log('saving suspense', suspenseList, Object.keys(suspenseList).length);
22793
- let response = await this.uploadMappedSuspense(suspenseList)
22817
+ let response = await this.uploadMappedSuspense(suspenseList, year)
22794
22818
  console.log('suspense save response', response);
22795
- this.loadOnboardingSuspense()
22819
+ this.loadOnboardingSuspense(year)
22796
22820
  })
22797
22821
 
22798
22822
  const buttonToggleMoreBack = (this._SfOnboardingSuspenseContainer as HTMLDivElement).querySelector('.button-toggle-more-back') as HTMLButtonElement;
@@ -22879,7 +22903,7 @@ export class SfIEvents extends LitElement {
22879
22903
  },
22880
22904
  () => {
22881
22905
  this.clearMessages();
22882
- this.renderOnboardingSuspense(sourceArray, tempSuspenseList);
22906
+ this.renderOnboardingSuspense(sourceArray, tempSuspenseList, year);
22883
22907
  }
22884
22908
  ])
22885
22909
  // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
@@ -28156,7 +28180,7 @@ export class SfIEvents extends LitElement {
28156
28180
  await this.uploadOnboardingMapping(data, 'countries');
28157
28181
  }
28158
28182
 
28159
- uploadMappedSuspense = async (data: any) => {
28183
+ uploadMappedSuspense = async (data: any, year: string) => {
28160
28184
 
28161
28185
  //console.log('uploading..', data);
28162
28186
 
@@ -28165,6 +28189,7 @@ export class SfIEvents extends LitElement {
28165
28189
  const body = {
28166
28190
  "projectid": this.projectId,
28167
28191
  "data": JSON.stringify(data),
28192
+ "year": year
28168
28193
  }
28169
28194
 
28170
28195
  let authorization: any = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -30230,11 +30255,13 @@ export class SfIEvents extends LitElement {
30230
30255
  }
30231
30256
  }
30232
30257
 
30233
- fetchSuspenseList = async () => {
30258
+ fetchSuspenseList = async (year: string = "") => {
30234
30259
 
30235
30260
  let url = "https://" + this.apiId + "/getsuspenselist1";
30236
30261
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
30237
- const year = this.getCurrentYearGeneric();
30262
+ if (year == "") {
30263
+ year = this.getCurrentYearGeneric();
30264
+ }
30238
30265
  const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "year": year }, url, this._SfLoader, authorization)) as any;
30239
30266
  this._SfLoader.innerHTML = '';
30240
30267
  if (xhr.status == 200) {
@@ -30944,7 +30971,7 @@ export class SfIEvents extends LitElement {
30944
30971
  this.edate = endDate;
30945
30972
 
30946
30973
 
30947
- path = "getstatistics";
30974
+ path = "getstatistics1";
30948
30975
 
30949
30976
  let sDate = "";
30950
30977
  let eDate = "";
@@ -32175,15 +32202,15 @@ export class SfIEvents extends LitElement {
32175
32202
 
32176
32203
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
32177
32204
  console.log('this.myroles', this.myroles)
32178
- const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId }, url, this._SfLoader, authorization)) as any;
32205
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "userprofileid": this.userProfileId, "year": this.calendarStartYYYY }, url, this._SfLoader, authorization)) as any;
32179
32206
  this._SfLoader.innerHTML = '';
32180
32207
  if (xhr.status == 200) {
32181
32208
 
32182
32209
  const jsonRespose = JSON.parse(xhr.responseText);
32183
32210
  let arrReports = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
32184
32211
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
32185
- console.log('reports response', arrReports);
32186
- console.log('report', arrReports['3/31/*,30;c989a44e-7d3d-427e-b712-90eacf585075;38dc8c53-643f-4fee-83fe-f15239606277;0a5fb99f-c36f-46c0-85b4-7fa3d48fa134']);
32212
+ console.log('reports response', Object.keys(arrReports).length);
32213
+ console.log('report', arrReports);
32187
32214
  this.renderReports(arrReports)
32188
32215
  } else {
32189
32216
  if (xhr.status == 401) {
@@ -32222,6 +32249,7 @@ export class SfIEvents extends LitElement {
32222
32249
  html += '<th part="td-head">Comments</th>'
32223
32250
  html += '<th part="td-head">LastUpdated</th>'
32224
32251
  html += '<th part="td-head">CompletionDate</th>'
32252
+ html += '<th part="td-head">Location</th>'
32225
32253
  html += '<th part="td-head">Compliance</th>'
32226
32254
  html += '</tr>';
32227
32255
 
@@ -32233,25 +32261,31 @@ export class SfIEvents extends LitElement {
32233
32261
  html += `<td part="td-body">${report['comments'].length}</td>`;
32234
32262
  html += `<td part="td-body">${Util.getDateTimeStrings(new Date(report['lastupdated']).getTime())}</td>`;
32235
32263
  html += `<td part="td-body">${new Date(parseInt(report['dateofcompletion'])).toLocaleDateString('en-US', { timeZone: 'Asia/Kolkata' })}</td>`;
32236
- html += '<th part="td-head">';
32237
-
32238
- // const jsonReportEvent = JSON.parse(report['comments'].reportevent);
32239
- console.log('jsonReportEvent', report['event']);
32264
+ let locationname = ""
32265
+ let eventHtml = ""
32240
32266
  if (report['event'] != null) {
32241
- html += '<table>';
32242
- html += '<tr>';
32267
+ locationname = JSON.parse(report['event'])['locationname'] ?? "";
32243
32268
  for (var i = 0; i < Object.keys(JSON.parse(report['event'])).length; i++) {
32244
-
32245
32269
  if (!this.EXCLUDE_COLS_FROM_REGS.includes(Object.keys(JSON.parse(report['event']))[i].toLowerCase())) {
32246
32270
 
32247
- html += '<td part="td-body-register">';
32248
- html += ('<span part="td-head" style="padding-left: 0px !important">' + Object.keys(JSON.parse(report['event']))[i] + '</span>');
32249
- html += ('<span part="td-body"><sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(report['event'])[Object.keys(JSON.parse(report['event']))[i]] + '" lineSize="4" minLength="60"></sf-i-elastic-text>' + '</span>');
32250
- html += '</td>';
32271
+ eventHtml += '<td part="td-body-register">';
32272
+ eventHtml += ('<span part="td-head" style="padding-left: 0px !important">' + Object.keys(JSON.parse(report['event']))[i] + '</span>');
32273
+ eventHtml += ('<span part="td-body"><sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(report['event'])[Object.keys(JSON.parse(report['event']))[i]] + '" lineSize="4" minLength="60"></sf-i-elastic-text>' + '</span>');
32274
+ eventHtml += '</td>';
32251
32275
 
32252
32276
  }
32253
32277
 
32254
32278
  }
32279
+ }
32280
+ html += `<td part="td-body">${locationname}</td>`;
32281
+ html += '<th part="td-head">';
32282
+
32283
+ // const jsonReportEvent = JSON.parse(report['comments'].reportevent);
32284
+ // console.log('jsonReportEvent', report['event']);
32285
+ if (report['event'] != null) {
32286
+ html += '<table>';
32287
+ html += '<tr>';
32288
+ html += eventHtml;
32255
32289
  html += '</tr>';
32256
32290
  html += '</table>';
32257
32291
  }
@@ -32396,15 +32430,42 @@ export class SfIEvents extends LitElement {
32396
32430
  html += '<button id="button-reports-date-selector-back" part="button-icon" class="button-icon"><span class="material-icons">keyboard_backspace</span></button>'
32397
32431
  html += '</div>'
32398
32432
  html += '<label part="input-label" class="mt-20">Select Date</label>'
32399
- html += '<input part="input" id="input-compliance-date" type="date" class="w-100-m-0" mandatory="" autocomplete="off" style="display: block;">'
32433
+ html += `<input id="input-compliance-date" part="input-text" class="input-text mb-20" type="date" />`
32434
+ html += `<sf-i-form id="input-location-tags" name="Tags" label="Select Location" apiId="${this.apiIdTags}" mode="select" searchPhrase="${this.projectName}&Location" selectProjection="name" ignoreProjections="[&quot;updatetype&quot;,&quot;project&quot;,&quot;tagtype&quot;,&quot;shortid&quot;,&quot;shortnumid&quot;,&quot;lastmodifiedby&quot;,&quot;lastmodifiedtime&quot;]" mandatory></sf-i-form>`
32400
32435
  // html += '<button id="button-reports-date-selector-back" class="button-back" part="button">back</button>';
32401
32436
  html += '</div>';
32402
32437
  (this._SfIEventsC.querySelector('#reports-data') as HTMLDivElement).innerHTML = html;
32403
32438
  let inputComplianceDate = (this._SfIEventsC.querySelector('#input-compliance-date') as HTMLInputElement)
32439
+ let inputLocationForm = (this._SfIEventsC.querySelector('#input-location-tags') as SfIForm);
32440
+
32404
32441
  inputComplianceDate.addEventListener('change', (ev: any) => {
32405
32442
  let selectedDate = new Date((ev.target as HTMLInputElement).value)
32406
- this.fetchReportCompliances(selectedDate, sortid)
32443
+ let selectedLocation = inputLocationForm.selectedValues()[0];
32444
+ if (selectedLocation == null || selectedLocation == '') {
32445
+ return;
32446
+ // let locationId = sortid.split(';')[2]
32447
+ // selectedLocation = locationId;
32448
+ }
32449
+ this.fetchReportCompliances(selectedDate, selectedLocation, sortid)
32407
32450
  })
32451
+ let locationId = sortid.split(';')[2]
32452
+ inputLocationForm.selectedSearchId = locationId;
32453
+ inputLocationForm.loadMode();
32454
+ inputLocationForm.addEventListener('valueChanged', (ev: any) => {
32455
+ let form = ev.target as SfIForm
32456
+ let selectedDate = new Date((inputComplianceDate as HTMLInputElement).value)
32457
+ if (selectedDate.toString() == 'Invalid Date') {
32458
+ return;
32459
+ // let mmddyyyy = sortid.split(';')[0];
32460
+ // let mm = mmddyyyy.split('/')[0];
32461
+ // let dd = mmddyyyy.split('/')[1];
32462
+ // let yyyy = mmddyyyy.split('/')[2];
32463
+ // selectedDate = new Date(parseInt(yyyy), parseInt(mm) - 1, parseInt(dd));
32464
+ }
32465
+ let selectedLocation = form.selectedValues()[0];
32466
+ this.fetchReportCompliances(selectedDate, selectedLocation, sortid)
32467
+ })
32468
+
32408
32469
  let buttonBack = (this._SfIEventsC.querySelector('#button-reports-date-selector-back') as HTMLButtonElement)
32409
32470
  buttonBack.addEventListener('click', () => {
32410
32471
  this.fetchReports()
@@ -32412,10 +32473,10 @@ export class SfIEvents extends LitElement {
32412
32473
 
32413
32474
  }
32414
32475
 
32415
- fetchReportCompliances = async (selectedDate: Date, sortid: string) => {
32476
+ fetchReportCompliances = async (selectedDate: Date, locationid: string, sortid: string) => {
32416
32477
  console.log('fetching compliances', sortid)
32417
32478
  let complianceEntityId = sortid.split(';')[1]
32418
- let complianceLocationId = sortid.split(';')[2]
32479
+ // let complianceLocationId = sortid.split(';')[2]
32419
32480
  let url = "https://" + this.apiId + "/getallcountryevents5";
32420
32481
  let sDateObj = selectedDate
32421
32482
  sDateObj.setDate(selectedDate.getDate() - 60)
@@ -32438,7 +32499,7 @@ export class SfIEvents extends LitElement {
32438
32499
  day = '0' + day;
32439
32500
  let eDate = month + "/" + day + "/" + year
32440
32501
  //console.log('fetch calendar url', url);
32441
- let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": complianceLocationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
32502
+ let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": complianceEntityId, "countryid": "", "functionid": "", "locationid": locationid, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": "location", "year": this.calendarStartYYYY };
32442
32503
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
32443
32504
  const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
32444
32505
  this._SfLoader.innerHTML = '';
@@ -32449,7 +32510,7 @@ export class SfIEvents extends LitElement {
32449
32510
  let arrCompliances = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
32450
32511
  await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete);
32451
32512
  console.log('receivedCompliacnes', arrCompliances)
32452
- this.renderReportsComplainces(arrCompliances, sortid);
32513
+ this.renderReportsCompliances(arrCompliances, sortid);
32453
32514
  } else {
32454
32515
  if (xhr.status == 401) {
32455
32516
  let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
@@ -32472,7 +32533,7 @@ export class SfIEvents extends LitElement {
32472
32533
  }
32473
32534
  }
32474
32535
 
32475
- renderReportsComplainces = (compliancesData: any, sortid: string) => {
32536
+ renderReportsCompliances = (compliancesData: any, sortid: string) => {
32476
32537
  let eventsData: any = {}
32477
32538
  let complianceId = sortid.split(';')[3]
32478
32539
  console.log('renderReportsComplainces', compliancesData, complianceId);