sf-i-events 1.0.708 → 1.0.709

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
@@ -693,7 +693,7 @@
693
693
  </div>
694
694
 
695
695
  </sf-i-events> -->
696
- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" fill="solid" username="Auditor J1" userprofileid="bda0d59b-058b-4098-b0fc-54aa54aa5998" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="auditor" showregisterexport="false" eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]" eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]" eventpreviewfields="[&quot;obligation&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
696
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" fill="solid" username="Auditor J1" userprofileid="bda0d59b-058b-4098-b0fc-54aa54aa5998" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="auditor" showregisterexport="false" eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]" eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]" eventpreviewfields="[&quot;obligation&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
697
697
 
698
698
  <div slot="uploader">
699
699
  <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
@@ -702,7 +702,7 @@
702
702
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
703
703
  </div>
704
704
 
705
- </sf-i-events>
705
+ </sf-i-events> -->
706
706
  <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" fill="pattern" username="Chief Compliance Officer " userprofileid="5fe96caa-1a44-4a2d-921a-920d29433eca" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" enabledeletelatestreport="true" eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]" eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]" eventpreviewfields="[&quot;obligationtitle&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
707
707
 
708
708
  <div slot="uploader">
@@ -722,9 +722,9 @@
722
722
 
723
723
  </sf-i-events> -->
724
724
 
725
- <!-- <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding" 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;]}}" contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
725
+ <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding" 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;]}}" contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
726
726
 
727
- </sf-i-events> -->
727
+ </sf-i-events>
728
728
 
729
729
  <!-- <sf-i-events projectid="5c073644-5dce-4d8f-b82e-2bc2def2390f" projectname="ABC Hospitals" mode="onboarding" locations="{}" contractstartdate="01/04/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="hrushi.mehendale@gmail.com" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
730
730
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.708",
4
+ "version": "1.0.709",
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
@@ -265,12 +265,14 @@ export declare class SfIEvents extends LitElement {
265
265
  nextTabStatus: string;
266
266
  sdate: string;
267
267
  edate: string;
268
+ changedOnboardingItemIds: string[];
268
269
  static styles: import("lit").CSSResult;
269
270
  _SfIEventsC: any;
270
271
  _SfRowError: any;
271
272
  _SfRowErrorMessage: any;
272
273
  _SfRowSuccess: any;
273
274
  _SfRowSuccessMessage: any;
275
+ _SfRowSuccessMessageBtnContainer: any;
274
276
  _SfLoader: any;
275
277
  _SfCalendarContainer: any;
276
278
  _SfButtonGenerate: any;
@@ -396,6 +398,7 @@ export declare class SfIEvents extends LitElement {
396
398
  clearMessages: () => void;
397
399
  setError: (msg: string) => void;
398
400
  setSuccess: (msg: string) => void;
401
+ setSuccessBtn: (msg: string, btnCaptions: string[], btnCallbacks: Function[]) => void;
399
402
  getLastDayOfLastMonth: (month: number, year: number) => number;
400
403
  getLastDayOfMonth: (month: number, year: number) => number;
401
404
  getFirstDateOfLastWeek: (startDate: Date) => Date;
package/sf-i-events.js CHANGED
@@ -1203,6 +1203,7 @@ let SfIEvents = class SfIEvents extends LitElement {
1203
1203
  this.nextTabStatus = "";
1204
1204
  this.sdate = "";
1205
1205
  this.edate = "";
1206
+ this.changedOnboardingItemIds = [];
1206
1207
  this.isSelectedLegend = (value) => {
1207
1208
  return this.chartSelectedLegend.includes(value);
1208
1209
  };
@@ -1365,18 +1366,36 @@ let SfIEvents = class SfIEvents extends LitElement {
1365
1366
  this._SfRowErrorMessage.innerHTML = '';
1366
1367
  this._SfRowSuccess.style.display = 'none';
1367
1368
  this._SfRowSuccessMessage.innerHTML = '';
1369
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1368
1370
  };
1369
1371
  this.setError = (msg) => {
1370
1372
  this._SfRowError.style.display = 'flex';
1371
1373
  this._SfRowErrorMessage.innerHTML = msg;
1372
1374
  this._SfRowSuccess.style.display = 'none';
1373
1375
  this._SfRowSuccessMessage.innerHTML = '';
1376
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1374
1377
  };
1375
1378
  this.setSuccess = (msg) => {
1376
1379
  this._SfRowError.style.display = 'none';
1377
1380
  this._SfRowErrorMessage.innerHTML = '';
1378
1381
  this._SfRowSuccess.style.display = 'flex';
1379
1382
  this._SfRowSuccessMessage.innerHTML = msg;
1383
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1384
+ };
1385
+ this.setSuccessBtn = (msg, btnCaptions, btnCallbacks) => {
1386
+ this._SfRowError.style.display = 'none';
1387
+ this._SfRowErrorMessage.innerHTML = '';
1388
+ this._SfRowSuccess.style.display = 'flex';
1389
+ this._SfRowSuccessMessage.innerHTML = msg;
1390
+ let btnHtml = '';
1391
+ for (let [i, caption] of btnCaptions.entries()) {
1392
+ btnHtml += '<button part="successmsgbtn" id="successbtn-' + i + '" class="d-flex align-center mt-10' + ((i > 0) ? ' ml-10' : '') + '">' + caption + '</button>';
1393
+ }
1394
+ this._SfRowSuccessMessageBtnContainer.innerHTML = btnHtml;
1395
+ for (let [i, callback] of btnCallbacks.entries()) {
1396
+ let btn = this._SfRowSuccessMessageBtnContainer.querySelector('#successbtn-' + i);
1397
+ btn.addEventListener('click', () => { callback(); });
1398
+ }
1380
1399
  };
1381
1400
  this.getLastDayOfLastMonth = (month, year) => {
1382
1401
  const date = new Date(year, month, 0);
@@ -7646,6 +7665,9 @@ let SfIEvents = class SfIEvents extends LitElement {
7646
7665
  if (sourceArray.data.mappings.mappings[j] != null && taggingArray.data.mappings.mappings[i] != null) {
7647
7666
  if (sourceArray.data.mappings.mappings[j][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
7648
7667
  equal = false;
7668
+ // if(taggingArray.data.mappings.mappings.length > 0){
7669
+ // console.log('taggingarray col not found', uniqCols[k], taggingArray.data.mappings.mappings[i])
7670
+ // }
7649
7671
  }
7650
7672
  }
7651
7673
  }
@@ -7867,10 +7889,20 @@ let SfIEvents = class SfIEvents extends LitElement {
7867
7889
  // }
7868
7890
  var classBg = "";
7869
7891
  if (i % 2 === 0) {
7870
- classBg = 'td-light';
7892
+ if (this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0) {
7893
+ classBg = 'td-light-selected';
7894
+ }
7895
+ else {
7896
+ classBg = 'td-light';
7897
+ }
7871
7898
  }
7872
7899
  else {
7873
- classBg = 'td-dark';
7900
+ if (this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0) {
7901
+ classBg = 'td-dark-selected';
7902
+ }
7903
+ else {
7904
+ classBg = 'td-dark';
7905
+ }
7874
7906
  }
7875
7907
  html += '<tr class="" id="tablerow-' + i + '">';
7876
7908
  html += '<td class="left-sticky td-body ' + classBg + '" ><div class="' + (!showSearch ? 'truncate' : '') + '"><input id="cb-' + i + '" type="checkbox" class="checkbox-row cb-select"/></div></td>';
@@ -8264,14 +8296,94 @@ let SfIEvents = class SfIEvents extends LitElement {
8264
8296
  });
8265
8297
  const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
8266
8298
  buttonExportMappingCSVNew === null || buttonExportMappingCSVNew === void 0 ? void 0 : buttonExportMappingCSVNew.addEventListener('click', async () => {
8267
- let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
8299
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings));
8300
+ for (let [i, obj] of csvArray.entries()) {
8301
+ let tempCsvObj = obj;
8302
+ if (obj['cols'] != null && obj['data'] != null) {
8303
+ let dataArr = JSON.parse(obj['data']);
8304
+ let colsArr = JSON.parse(obj['cols']);
8305
+ for (let [j, colKey] of colsArr.entries()) {
8306
+ tempCsvObj['cols_' + colKey] = dataArr[j];
8307
+ }
8308
+ }
8309
+ csvArray[i] = tempCsvObj;
8310
+ }
8311
+ console.log('csv array', csvArray);
8312
+ let csvData = Util.convertToCSV(csvArray);
8313
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
8268
8314
  console.log('csvData', csvData);
8315
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
8316
+ const url = window.URL.createObjectURL(blob);
8317
+ const a = document.createElement('a');
8318
+ a.setAttribute('href', url);
8319
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.csv');
8320
+ a.click();
8269
8321
  });
8270
8322
  const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
8271
8323
  buttonLoadLocalNew === null || buttonLoadLocalNew === void 0 ? void 0 : buttonLoadLocalNew.addEventListener('click', async () => {
8272
8324
  console.log('load-local');
8273
8325
  divElement.querySelector('#fileInput').click();
8274
8326
  });
8327
+ const fileInput = divElement.querySelector('#fileInput');
8328
+ fileInput.value = '';
8329
+ const fileInputNew = Util.clearListeners(fileInput);
8330
+ fileInputNew.addEventListener('change', (e) => {
8331
+ var fr = new FileReader();
8332
+ fr.onload = () => {
8333
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8334
+ };
8335
+ var frCsv = new FileReader();
8336
+ frCsv.onload = () => {
8337
+ console.log('taggingarray onload called');
8338
+ console.log('csv result', frCsv.result);
8339
+ const tempArr = Util.parseCsv(frCsv.result + "");
8340
+ console.log('csv data', tempArr);
8341
+ let changeCount = 0;
8342
+ for (let [i, obj] of tempArr.entries()) {
8343
+ if (JSON.stringify(taggingArray.data.mappings.mappings[i]) !== JSON.stringify(obj)) {
8344
+ console.log('item changed', taggingArray.data.mappings.mappings[i], obj);
8345
+ this.changedOnboardingItemIds.push(taggingArray.data.mappings.mappings[i].id);
8346
+ changeCount++;
8347
+ }
8348
+ }
8349
+ this.setSuccessBtn(changeCount + " items changed. Do you wish to apply?", ["No", "Yes"], [
8350
+ () => {
8351
+ this.clearMessages();
8352
+ this.changedOnboardingItemIds = [];
8353
+ buttonToggleMoreBack.click();
8354
+ },
8355
+ () => {
8356
+ this.clearMessages();
8357
+ let tempObj = {};
8358
+ tempObj["data"] = {};
8359
+ // let mappingsObj:any = {}
8360
+ // mappingsObj.mappings = tempArr
8361
+ // console.log('csv mappingsobj', mappingsObj)
8362
+ tempObj["data"]["mappings"] = {};
8363
+ tempObj["data"]["mappings"]["mappings"] = tempArr;
8364
+ // for(let tempItem of tempArr){
8365
+ // tempObj["data"]["mappings"]["mappings"].push(tempItem)
8366
+ // }
8367
+ // tempObj.data.mappings.mappings.push("pqrs")
8368
+ let tempObjStr = JSON.stringify(tempObj);
8369
+ // console.log('csv taggingarray tempobj', tempObj, tempObjStr, tempObj.data.mappings.mappings[0])
8370
+ console.log('csv taggingarray cols', uniqCols, tempObjStr, Object.keys(tempObj.data.mappings.mappings[0]));
8371
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8372
+ }
8373
+ ]);
8374
+ // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
8375
+ // let tempObj:{data:{mappings:{mappings:any[]}}} = {data:{mappings:{mappings:tempArr}}}
8376
+ };
8377
+ if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
8378
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1];
8379
+ if (ext.toLowerCase() == "csv") {
8380
+ frCsv.readAsText(e.target.files[0]);
8381
+ }
8382
+ else {
8383
+ fr.readAsText(e.target.files[0]);
8384
+ }
8385
+ }
8386
+ });
8275
8387
  const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
8276
8388
  buttonSaveLocalNew === null || buttonSaveLocalNew === void 0 ? void 0 : buttonSaveLocalNew.addEventListener('click', async () => {
8277
8389
  console.log('save-local');
@@ -8306,16 +8418,6 @@ let SfIEvents = class SfIEvents extends LitElement {
8306
8418
  // console.log('load-local');
8307
8419
  // ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
8308
8420
  // });
8309
- const fileInput = divElement.querySelector('#fileInput');
8310
- fileInput.addEventListener('change', (e) => {
8311
- var fr = new FileReader();
8312
- fr.onload = () => {
8313
- this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8314
- };
8315
- if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
8316
- fr.readAsText(e.target.files[0]);
8317
- }
8318
- });
8319
8421
  // const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
8320
8422
  // buttonSaveLocal?.addEventListener('click', async () => {
8321
8423
  // console.log('save-local');
@@ -8366,6 +8468,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8366
8468
  //(divElement as HTMLDivElement).querySelector("#span-extra-filled")!.innerHTML = "Fields: " + filledFields + "/" + totalFields + " completed";
8367
8469
  //console.log('Total fields = ' + totalFields + ', filled fields = ' + filledFields);
8368
8470
  }
8471
+ this.changedOnboardingItemIds = [];
8369
8472
  };
8370
8473
  this.renderMappingTable = (divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, subfilter, statuteColName, extraHintsArr) => {
8371
8474
  var _a, _b, _c, _f;
@@ -16006,6 +16109,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16006
16109
  </div>
16007
16110
  <div class="div-row-success div-row-submit gone">
16008
16111
  <div part="successmsg" class="div-row-success-message"></div>
16112
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16009
16113
  </div>
16010
16114
  </div>
16011
16115
  <div class="rb"></div>
@@ -16056,6 +16160,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16056
16160
  </div>
16057
16161
  <div class="div-row-success div-row-submit gone">
16058
16162
  <div part="successmsg" class="div-row-success-message"></div>
16163
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16059
16164
  </div>
16060
16165
  </div>
16061
16166
  <div class="rb"></div>
@@ -16164,6 +16269,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16164
16269
  </div>
16165
16270
  <div class="div-row-success div-row-submit gone">
16166
16271
  <div part="successmsg" class="div-row-success-message"></div>
16272
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16167
16273
  </div>
16168
16274
  </div>
16169
16275
  <div class="rb"></div>
@@ -16279,6 +16385,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16279
16385
  </div>
16280
16386
  <div class="div-row-success div-row-submit gone">
16281
16387
  <div part="successmsg" class="div-row-success-message"></div>
16388
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16282
16389
  </div>
16283
16390
  </div>
16284
16391
  <div class="rb"></div>
@@ -16325,6 +16432,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16325
16432
  </div>
16326
16433
  <div class="div-row-success div-row-submit">
16327
16434
  <div part="successmsg" class="div-row-success-message"></div>
16435
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16328
16436
  </div>
16329
16437
  <div class="div-row-notif div-row-submit">
16330
16438
  <div part="notifmsg" class="div-row-notif-message"></div>
@@ -16364,6 +16472,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16364
16472
  </div>
16365
16473
  <div class="div-row-success div-row-submit gone">
16366
16474
  <div part="successmsg" class="div-row-success-message"></div>
16475
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16367
16476
  </div>
16368
16477
  </div>
16369
16478
  <div class="rb"></div>
@@ -16392,6 +16501,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16392
16501
  </div>
16393
16502
  <div class="div-row-success div-row-submit gone">
16394
16503
  <div part="successmsg" class="div-row-success-message"></div>
16504
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16395
16505
  </div>
16396
16506
  </div>
16397
16507
  <div class="rb"></div>
@@ -16460,6 +16570,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16460
16570
  </div>
16461
16571
  <div class="div-row-success div-row-submit gone">
16462
16572
  <div part="successmsg" class="div-row-success-message"></div>
16573
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16463
16574
  </div>
16464
16575
  </div>
16465
16576
  <div class="rb"></div>
@@ -16711,9 +16822,16 @@ SfIEvents.styles = css `
16711
16822
  background-color: #e9e9e9;
16712
16823
  }
16713
16824
 
16825
+ .td-dark-selected {
16826
+ background-color: #e3e0c8;
16827
+ }
16828
+
16714
16829
  .td-light {
16715
16830
  background-color: #f6f6f6;
16716
16831
  }
16832
+ .td-light-selected {
16833
+ background-color: #f5f2d9;
16834
+ }
16717
16835
 
16718
16836
  .invisible {
16719
16837
  visibility: hidden;
@@ -17391,6 +17509,7 @@ SfIEvents.styles = css `
17391
17509
 
17392
17510
  .div-row-success {
17393
17511
  display: flex;
17512
+ flex-direction: column;
17394
17513
  justify-content: center;
17395
17514
  position: fixed;
17396
17515
  top: 0px;
@@ -17398,7 +17517,7 @@ SfIEvents.styles = css `
17398
17517
  margin-top: 20px;
17399
17518
  margin-right: 20px;
17400
17519
  display: none;
17401
- align-items:center;
17520
+ align-items:stretch;
17402
17521
  background-color: white;
17403
17522
  border: dashed 1px green;
17404
17523
  padding: 20px;
@@ -17412,6 +17531,14 @@ SfIEvents.styles = css `
17412
17531
  text-align: center;
17413
17532
  }
17414
17533
 
17534
+ .div-row-success-message-btn-container {
17535
+ background-color: white;
17536
+ display: flex;
17537
+ flex-direction: row;
17538
+ justify-content: end;
17539
+ align-items: center;
17540
+ }
17541
+
17415
17542
  .d-flex {
17416
17543
  display: flex;
17417
17544
  }
@@ -17913,6 +18040,9 @@ __decorate([
17913
18040
  __decorate([
17914
18041
  query('.div-row-success-message')
17915
18042
  ], SfIEvents.prototype, "_SfRowSuccessMessage", void 0);
18043
+ __decorate([
18044
+ query('.div-row-success-message-btn-container')
18045
+ ], SfIEvents.prototype, "_SfRowSuccessMessageBtnContainer", void 0);
17916
18046
  __decorate([
17917
18047
  query('.loader-element')
17918
18048
  ], SfIEvents.prototype, "_SfLoader", void 0);
@@ -1588,6 +1588,8 @@ export class SfIEvents extends LitElement {
1588
1588
 
1589
1589
  edate: string = "";
1590
1590
 
1591
+ changedOnboardingItemIds: string[] = []
1592
+
1591
1593
  static override styles = css`
1592
1594
 
1593
1595
  .bg-white {
@@ -1829,9 +1831,16 @@ export class SfIEvents extends LitElement {
1829
1831
  background-color: #e9e9e9;
1830
1832
  }
1831
1833
 
1834
+ .td-dark-selected {
1835
+ background-color: #e3e0c8;
1836
+ }
1837
+
1832
1838
  .td-light {
1833
1839
  background-color: #f6f6f6;
1834
1840
  }
1841
+ .td-light-selected {
1842
+ background-color: #f5f2d9;
1843
+ }
1835
1844
 
1836
1845
  .invisible {
1837
1846
  visibility: hidden;
@@ -2509,6 +2518,7 @@ export class SfIEvents extends LitElement {
2509
2518
 
2510
2519
  .div-row-success {
2511
2520
  display: flex;
2521
+ flex-direction: column;
2512
2522
  justify-content: center;
2513
2523
  position: fixed;
2514
2524
  top: 0px;
@@ -2516,7 +2526,7 @@ export class SfIEvents extends LitElement {
2516
2526
  margin-top: 20px;
2517
2527
  margin-right: 20px;
2518
2528
  display: none;
2519
- align-items:center;
2529
+ align-items:stretch;
2520
2530
  background-color: white;
2521
2531
  border: dashed 1px green;
2522
2532
  padding: 20px;
@@ -2530,6 +2540,14 @@ export class SfIEvents extends LitElement {
2530
2540
  text-align: center;
2531
2541
  }
2532
2542
 
2543
+ .div-row-success-message-btn-container {
2544
+ background-color: white;
2545
+ display: flex;
2546
+ flex-direction: row;
2547
+ justify-content: end;
2548
+ align-items: center;
2549
+ }
2550
+
2533
2551
  .d-flex {
2534
2552
  display: flex;
2535
2553
  }
@@ -2615,6 +2633,9 @@ export class SfIEvents extends LitElement {
2615
2633
  @query('.div-row-success-message')
2616
2634
  _SfRowSuccessMessage: any;
2617
2635
 
2636
+ @query('.div-row-success-message-btn-container')
2637
+ _SfRowSuccessMessageBtnContainer: any;
2638
+
2618
2639
  @query('.loader-element')
2619
2640
  _SfLoader: any;
2620
2641
 
@@ -3172,6 +3193,7 @@ export class SfIEvents extends LitElement {
3172
3193
  this._SfRowErrorMessage.innerHTML = '';
3173
3194
  this._SfRowSuccess.style.display = 'none';
3174
3195
  this._SfRowSuccessMessage.innerHTML = '';
3196
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3175
3197
  }
3176
3198
 
3177
3199
  setError = (msg: string) => {
@@ -3179,6 +3201,7 @@ export class SfIEvents extends LitElement {
3179
3201
  this._SfRowErrorMessage.innerHTML = msg;
3180
3202
  this._SfRowSuccess.style.display = 'none';
3181
3203
  this._SfRowSuccessMessage.innerHTML = '';
3204
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3182
3205
  }
3183
3206
 
3184
3207
  setSuccess = (msg: string) => {
@@ -3186,6 +3209,23 @@ export class SfIEvents extends LitElement {
3186
3209
  this._SfRowErrorMessage.innerHTML = '';
3187
3210
  this._SfRowSuccess.style.display = 'flex';
3188
3211
  this._SfRowSuccessMessage.innerHTML = msg;
3212
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3213
+ }
3214
+
3215
+ setSuccessBtn = (msg: string, btnCaptions:string[], btnCallbacks:Function[]) => {
3216
+ this._SfRowError.style.display = 'none';
3217
+ this._SfRowErrorMessage.innerHTML = '';
3218
+ this._SfRowSuccess.style.display = 'flex';
3219
+ this._SfRowSuccessMessage.innerHTML = msg;
3220
+ let btnHtml = ''
3221
+ for(let [i, caption] of btnCaptions.entries()){
3222
+ btnHtml += '<button part="successmsgbtn" id="successbtn-' + i + '" class="d-flex align-center mt-10' + ((i > 0) ? ' ml-10' : '' )+'">' + caption + '</button>'
3223
+ }
3224
+ this._SfRowSuccessMessageBtnContainer.innerHTML = btnHtml
3225
+ for(let [i, callback] of btnCallbacks.entries()){
3226
+ let btn = this._SfRowSuccessMessageBtnContainer.querySelector('#successbtn-' + i) as HTMLButtonElement
3227
+ btn.addEventListener('click',() => {callback()})
3228
+ }
3189
3229
  }
3190
3230
 
3191
3231
  getLastDayOfLastMonth = (month: number, year: number) => {
@@ -11199,6 +11239,9 @@ export class SfIEvents extends LitElement {
11199
11239
  if(sourceArray.data.mappings.mappings[j] != null && taggingArray.data.mappings.mappings[i] != null) {
11200
11240
  if(sourceArray.data.mappings.mappings[j][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
11201
11241
  equal = false;
11242
+ // if(taggingArray.data.mappings.mappings.length > 0){
11243
+ // console.log('taggingarray col not found', uniqCols[k], taggingArray.data.mappings.mappings[i])
11244
+ // }
11202
11245
  }
11203
11246
  }
11204
11247
 
@@ -11223,7 +11266,6 @@ export class SfIEvents extends LitElement {
11223
11266
  }
11224
11267
 
11225
11268
  taggingArray.data.mappings.mappings = foundArr;
11226
-
11227
11269
  let mandatoryPresent = true;
11228
11270
 
11229
11271
  for(i = 0; i < (mandatoryFields as Array<string>).length; i++) {
@@ -11519,9 +11561,17 @@ export class SfIEvents extends LitElement {
11519
11561
  var classBg = "";
11520
11562
 
11521
11563
  if(i%2 === 0) {
11522
- classBg = 'td-light';
11564
+ if(this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0 ){
11565
+ classBg = 'td-light-selected';
11566
+ }else{
11567
+ classBg = 'td-light';
11568
+ }
11523
11569
  } else {
11524
- classBg = 'td-dark';
11570
+ if(this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0 ){
11571
+ classBg = 'td-dark-selected';
11572
+ }else{
11573
+ classBg = 'td-dark';
11574
+ }
11525
11575
  }
11526
11576
 
11527
11577
  html += '<tr class="" id="tablerow-'+i+'">';
@@ -12099,8 +12149,28 @@ export class SfIEvents extends LitElement {
12099
12149
 
12100
12150
  const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
12101
12151
  buttonExportMappingCSVNew?.addEventListener('click', async () => {
12102
- let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
12152
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings))
12153
+ for(let [i, obj] of csvArray.entries()){
12154
+ let tempCsvObj = obj
12155
+ if(obj['cols'] != null && obj['data'] != null){
12156
+ let dataArr = JSON.parse(obj['data'])
12157
+ let colsArr = JSON.parse(obj['cols'])
12158
+ for(let [j, colKey] of colsArr.entries()){
12159
+ tempCsvObj['cols_' + colKey] = dataArr[j]
12160
+ }
12161
+ }
12162
+ csvArray[i] = tempCsvObj
12163
+ }
12164
+ console.log('csv array', csvArray)
12165
+ let csvData = Util.convertToCSV(csvArray);
12166
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
12103
12167
  console.log('csvData', csvData);
12168
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;'});
12169
+ const url = window.URL.createObjectURL(blob)
12170
+ const a = document.createElement('a')
12171
+ a.setAttribute('href', url)
12172
+ a.setAttribute('download', 'mapping_'+colName+'_'+new Date().getTime()+'.csv');
12173
+ a.click()
12104
12174
  })
12105
12175
 
12106
12176
  const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
@@ -12109,6 +12179,70 @@ export class SfIEvents extends LitElement {
12109
12179
  ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
12110
12180
  });
12111
12181
 
12182
+ const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
12183
+ fileInput.value = '';
12184
+ const fileInputNew = Util.clearListeners(fileInput);
12185
+ fileInputNew.addEventListener('change', (e: any) => {
12186
+ var fr=new FileReader();
12187
+ fr.onload = () => {
12188
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12189
+ };
12190
+ var frCsv = new FileReader();
12191
+ frCsv.onload = () => {
12192
+ console.log('taggingarray onload called');
12193
+ console.log('csv result', frCsv.result);
12194
+ const tempArr = Util.parseCsv(frCsv.result + "");
12195
+ console.log('csv data', tempArr)
12196
+ let changeCount = 0;
12197
+ for(let [i,obj] of tempArr.entries()){
12198
+ if(JSON.stringify(taggingArray.data.mappings.mappings[i]) !== JSON.stringify(obj)){
12199
+ console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
12200
+ this.changedOnboardingItemIds.push(taggingArray.data.mappings.mappings[i].id)
12201
+ changeCount++
12202
+ }
12203
+ }
12204
+ this.setSuccessBtn( changeCount + " items changed. Do you wish to apply?",["No","Yes"],[
12205
+ ()=>{
12206
+ this.clearMessages();
12207
+ this.changedOnboardingItemIds = [];
12208
+ (buttonToggleMoreBack as HTMLButtonElement).click();
12209
+ },
12210
+ ()=>{
12211
+ this.clearMessages();
12212
+ let tempObj:any = {}
12213
+ tempObj["data"] = {}
12214
+ // let mappingsObj:any = {}
12215
+ // mappingsObj.mappings = tempArr
12216
+ // console.log('csv mappingsobj', mappingsObj)
12217
+ tempObj["data"]["mappings"] = {}
12218
+ tempObj["data"]["mappings"]["mappings"] = tempArr
12219
+ // for(let tempItem of tempArr){
12220
+ // tempObj["data"]["mappings"]["mappings"].push(tempItem)
12221
+ // }
12222
+ // tempObj.data.mappings.mappings.push("pqrs")
12223
+ let tempObjStr = JSON.stringify(tempObj)
12224
+
12225
+ // console.log('csv taggingarray tempobj', tempObj, tempObjStr, tempObj.data.mappings.mappings[0])
12226
+ console.log('csv taggingarray cols', uniqCols, tempObjStr, Object.keys(tempObj.data.mappings.mappings[0]))
12227
+
12228
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12229
+ }
12230
+ ])
12231
+ // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
12232
+ // let tempObj:{data:{mappings:{mappings:any[]}}} = {data:{mappings:{mappings:tempArr}}}
12233
+
12234
+
12235
+ }
12236
+ if(e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
12237
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1]
12238
+ if(ext.toLowerCase() == "csv"){
12239
+ frCsv.readAsText(e.target.files[0]);
12240
+ }else{
12241
+ fr.readAsText(e.target.files[0]);
12242
+ }
12243
+ }
12244
+ })
12245
+
12112
12246
  const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
12113
12247
  buttonSaveLocalNew?.addEventListener('click', async () => {
12114
12248
  console.log('save-local');
@@ -12149,17 +12283,7 @@ export class SfIEvents extends LitElement {
12149
12283
  // ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
12150
12284
  // });
12151
12285
 
12152
- const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
12153
- fileInput.addEventListener('change', (e: any) => {
12154
- var fr=new FileReader();
12155
- fr.onload = () => {
12156
-
12157
- this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12158
- };
12159
- if(e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
12160
- fr.readAsText(e.target.files[0]);
12161
- }
12162
- })
12286
+
12163
12287
 
12164
12288
 
12165
12289
  // const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
@@ -12216,7 +12340,7 @@ export class SfIEvents extends LitElement {
12216
12340
  //(divElement as HTMLDivElement).querySelector("#span-extra-filled")!.innerHTML = "Fields: " + filledFields + "/" + totalFields + " completed";
12217
12341
  //console.log('Total fields = ' + totalFields + ', filled fields = ' + filledFields);
12218
12342
  }
12219
-
12343
+ this.changedOnboardingItemIds = []
12220
12344
  }
12221
12345
 
12222
12346
  renderMappingTable = (divElement: any, jsonData: Array<any>, cursor: Array<any>, fetchFunction: any, searchString: string, mappedArray: any, found: number, uploadFunction: any, refreshFunction: any, extraFields: Array<string>, uploadBlock: number, extraFieldPosition: number, colName: string, subfilter: string, statuteColName: string, extraHintsArr: Array<string>) => {
@@ -21952,6 +22076,7 @@ export class SfIEvents extends LitElement {
21952
22076
  </div>
21953
22077
  <div class="div-row-success div-row-submit gone">
21954
22078
  <div part="successmsg" class="div-row-success-message"></div>
22079
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
21955
22080
  </div>
21956
22081
  </div>
21957
22082
  <div class="rb"></div>
@@ -22003,6 +22128,7 @@ export class SfIEvents extends LitElement {
22003
22128
  </div>
22004
22129
  <div class="div-row-success div-row-submit gone">
22005
22130
  <div part="successmsg" class="div-row-success-message"></div>
22131
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22006
22132
  </div>
22007
22133
  </div>
22008
22134
  <div class="rb"></div>
@@ -22112,6 +22238,7 @@ export class SfIEvents extends LitElement {
22112
22238
  </div>
22113
22239
  <div class="div-row-success div-row-submit gone">
22114
22240
  <div part="successmsg" class="div-row-success-message"></div>
22241
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22115
22242
  </div>
22116
22243
  </div>
22117
22244
  <div class="rb"></div>
@@ -22229,6 +22356,7 @@ export class SfIEvents extends LitElement {
22229
22356
  </div>
22230
22357
  <div class="div-row-success div-row-submit gone">
22231
22358
  <div part="successmsg" class="div-row-success-message"></div>
22359
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22232
22360
  </div>
22233
22361
  </div>
22234
22362
  <div class="rb"></div>
@@ -22276,6 +22404,7 @@ export class SfIEvents extends LitElement {
22276
22404
  </div>
22277
22405
  <div class="div-row-success div-row-submit">
22278
22406
  <div part="successmsg" class="div-row-success-message"></div>
22407
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22279
22408
  </div>
22280
22409
  <div class="div-row-notif div-row-submit">
22281
22410
  <div part="notifmsg" class="div-row-notif-message"></div>
@@ -22316,6 +22445,7 @@ export class SfIEvents extends LitElement {
22316
22445
  </div>
22317
22446
  <div class="div-row-success div-row-submit gone">
22318
22447
  <div part="successmsg" class="div-row-success-message"></div>
22448
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22319
22449
  </div>
22320
22450
  </div>
22321
22451
  <div class="rb"></div>
@@ -22344,6 +22474,7 @@ export class SfIEvents extends LitElement {
22344
22474
  </div>
22345
22475
  <div class="div-row-success div-row-submit gone">
22346
22476
  <div part="successmsg" class="div-row-success-message"></div>
22477
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22347
22478
  </div>
22348
22479
  </div>
22349
22480
  <div class="rb"></div>
@@ -22412,6 +22543,7 @@ export class SfIEvents extends LitElement {
22412
22543
  </div>
22413
22544
  <div class="div-row-success div-row-submit gone">
22414
22545
  <div part="successmsg" class="div-row-success-message"></div>
22546
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22415
22547
  </div>
22416
22548
  </div>
22417
22549
  <div class="rb"></div>
package/src/util.ts CHANGED
@@ -382,15 +382,53 @@ function jsonObjectToHtml(json: any) {
382
382
 
383
383
  function convertToCSV(arr:any[]) {
384
384
  const array = [Object.keys(arr[0])].concat(arr)
385
-
386
- return array.map(it => {
387
- console.log('csv it', it);
388
- return Object.values(it).toString()
385
+ return array.map((it, index) => {
386
+ let strIt = ""
387
+ for(let [i,objkey] of Object.keys(it).entries()){
388
+ if(index == 0){
389
+ strIt += "\"" + it[objkey as any].replace(/"/g,"\"\"") + "\""
390
+ }else{
391
+ strIt += "\"" + JSON.stringify(it[objkey as any]).replace(/"/g,"\"\"") + "\""
392
+ }
393
+ if(i < (Object.keys(it).length - 1)){
394
+ strIt += ","
395
+ }
396
+ }
397
+ return strIt
389
398
  }).join('\n')
390
399
  }
391
400
 
401
+ function parseCsv(csv:string){
402
+ const re = /(,|\r?\n|\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/gi
403
+ const result:any = [[]]
404
+ let matches:any;
405
+ while ((matches = re.exec(csv))) {
406
+ if (matches[1].length && matches[1] !== ',') result.push([])
407
+ result[result.length - 1].push(
408
+ matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]
409
+ )
410
+ }
411
+ console.log('csv arr result', result, result.length);
412
+ let csvResult = arrayToObject(result)
413
+ return csvResult
414
+ }
415
+ function arrayToObject (csvArray:any) {
416
+
417
+ //Take the first line (headers) from the array and remove it from the array.
418
+ const headers = csvArray.shift()
419
+
420
+ // Iterate through the rows and reduce each column to an object
421
+
422
+ return csvArray.filter((row:any)=>{
423
+ console.log('csv object keys lngth', Object.keys(row).length)
424
+ return Object.keys(row).length > 1
425
+ }).map((row: { [x: string]: any; } ) =>{
426
+ return headers.reduce((acc: any, currentHeader: any, i: string | number) => ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i])}} : acc)), {})
427
+ })
428
+ }
429
+
392
430
  const exportFunctions = {
393
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV
431
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv
394
432
  };
395
433
 
396
434
  export default exportFunctions;
package/util.d.ts CHANGED
@@ -11,6 +11,7 @@ declare function isInteger(value: string): boolean;
11
11
  declare function clearListeners(old_element: HTMLElement): Node;
12
12
  declare function jsonObjectToHtml(json: any): string;
13
13
  declare function convertToCSV(arr: any[]): string;
14
+ declare function parseCsv(csv: string): any;
14
15
  declare const exportFunctions: {
15
16
  callApiPresignedDelete: typeof callApiPresignedDelete;
16
17
  callApiPresignedGet: typeof callApiPresignedGet;
@@ -27,6 +28,7 @@ declare const exportFunctions: {
27
28
  createDiagonalPattern3: typeof createDiagonalPattern3;
28
29
  getRandomColor: typeof getRandomColor;
29
30
  convertToCSV: typeof convertToCSV;
31
+ parseCsv: typeof parseCsv;
30
32
  };
31
33
  export default exportFunctions;
32
34
  //# sourceMappingURL=util.d.ts.map
package/util.js CHANGED
@@ -316,13 +316,48 @@ function jsonObjectToHtml(json) {
316
316
  }
317
317
  function convertToCSV(arr) {
318
318
  const array = [Object.keys(arr[0])].concat(arr);
319
- return array.map(it => {
320
- console.log('csv it', it);
321
- return Object.values(it).toString();
319
+ return array.map((it, index) => {
320
+ let strIt = "";
321
+ for (let [i, objkey] of Object.keys(it).entries()) {
322
+ if (index == 0) {
323
+ strIt += "\"" + it[objkey].replace(/"/g, "\"\"") + "\"";
324
+ }
325
+ else {
326
+ strIt += "\"" + JSON.stringify(it[objkey]).replace(/"/g, "\"\"") + "\"";
327
+ }
328
+ if (i < (Object.keys(it).length - 1)) {
329
+ strIt += ",";
330
+ }
331
+ }
332
+ return strIt;
322
333
  }).join('\n');
323
334
  }
335
+ function parseCsv(csv) {
336
+ const re = /(,|\r?\n|\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/gi;
337
+ const result = [[]];
338
+ let matches;
339
+ while ((matches = re.exec(csv))) {
340
+ if (matches[1].length && matches[1] !== ',')
341
+ result.push([]);
342
+ result[result.length - 1].push(matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]);
343
+ }
344
+ console.log('csv arr result', result, result.length);
345
+ let csvResult = arrayToObject(result);
346
+ return csvResult;
347
+ }
348
+ function arrayToObject(csvArray) {
349
+ //Take the first line (headers) from the array and remove it from the array.
350
+ const headers = csvArray.shift();
351
+ // Iterate through the rows and reduce each column to an object
352
+ return csvArray.filter((row) => {
353
+ console.log('csv object keys lngth', Object.keys(row).length);
354
+ return Object.keys(row).length > 1;
355
+ }).map((row) => {
356
+ return headers.reduce((acc, currentHeader, i) => ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i]) } } : acc)), {});
357
+ });
358
+ }
324
359
  const exportFunctions = {
325
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV
360
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv
326
361
  };
327
362
  export default exportFunctions;
328
363
  //# sourceMappingURL=util.js.map