sf-i-events 1.0.976 → 1.0.978

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.
@@ -14,6 +14,7 @@ import { Chart, ChartItem, registerables } from 'chart.js';
14
14
  import { SfIElasticText } from 'sf-i-elastic-text';
15
15
  import { SfIMultitextarea } from 'sf-i-multitextarea';
16
16
  import { SfIReporting } from 'sf-i-reporting';
17
+ import { SfMultiselectSearch } from 'sf-multiselect-search';
17
18
  // import {LitElement, html, css} from 'lit';
18
19
  // import {customElement} from 'lit/decorators.js';
19
20
 
@@ -3112,6 +3113,9 @@ export class SfIEvents extends LitElement {
3112
3113
  @query('#internalcontrols-container')
3113
3114
  _SfOnboardingInternalControlsContainer: any;
3114
3115
 
3116
+ @query('#reportedlocations-list-container')
3117
+ _SfOnboardingReportedLocationsListContainer: any;
3118
+
3115
3119
  @query('#reportedlocations-container')
3116
3120
  _SfOnboardingReportedLocationsContainer: any;
3117
3121
 
@@ -5295,7 +5299,7 @@ export class SfIEvents extends LitElement {
5295
5299
  // console.log("graphParam", graphParam.split(';')[0]);
5296
5300
  const configHome = Util.getProjectConfigHome();
5297
5301
  const configFlag = configHome.features != null && configHome.features.indexOf("understood") >= 0
5298
- html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + (((event.module == "compliances" || event.module == null) && event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true)) && !fromDrilldown) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood</button>')) : '') + ((event.module == "rcmresource" && event.completenessstatus == "approved") ? '<button id="button-renew-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-small" class="d-flex align-center mb-20 ml-10 button-icon button-renew"><span class="material-symbols-outlined" title="Renew">replay</span>&nbsp;&nbsp;Renew</button>' : '') +'</div>';
5302
+ html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + (((event.module == "compliances" || event.module == null) && event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true)) && !fromDrilldown) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span>&nbsp;&nbsp;Mark Understood</button>')) : '') + ((event.module == "rcmresource" && event.completenessstatus == "approved") ? '<button id="button-renew-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-small" class="d-flex align-center mb-20 ml-10 button-icon button-renew"><span class="material-symbols-outlined" title="Renew">replay</span>&nbsp;&nbsp;Renew</button>' : '') + '</div>';
5299
5303
  // }
5300
5304
 
5301
5305
  return html;
@@ -7755,7 +7759,7 @@ export class SfIEvents extends LitElement {
7755
7759
  console.log('idArr', idArr);
7756
7760
  const mmdd = idArr[2] + "/" + idArr[3];
7757
7761
  const j = idArr[4];
7758
- const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
7762
+ const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
7759
7763
  let renewEvent = this.events[mmdd][j];
7760
7764
  let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
7761
7765
  console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
@@ -10240,82 +10244,86 @@ export class SfIEvents extends LitElement {
10240
10244
  this.renderOnboardingStatutes(mappedStatutes);
10241
10245
  }
10242
10246
 
10243
- loadOnboardingCompliances = async () => {
10247
+ loadOnboardingCompliances = async (selectedStatutes: any = []) => {
10244
10248
  this.hideTabContainers();
10245
10249
  (this._SfOnboardingCompliancesContainer as HTMLDivElement).style.display = 'flex';
10246
- const mappedStatutes = await this.fetchMappedStatutes();
10247
- const mappedCompliances = await this.fetchMappedCompliances();
10248
- this.renderOnboardingCompliances(mappedStatutes, mappedCompliances);
10250
+ const mappedStatutes = await this.fetchMappedStatutesList();
10251
+ console.log("mapped statutes", mappedStatutes);
10252
+ // const mappedStatutes = await this.fetchMappedStatutes();
10253
+ // const mappedCompliances = await this.fetchMappedCompliances();
10254
+ // this.renderOnboardingCompliances(mappedStatutes, mappedCompliances);
10255
+ this.renderOnboardingStatutesDropdownMapping(this._SfOnboardingCompliancesContainer as HTMLDivElement, mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.renderOnboardingCompliances);
10249
10256
  }
10250
10257
 
10251
- loadOnboardingCountries = async () => {
10258
+ loadOnboardingCountries = async (selectedStatutes: any = []) => {
10252
10259
  this.hideTabContainers();
10253
10260
  (this._SfOnboardingCountriesContainer as HTMLDivElement).style.display = 'flex';
10261
+ const mappedStatutes = await this.fetchMappedStatutesList();
10254
10262
  // const countriesJobs = await this.fetchCountriesJobs();
10255
- const mappedCountries = await this.fetchMappedCountries();
10256
- const mappedCompliances = await this.fetchMappedCompliances();
10263
+ // const mappedCountries = await this.fetchMappedCountries();
10264
+ // const mappedCompliances = await this.fetchMappedCompliances();
10257
10265
  // const mappedStatutes = await this.fetchMappedStatutes();
10258
- //console.log('countriesJobs', countriesJobs);
10259
- console.log('mappedCompliances', mappedCompliances);
10260
- console.log('mappedCountries', mappedCountries);
10261
-
10262
-
10263
- for (var i = 0; i < mappedCompliances.data.mappings.mappings.length; i++) {
10264
-
10265
- if (mappedCompliances.data.mappings.mappings[i].id == "33a0deab-e93e-41b7-831a-473f9ea3eea2") {
10266
- //console.log('uniqcol zero', mappedCompliances.data.mappings.mappings[i]);
10267
- }
10268
-
10269
- }
10270
- this.renderOnboardingCountries(mappedCountries, mappedCompliances, null);
10266
+ // //console.log('countriesJobs', countriesJobs);
10267
+ // console.log('mappedCompliances', mappedCompliances);
10268
+ // console.log('mappedCountries', mappedCountries);
10269
+ // this.renderOnboardingCountries(mappedCountries, mappedCompliances, null);
10270
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingCountriesContainer as HTMLDivElement, 'countries-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, () => { return [] }, this.fetchMappedCountries, this.renderOnboardingCountries);
10271
10271
  }
10272
10272
 
10273
- loadOnboardingEntities = async () => {
10273
+ loadOnboardingEntities = async (selectedStatutes: any = []) => {
10274
10274
  this.hideTabContainers();
10275
10275
  (this._SfOnboardingEntitiesContainer as HTMLDivElement).style.display = 'flex';
10276
10276
  // const entitiesJobs = await this.fetchEntitiesJobs();
10277
- const mappedEntities = await this.fetchMappedEntities();
10278
- const mappedSerializedCountries = await this.fetchMappedSerializedCountries();
10279
- const arrStatuteEntitiesApplicabilities = await this.loadProposedFromStatutes(1);
10280
- // const mappedStatutes = await this.fetchMappedStatutes();
10277
+ const mappedStatutes = await this.fetchMappedStatutesList();
10278
+ // const mappedEntities = await this.fetchMappedEntities();
10279
+ // const mappedSerializedCountries = await this.fetchMappedSerializedCountries();
10280
+ // const arrStatuteEntitiesApplicabilities = await this.loadProposedFromStatutes(1);
10281
+ // // const mappedStatutes = await this.fetchMappedStatutes();
10281
10282
  //console.log('mappedSerializedCountries', mappedSerializedCountries);
10282
10283
  //console.log('mappedEntities', mappedEntities);
10283
10284
  //console.log('entitiesApplicabilities', arrStatuteEntitiesApplicabilities);
10284
- this.renderOnboardingEntities(mappedEntities, mappedSerializedCountries, null, arrStatuteEntitiesApplicabilities);
10285
+ // this.renderOnboardingEntities(mappedEntities, mappedSerializedCountries, null, arrStatuteEntitiesApplicabilities);
10286
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingEntitiesContainer as HTMLDivElement, 'entities-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedCountries, this.fetchMappedEntities, this.renderOnboardingEntities);
10285
10287
  }
10286
10288
 
10287
- loadOnboardingLocations = async () => {
10289
+ loadOnboardingLocations = async (selectedStatutes: any = []) => {
10288
10290
  this.hideTabContainers();
10289
10291
  (this._SfOnboardingLocationsContainer as HTMLDivElement).style.display = 'flex';
10290
10292
  // const locationsJobs = await this.fetchLocationsJobs();
10291
- const mappedSerializedEntities = await this.fetchMappedSerializedEntities();
10292
- const mappedLocations = await this.fetchMappedLocations();
10293
+ const mappedStatutes = await this.fetchMappedStatutesList();
10294
+ // const mappedSerializedEntities = await this.fetchMappedSerializedEntities();
10295
+ // const mappedLocations = await this.fetchMappedLocations();
10293
10296
  //console.log('mappedserializedentities', mappedSerializedEntities);
10294
- //console.log('mappedlocations', mappedLocations);
10295
- this.renderOnboardingLocations(mappedLocations, mappedSerializedEntities, null);
10297
+ //console.log('mappedlocations', mappedLocations);
10298
+ // this.renderOnboardingLocations(mappedLocations, mappedSerializedEntities, null);
10299
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingLocationsContainer as HTMLDivElement, 'locations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedEntities, this.fetchMappedLocations, this.renderOnboardingLocations);
10296
10300
  }
10297
10301
 
10298
- loadOnboardingFunctions = async () => {
10302
+ loadOnboardingFunctions = async (selectedStatutes: any = []) => {
10299
10303
  this.hideTabContainers();
10300
10304
  (this._SfOnboardingFunctionsContainer as HTMLDivElement).style.display = 'flex';
10305
+ const mappedStatutes = await this.fetchMappedStatutesList()
10301
10306
  // const functionsJobs = await this.fetchFunctionJobs();
10302
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10303
- const mappedFunctions = await this.fetchMappedFunctions();
10307
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10308
+ // const mappedFunctions = await this.fetchMappedFunctions();
10304
10309
  //console.log('functionjobs', functionsJobs);
10305
10310
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10306
10311
  //console.log('mappedfunctions', mappedFunctions);
10307
- this.renderOnboardingFunctions(mappedFunctions, mappedSerializedLocations, null);
10312
+ // this.renderOnboardingFunctions(mappedFunctions, mappedSerializedLocations, null);
10313
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingFunctionsContainer as HTMLDivElement, 'functions-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedLocations, this.fetchMappedFunctions, this.renderOnboardingFunctions);
10308
10314
  }
10309
10315
 
10310
- loadOnboardingTags = async () => {
10316
+ loadOnboardingTags = async (selectedStatutes: any = []) => {
10311
10317
  this.hideTabContainers();
10312
10318
  (this._SfOnboardingTagsContainer as HTMLDivElement).style.display = 'flex';
10319
+ const mappedStatutes = await this.fetchMappedStatutesList()
10313
10320
  // const tagsJobs = await this.fetchTagsJobs();
10314
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10315
- const mappedTags = await this.fetchMappedTags();
10321
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10322
+ // const mappedTags = await this.fetchMappedTags();
10316
10323
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10317
10324
  //console.log('mappedtags', mappedTags);
10318
- this.renderOnboardingTags(mappedTags, mappedSerializedLocations, null);
10325
+ // this.renderOnboardingTags(mappedTags, mappedSerializedLocations, null);
10326
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingTagsContainer as HTMLDivElement, 'tags-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedTags, this.renderOnboardingTags);
10319
10327
  }
10320
10328
 
10321
10329
  loadProposedFromStatutes = async (fieldIndex: number) => {
@@ -10337,175 +10345,206 @@ export class SfIEvents extends LitElement {
10337
10345
  return arrStatuteReporters;
10338
10346
  }
10339
10347
 
10340
- loadOnboardingReporters = async () => {
10348
+ loadOnboardingReporters = async (selectedStatutes: any = []) => {
10341
10349
  this.hideTabContainers();
10342
10350
  (this._SfOnboardingReportersContainer as HTMLDivElement).style.display = 'flex';
10351
+ const mappedStatutes = await this.fetchMappedStatutesList()
10343
10352
  // const reportersJobs = await this.fetchReportersJobs();
10344
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10345
- const mappedReporters = await this.fetchMappedReporters();
10353
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10354
+ // const mappedReporters = await this.fetchMappedReporters();
10346
10355
  // const arrStatuteReporters = await this.loadProposedFromStatutes(1);
10347
10356
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10348
10357
  //console.log('mappedreporters', mappedReporters);
10349
10358
  //console.log('arrstatutereporters', arrStatuteReporters);
10350
- this.renderOnboardingReporters(mappedReporters, mappedSerializedLocations, null, null);
10359
+ // this.renderOnboardingReporters(mappedReporters, mappedSerializedLocations, null, null);
10360
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingReportersContainer as HTMLDivElement, 'reporters-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedReporters, this.renderOnboardingReporters);
10351
10361
  }
10352
10362
 
10353
- loadOnboardingApprovers = async () => {
10363
+ loadOnboardingApprovers = async (selectedStatutes: any = []) => {
10354
10364
  this.hideTabContainers();
10355
10365
  (this._SfOnboardingApproversContainer as HTMLDivElement).style.display = 'flex';
10366
+ const mappedStatutes = await this.fetchMappedStatutesList()
10356
10367
  // const approversJobs = await this.fetchApproversJobs();
10357
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10358
- const mappedApprovers = await this.fetchMappedApprovers();
10368
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10369
+ // const mappedApprovers = await this.fetchMappedApprovers();
10359
10370
  // const arrStatuteApprovers = await this.loadProposedFromStatutes(2);
10360
10371
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10361
10372
  //console.log('mappedapprovers', mappedApprovers);
10362
- this.renderOnboardingApprovers(mappedApprovers, mappedSerializedLocations, null, null);
10373
+ // this.renderOnboardingApprovers(mappedApprovers, mappedSerializedLocations, null, null);
10374
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingApproversContainer as HTMLDivElement, 'approvers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedApprovers, this.renderOnboardingApprovers);
10363
10375
  }
10364
10376
 
10365
- loadOnboardingFunctionHeads = async () => {
10377
+ loadOnboardingFunctionHeads = async (selectedStatutes: any = []) => {
10366
10378
  this.hideTabContainers();
10367
10379
  (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).style.display = 'flex';
10380
+ const mappedStatutes = await this.fetchMappedStatutesList()
10368
10381
  // const functionHeadsJobs = await this.fetchFunctionHeadsJobs();
10369
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10370
- const mappedFunctionHeads = await this.fetchMappedFunctionHeads();
10382
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10383
+ // const mappedFunctionHeads = await this.fetchMappedFunctionHeads();
10371
10384
  // const arrStatuteFunctionheads = await this.loadProposedFromStatutes(3);
10372
10385
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10373
10386
  //console.log('mappedfunctionheads', mappedFunctionHeads);
10374
- this.renderOnboardingFunctionHeads(mappedFunctionHeads, mappedSerializedLocations, null, null);
10387
+ // this.renderOnboardingFunctionHeads(mappedFunctionHeads, mappedSerializedLocations, null, null);
10388
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingFunctionHeadsContainer as HTMLDivElement, 'functionheads-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedFunctionHeads, this.renderOnboardingFunctionHeads);
10375
10389
  }
10376
10390
 
10377
- loadOnboardingViewers = async () => {
10391
+ loadOnboardingViewers = async (selectedStatutes: any = []) => {
10378
10392
  this.hideTabContainers();
10379
10393
  (this._SfOnboardingViewersContainer as HTMLDivElement).style.display = 'flex';
10394
+ const mappedStatutes = await this.fetchMappedStatutesList()
10380
10395
  // const makerViewersJobs = await this.fetchViewersJobs();
10381
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10382
- const mappedViewers = await this.fetchMappedViewers();
10396
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10397
+ // const mappedViewers = await this.fetchMappedViewers();
10383
10398
  // const arrStatuteViewers = await this.loadProposedFromStatutes(5);
10384
10399
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10385
10400
  //console.log('mappedViewers', mappedViewers);
10386
- this.renderOnboardingViewers(mappedViewers, mappedSerializedLocations, null, null);
10401
+ // this.renderOnboardingViewers(mappedViewers, mappedSerializedLocations, null, null);
10402
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingViewersContainer as HTMLDivElement, 'viewers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedViewers, this.renderOnboardingViewers);
10387
10403
  }
10388
10404
 
10389
- loadOnboardingDocs = async () => {
10405
+ loadOnboardingDocs = async (selectedStatutes: any = []) => {
10390
10406
  this.hideTabContainers();
10391
10407
  (this._SfOnboardingDocsContainer as HTMLDivElement).style.display = 'flex';
10408
+ const mappedStatutes = await this.fetchMappedStatutesList()
10392
10409
  // const docsJobs = await this.fetchDocsJobs();
10393
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10394
- const mappedDocs = await this.fetchMappedDocs();
10410
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10411
+ // const mappedDocs = await this.fetchMappedDocs();
10395
10412
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10396
10413
  //console.log('mappedDocs', mappedDocs);
10397
- this.renderOnboardingDocs(mappedDocs, mappedSerializedLocations, null);
10414
+ // this.renderOnboardingDocs(mappedDocs, mappedSerializedLocations, null);
10415
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingDocsContainer as HTMLDivElement, 'docs-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedDocs, this.renderOnboardingDocs);
10398
10416
  }
10399
10417
 
10400
- loadOnboardingMakerCheckers = async () => {
10418
+ loadOnboardingMakerCheckers = async (selectedStatutes: any = []) => {
10401
10419
  this.hideTabContainers();
10402
10420
  (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).style.display = 'flex';
10421
+ const mappedStatutes = await this.fetchMappedStatutesList()
10403
10422
  // const makerCheckersJobs = await this.fetchMakerCheckersJobs();
10404
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10405
- const mappedMakerCheckers = await this.fetchMappedMakerCheckers();
10423
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10424
+ // const mappedMakerCheckers = await this.fetchMappedMakerCheckers();
10406
10425
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10407
10426
  //console.log('mappedMakerCheckers', mappedMakerCheckers);
10408
- this.renderOnboardingMakerCheckers(mappedMakerCheckers, mappedSerializedLocations, null);
10427
+ // this.renderOnboardingMakerCheckers(mappedMakerCheckers, mappedSerializedLocations, null);
10428
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingMakerCheckersContainer as HTMLDivElement, 'makercheckers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedMakerCheckers, this.renderOnboardingMakerCheckers);
10409
10429
  }
10410
10430
 
10411
- loadOnboardingAuditors = async () => {
10431
+ loadOnboardingAuditors = async (selectedStatutes: any = []) => {
10412
10432
  this.hideTabContainers();
10413
10433
  (this._SfOnboardingAuditorsContainer as HTMLDivElement).style.display = 'flex';
10434
+ const mappedStatutes = await this.fetchMappedStatutesList()
10414
10435
  // const auditorsJobs = await this.fetchAuditorsJobs();
10415
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10416
- const mappedAuditors = await this.fetchMappedAuditors();
10436
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10437
+ // const mappedAuditors = await this.fetchMappedAuditors();
10417
10438
  // const arrStatuteAuditors = await this.loadProposedFromStatutes(4);
10418
10439
  //console.log('mappedSerializedFunctionheads', mappedSerializedLocations);
10419
10440
  //console.log('mappedAuditors', mappedAuditors);
10420
- this.renderOnboardingAuditors(mappedAuditors, mappedSerializedLocations, null, null);
10441
+ // this.renderOnboardingAuditors(mappedAuditors, mappedSerializedLocations, null, null);
10442
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingAuditorsContainer as HTMLDivElement, 'auditors-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedAuditors, this.renderOnboardingAuditors);
10443
+
10421
10444
  }
10422
10445
 
10423
- loadOnboardingDuedates = async () => {
10446
+ loadOnboardingDuedates = async (selectedStatutes: any = []) => {
10424
10447
  this.hideTabContainers();
10425
10448
  (this._SfOnboardingDuedatesContainer as HTMLDivElement).style.display = 'flex';
10449
+ const mappedStatutes = await this.fetchMappedStatutesList()
10426
10450
  // const duedatesJobs = await this.fetchDueDatesJobs();
10427
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10428
- const mappedDuedates = await this.fetchMappedDuedates();
10451
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10452
+ // const mappedDuedates = await this.fetchMappedDuedates();
10429
10453
  //console.log('mappedSerializedLocations', mappedSerializedLocations);
10430
10454
  //console.log('mappedduedates', mappedDuedates);
10431
- this.renderOnboardingDuedates(mappedDuedates, mappedSerializedLocations, null);
10455
+ // this.renderOnboardingDuedates(mappedDuedates, mappedSerializedLocations, null);
10456
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingDuedatesContainer as HTMLDivElement, 'duedates-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedDuedates, this.renderOnboardingDuedates);
10432
10457
  }
10433
10458
 
10434
- loadOnboardingActivations = async () => {
10459
+ loadOnboardingActivations = async (selectedStatutes: any = []) => {
10435
10460
  this.hideTabContainers();
10436
10461
  (this._SfOnboardingActivationsContainer as HTMLDivElement).style.display = 'flex';
10462
+ const mappedStatutes = await this.fetchMappedStatutesList()
10437
10463
  // const activationsJobs = await this.fetchExtensionsJobs();
10438
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10439
- const mappedActivations = await this.fetchMappedActivations();
10464
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10465
+ // const mappedActivations = await this.fetchMappedActivations();
10440
10466
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10441
10467
  //console.log('mappedactivations', mappedActivations);
10442
- this.renderOnboardingActivations(mappedActivations, mappedSerializedLocations, null);
10468
+ // this.renderOnboardingActivations(mappedActivations, mappedSerializedLocations, null);
10469
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingActivationsContainer as HTMLDivElement, 'activations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedActivations, this.renderOnboardingActivations);
10443
10470
  }
10444
10471
 
10445
- loadOnboardingInvalidations = async () => {
10472
+ loadOnboardingInvalidations = async (selectedStatutes: any = []) => {
10446
10473
  this.hideTabContainers();
10447
10474
  (this._SfOnboardingInvalidationsContainer as HTMLDivElement).style.display = 'flex';
10475
+ const mappedStatutes = await this.fetchMappedStatutesList()
10448
10476
  // const invalidationsJobs = await this.fetchExtensionsJobs();
10449
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10450
- const mappedInvalidations = await this.fetchMappedInvalidations();
10477
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10478
+ // const mappedInvalidations = await this.fetchMappedInvalidations();
10451
10479
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10452
10480
  //console.log('mappedinvalidations', mappedInvalidations);
10453
- this.renderOnboardingInvalidations(mappedInvalidations, mappedSerializedLocations, null);
10481
+ // this.renderOnboardingInvalidations(mappedInvalidations, mappedSerializedLocations, null);
10482
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingInvalidationsContainer as HTMLDivElement, 'invalidations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedInvalidations, this.renderOnboardingInvalidations);
10454
10483
  }
10455
10484
 
10456
- loadOnboardingAlertSchedules = async () => {
10485
+ loadOnboardingAlertSchedules = async (selectedStatutes: any = []) => {
10457
10486
  this.hideTabContainers();
10458
10487
  (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).style.display = 'flex';
10488
+ const mappedStatutes = await this.fetchMappedStatutesList()
10459
10489
  // const alertschedulesJobs = await this.fetchAlertSchedulesJobs();
10460
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10461
- const mappedAlertSchedules = await this.fetchMappedAlertSchedules();
10490
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10491
+ // const mappedAlertSchedules = await this.fetchMappedAlertSchedules();
10462
10492
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10463
10493
  //console.log('mappedalertschedules', mappedAlertSchedules);
10464
- this.renderOnboardingAlertSchedules(mappedAlertSchedules, mappedSerializedLocations, null);
10494
+ // this.renderOnboardingAlertSchedules(mappedAlertSchedules, mappedSerializedLocations, null);
10495
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingAlertSchedulesContainer as HTMLDivElement, 'alertschedules-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedAlertSchedules, this.renderOnboardingAlertSchedules);
10465
10496
  }
10466
10497
 
10467
- loadOnboardingExtensions = async () => {
10498
+ loadOnboardingExtensions = async (selectedStatutes: any = []) => {
10468
10499
  this.hideTabContainers();
10469
10500
  (this._SfOnboardingExtensionsContainer as HTMLDivElement).style.display = 'flex';
10501
+ const mappedStatutes = await this.fetchMappedStatutesList()
10470
10502
  // const extensionsJobs = await this.fetchExtensionsJobs();
10471
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10472
- const mappedExtensions = await this.fetchMappedExtensions();
10503
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10504
+ // const mappedExtensions = await this.fetchMappedExtensions();
10473
10505
  //console.log('mappedserializedlocations', mappedSerializedLocations);
10474
10506
  //console.log('mappedextensions', mappedExtensions);
10475
- this.renderOnboardingExtensions(mappedExtensions, mappedSerializedLocations, null);
10507
+ // this.renderOnboardingExtensions(mappedExtensions, mappedSerializedLocations, null);
10508
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingExtensionsContainer as HTMLDivElement, 'extensions-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedExtensions, this.renderOnboardingExtensions);
10476
10509
  }
10477
10510
 
10478
- loadOnboardingTriggers = async () => {
10511
+ loadOnboardingTriggers = async (selectedStatutes: any = []) => {
10479
10512
  this.hideTabContainers();
10480
10513
  (this._SfOnboardingTriggersContainer as HTMLDivElement).style.display = 'flex';
10514
+ const mappedStatutes = await this.fetchMappedStatutesList()
10481
10515
  // const triggersJobs = await this.fetchInternalControlsJobs();
10482
10516
  // const mappedSerializedAlertSchedules = await this.fetchMappedSerializedAlertSchedules();
10483
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10484
- const mappedTriggers = await this.fetchMappedTriggers();
10517
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10518
+ // const mappedTriggers = await this.fetchMappedTriggers();
10485
10519
  //console.log('mappedSerializedAlertSchedules', mappedSerializedAlertSchedules);
10486
10520
  //console.log('mappedTriggers', mappedTriggers);
10487
- this.renderOnboardingTriggers(mappedTriggers, mappedSerializedLocations, null);
10521
+ // this.renderOnboardingTriggers(mappedTriggers, mappedSerializedLocations, null);
10522
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingTriggersContainer as HTMLDivElement, 'triggers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedTriggers, this.renderOnboardingTriggers);
10488
10523
  }
10489
10524
 
10490
- loadOnboardingInternalControls = async () => {
10525
+ loadOnboardingInternalControls = async (selectedStatutes: any = []) => {
10491
10526
  this.hideTabContainers();
10492
10527
  (this._SfOnboardingInternalControlsContainer as HTMLDivElement).style.display = 'flex';
10528
+ const mappedStatutes = await this.fetchMappedStatutesList()
10493
10529
  // const internalcontrolsJobs = await this.fetchInternalControlsJobs();
10494
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10495
- const mappedInternalControls = await this.fetchMappedInternalControls();
10530
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10531
+ // const mappedInternalControls = await this.fetchMappedInternalControls();
10496
10532
  //console.log('mappedSerializedlocations', mappedSerializedLocations);
10497
10533
  //console.log('mappedinternalcontrols', mappedInternalControls);
10498
- this.renderOnboardingInternalControls(mappedInternalControls, mappedSerializedLocations, null);
10534
+ // this.renderOnboardingInternalControls(mappedInternalControls, mappedSerializedLocations, null);
10535
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingInternalControlsContainer as HTMLDivElement, 'internalcontrols-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedInternalControls, this.renderOnboardingInternalControls);
10499
10536
  }
10500
10537
 
10501
- loadOnboardingReportedLocations = async () => {
10538
+ loadOnboardingReportedLocations = async (selectedStatutes: any = []) => {
10502
10539
  this.hideTabContainers();
10503
10540
  (this._SfOnboardingReportedLocationsContainer as HTMLDivElement).style.display = 'flex';
10504
- const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10505
- const mappedReportedLocations = await this.fetchMappedReportedLocations();
10541
+ const mappedStatutes = await this.fetchMappedStatutesList()
10542
+ // const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
10543
+ // const mappedReportedLocations = await this.fetchMappedReportedLocations();
10506
10544
  //console.log('mappedSerializedlocations', mappedSerializedLocations);
10507
10545
  //console.log('mappedReportedLocations', mappedReportedLocations);
10508
- this.renderOnboardingReportedLocations(mappedReportedLocations, mappedSerializedLocations, null);
10546
+ // this.renderOnboardingReportedLocations(mappedReportedLocations, mappedSerializedLocations, null);
10547
+ this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingReportedLocationsContainer as HTMLDivElement, 'reportedlocations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedReportedLocations, this.renderOnboardingReportedLocations);
10509
10548
  }
10510
10549
 
10511
10550
  loadOnboardingSignoff = async () => {
@@ -12467,7 +12506,7 @@ export class SfIEvents extends LitElement {
12467
12506
  console.log('idArr', idArr);
12468
12507
  const mmdd = idArr[2] + "/" + idArr[3];
12469
12508
  const j = idArr[4];
12470
- const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
12509
+ const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
12471
12510
  let renewEvent = this.events[mmdd][j];
12472
12511
  let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
12473
12512
  console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
@@ -13200,7 +13239,7 @@ export class SfIEvents extends LitElement {
13200
13239
  console.log('idArr', idArr);
13201
13240
  const mmdd = idArr[2] + "/" + idArr[3];
13202
13241
  const j = idArr[4];
13203
- const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
13242
+ const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
13204
13243
  let renewEvent = this.events[mmdd][j];
13205
13244
  let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
13206
13245
  console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
@@ -13413,7 +13452,7 @@ export class SfIEvents extends LitElement {
13413
13452
  const startDate = new Date(startDateStr);
13414
13453
  const endDate = new Date(endDateStr);
13415
13454
  const month = parseInt(monthStr, 10); // Ensure month is a number
13416
-
13455
+ console.log('getting date', startDate, endDate, month);
13417
13456
  if (isNaN(month) || month < 1 || month > 12) {
13418
13457
  return this.calendarStartYYYY
13419
13458
  }
@@ -14494,7 +14533,7 @@ export class SfIEvents extends LitElement {
14494
14533
  console.log('idArr', idArr);
14495
14534
  const mmdd = idArr[2] + "/" + idArr[3];
14496
14535
  const j = idArr[4];
14497
- const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
14536
+ const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
14498
14537
  let renewEvent = this.events[mmdd][j];
14499
14538
  let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
14500
14539
  console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
@@ -17390,7 +17429,7 @@ export class SfIEvents extends LitElement {
17390
17429
  console.log('jsonRespose agreement details', jsonRespose);
17391
17430
  if (flagReturn) {
17392
17431
  return jsonRespose.object;
17393
- }else{
17432
+ } else {
17394
17433
  this.renderRCMResourceDetails(jsonRespose.object, mmddyyyy)
17395
17434
  }
17396
17435
  } else {
@@ -19325,14 +19364,16 @@ export class SfIEvents extends LitElement {
19325
19364
  if (this.selectedItemIds.length <= 1) {
19326
19365
  console.log('selectedevent', JSON.stringify(event));
19327
19366
  if (await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, event.module ?? "compliance")) {
19328
- for (var p = 0; p < this.events[mmdd].length; p++) {
19329
- if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
19330
- this.events[mmdd][p].approved = approved
19331
- console.log('selected event', this.events[mmdd][p]);
19332
- this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
19333
- this.events[mmdd][p].lastupdated = new Date().toString()
19334
- if (approved) {
19335
- this.events[mmdd][p].dateofcompletion = new Date().getTime() + ""
19367
+ if (this.mode != "next") {
19368
+ for (var p = 0; p < this.events[mmdd].length; p++) {
19369
+ if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
19370
+ this.events[mmdd][p].approved = approved
19371
+ console.log('selected event', this.events[mmdd][p]);
19372
+ this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
19373
+ this.events[mmdd][p].lastupdated = new Date().toString()
19374
+ if (approved) {
19375
+ this.events[mmdd][p].dateofcompletion = new Date().getTime() + ""
19376
+ }
19336
19377
  }
19337
19378
  }
19338
19379
  }
@@ -19719,7 +19760,7 @@ export class SfIEvents extends LitElement {
19719
19760
  }
19720
19761
  this.recentlyReported[mmdd].push(event)
19721
19762
  console.log('recently reported', this.recentlyReported)
19722
-
19763
+
19723
19764
  } else {
19724
19765
  for (var p = 0; p < this.nextEvents[this.nextTabRole][mmdd].length; p++) {
19725
19766
  if (this.nextEvents[this.nextTabRole][mmdd][p].id == event.id && this.nextEvents[this.nextTabRole][mmdd][p].locationid == event.locationid && this.nextEvents[this.nextTabRole][mmdd][p].entityid == event.entityid) {
@@ -19790,14 +19831,14 @@ export class SfIEvents extends LitElement {
19790
19831
  "makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
19791
19832
  })
19792
19833
 
19793
-
19834
+
19794
19835
  }
19795
-
19836
+
19796
19837
  if (bulkBody.length > 0) {
19797
19838
  await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
19798
19839
  }
19799
19840
 
19800
-
19841
+
19801
19842
  for (var k = 0; k < this.selectedItemIds.length; k++) {
19802
19843
 
19803
19844
  const selectedId = this.selectedItemIds[k];
@@ -20167,6 +20208,63 @@ export class SfIEvents extends LitElement {
20167
20208
 
20168
20209
  }
20169
20210
 
20211
+ applyAndReloadTaggingNew = (e: any, colName: string, taggingArray: any, sourceArray: any, divElement: any) => {
20212
+
20213
+ const selectedIndex = e.currentTarget.id.split('-')[1];
20214
+ const tempArray = [];
20215
+ console.log('sourceArray apply', sourceArray, taggingArray);
20216
+ console.log('selectedindexchecking 1', this.selectedCbs)
20217
+ for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
20218
+ console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex + ""), this.selectedCbs.includes(count + ""));
20219
+ tempArray.push(taggingArray.data.mappings.mappings[count]);
20220
+ if (this.selectedCbs.includes(selectedIndex + '') && this.selectedCbs.includes(count + '')) {
20221
+ if (((divElement as HTMLDivElement).querySelector('#tags-' + selectedIndex) as SfIForm).selectedValues != null) {
20222
+
20223
+ if (tempArray[count] == null) tempArray[count] = {};
20224
+ tempArray[count][colName] = ((divElement as HTMLDivElement).querySelector('#tags-' + selectedIndex) as SfIForm).selectedValues();
20225
+ } else {
20226
+
20227
+ if (tempArray[count] == null) tempArray[count] = {};
20228
+ tempArray[count][colName] = ((divElement as HTMLDivElement).querySelector('#tags-' + selectedIndex) as HTMLInputElement).value;
20229
+ }
20230
+
20231
+ } else {
20232
+
20233
+ if (((divElement as HTMLDivElement).querySelector('#tags-' + count) as SfIForm).selectedValues != null) {
20234
+
20235
+ if (tempArray[count] == null) tempArray[count] = {};
20236
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
20237
+ let selectedValues = ((divElement as HTMLDivElement).querySelector('#tags-' + count) as SfIForm).selectedValues()
20238
+ if (selectedValues == null || selectedValues.length == 0) {
20239
+ tempArray[count] = {};
20240
+ console.log('deleting1', tempArray)
20241
+ } else {
20242
+ tempArray[count][colName] = ((divElement as HTMLDivElement).querySelector('#tags-' + count) as SfIForm).selectedValues();
20243
+ }
20244
+ } else {
20245
+ tempArray[count][colName] = ((divElement as HTMLDivElement).querySelector('#tags-' + count) as SfIForm).selectedValues();
20246
+ }
20247
+
20248
+
20249
+ } else {
20250
+ //console.log('selectedindexchecking D');
20251
+
20252
+ if (tempArray[count] == null) tempArray[count] = {};
20253
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
20254
+ tempArray[count] = {};
20255
+ console.log('deleting2', tempArray);
20256
+ } else {
20257
+ tempArray[count][colName] = ((divElement as HTMLDivElement).querySelector('#tags-' + count) as HTMLInputElement).value;
20258
+ }
20259
+ }
20260
+ }
20261
+ }
20262
+
20263
+ taggingArray.data.mappings.mappings = tempArray;
20264
+ console.log('selectedindexchecking', colName, taggingArray);
20265
+
20266
+ }
20267
+
20170
20268
  getDataValue = (jsonData: any, id: string) => {
20171
20269
 
20172
20270
  let ret: any = null;
@@ -20201,7 +20299,7 @@ export class SfIEvents extends LitElement {
20201
20299
 
20202
20300
  }
20203
20301
 
20204
- saveMapping = async (divElement: any, uploadBlock: number, jsonData: any, extraFields: any, searchString: string, uploadFunction: any, refreshFunction: any, saveInBackground: boolean = false) => {
20302
+ saveMapping = async (divElement: any, uploadBlock: number, jsonData: any, extraFields: any, searchString: string, uploadFunction: any, refreshFunction: any, saveInBackground: boolean = false, mappedStatutes: Array<any>) => {
20205
20303
 
20206
20304
  const process = async () => {
20207
20305
  const tableRowArr = (divElement as HTMLDivElement).querySelectorAll('.tablerow') as NodeListOf<HTMLTableRowElement>;
@@ -20216,33 +20314,85 @@ export class SfIEvents extends LitElement {
20216
20314
  let updatedRows = [];
20217
20315
  let jsonArr = [];
20218
20316
  if (uploadBlock < 0) {
20219
- for (var i = 0; i < checkboxArr.length; i++) {
20317
+ if (mappedStatutes.length == 0) {
20318
+ for (var i = 0; i < checkboxArr.length; i++) {
20319
+
20320
+ //console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
20321
+ if (checkboxArr[i].checked !== true) {
20322
+ continue;
20323
+ }
20220
20324
 
20221
- //console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
20325
+ if ((tableRowArr[i] as HTMLTableRowElement).style.display == 'none') {
20326
+ } else {
20327
+ updatedRows.push((statuteArr[i] as SfIElasticText).text);
20328
+ }
20329
+ let cols = JSON.parse(this.getColsValue(jsonData, (statuteArr[i] as SfIElasticText).text)[0]);
20330
+ let data = JSON.parse(this.getDataValue(jsonData, (statuteArr[i] as SfIElasticText).text)[0]);
20331
+ var dataToBePushed: any = { id: (statuteArr[i] as SfIElasticText).text, name: data[cols.indexOf('name')], countryname: data[cols.indexOf('country')][0] };
20332
+ /* var dataToBePushed = { id: (statuteArr[k] as SfIElasticText).text, selected: checkboxArr[k].checked, data: this.getDataValue(jsonData, (statuteArr[k] as SfIElasticText).text), cols: this.getColsValue(jsonData, (statuteArr[k] as SfIElasticText).text), extraFields: [] as string[], updatedFields: [] as string[] };
20333
+ for (var j = 0; j < extraFields.length; j++) {
20334
+ const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20335
+ const value = inputArr[k].getValues();
20336
+ dataToBePushed.extraFields.push(value);
20337
+ if (j === 0) {
20338
+ const fields = inputArr[i].getFields();
20339
+ dataToBePushed.updatedFields.push(...fields);
20340
+ }
20341
+ } */
20222
20342
 
20223
- if ((tableRowArr[i] as HTMLTableRowElement).style.display == 'none') {
20224
- } else {
20225
- updatedRows.push((statuteArr[i] as SfIElasticText).text);
20343
+ jsonArr.push(dataToBePushed)
20226
20344
  }
20345
+ console.log('jsonArr', jsonArr);
20346
+ //console.log('updatedRows', updatedRows);
20347
+ // const batchNum = new Date().getTime();
20348
+ // await uploadFunction({ "searchstring": searchString, "mappings": jsonArr, "batch": batchNum, "updatedrows": updatedRows });
20227
20349
 
20228
- var dataToBePushed = { id: (statuteArr[i] as SfIElasticText).text, selected: checkboxArr[i].checked, data: this.getDataValue(jsonData, (statuteArr[i] as SfIElasticText).text), cols: this.getColsValue(jsonData, (statuteArr[i] as SfIElasticText).text), extraFields: [] as string[], updatedFields: [] as string[] };
20229
- for (var j = 0; j < extraFields.length; j++) {
20230
- const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20231
- const value = inputArr[i].getValues();
20232
- // //console.log('value', value);
20233
- dataToBePushed.extraFields.push(value);
20234
- if (j === 0) {
20235
- const fields = inputArr[i].getFields();
20236
- dataToBePushed.updatedFields.push(...fields);
20350
+ await uploadFunction({ "searchstring": searchString, "mappings": jsonArr });
20351
+ } else {
20352
+ for (var i = 0; i < checkboxArr.length; i++) {
20353
+
20354
+ //console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
20355
+ if (checkboxArr[i].checked !== true) {
20356
+ continue;
20357
+ }
20358
+
20359
+ if ((tableRowArr[i] as HTMLTableRowElement).style.display == 'none') {
20360
+ } else {
20361
+ updatedRows.push((statuteArr[i] as SfIElasticText).text);
20362
+ }
20363
+ let cols = JSON.parse(this.getColsValue(jsonData, (statuteArr[i] as SfIElasticText).text)[0]);
20364
+ let data = JSON.parse(this.getDataValue(jsonData, (statuteArr[i] as SfIElasticText).text)[0]);
20365
+ var dataToBePushed: any = { id: (statuteArr[i] as SfIElasticText).text, data: [JSON.stringify(data)], cols: [JSON.stringify(cols)] };
20366
+ /* var dataToBePushed = { id: (statuteArr[k] as SfIElasticText).text, selected: checkboxArr[k].checked, data: this.getDataValue(jsonData, (statuteArr[k] as SfIElasticText).text), cols: this.getColsValue(jsonData, (statuteArr[k] as SfIElasticText).text), extraFields: [] as string[], updatedFields: [] as string[] };
20367
+ for (var j = 0; j < extraFields.length; j++) {
20368
+ const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20369
+ const value = inputArr[k].getValues();
20370
+ dataToBePushed.extraFields.push(value);
20371
+ if (j === 0) {
20372
+ const fields = inputArr[i].getFields();
20373
+ dataToBePushed.updatedFields.push(...fields);
20374
+ }
20375
+ } */
20376
+
20377
+ jsonArr.push(dataToBePushed)
20378
+ }
20379
+ let jsonObj: { [key: string]: { [key: string]: any } } = {};
20380
+
20381
+ for (let statuteObj of mappedStatutes) {
20382
+ let statuteid = statuteObj.id;
20383
+ if (jsonObj[statuteid] == null) {
20384
+ jsonObj[statuteid] = {};
20385
+ }
20386
+ for (let mappingObj of jsonArr) {
20387
+ console.log('mappingObj', mappingObj.data, statuteid);
20388
+ if (mappingObj.data[0].indexOf(statuteid) >= 0) {
20389
+ jsonObj[statuteid][mappingObj.id] = mappingObj;
20390
+ }
20237
20391
  }
20238
20392
  }
20239
20393
 
20240
- jsonArr.push(dataToBePushed)
20394
+ await uploadFunction(jsonObj, mappedStatutes);
20241
20395
  }
20242
- //console.log('jsonArr', jsonArr);
20243
- //console.log('updatedRows', updatedRows);
20244
- const batchNum = new Date().getTime();
20245
- await uploadFunction({ "searchstring": searchString, "mappings": jsonArr, "batch": batchNum, "updatedrows": updatedRows });
20246
20396
 
20247
20397
  } else {
20248
20398
 
@@ -20259,7 +20409,7 @@ export class SfIEvents extends LitElement {
20259
20409
 
20260
20410
  if ((statuteArr[k] as SfIElasticText) != null) {
20261
20411
 
20262
- var dataToBePushed = { id: (statuteArr[k] as SfIElasticText).text, selected: checkboxArr[k].checked, data: this.getDataValue(jsonData, (statuteArr[k] as SfIElasticText).text), cols: this.getColsValue(jsonData, (statuteArr[k] as SfIElasticText).text), extraFields: [] as string[], updatedFields: [] as string[] };
20412
+ var dataToBePushed: any = { id: (statuteArr[k] as SfIElasticText).text, selected: checkboxArr[k].checked, data: this.getDataValue(jsonData, (statuteArr[k] as SfIElasticText).text), cols: this.getColsValue(jsonData, (statuteArr[k] as SfIElasticText).text), extraFields: [] as string[], updatedFields: [] as string[] };
20263
20413
  for (var j = 0; j < extraFields.length; j++) {
20264
20414
  const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20265
20415
  const value = inputArr[k].getValues();
@@ -20285,7 +20435,7 @@ export class SfIEvents extends LitElement {
20285
20435
 
20286
20436
  }
20287
20437
 
20288
- if (!saveInBackground) refreshFunction();
20438
+ if (!saveInBackground) refreshFunction(mappedStatutes);
20289
20439
  }
20290
20440
 
20291
20441
  if (this.disablesave == "yes") {
@@ -20310,14 +20460,54 @@ export class SfIEvents extends LitElement {
20310
20460
 
20311
20461
  }
20312
20462
 
20313
- saveTagging = async (mapping: any, uploadFunction: any, refreshFunction: any, saveInBackground: boolean) => {
20463
+ saveTagging = async (mapping: any, selectedStatutes: any, uploadFunction: any, refreshFunction: any, saveInBackground: boolean, colName: string) => {
20314
20464
 
20315
20465
  async function process() {
20316
20466
 
20317
- //console.log('Saving...', mapping);
20467
+ console.log('Saving...', JSON.stringify(mapping));
20468
+ let statuteids = []
20469
+ let statutewiseMapping: any = {}
20470
+ for (let statutesObj of selectedStatutes) {
20471
+ statuteids.push(statutesObj.id);
20472
+ statutewiseMapping[statutesObj.id] = {};
20473
+ for (let mapObj of mapping.mappings) {
20474
+ if (mapObj.statuteid == statutesObj.id) {
20475
+ let pushObj = mapObj;
20476
+ delete pushObj.statuteid
20477
+ let compoundid = mapObj.id
20478
+
20479
+ // if (colName == "countries" || colName == "entities" || colName == "locations") {
20480
+ switch (colName) {
20481
+ case "countries":
20482
+ compoundid = mapObj.id
20483
+ break;
20484
+
20485
+ case "entities":
20486
+ compoundid = mapObj.countryid + ';' + mapObj.id;
20487
+ break;
20488
+
20489
+ case "locations":
20490
+ compoundid = mapObj.entityid + ';' + mapObj.id;
20491
+ break;
20492
+
20493
+ default:
20494
+ compoundid = mapObj.entityid + ';' + mapObj.locationid + ';' + mapObj.id
20495
+ break;
20496
+ }
20318
20497
 
20319
- await uploadFunction(mapping);
20320
- if (!saveInBackground) refreshFunction();
20498
+ // }
20499
+ if (statutewiseMapping[statutesObj.id][compoundid] != null) {
20500
+ let pushObjOld = statutewiseMapping[statutesObj.id][compoundid];
20501
+ pushObj[colName] = [...pushObjOld[colName], ...mapObj[colName]]
20502
+ } else {
20503
+ statutewiseMapping[statutesObj.id][compoundid] = pushObj;
20504
+ }
20505
+ }
20506
+ }
20507
+ }
20508
+ console.log('Uploading ...', JSON.stringify(statutewiseMapping));
20509
+ await uploadFunction(statutewiseMapping, statuteids);
20510
+ if (!saveInBackground) refreshFunction(selectedStatutes);
20321
20511
  }
20322
20512
 
20323
20513
  if (this.disablesave == "yes") {
@@ -21495,7 +21685,7 @@ export class SfIEvents extends LitElement {
21495
21685
 
21496
21686
  const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
21497
21687
  buttonSave?.addEventListener('click', async () => {
21498
- await this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, false);
21688
+ await this.saveTagging(taggingArray.data.mappings, [], uploadFunction, refreshFunction, false, colName);
21499
21689
  });
21500
21690
 
21501
21691
  const buttonCancel = (divElement as HTMLDivElement).querySelector('.button-cancel') as HTMLButtonElement;
@@ -21539,126 +21729,1136 @@ export class SfIEvents extends LitElement {
21539
21729
  this.changedOnboardingItemIds = []
21540
21730
  }
21541
21731
 
21542
- 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>) => {
21543
- console.log('cols1', jsonData);
21544
- // console.log('cols', jsonData[0].data.cols);
21545
- //console.log('divelement', divElement);
21546
- //console.log('jsonData', jsonData);
21547
- //console.log('cursor', cursor);
21548
- //console.log('fetch', fetchFunction);
21549
- //console.log('searchstring', searchString);
21550
- //console.log('subfiltervalue', subfilter);
21551
-
21552
- const arrCompliancesFrequencies: any = {};
21553
-
21554
- if (jsonData.length === 0) return;
21732
+ renderTaggingTableNew = (divElement: any, selectedStatutes: any, sourceObject: any, sourceMapping: any, taggingObject: any, sourceCols: any, uploadFunction: any, refreshFunction: any, colName: any, uniqCols: Array<any>, apiIdDropdown: string, dropdownSearchPhrase: any, mandatoryFields: any, compareFields: Array<any>, anotherProjection: any, extraFields: Array<string>, _arrFeedbackReference: any, proposedUsersLabel: string, subfilter: string) => {
21733
+ console.log('sourceObj', sourceObject)
21734
+ console.log('taggingObj', taggingObject)
21735
+ let sourceArray: any = { data: { mappings: { mappings: sourceObject.data.mappings } } };
21736
+ let taggingArray: any = { data: { mappings: { mappings: taggingObject.data.mappings } } };
21737
+ if (taggingObject.data.mappings.mappings != null) {
21738
+ taggingArray = taggingObject;
21739
+ }
21740
+ console.log('divelement', divElement);
21741
+ console.log('sourcearray', sourceArray);
21742
+ console.log('sourceMapping', sourceMapping);
21743
+ console.log('taggingarray', JSON.stringify(taggingArray));
21744
+ console.log('selectedStatutes', selectedStatutes);
21555
21745
 
21556
21746
  this.selectedCbs = [];
21557
21747
 
21558
- let colCountry = -1;
21559
- let colState = -1;
21560
- let colSubcategory = -1;
21561
- let colStatute = -1;
21748
+ // const foundArr = [];
21562
21749
 
21563
- const unfilteredDict: any[] = [];
21750
+ // if (taggingArray.data.mappings != null && taggingArray.data.mappings.mappings.length > 0) {
21751
+ // console.log('scanning taggingarray', taggingArray.data.mappings.mappings.length + "");
21752
+ // for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
21564
21753
 
21565
- var html = '';
21754
+ // var found = false;
21566
21755
 
21567
- html += '<div>';
21568
- html += '<h3 part="results-title">Total Items (' + found + ')</h3>';
21569
- html += '<h4 id="span-filtered" part="results-title"></h4>'
21570
- html += '<h4 id="span-extra-filled" part="results-title"></h4>'
21571
- html += '</div>';
21756
+ // // console.log('source array search', sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id], taggingArray.data.mappings.mappings[i].id)
21757
+ // if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null) {
21572
21758
 
21759
+ // var equal = true;
21573
21760
 
21574
- html += '<div class="d-flex justify-between align-center left-sticky flex-wrap mb-20">';
21761
+ // for (var k = 0; k < uniqCols.length; k++) {
21762
+ // console.log('checking uniqCols', uniqCols[k]);
21763
+ // if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null && taggingArray.data.mappings.mappings[i] != null) {
21764
+ // if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
21765
+ // equal = false;
21766
+ // }
21767
+ // }
21575
21768
 
21576
- html += '<div id="div-subfiltered"></div>';
21577
- html += '<div id="scroll-overlay" part="onboarding-scroll-overlay" class="pos-fixed-scroll justify-center align-center">';
21578
- html += '<div id="scroll-overlay-left" class="mr-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_left_alt</span></button></div>';
21579
- html += '<div id="scroll-overlay-right" class="ml-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_right_alt</span></button></div>';
21580
- html += '</div>';
21769
+ // }
21581
21770
 
21582
- html += '<div id="detail-overlay" part="onboarding-detail-overlay" class="pos-fixed justify-center align-center hide">';
21583
- html += '<div class="cover-slide"></div>';
21584
- html += '<div class="detail-container p-10">';
21585
- html += '<div class="d-flex justify-between align-center mb-20">';
21586
- html += '<div part="results-title">Row Details</div>';
21587
- html += '<button part="button-icon" class="detail-close"><span class="material-symbols-outlined">close</span></button>';
21588
- html += '</div>';
21589
- html += '<div id="detail-overlay-list">';
21590
- html += '</div>';
21591
- html += '</div>';
21592
- html += '</div>';
21771
+ // if (equal) {
21772
+ // found = true;
21773
+ // }
21774
+ // }
21593
21775
 
21594
- html += '<div class="d-flex align-center">';
21595
- html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
21596
- html += '<div class="mr-10">';
21597
- html += '<div class="d-flex justify-end"><button part="calendar-tab-icon-not-selected" class="material-icons button-toggle-more">expand_more</button><button part="calendar-tab-icon-selected" class="material-icons button-toggle-more-back hide">expand_less</button></div>'
21598
- html += '<div style="position: absolute; margin-top: 5px;"><button part="button" class="hide d-flex align-center button-download-backups" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">file_save</span><span>Download Backups</span></button><button part="button" class="mt-10 hide d-flex align-center button-export-mapping" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">export_notes</span><span>Export Mapping</span></button></div>'
21599
- html += '</div>';
21600
- html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
21601
- html += '</div>';
21776
+ // if (found) {
21777
+ // foundArr.push(taggingArray.data.mappings.mappings[i]);
21778
+ // } else {
21779
+ // console.log('taggingarray not found', taggingArray.data.mappings.mappings[i], i)
21780
+ // }
21602
21781
 
21603
- html += '</div>';
21782
+ // }
21783
+ // } else {
21784
+ // console.log('taggingArray1', taggingArray.data.mappings, taggingArray.data.mappings.mappings)
21785
+ // }
21786
+ // console.log('taggingarray2', taggingArray.data.mappings.mappings.length + "");
21787
+ // if (taggingArray.data.mappings == null) {
21788
+ // taggingArray.data.mappings = {};
21789
+ // }
21604
21790
 
21605
- html += '<table id="table-data">';
21791
+ // taggingArray.data.mappings.mappings = foundArr;
21606
21792
 
21607
- html += '<thead>';
21608
- html += '<th part="td-head" class="td-head">'
21609
- // html += 'Select';
21610
- html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
21611
- html += '</th>'
21612
- html += '<th part="td-head" class="td-head">'
21613
- html += '<div>View</div>';
21614
- html += '</th>'
21615
- if (extraFieldPosition === 0) {
21616
- for (var i = 0; i < extraFields.length; i++) {
21617
- html += '<th part="td-head" class="td-head">'
21618
- html += extraFields[i];
21619
- html += '</th>'
21793
+ for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
21794
+
21795
+ if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] == null) {
21796
+ taggingArray.data.mappings.mappings.splice(i, 1)
21620
21797
  }
21621
21798
  }
21622
- if (colName.toLowerCase() == "compliances") {
21623
- html += '<th part="td-head" class="td-head">'
21624
- html += 'Proposed Users';
21625
- html += '</th>'
21626
- }
21627
- html += '<th part="td-head" class="td-head">'
21628
- html += 'Id';
21629
- html += '</th>'
21799
+ let mandatoryPresent = true;
21800
+ console.log('mandatoryFields', mandatoryFields);
21801
+ for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
21630
21802
 
21631
- // for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
21803
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21632
21804
 
21633
- // if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
21634
- // html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
21635
- // html += JSON.parse(jsonData[0].data.cols)[j]
21636
- // html += '</th>'
21637
- // }
21638
21805
 
21639
- // }
21806
+ if (taggingArray.data.mappings.mappings[j][mandatoryFields[i]] == null) {
21807
+ console.log('mandatory not found', mandatoryFields[i])
21808
+ mandatoryPresent = false;
21809
+ }
21640
21810
 
21641
- for (var j = 0; j < jsonData[0].cols.length; j++) {
21642
- console.log('jsoncols', JSON.parse(jsonData[0].data.cols), jsonData[0].cols.length, j)
21643
- html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == (JSON.parse(jsonData[0].data.cols)[j] ?? "").toLowerCase() ? 'left-sticky' : '') + '">'
21644
- // html += jsonData[0].cols[j]
21645
- html += '</th>'
21811
+ }
21646
21812
 
21647
21813
  }
21648
21814
 
21649
- if (extraFieldPosition === 1) {
21650
- for (var i = 0; i < extraFields.length; i++) {
21651
- html += '<th part="td-head" class="td-head">'
21652
- html += extraFields[i];
21653
- html += '</th>'
21815
+ var taggedIds = []
21816
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21817
+ if (taggingArray.data.mappings.mappings[j] != null) {
21818
+ if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
21819
+ if (taggedIds.indexOf(taggingArray.data.mappings.mappings[j].id) < 0) {
21820
+ taggedIds.push(taggingArray.data.mappings.mappings[j].id)
21821
+ }
21822
+ }
21654
21823
  }
21655
21824
  }
21656
- html += '</thead>'
21657
21825
 
21658
- //console.log('colstate', JSON.parse(jsonData[0].data.cols));
21826
+ // if (taggedIds.length < Object.keys(sourceArray.data.mappings.mappings).length) {
21827
+ // for (let sourceid of Object.keys(sourceArray.data.mappings.mappings)) {
21828
+ // if (taggedIds.indexOf(sourceid) >= 0) {
21829
+ // continue;
21830
+ // }
21831
+ // let objToPush: any = { id: sourceid }
21832
+ // for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
21833
+ // objToPush[mandatoryFields[i]] = ""
21834
+ // }
21835
+ // taggingArray.data.mappings.mappings.push(objToPush);
21836
+ // }
21837
+ // }
21659
21838
 
21660
- for (var i = 0; i < JSON.parse(jsonData[0].data.cols).length; i++) {
21661
- if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "country") {
21839
+ for (var i = 0; i < (sourceMapping.data?.mappings ?? []).length; i++) {
21840
+ let flagMatch = false;
21841
+ if (sourceArray.data.mappings.mappings[sourceMapping.data.mappings[i].id] == null) {
21842
+ continue;
21843
+ }
21844
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21845
+ if (taggingArray.data.mappings.mappings[j] != null) {
21846
+ if (sourceMapping.data.mappings[i].id == taggingArray.data.mappings.mappings[j].id) {
21847
+ let flagMatchObj = true;
21848
+ for (let objKey of compareFields) {
21849
+ if (sourceMapping.data.mappings[i][objKey] !== taggingArray.data.mappings.mappings[j][objKey] && taggingArray.data.mappings.mappings[j][objKey] != null) {
21850
+ console.log('Flag Mismatch', objKey, sourceMapping.data.mappings[i][objKey], taggingArray.data.mappings.mappings[j][objKey])
21851
+ flagMatchObj = false;
21852
+ break;
21853
+ }
21854
+ }
21855
+ if (flagMatchObj == true) {
21856
+ flagMatch = true;
21857
+ continue;
21858
+ }
21859
+ }
21860
+ }
21861
+ }
21862
+ if (!flagMatch) {
21863
+ let objToPush: any = sourceMapping.data.mappings[i]
21864
+ for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
21865
+ objToPush[mandatoryFields[i]] = ""
21866
+ }
21867
+ taggingArray.data.mappings.mappings.push(objToPush);
21868
+ }
21869
+ }
21870
+
21871
+
21872
+ var tagged = 0;
21873
+ var changed = 0;
21874
+ var total = 0;
21875
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21876
+ if (taggingArray.data.mappings.mappings[j] != null) {
21877
+ if (sourceMapping.data == null) {
21878
+ if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
21879
+ total++;
21880
+ let tagStr = ""
21881
+ for (let col of compareFields) {
21882
+ tagStr += `${taggingArray.data.mappings.mappings[j][col]};`
21883
+ }
21884
+ tagStr.slice(0, -1)
21885
+ if (this.changedOnboardingItemIds.length > 0) {
21886
+ let changedId = tagStr
21887
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
21888
+ changed++;
21889
+ }
21890
+ }
21891
+ if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
21892
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
21893
+ let flagNull = false;
21894
+ for (let mandatoryfield of mandatoryFields) {
21895
+ if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
21896
+ flagNull = true;
21897
+ break;
21898
+ }
21899
+ }
21900
+ if (flagNull) {
21901
+ continue
21902
+ }
21903
+ } else {
21904
+ continue;
21905
+ }
21906
+ }
21907
+ tagged++;
21908
+ }
21909
+ } else {
21910
+ let flagFound = false;
21911
+ for (let sourceObj of sourceMapping.data.mappings) {
21912
+ if (sourceObj.id == taggingArray.data.mappings.mappings[j].id) {
21913
+ let flagEqual = true;
21914
+ for (let col of compareFields) {
21915
+ if (sourceObj[col] != taggingArray.data.mappings.mappings[j][col] && taggingArray.data.mappings.mappings[j][col] != null) {
21916
+ flagEqual = false;
21917
+ break;
21918
+ }
21919
+ }
21920
+ if (flagEqual) {
21921
+ flagFound = true;
21922
+ break;
21923
+ }
21924
+ }
21925
+ }
21926
+ if (flagFound) {
21927
+ let tagStr = ""
21928
+ for (let col of compareFields) {
21929
+ tagStr += `${taggingArray.data.mappings.mappings[j][col]};`
21930
+ }
21931
+ tagStr.slice(0, -1)
21932
+ total++;
21933
+ if (this.changedOnboardingItemIds.length > 0) {
21934
+ let changedId = tagStr
21935
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
21936
+ changed++;
21937
+ }
21938
+ }
21939
+ if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
21940
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
21941
+ let flagNull = false;
21942
+ for (let mandatoryfield of mandatoryFields) {
21943
+ if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
21944
+ flagNull = true;
21945
+ break;
21946
+ }
21947
+ }
21948
+ if (flagNull) {
21949
+ continue
21950
+ }
21951
+ } else {
21952
+ continue;
21953
+ }
21954
+ }
21955
+ tagged++;
21956
+ } else {
21957
+ console.log('tagged not found', taggingArray.data.mappings.mappings[j])
21958
+ }
21959
+ }
21960
+ }
21961
+ }
21962
+ console.log('taggingarray3', JSON.stringify(taggingArray.data.mappings.mappings));
21963
+ console.log('tagged', tagged, 'total', total);
21964
+ const unfilteredDict: any[] = [];
21965
+ if (divElement == null) {
21966
+ return;
21967
+ }
21968
+ var html = '';
21969
+
21970
+ var showTable = true;
21971
+
21972
+ html += '<div class="d-flex justify-between flex-wrap align-center"> ';
21973
+
21974
+ var status = '';
21975
+ if (tagged < total) {
21976
+ status = '<span class="color-pending material-icons">pending</span>';
21977
+ } else {
21978
+ status = '<span class="color-done material-icons">check_circle</span>';
21979
+ }
21980
+
21981
+ var mandatoryStatus = '';
21982
+ if (!mandatoryPresent) {
21983
+ mandatoryStatus = '<span class="color-late-executed material-icons">error</span>&nbsp;&nbsp;Mandatory fields are not present';
21984
+ } else {
21985
+ mandatoryStatus = '<span class="color-done material-icons">check_circle</span>&nbsp;&nbsp;Mandatory fields are present';
21986
+ }
21987
+
21988
+ if (showTable) {
21989
+
21990
+ 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;Mapped ' + tagged + ' out of ' + total + '</h4></div>');
21991
+
21992
+ } else {
21993
+
21994
+ 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;Mapped ' + tagged + ' out of ' + total + '</h4></div>')
21995
+
21996
+ }
21997
+ if (changed > 0) {
21998
+ 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>')
21999
+ }
22000
+ html += ('<div class="left-sticky d-flex justify-between align-center mr-10"><h4 part="results-title" class="d-flex align-center m-0">' + mandatoryStatus + '</h4></div>')
22001
+
22002
+ html += ('<div class="left-sticky d-flex justify-between align-center mr-10"><h4 id="span-extra-filled" class="m-0" part="results-title"></h4></div>')
22003
+
22004
+ html += '<div class="d-flex align-center">';
22005
+ html += '<div class="mr-10">';
22006
+ html += '<div class="d-flex justify-end"><button part="calendar-tab-icon-not-selected" class="material-icons button-toggle-more">expand_more</button><button part="calendar-tab-icon-selected" class="material-icons button-toggle-more-back hide">expand_less</button></div>'
22007
+
22008
+ html += '<div style="position: absolute; margin-top: 5px;">'
22009
+ html += '<button part="button" class="hide d-flex align-center button-download-backups" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">file_save</span><span>Download Backups</span></button><button part="button" class="mt-10 hide d-flex align-center button-export-mapping" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">export_notes</span><span>Export Mapping</span></button><button part="button" class="mt-10 hide d-flex align-center button-export-mapping-csv" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">data_table</span><span>Export CSV</span></button>'
22010
+
22011
+ // console.log('jobs', jobs);
22012
+ html += ('<input id="fileInput" type="file" style="display:none;" /><button part="button" class="mt-10 hide button-local-load d-flex align-center mr-10" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">upload_file</span><span>Load From Local</span></button><button part="button" class="mt-10 hide button-local-save d-flex align-center mr-10" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">save</span><span>Save Locally</span></button>');
22013
+ html += '</div>';
22014
+ html += '</div>';
22015
+ html += '<button part="button" class="button-apply d-flex align-center mr-10"><span class="material-symbols-outlined mr-10">touch_app</span><span>Apply</span></button>'
22016
+ html += '<button part="button" class="button-save d-flex align-center"><span class="material-symbols-outlined mr-10">save</span><span>Save On Cloud</span></button>'
22017
+ html += '</div>';
22018
+
22019
+ html += '</div>';
22020
+
22021
+ html += '<div>';
22022
+ html += '<h4 id="span-filtered" part="results-title"></h4>'
22023
+ html += '<div id="div-subfiltered"></div>'
22024
+ html += '</div>';
22025
+
22026
+ html += '<br />';
22027
+
22028
+ var subfiltered = 0;
22029
+
22030
+ if (showTable) {
22031
+
22032
+ html += '<table id="table-data" class="mt-20" style="height: 200px">';
22033
+
22034
+ html += '<thead>';
22035
+ html += '<th part="td-head" class="td-head">'
22036
+ html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
22037
+ html += '</th>'
22038
+ for (var i = 0; i < extraFields.length; i++) {
22039
+ html += '<th part="td-head" class="td-head">'
22040
+ html += extraFields[i];
22041
+ html += '</th>'
22042
+ }
22043
+ html += '<th part="td-head" class="td-head">'
22044
+ html += colName;
22045
+ html += '</th>'
22046
+
22047
+ for (i = 0; i < uniqCols.length; i++) {
22048
+ html += '<th part="td-head" class="td-head">'
22049
+ html += uniqCols[i];
22050
+ html += '</th>'
22051
+ }
22052
+ for (i = 0; i < sourceCols.length; i++) {
22053
+ html += '<th part="td-head" class="td-head">'
22054
+ html += sourceCols[i];
22055
+ html += '</th>'
22056
+ }
22057
+
22058
+ html += '</thead>';
22059
+ html += '<tbody>';
22060
+ // console.log('changedIds', this.changedOnboardingItemIds);
22061
+ for (i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
22062
+
22063
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22064
+ console.log('compliance id', complianceid);
22065
+ var showSearch = false;
22066
+
22067
+ if (subfilter == "") {
22068
+ //console.log('showsearch true 1');
22069
+ showSearch = true;
22070
+ }
22071
+
22072
+ var classBg = "";
22073
+
22074
+ if (i % 2 === 0) {
22075
+ if (this.changedOnboardingItemIds.length > 0) {
22076
+ let changedId = ""
22077
+ for (let [k, col] of uniqCols.entries()) {
22078
+ // console.log('taggingarray rendered', i, col)
22079
+ changedId += taggingArray.data.mappings.mappings[i][col];
22080
+ if (k < (uniqCols.length - 1)) {
22081
+ changedId += ";"
22082
+ }
22083
+ }
22084
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
22085
+ classBg = 'td-light-selected';
22086
+ } else {
22087
+ classBg = 'td-light';
22088
+ }
22089
+ } else {
22090
+ classBg = 'td-light';
22091
+ }
22092
+ } else {
22093
+ if (this.changedOnboardingItemIds.length > 0) {
22094
+ let changedId = ""
22095
+ for (let [k, col] of uniqCols.entries()) {
22096
+ if (taggingArray.data.mappings.mappings[i] == null) {
22097
+ // console.log('id not found', i, taggingArray.data.mappings.mappings.length, sourceArray.data.mappings.mappings.length)
22098
+ }
22099
+ changedId += taggingArray.data.mappings.mappings[i][col];
22100
+ if (k < (uniqCols.length - 1)) {
22101
+ changedId += ";"
22102
+ }
22103
+ }
22104
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
22105
+ classBg = 'td-dark-selected';
22106
+ } else {
22107
+ classBg = 'td-dark';
22108
+ }
22109
+ } else {
22110
+ classBg = 'td-dark';
22111
+ }
22112
+ }
22113
+
22114
+ html += '<tr class="" id="tablerow-' + i + '">';
22115
+
22116
+ 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>';
22117
+
22118
+ for (var j = 0; j < extraFields.length; j++) {
22119
+
22120
+ if (i < taggingArray.data.mappings.mappings.length) {
22121
+
22122
+ html += '<td part="td-body" class="' + classBg + '">';
22123
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">'
22124
+ html += '<textarea part="input" id="extra-field-' + i + '-' + j + '" class="extra-field extra-field-' + j + '" ' + (extraFields != null ? (extraFields[j] != null ? ((extraFields[j].toLowerCase() == "client remarks" && this.disableclientresponse.toLowerCase() == "yes") ? 'disabled' : ((extraFields[j].toLowerCase() == "flagggrc response" && this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '')) : "") : "") + ' >' + (taggingArray.data.mappings.mappings[i].extraFields != null ? (taggingArray.data.mappings.mappings[i].extraFields[j] != null ? (typeof taggingArray.data.mappings.mappings[i].extraFields[j] == 'string' ? taggingArray.data.mappings.mappings[i].extraFields[j] : "") : "") : "") + '</textarea>';
22125
+ html += '</div>';
22126
+ html += '</td>';
22127
+ } else {
22128
+
22129
+ html += '<td part="td-body" class="' + classBg + '">';
22130
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22131
+ html += '<textarea part="input" id="extra-field-' + i + '-' + j + '" class="extra-field extra-field-' + j + '" type="text" value="" ' + ((extraFields[j].toLowerCase() == "flagggrc response" && this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + ' ></textarea>';
22132
+ html += '</div>';
22133
+ html += '</td>';
22134
+ }
22135
+
22136
+
22137
+ }
22138
+
22139
+ html += '<td class="td-body ' + classBg + '" part="td-key">'
22140
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22141
+ if (apiIdDropdown.length > 0) {
22142
+ if (anotherProjection != null) {
22143
+ html += '<sf-i-form id="tags-' + i + '" class="tags-input tags-' + i + '" name="Tags" label="Select ' + colName + '" apiId="' + apiIdDropdown + '" mode="multiselect-dropdown" searchPhrase="' + this.projectName + ((dropdownSearchPhrase != null && dropdownSearchPhrase != "") ? dropdownSearchPhrase : "") + '" selectProjection="name" selectAnotherProjection="' + anotherProjection + '" mandatory></sf-i-form>';
22144
+ } else {
22145
+ html += '<sf-i-form id="tags-' + i + '" class="tags-input tags-' + i + '" name="Tags" label="Select ' + colName + '" apiId="' + apiIdDropdown + '" mode="multiselect-dropdown" searchPhrase="' + this.projectName + ((dropdownSearchPhrase != null && dropdownSearchPhrase != "") ? dropdownSearchPhrase : "") + '" selectProjection="name" mandatory></sf-i-form>';
22146
+ }
22147
+
22148
+ } else {
22149
+
22150
+ if (colName.toLowerCase() == "internalcontrols") {
22151
+ html += '<textarea id="tags-' + i + '" type="text" part="input" class="tags-input"></textarea>';
22152
+ } else {
22153
+ html += '<input id="tags-' + i + '" type="text" part="input" class="tags-input"/>';
22154
+ }
22155
+
22156
+ }
22157
+ html += '</div>';
22158
+ html += '</td>'
22159
+
22160
+ for (var l = 0; l < uniqCols.length; l++) {
22161
+ html += '<td class="td-body ' + classBg + '" part="td-key">'
22162
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22163
+ html += '<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + taggingArray.data.mappings.mappings[i][uniqCols[l]].replace(/ *\([^)]*\) */g, "") + '" minLength="20"></sf-i-elastic-text>';
22164
+ html += '</div>';
22165
+ html += '</td>'
22166
+ }
22167
+
22168
+
22169
+ for (l = 0; l < sourceCols.length; l++) {
22170
+
22171
+ for (var j = 0; j < JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols).length; j++) {
22172
+
22173
+ if (sourceCols[l] == JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols)[j]) {
22174
+
22175
+ if (sourceArray.data.mappings.mappings[complianceid].data != null) {
22176
+
22177
+ html += '<td class="td-body ' + classBg + '" part="td-body">';
22178
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22179
+
22180
+ if (Array.isArray(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
22181
+
22182
+ for (var k = 0; k < JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j].length; k++) {
22183
+ html += ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j][k] + '" minLength="100" lineSize="4"></sf-i-elastic-text>');
22184
+ }
22185
+
22186
+ } else {
22187
+ if (typeof JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j] == "string" && Util.isJSONParsable(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
22188
+ html += ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j]) + '" minLength="100" lineSize="4"></sf-i-elastic-text>')
22189
+
22190
+ } else {
22191
+ html += ('<sf-i-elastic-text exportparts="highlight,highlight-count" text="' + JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j] + '" minLength="100" lineSize="4"></sf-i-elastic-text>')
22192
+ }
22193
+ }
22194
+
22195
+ html += '</div>';
22196
+ html += '</td>';
22197
+
22198
+ }
22199
+
22200
+ }
22201
+
22202
+ }
22203
+
22204
+ }
22205
+
22206
+ html += '</tr>';
22207
+ //console.log('i=', i);
22208
+
22209
+ }
22210
+ html += '</tbody>';
22211
+ html += '</table>';
22212
+
22213
+ }
22214
+ if (divElement == null) {
22215
+ return;
22216
+ }
22217
+ divElement.innerHTML = html;
22218
+
22219
+ if (unfilteredDict.length > 0) {
22220
+ var html = '';
22221
+ html += '<div class="mb-10">Items In Your Category (' + unfilteredDict.length + ")</div>";
22222
+ html += this.getFilterOnboardingString();
22223
+ ((divElement as HTMLDivElement).querySelector('#span-filtered') as HTMLDivElement).innerHTML = html;
22224
+
22225
+ } else {
22226
+ ((divElement as HTMLDivElement).querySelector('#span-filtered') as HTMLDivElement).style.display = 'none';
22227
+ }
22228
+
22229
+ if (subfiltered > 0) {
22230
+ ((divElement as HTMLDivElement).querySelector('#div-subfiltered') as HTMLDivElement).innerHTML = '<h4 part="results-title">Filtered Results (' + subfiltered + ')</h4>';
22231
+ }
22232
+
22233
+ if (this.getfilterOnboarding().length > 0) {
22234
+ for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
22235
+
22236
+ if (!unfilteredDict.includes(i)) {
22237
+ const tableRow = (divElement as HTMLDivElement).querySelector('#tablerow-' + i);
22238
+ if (tableRow != null) {
22239
+ (tableRow as HTMLTableRowElement).style.display = 'none';
22240
+ }
22241
+
22242
+ }
22243
+
22244
+ }
22245
+ }
22246
+
22247
+ (divElement as HTMLDivElement).querySelector('.checkbox-all')?.addEventListener('change', (e: any) => {
22248
+
22249
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22250
+
22251
+ const arrCheckBoxes = (divElement as HTMLDivElement).querySelectorAll('.checkbox-row') as NodeListOf<HTMLInputElement>;
22252
+ //console.log('cb-length', arrCheckBoxes.length);
22253
+ for (var i = 0; i < arrCheckBoxes.length; i++) {
22254
+ const tableRow = (divElement as HTMLDivElement).querySelector('#tablerow-' + (i)) as HTMLElement;
22255
+ //console.log('tablerow', i, tableRow);
22256
+ if (tableRow != null) {
22257
+ if (tableRow.style.display != 'none') {
22258
+ //console.log('tablerow setting', e.currentTarget.checked, (arrCheckBoxes[i] as HTMLInputElement));
22259
+ (arrCheckBoxes[i] as HTMLInputElement).checked = e.currentTarget.checked;
22260
+ if (e.currentTarget.checked) {
22261
+ if (!this.selectedCbs.includes(i + '')) {
22262
+ this.selectedCbs.push(i + '');
22263
+ }
22264
+ } else {
22265
+ this.selectedCbs = [];
22266
+ }
22267
+ }
22268
+ }
22269
+ }
22270
+
22271
+ //console.log('checkedarr', this.selectedCbs);
22272
+
22273
+ });
22274
+
22275
+ for (var j = 0; j < extraFields.length; j++) {
22276
+
22277
+ const inputArrJ = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIForm | HTMLInputElement>;
22278
+ for (var k = 0; k < inputArrJ.length; k++) {
22279
+ inputArrJ[k].addEventListener('keyup', (e: any) => {
22280
+
22281
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22282
+
22283
+ if (e.key == "Enter") {
22284
+
22285
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22286
+
22287
+ const activeIndex = e.target.id.split('-')[2];
22288
+
22289
+ for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
22290
+
22291
+ taggingArray.data.mappings.mappings[count].extraFields = [];
22292
+
22293
+ if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
22294
+
22295
+ for (var l = 0; l < extraFields.length; l++) {
22296
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + activeIndex + '-' + l) as HTMLInputElement);
22297
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22298
+ }
22299
+
22300
+ } else {
22301
+
22302
+ for (var l = 0; l < extraFields.length; l++) {
22303
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + count + '-' + l) as HTMLInputElement);
22304
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22305
+ }
22306
+
22307
+ }
22308
+
22309
+ }
22310
+
22311
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22312
+
22313
+ }
22314
+
22315
+ // this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, true);
22316
+
22317
+ });
22318
+
22319
+ inputArrJ[k].addEventListener('focusout', (e: any) => {
22320
+
22321
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22322
+
22323
+ const activeIndex = e.target.id.split('-')[2];
22324
+
22325
+ for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
22326
+
22327
+ taggingArray.data.mappings.mappings[count].extraFields = [];
22328
+
22329
+ if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
22330
+
22331
+ for (var l = 0; l < extraFields.length; l++) {
22332
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + activeIndex + '-' + l) as HTMLInputElement);
22333
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22334
+ }
22335
+
22336
+ } else {
22337
+
22338
+ for (var l = 0; l < extraFields.length; l++) {
22339
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + count + '-' + l) as HTMLInputElement);
22340
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22341
+ }
22342
+
22343
+ }
22344
+
22345
+ }
22346
+
22347
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22348
+
22349
+ });
22350
+ }
22351
+
22352
+ }
22353
+
22354
+ const multiArr = (divElement as HTMLDivElement).querySelectorAll('.tags-input') as NodeListOf<SfIForm | HTMLInputElement>;
22355
+
22356
+ for (var i = 0; i < multiArr.length; i++) {
22357
+
22358
+ if (apiIdDropdown.length > 0) {
22359
+
22360
+
22361
+ // for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22362
+
22363
+ var equal = true;
22364
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22365
+ for (var k = 0; k < uniqCols.length; k++) {
22366
+ if (uniqCols[k] != "id") { continue; }
22367
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
22368
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
22369
+ equal = false;
22370
+ }
22371
+ }
22372
+
22373
+ }
22374
+
22375
+ if (equal) {
22376
+ let preselctedVals = []
22377
+ if ((colName == "countries" || colName == "entities" || colName == "locations") && taggingArray.data.mappings.mappings[i][colName] == null) {
22378
+ let preselctedValsStr = ""
22379
+ for (let mandatoryfield of mandatoryFields) {
22380
+ if (taggingArray.data.mappings.mappings[i][mandatoryfield] == null || taggingArray.data.mappings.mappings[i][mandatoryfield] == "") {
22381
+ preselctedValsStr = ""
22382
+ } else {
22383
+ preselctedValsStr += `${taggingArray.data.mappings.mappings[i][mandatoryfield]};`
22384
+ }
22385
+ }
22386
+
22387
+ preselctedValsStr = preselctedValsStr.slice(0, -1);
22388
+ if (preselctedValsStr.indexOf(';') >= 0) {
22389
+ preselctedVals.push(preselctedValsStr)
22390
+ }
22391
+ } else {
22392
+ preselctedVals = taggingArray.data.mappings.mappings[i][colName];
22393
+ }
22394
+ (multiArr[i] as SfIForm).preselectedValues = JSON.stringify(preselctedVals);
22395
+ if (preselctedVals.length > 0) {
22396
+ ((multiArr[i] as SfIForm).parentElement as HTMLTableCellElement).setAttribute("part", "row-mapped");
22397
+ }
22398
+
22399
+ }
22400
+
22401
+ // }
22402
+
22403
+ multiArr[i].addEventListener('valueChanged', async (e: any) => {
22404
+
22405
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22406
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22407
+ });
22408
+
22409
+ } else {
22410
+
22411
+ // for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22412
+
22413
+ var equal = true;
22414
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22415
+ for (var k = 0; k < uniqCols.length; k++) {
22416
+ if (uniqCols[k] != "id") { continue; }
22417
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
22418
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
22419
+ equal = false;
22420
+ }
22421
+ }
22422
+
22423
+ }
22424
+
22425
+ if (equal) {
22426
+
22427
+ if (taggingArray.data.mappings.mappings[i] != null) {
22428
+ if (Util.isJSONParsable(sourceArray.data.mappings.mappings[complianceid][colName])) {
22429
+ (multiArr[i] as HTMLInputElement).value = JSON.parse(sourceArray.data.mappings.mappings[complianceid][colName])[0];
22430
+ } else {
22431
+ (multiArr[i] as HTMLInputElement).value = sourceArray.data.mappings.mappings[complianceid][colName] ?? "";
22432
+ }
22433
+ }
22434
+
22435
+ }
22436
+
22437
+ // }
22438
+
22439
+
22440
+
22441
+ multiArr[i].addEventListener('keyup', async (e: any) => {
22442
+
22443
+ if (e.key == "Enter") {
22444
+
22445
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22446
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22447
+ }
22448
+
22449
+ });
22450
+
22451
+ multiArr[i].addEventListener('focusout', async (e: any) => {
22452
+
22453
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22454
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22455
+ });
22456
+
22457
+
22458
+ }
22459
+
22460
+
22461
+ }
22462
+
22463
+ const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22464
+ buttonApply.addEventListener('click', () => {
22465
+ // console.log('applied');
22466
+ // this.applyAndReloadTagging(e,colName, taggingArray, sourceArray, divElement);
22467
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22468
+ })
22469
+
22470
+ const buttonToggleMoreBack = (divElement as HTMLDivElement).querySelector('.button-toggle-more-back') as HTMLButtonElement;
22471
+ const buttonToggleMore = (divElement as HTMLDivElement).querySelector('.button-toggle-more') as HTMLButtonElement;
22472
+
22473
+ buttonToggleMore.addEventListener('click', async (ev: any) => {
22474
+
22475
+ ev.target.classList.add('hide');
22476
+ buttonToggleMoreBack.classList.remove('hide');
22477
+ const buttonDownloadBackups = (divElement as HTMLDivElement).querySelector('.button-download-backups') as HTMLButtonElement;
22478
+ buttonDownloadBackups.style.display = 'flex';
22479
+ const buttonExportMapping = (divElement as HTMLDivElement).querySelector('.button-export-mapping') as HTMLButtonElement;
22480
+ buttonExportMapping.style.display = 'flex';
22481
+ const buttonExportMappingCSV = (divElement as HTMLDivElement).querySelector('.button-export-mapping-csv') as HTMLButtonElement;
22482
+ buttonExportMappingCSV.style.display = 'flex';
22483
+ // const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22484
+ // buttonApply.style.display = 'flex';
22485
+ const buttonLoadLocal = (divElement as HTMLDivElement).querySelector('.button-local-load') as HTMLButtonElement;
22486
+ buttonLoadLocal.style.display = 'flex';
22487
+ const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
22488
+ buttonSaveLocal.style.display = 'flex';
22489
+ // const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22490
+ // buttonSave.style.display = 'flex';
22491
+
22492
+ const buttonDownloadBackupsNew = Util.clearListeners(buttonDownloadBackups);
22493
+ buttonDownloadBackupsNew.addEventListener('click', async () => {
22494
+
22495
+ const result = await this.fetchGetStoredMapping(colName);
22496
+
22497
+ for (var i = 0; i < result.data.length; i++) {
22498
+
22499
+ const blob = new Blob([result.data[i].mappings != null ? JSON.stringify(result.data[i].mappings) : JSON.stringify(result.data[i])], { type: 'text/html' });
22500
+ const url = window.URL.createObjectURL(blob)
22501
+ const a = document.createElement('a')
22502
+ a.setAttribute('href', url)
22503
+ a.setAttribute('download', 'report_' + colName + '_' + i + '.json');
22504
+ a.click()
22505
+
22506
+ }
22507
+
22508
+ (buttonToggleMoreBack as HTMLButtonElement).click();
22509
+
22510
+ if (result.data.length === 0) {
22511
+
22512
+ this.setError("No backups found!")
22513
+ setTimeout(() => {
22514
+ this.clearMessages();
22515
+ }, 3000);
22516
+
22517
+ }
22518
+
22519
+ });
22520
+
22521
+ const buttonExportMappingNew = Util.clearListeners(buttonExportMapping);
22522
+ buttonExportMappingNew.addEventListener('click', async () => {
22523
+
22524
+ let valueStr: string[] = [];
22525
+
22526
+ for (var i = 0; i < multiArr.length; i++) {
22527
+
22528
+ if (apiIdDropdown.length > 0) {
22529
+
22530
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22531
+
22532
+ var equal = true;
22533
+ let complianceid = taggingArray.data.mappings.mappings[j].id
22534
+ for (var k = 0; k < uniqCols.length; k++) {
22535
+ if (uniqCols[k] != "id") { continue; }
22536
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[j] != null) {
22537
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[j][uniqCols[k]]) {
22538
+ equal = false;
22539
+ }
22540
+ }
22541
+
22542
+ }
22543
+
22544
+ if (equal) {
22545
+ valueStr.push(JSON.stringify(taggingArray.data.mappings.mappings[j][colName]));
22546
+ }
22547
+ }
22548
+
22549
+ } else {
22550
+
22551
+ if (taggingArray.data.mappings.mappings[i] != null) {
22552
+ valueStr.push(taggingArray.data.mappings.mappings[i][colName]);
22553
+ } else {
22554
+ valueStr.push('');
22555
+ }
22556
+
22557
+ }
22558
+
22559
+ }
22560
+
22561
+ //console.log('valueStr', valueStr);
22562
+
22563
+ const valuesHTML = JSON.stringify(valueStr);
22564
+
22565
+ const outerHTML = '<h3>This extract is generated on ' + new Date() + '</h3>' + ((divElement as HTMLDivElement).querySelector('#span-filtered') as HTMLHeadingElement).outerHTML + '<br /><h2>' + ((divElement as HTMLDivElement).querySelector('#mapped-stats-title') as HTMLHeadingElement).outerHTML + '</h2>' + ((divElement as HTMLDivElement).querySelector('#table-data') as HTMLTableElement).outerHTML;
22566
+
22567
+ let tableHTML = this.TAGGING_HTML.replace(/TABLE_DATA/g, outerHTML);
22568
+ tableHTML = tableHTML.replace(/TABLE_VALUES/g, valuesHTML);
22569
+
22570
+ const blob = new Blob([tableHTML], { type: 'text/html' });
22571
+ const url = window.URL.createObjectURL(blob)
22572
+ const a = document.createElement('a')
22573
+ a.setAttribute('href', url)
22574
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.html');
22575
+ a.click()
22576
+
22577
+ });
22578
+
22579
+ const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
22580
+ buttonExportMappingCSVNew?.addEventListener('click', async () => {
22581
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings))
22582
+ for (let [i, obj] of csvArray.entries()) {
22583
+ let tempCsvObj = obj
22584
+ if (obj['cols'] != null && obj['data'] != null) {
22585
+ let dataArr = JSON.parse(obj['data'])
22586
+ let colsArr = JSON.parse(obj['cols'])
22587
+ for (let [j, colKey] of colsArr.entries()) {
22588
+ tempCsvObj['cols_' + colKey] = dataArr[j]
22589
+ }
22590
+ }
22591
+ csvArray[i] = tempCsvObj
22592
+ }
22593
+ console.log('csv array', csvArray)
22594
+ let csvData = Util.convertToCSV(csvArray);
22595
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
22596
+ console.log('csvData', csvData);
22597
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
22598
+ const url = window.URL.createObjectURL(blob)
22599
+ const a = document.createElement('a')
22600
+ a.setAttribute('href', url)
22601
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.csv');
22602
+ a.click()
22603
+ })
22604
+
22605
+ const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
22606
+ buttonLoadLocalNew?.addEventListener('click', async () => {
22607
+ console.log('load-local');
22608
+ ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
22609
+ });
22610
+
22611
+ const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
22612
+ fileInput.value = '';
22613
+ const fileInputNew = Util.clearListeners(fileInput);
22614
+ fileInputNew.addEventListener('change', (e: any) => {
22615
+ var fr = new FileReader();
22616
+ fr.onload = () => {
22617
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
22618
+ };
22619
+ var frCsv = new FileReader();
22620
+ frCsv.onload = () => {
22621
+ console.log('taggingarray onload called');
22622
+ console.log('csv result', frCsv.result);
22623
+ const tempArr = Util.parseCsv(frCsv.result + "");
22624
+ console.log('csv data', tempArr)
22625
+ let changeCount = 0;
22626
+ for (let [i, obj] of tempArr.entries()) {
22627
+ let tempObj = taggingArray.data.mappings.mappings[i]
22628
+ delete tempObj['delta'];
22629
+ delete tempObj['lastupdated'];
22630
+ let tempNewObj = obj
22631
+ delete tempNewObj['delta'];
22632
+ delete tempNewObj['lastupdated'];
22633
+ if (JSON.stringify(tempObj) !== JSON.stringify(tempNewObj)) {
22634
+ // console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
22635
+ let changedId = ""
22636
+ for (let [k, col] of uniqCols.entries()) {
22637
+ if (col != "id") { continue; }
22638
+ changedId += tempObj[col];
22639
+ if (k < (uniqCols.length - 1)) {
22640
+ changedId += ";"
22641
+ }
22642
+ }
22643
+
22644
+ this.changedOnboardingItemIds.push(changedId)
22645
+ changeCount++
22646
+ }
22647
+ }
22648
+ this.setSuccessBtn(changeCount + " items changed. Do you wish to apply?", ["No", "Yes"], [
22649
+ () => {
22650
+ this.clearMessages();
22651
+ this.changedOnboardingItemIds = [];
22652
+ (buttonToggleMoreBack as HTMLButtonElement).click();
22653
+ },
22654
+ () => {
22655
+ this.clearMessages();
22656
+ let tempObj: any = {}
22657
+ tempObj["data"] = {}
22658
+ tempObj["data"]["mappings"] = {}
22659
+ tempObj["data"]["mappings"]["mappings"] = tempArr
22660
+ let tempObjStr = JSON.stringify(tempObj)
22661
+
22662
+ console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]))
22663
+
22664
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
22665
+ }
22666
+ ])
22667
+ }
22668
+ if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
22669
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1]
22670
+ if (ext.toLowerCase() == "csv") {
22671
+ frCsv.readAsText(e.target.files[0]);
22672
+ } else {
22673
+ fr.readAsText(e.target.files[0]);
22674
+ }
22675
+ }
22676
+ })
22677
+
22678
+ const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
22679
+ buttonSaveLocalNew?.addEventListener('click', async () => {
22680
+ console.log('save-local');
22681
+ const blob = new Blob([JSON.stringify(taggingArray)], { type: 'text/plain' });
22682
+ const url = window.URL.createObjectURL(blob)
22683
+ const a = document.createElement('a')
22684
+ a.setAttribute('href', url)
22685
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().toLocaleString() + '.txt');
22686
+ a.click()
22687
+ });
22688
+
22689
+ });
22690
+
22691
+ buttonToggleMoreBack.addEventListener('click', async (ev: any) => {
22692
+
22693
+ ev.target.classList.add('hide');
22694
+ buttonToggleMore.classList.remove('hide');
22695
+ const buttonDownloadBackups = (divElement as HTMLDivElement).querySelector('.button-download-backups') as HTMLButtonElement;
22696
+ buttonDownloadBackups.style.display = 'none';
22697
+ const buttonExportMapping = (divElement as HTMLDivElement).querySelector('.button-export-mapping') as HTMLButtonElement;
22698
+ buttonExportMapping.style.display = 'none';
22699
+ const buttonExportMappingCSV = (divElement as HTMLDivElement).querySelector('.button-export-mapping-csv') as HTMLButtonElement;
22700
+ buttonExportMappingCSV.style.display = 'none';
22701
+ // const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22702
+ // buttonApply.style.display = 'none';
22703
+ const buttonLoadLocal = (divElement as HTMLDivElement).querySelector('.button-local-load') as HTMLButtonElement;
22704
+ buttonLoadLocal.style.display = 'none';
22705
+ const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
22706
+ buttonSaveLocal.style.display = 'none';
22707
+ // const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22708
+ // buttonSave.style.display = 'none';
22709
+
22710
+ });
22711
+
22712
+ const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22713
+ buttonSave?.addEventListener('click', async () => {
22714
+ await this.saveTagging(taggingArray.data.mappings, selectedStatutes, uploadFunction, refreshFunction, false, colName);
22715
+ });
22716
+
22717
+ const buttonCancel = (divElement as HTMLDivElement).querySelector('.button-cancel') as HTMLButtonElement;
22718
+ buttonCancel?.addEventListener('click', async () => {
22719
+ //console.log('cancel clicked');
22720
+ await this.fetchCancelOnboardingJob(colName);
22721
+ refreshFunction();
22722
+ });
22723
+
22724
+ const cbArr = (divElement as HTMLDivElement).querySelectorAll('.cb-select') as NodeListOf<HTMLInputElement>;
22725
+ for (i = 0; i < cbArr.length; i++) {
22726
+ cbArr[i].addEventListener('change', (ev: any) => {
22727
+ const cbSelectId = ev.currentTarget.id;
22728
+ const cbSelectIndex = cbSelectId.split('-')[1];
22729
+
22730
+ if (!this.selectedCbs.includes(cbSelectIndex)) {
22731
+ this.selectedCbs.push(cbSelectIndex);
22732
+ } else {
22733
+ this.selectedCbs.splice(this.selectedCbs.indexOf(cbSelectIndex), 1);
22734
+ }
22735
+ //console.log(this.selectedCbs);
22736
+ })
22737
+ }
22738
+
22739
+ this.changedOnboardingItemIds = []
22740
+ }
22741
+
22742
+ 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>, mappedStatutes: Array<any> = []) => {
22743
+ console.log('cols1', jsonData);
22744
+ // console.log('cols', jsonData[0].data.cols);
22745
+ //console.log('divelement', divElement);
22746
+ //console.log('jsonData', jsonData);
22747
+ //console.log('cursor', cursor);
22748
+ //console.log('fetch', fetchFunction);
22749
+ //console.log('searchstring', searchString);
22750
+ //console.log('subfiltervalue', subfilter);
22751
+
22752
+ const arrCompliancesFrequencies: any = {};
22753
+
22754
+ if (jsonData.length === 0) return;
22755
+
22756
+ this.selectedCbs = [];
22757
+
22758
+ let colCountry = -1;
22759
+ let colState = -1;
22760
+ let colSubcategory = -1;
22761
+ let colStatute = -1;
22762
+
22763
+ const unfilteredDict: any[] = [];
22764
+
22765
+ var html = '';
22766
+
22767
+ html += '<div>';
22768
+ html += '<h3 part="results-title">Total Items (' + found + ')</h3>';
22769
+ html += '<h4 id="span-filtered" part="results-title"></h4>'
22770
+ html += '<h4 id="span-extra-filled" part="results-title"></h4>'
22771
+ html += '</div>';
22772
+
22773
+
22774
+ html += '<div class="d-flex justify-between align-center left-sticky flex-wrap mb-20">';
22775
+
22776
+ html += '<div id="div-subfiltered"></div>';
22777
+ html += '<div id="scroll-overlay" part="onboarding-scroll-overlay" class="pos-fixed-scroll justify-center align-center">';
22778
+ html += '<div id="scroll-overlay-left" class="mr-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_left_alt</span></button></div>';
22779
+ html += '<div id="scroll-overlay-right" class="ml-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_right_alt</span></button></div>';
22780
+ html += '</div>';
22781
+
22782
+ html += '<div id="detail-overlay" part="onboarding-detail-overlay" class="pos-fixed justify-center align-center hide">';
22783
+ html += '<div class="cover-slide"></div>';
22784
+ html += '<div class="detail-container p-10">';
22785
+ html += '<div class="d-flex justify-between align-center mb-20">';
22786
+ html += '<div part="results-title">Row Details</div>';
22787
+ html += '<button part="button-icon" class="detail-close"><span class="material-symbols-outlined">close</span></button>';
22788
+ html += '</div>';
22789
+ html += '<div id="detail-overlay-list">';
22790
+ html += '</div>';
22791
+ html += '</div>';
22792
+ html += '</div>';
22793
+
22794
+ html += '<div class="d-flex align-center">';
22795
+ html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
22796
+ html += '<div class="mr-10">';
22797
+ html += '<div class="d-flex justify-end"><button part="calendar-tab-icon-not-selected" class="material-icons button-toggle-more">expand_more</button><button part="calendar-tab-icon-selected" class="material-icons button-toggle-more-back hide">expand_less</button></div>'
22798
+ html += '<div style="position: absolute; margin-top: 5px;"><button part="button" class="hide d-flex align-center button-download-backups" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">file_save</span><span>Download Backups</span></button><button part="button" class="mt-10 hide d-flex align-center button-export-mapping" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">export_notes</span><span>Export Mapping</span></button></div>'
22799
+ html += '</div>';
22800
+ html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
22801
+ html += '</div>';
22802
+
22803
+ html += '</div>';
22804
+
22805
+ html += '<table id="table-data">';
22806
+
22807
+ html += '<thead>';
22808
+ html += '<th part="td-head" class="td-head">'
22809
+ // html += 'Select';
22810
+ html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
22811
+ html += '</th>'
22812
+ html += '<th part="td-head" class="td-head">'
22813
+ html += '<div>View</div>';
22814
+ html += '</th>'
22815
+ if (extraFieldPosition === 0) {
22816
+ for (var i = 0; i < extraFields.length; i++) {
22817
+ html += '<th part="td-head" class="td-head">'
22818
+ html += extraFields[i];
22819
+ html += '</th>'
22820
+ }
22821
+ }
22822
+ if (colName.toLowerCase() == "compliances") {
22823
+ html += '<th part="td-head" class="td-head">'
22824
+ html += 'Proposed Users';
22825
+ html += '</th>'
22826
+ }
22827
+ html += '<th part="td-head" class="td-head">'
22828
+ html += 'Id';
22829
+ html += '</th>'
22830
+
22831
+ // for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
22832
+
22833
+ // if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
22834
+ // html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
22835
+ // html += JSON.parse(jsonData[0].data.cols)[j]
22836
+ // html += '</th>'
22837
+ // }
22838
+
22839
+ // }
22840
+
22841
+ for (var j = 0; j < jsonData[0].cols.length; j++) {
22842
+ console.log('jsoncols', JSON.parse(jsonData[0].data.cols), jsonData[0].cols.length, j)
22843
+ html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == (JSON.parse(jsonData[0].data.cols)[j] ?? "").toLowerCase() ? 'left-sticky' : '') + '">'
22844
+ // html += jsonData[0].cols[j]
22845
+ html += '</th>'
22846
+
22847
+ }
22848
+
22849
+ if (extraFieldPosition === 1) {
22850
+ for (var i = 0; i < extraFields.length; i++) {
22851
+ html += '<th part="td-head" class="td-head">'
22852
+ html += extraFields[i];
22853
+ html += '</th>'
22854
+ }
22855
+ }
22856
+ html += '</thead>'
22857
+
22858
+ //console.log('colstate', JSON.parse(jsonData[0].data.cols));
22859
+
22860
+ for (var i = 0; i < JSON.parse(jsonData[0].data.cols).length; i++) {
22861
+ if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "country") {
21662
22862
  console.log('colstate country', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
21663
22863
  colCountry = i;
21664
22864
  }
@@ -22329,7 +23529,7 @@ export class SfIEvents extends LitElement {
22329
23529
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
22330
23530
  ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22331
23531
  if (extraFieldPosition === 1) {
22332
- await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
23532
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true, mappedStatutes)
22333
23533
  }
22334
23534
  });
22335
23535
  }
@@ -22407,7 +23607,7 @@ export class SfIEvents extends LitElement {
22407
23607
 
22408
23608
  (this._SfButtonSave as HTMLButtonElement)?.addEventListener('click', async () => {
22409
23609
 
22410
- await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false)
23610
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false, mappedStatutes)
22411
23611
 
22412
23612
  });
22413
23613
 
@@ -23156,368 +24356,450 @@ export class SfIEvents extends LitElement {
23156
24356
 
23157
24357
  });
23158
24358
 
23159
- //this.refreshCalendar();
23160
-
23161
- }
23162
-
23163
- renderOnboardingTriggers = (mappedTriggers: any, mappedSerializedAlertSchedules: any, triggersJobs: any) => {
23164
-
23165
- var html = '';
23166
-
23167
- html += '<div id="triggers-list-container" class="d-flex flex-col w-100 scroll-x">';
23168
- html += '</div>';
23169
-
23170
- (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML = html;
23171
-
23172
- //console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
23173
-
23174
- this.renderTaggingTable((this._SfOnboardingTriggersListContainer as HTMLDivElement), mappedSerializedAlertSchedules, mappedTriggers, ["shortid", "obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24359
+ //this.refreshCalendar();
23175
24360
 
23176
24361
  }
23177
24362
 
23178
- renderOnboardingInternalControls = (mappedInternalControls: any, mappedSerializedTriggers: any, internalcontrolsJobs: any) => {
24363
+ renderOnboardingTriggers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedTriggers: any) => {
23179
24364
 
23180
- var html = '';
24365
+ this.renderTaggingTableNew((this._SfOnboardingTriggersListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedTriggers, ["shortid", "obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id"], '', "", ["triggers"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23181
24366
 
23182
- html += '<div id="internalcontrols-list-container" class="d-flex flex-col w-100 scroll-x">';
23183
- html += '</div>';
24367
+ }
23184
24368
 
23185
- (this._SfOnboardingInternalControlsContainer as HTMLDivElement).innerHTML = html;
24369
+ renderOnboardingInternalControls = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedInternalControls: any) => {
23186
24370
 
23187
- this.renderTaggingTable((this._SfOnboardingInternalControlsListContainer as HTMLDivElement), mappedSerializedTriggers, mappedInternalControls, ["shortid", "obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24371
+ this.renderTaggingTableNew((this._SfOnboardingInternalControlsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedInternalControls, ["shortid", "obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23188
24372
 
23189
24373
  }
23190
24374
 
23191
- renderOnboardingReportedLocations = (mappedReportedLocations: any, mappedSerializedTriggers: any, reportedlocationsJobs: any) => {
24375
+ renderOnboardingReportedLocations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedReportedLocations: any) => {
23192
24376
 
23193
- var html = '';
24377
+ this.renderTaggingTableNew((this._SfOnboardingReportedLocationsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedReportedLocations, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportedLocationsMapping, this.loadOnboardingReportedLocations, "reportedlocations", ["id", "entityname", "locationname"], '', "", ["reportedlocations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23194
24378
 
23195
- html += '<div id="reportedlocations-list-container" class="d-flex flex-col w-100 scroll-x">';
23196
- html += '</div>';
24379
+ }
23197
24380
 
23198
- (this._SfOnboardingReportedLocationsContainer as HTMLDivElement).innerHTML = html;
24381
+ renderOnboardingActivations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedActivations: any) => {
23199
24382
 
23200
- this.renderTaggingTable((this._SfOnboardingReportedLocationsContainer as HTMLDivElement), mappedSerializedTriggers, mappedReportedLocations, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportedLocationsMapping, this.loadOnboardingReportedLocations, "reportedlocations", ["id", "entityname", "locationname"], '', "", ["reportedlocations"], reportedlocationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24383
+ this.renderTaggingTableNew((this._SfOnboardingActivationListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedActivations, ["shortid", "obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23201
24384
 
23202
24385
  }
23203
24386
 
23204
- renderOnboardingActivations = (mappedActivations: any, mappedSerializedExtensions: any, activationsJobs: any) => {
24387
+ renderOnboardingInvalidations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedInvalidations: any) => {
23205
24388
 
23206
- var html = '';
24389
+ this.renderTaggingTableNew((this._SfOnboardingInvalidationListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedInvalidations, ["shortid", "obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23207
24390
 
23208
- html += '<div id="activations-list-container" class="d-flex flex-col w-100 scroll-x">';
23209
- html += '</div>';
24391
+ }
23210
24392
 
23211
- (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
24393
+ renderOnboardingAlertSchedules = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedAlertSchedules: any) => {
23212
24394
 
23213
- this.renderTaggingTable((this._SfOnboardingActivationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedActivations, ["shortid", "obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24395
+ this.renderTaggingTableNew((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedAlertSchedules, ["shortid", "obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23214
24396
 
23215
24397
  }
23216
24398
 
23217
- renderOnboardingInvalidations = (mappedInvalidations: any, mappedSerializedExtensions: any, invalidationsJobs: any) => {
24399
+ renderOnboardingExtensions = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedExtensions: any) => {
23218
24400
 
23219
- var html = '';
24401
+ this.renderTaggingTableNew((this._SfOnboardingExtensionsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedExtensions, ["shortid", "obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23220
24402
 
23221
- html += '<div id="invalidations-list-container" class="d-flex flex-col w-100 scroll-x">';
23222
- html += '</div>';
24403
+ }
23223
24404
 
23224
- (this._SfOnboardingInvalidationsContainer as HTMLDivElement).innerHTML = html;
24405
+ renderOnboardingDuedates = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedDuedates: any) => {
23225
24406
 
23226
- this.renderTaggingTable((this._SfOnboardingInvalidationListContainer as HTMLDivElement), mappedSerializedExtensions, mappedInvalidations, ["shortid", "obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24407
+ this.renderTaggingTableNew((this._SfOnboardingDuedatesListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedDuedates, ["shortid", "obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23227
24408
 
23228
24409
  }
23229
24410
 
23230
- renderOnboardingAlertSchedules = (mappedAlertSchedules: any, mappedSerializedExtensions: any, alertschedulesJobs: any) => {
24411
+ renderOnboardingReporters = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedReporters: any) => {
23231
24412
 
23232
- var html = '';
24413
+ this.renderTaggingTableNew((this._SfOnboardingReportersListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedReporters, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportersMapping, this.loadOnboardingReporters, "reporters", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["reporters"], ["id", "countryid", "entityid", "locationid"], null, [], null, "Guidelines", "");
23233
24414
 
23234
- html += '<div id="alertschedules-list-container" class="d-flex flex-col w-100 scroll-x">';
23235
- html += '</div>';
24415
+ }
23236
24416
 
23237
- (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
24417
+ renderOnboardingApprovers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedApprovers: any) => {
23238
24418
 
23239
- this.renderTaggingTable((this._SfOnboardingAlertSchedulesListContainer as HTMLDivElement), mappedSerializedExtensions, mappedAlertSchedules, ["shortid", "obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24419
+ this.renderTaggingTableNew((this._SfOnboardingApproversListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedApprovers, ["shortid", "obligationtitle", "obligationtype"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], ["id", "countryid", "entityid", "locationid"], null, [], null, "Guidelines", "");
23240
24420
 
23241
24421
  }
23242
24422
 
23243
- renderOnboardingExtensions = (mappedExtensions: any, mappedSerializedDuedates: any, extensionsJobs: any) => {
24423
+ renderOnboardingFunctionHeads = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedFunctionHeads: any) => {
23244
24424
 
23245
- var html = '';
23246
-
23247
- html += '<div id="extensions-list-container" class="d-flex flex-col w-100 scroll-x">';
23248
- html += '</div>';
23249
-
23250
- (this._SfOnboardingExtensionsContainer as HTMLDivElement).innerHTML = html;
23251
24425
 
23252
- this.renderTaggingTable((this._SfOnboardingExtensionsListContainer as HTMLDivElement), mappedSerializedDuedates, mappedExtensions, ["shortid", "obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24426
+ this.renderTaggingTableNew((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedFunctionHeads, ["shortid", "obligationtitle", "obligationtype"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], ["id", "countryid", "entityid", "locationid"], null, [], null, "Guidelines", "");
23253
24427
 
23254
24428
  }
23255
24429
 
23256
- renderOnboardingDuedates = (mappedDuedates: any, mappedSerializedMakerCheckers: any, duedatesJobs: any) => {
23257
-
23258
- var html = '';
23259
-
23260
- html += '<div id="duedates-list-container" class="d-flex flex-col w-100 scroll-x">';
23261
- html += '</div>';
23262
-
23263
- (this._SfOnboardingDuedatesContainer as HTMLDivElement).innerHTML = html;
24430
+ renderOnboardingMakerCheckers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedMakerCheckers: any) => {
23264
24431
 
23265
- this.renderTaggingTable((this._SfOnboardingDuedatesListContainer as HTMLDivElement), mappedSerializedMakerCheckers, mappedDuedates, ["shortid", "obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24432
+ this.renderTaggingTableNew((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedMakerCheckers, ["shortid", "obligationtitle", "obligationtype"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23266
24433
 
23267
24434
  }
23268
24435
 
23269
- renderOnboardingReporters = (mappedReporters: any, mappedSerializedTags: any, reportersJobs: any, _arrFeedbackReference: any) => {
24436
+ renderOnboardingDocs = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedDocs: any) => {
23270
24437
 
23271
- var html = '';
24438
+ this.renderTaggingTableNew((this._SfOnboardingDocsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedDocs, ["shortid", "obligationtitle", "obligationtype"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23272
24439
 
23273
- html += '<div id="reporters-list-container" class="d-flex flex-col w-100 scroll-x">';
23274
- html += '</div>';
24440
+ }
23275
24441
 
23276
- (this._SfOnboardingReportersContainer as HTMLDivElement).innerHTML = html;
24442
+ renderOnboardingAuditors = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedAuditors: any) => {
23277
24443
 
23278
- this.renderTaggingTable((this._SfOnboardingReportersListContainer as HTMLDivElement), mappedSerializedTags, mappedReporters, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportersMapping, this.loadOnboardingReporters, "reporters", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["reporters"], reportersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
24444
+ this.renderTaggingTableNew((this._SfOnboardingAuditorsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedAuditors, ["shortid", "obligationtitle", "obligationtype"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], ["id", "countryid", "entityid", "locationid"], null, [], null, "Guidelines", "");
23279
24445
 
23280
24446
  }
23281
24447
 
23282
- renderOnboardingApprovers = (mappedApprovers: any, mappedSerializedReporters: any, approversJobs: any, _arrFeedbackReference: any) => {
24448
+ renderOnboardingViewers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedViewers: any) => {
23283
24449
 
23284
- var html = '';
24450
+ this.renderTaggingTableNew((this._SfOnboardingViewersListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedViewers, ["shortid", "obligationtitle", "obligationtype"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], ["id", "countryid", "entityid", "locationid"], null, [], null, "Guidelines", "");
23285
24451
 
23286
- html += '<div id="approvers-list-container" class="d-flex flex-col w-100 scroll-x">';
23287
- html += '</div>';
24452
+ }
23288
24453
 
23289
- (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
24454
+ renderOnboardingTags = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedTags: any) => {
23290
24455
 
23291
- this.renderTaggingTable((this._SfOnboardingApproversListContainer as HTMLDivElement), mappedSerializedReporters, mappedApprovers, ["shortid", "obligationtitle", "obligationtype"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
24456
+ this.renderTaggingTableNew((this._SfOnboardingTagsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedFunctions, mappedTags, ["shortid", "obligationtitle", "obligationtype"], this.uploadTagsMapping, this.loadOnboardingTags, "tags", ["id", "entityname", "locationname"], this.apiIdTags, "&Tag", ["tags"], ["id", "countryid", "entityid", "locationid"], "tagtype", [], null, "", "");
23292
24457
 
23293
24458
  }
23294
24459
 
23295
- renderOnboardingFunctionHeads = (mappedFunctionHeads: any, mappedSerializedApprovers: any, functionHeadsJobs: any, _arrFeedbackReference: any) => {
24460
+ renderOnboardingFunctions = (selectedStatutes: any, mappedCompliances: any, mappedLocations: any, mappedFunctions: any) => {
23296
24461
 
23297
- var html = '';
24462
+ this.renderTaggingTableNew((this._SfOnboardingFunctionsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedLocations, mappedFunctions, ["shortid", "obligationtitle", "obligationtype"], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
23298
24463
 
23299
- html += '<div id="functionheads-list-container" class="d-flex flex-col w-100 scroll-x">';
23300
- html += '</div>';
24464
+ }
23301
24465
 
23302
- (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).innerHTML = html;
24466
+ renderOnboardingLocations = (selectedStatutes: any, mappedCompliances: any, mappedEntities: any, mappedLocations: any) => {
23303
24467
 
23304
- this.renderTaggingTable((this._SfOnboardingFunctionHeadsListContainer as HTMLDivElement), mappedSerializedApprovers, mappedFunctionHeads, ["shortid", "obligationtitle", "obligationtype"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
24468
+ this.renderTaggingTableNew((this._SfOnboardingLocationsListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedEntities, mappedLocations, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference", "activations", "invalidations"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "entityname"], this.apiIdTags, "&Location", ["locationname", "locationid"], ["id", "countryid", "entityid"], null, [], null, "", "");
23305
24469
 
23306
24470
  }
23307
24471
 
23308
- renderOnboardingMakerCheckers = (mappedMakerCheckers: any, mappedSerializedDocs: any, makerCheckerJobs: any) => {
23309
-
24472
+ renderOnboardingStatutesDropdownMapping = (container: HTMLDivElement, mappedStatutes: any, selectedStatutes: any, fetchtaggingfunction: Function, rendermappingfunction: Function) => {
24473
+ console.log('rendering dropdown', mappedStatutes.length);
23310
24474
  var html = '';
23311
24475
 
23312
- html += '<div id="makercheckers-list-container" class="d-flex flex-col w-100 scroll-x">';
24476
+ html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
24477
+ html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
24478
+ html += '<label part="input-label">Select Statute</label>';
24479
+ html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
23313
24480
  html += '</div>';
23314
24481
 
23315
- (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).innerHTML = html;
23316
-
23317
- this.renderTaggingTable((this._SfOnboardingMakerCheckersListContainer as HTMLDivElement), mappedSerializedDocs, mappedMakerCheckers, ["shortid", "obligationtitle", "obligationtype"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
23318
-
23319
- }
23320
-
23321
- renderOnboardingDocs = (mappedDocs: any, mappedSerializedViewers: any, docsJobs: any) => {
23322
-
23323
- var html = '';
23324
-
23325
- html += '<div id="docs-list-container" class="d-flex flex-col w-100 scroll-x">';
24482
+ html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
23326
24483
  html += '</div>';
24484
+ html += '</div>';
24485
+ console.log('attaching html', html);
24486
+ container.innerHTML = html;
23327
24487
 
23328
- (this._SfOnboardingDocsContainer as HTMLDivElement).innerHTML = html;
24488
+ let multiselectStatute = container.querySelector('#statute-select') as SfMultiselectSearch;
24489
+ multiselectStatute.listelements = mappedStatutes;
24490
+ let selectedStatutesObj: any = {}
24491
+ for (let statuteObj of selectedStatutes) {
24492
+ selectedStatutesObj[statuteObj.id] = true
24493
+ }
24494
+ multiselectStatute.listselection = selectedStatutesObj;
24495
+ multiselectStatute.loadMode();
24496
+ multiselectStatute.addEventListener('valueChanged', async (e: any) => {
24497
+ let multiselect = e.currentTarget as SfMultiselectSearch;
24498
+ console.log('selected statutes', multiselect.selectedValuesNames());
24499
+ if (Object.keys(multiselect.selectedValuesNames()).length == 0) {
24500
+ return;
24501
+ }
24502
+ let selectedStatutes = [];
24503
+ const regex = /^\[.*?\] - /;
24504
+ for (let statuteid of Object.keys(multiselect.selectedValuesNames())) {
24505
+ selectedStatutes.push({ id: statuteid, selected: true, statutename: multiselect.selectedValuesNames()[statuteid].name.replace(regex, '') });
24506
+ }
23329
24507
 
23330
- this.renderTaggingTable((this._SfOnboardingDocsListContainer as HTMLDivElement), mappedSerializedViewers, mappedDocs, ["shortid", "obligationtitle", "obligationtype"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24508
+ let mappedCompliances = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
23331
24509
 
24510
+ rendermappingfunction({ data: { mappings: { mappings: selectedStatutes } } }, mappedCompliances);
24511
+ })
23332
24512
  }
23333
24513
 
23334
- renderOnboardingAuditors = (mappedAuditors: any, mappedSerializedFunctionheads: any, auditorsJobs: any, _arrFeedbackReference: any) => {
23335
-
23336
- //console.log('inside rendering auditors..');
23337
-
24514
+ renderOnboardingStatutesDropdownTagging = (container: HTMLDivElement, listcontainerid: string, mappedStatutes: any, selectedStatutes: any, fetchcompliancesfunction: Function, fetchsourcemapping: Function, fetchtaggingfunction: Function, rendertaggingfunction: Function) => {
24515
+ console.log('rendering dropdown', mappedStatutes.length);
23338
24516
  var html = '';
23339
24517
 
23340
- html += '<div id="auditors-list-container" class="d-flex flex-col w-100 scroll-x">';
24518
+ html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
24519
+ html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
24520
+ html += '<label part="input-label">Select Statute</label>';
24521
+ html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
23341
24522
  html += '</div>';
23342
24523
 
23343
- (this._SfOnboardingAuditorsContainer as HTMLDivElement).innerHTML = html;
24524
+ html += '<div id="' + listcontainerid + '" class="d-flex flex-col w-100 scroll-x">';
24525
+ html += '</div>';
24526
+ html += '</div>';
24527
+ console.log('attaching html', html);
24528
+ container.innerHTML = html;
23344
24529
 
23345
- this.renderTaggingTable((this._SfOnboardingAuditorsListContainer as HTMLDivElement), mappedSerializedFunctionheads, mappedAuditors, ["shortid", "obligationtitle", "obligationtype"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
24530
+ let multiselectStatute = container.querySelector('#statute-select') as SfMultiselectSearch;
24531
+ multiselectStatute.listelements = mappedStatutes;
24532
+ let selectedStatutesObj: any = {}
24533
+ for (let statuteObj of selectedStatutes) {
24534
+ selectedStatutesObj[statuteObj.id] = true
24535
+ }
24536
+ multiselectStatute.listselection = selectedStatutesObj;
24537
+ multiselectStatute.loadMode();
24538
+ multiselectStatute.addEventListener('valueChanged', async (e: any) => {
24539
+ let multiselect = e.currentTarget as SfMultiselectSearch;
24540
+ console.log('selected statutes', multiselect.selectedValuesNames());
24541
+ if (Object.keys(multiselect.selectedValuesNames()).length == 0) {
24542
+ return;
24543
+ }
24544
+ let selectedStatutes = [];
24545
+ const regex = /^\[.*?\] - /;
24546
+ for (let statuteid of Object.keys(multiselect.selectedValuesNames())) {
24547
+ selectedStatutes.push({ id: statuteid, selected: true, statutename: multiselect.selectedValuesNames()[statuteid].name.replace(regex, '') });
24548
+ }
23346
24549
 
24550
+ let sourceMappingArray = await fetchsourcemapping(Object.keys(multiselect.selectedValuesNames()));
24551
+ let mappingArray = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
24552
+ let mappedCompliances = await fetchcompliancesfunction(Object.keys(multiselect.selectedValuesNames()));
24553
+ let mappedCompliancesArr: any = { data: { mappings: {} } };
24554
+ console.log('mapped compliances', mappedCompliances)
24555
+ for (let statuteObj of selectedStatutes) {
24556
+ for (let complianceid of Object.keys(mappedCompliances.data.mappings[statuteObj.id])) {
24557
+ let pushObj = mappedCompliances.data.mappings[statuteObj.id][complianceid];
24558
+ pushObj.id = complianceid;
24559
+ pushObj.statuteid = statuteObj.id;
24560
+ mappedCompliancesArr.data.mappings[complianceid] = pushObj;
24561
+ }
24562
+ }
24563
+ rendertaggingfunction(selectedStatutes, mappedCompliancesArr, sourceMappingArray, mappingArray);
24564
+ })
23347
24565
  }
23348
24566
 
23349
- renderOnboardingViewers = (mappedViewers: any, mappedSerializedAuditors: any, viewersJobs: any, _arrFeedbackReference: any) => {
24567
+ renderOnboardingCompliances = async (mappedStatutes: any, mappedCompliancesArr: any) => {
24568
+
24569
+ //console.log('mappedcompliances', mappedCompliances);
24570
+ //console.log('mappedstatutes', mappedStatutes);
23350
24571
 
23351
- //console.log('inside rendering viewers..');
24572
+ var searchString = "";
24573
+ let mappedCompliances: any = { data: { mappings: { mappings: [] } } };
24574
+ for (var i = 0; i < (mappedStatutes.data.mappings.mappings as Array<any>).length; i++) {
24575
+ if ((mappedStatutes.data.mappings.mappings as Array<any>)[i].selected) {
24576
+ let statuteid = (mappedStatutes.data.mappings.mappings as Array<any>)[i].id
24577
+ if (mappedCompliancesArr.data.mappings[statuteid] != null) {
24578
+ for (let complianceid of Object.keys(mappedCompliancesArr.data.mappings[statuteid])) {
24579
+ let pushObj = mappedCompliancesArr.data.mappings[statuteid][complianceid];
24580
+ pushObj.id = complianceid;
24581
+ mappedCompliances.data.mappings.mappings.push(pushObj);
24582
+ }
24583
+ }
24584
+ searchString += statuteid + "|";
24585
+ }
24586
+ }
24587
+ searchString = searchString.slice(0, -1);
23352
24588
 
23353
- var html = '';
24589
+ //console.log('searchstring', searchString);
23354
24590
 
23355
- html += '<div id="viewers-list-container" class="d-flex flex-col w-100 scroll-x">';
23356
- html += '</div>';
24591
+ var initCursor = "";
23357
24592
 
23358
- (this._SfOnboardingViewersContainer as HTMLDivElement).innerHTML = html;
24593
+ // var html = '';
23359
24594
 
23360
- this.renderTaggingTable((this._SfOnboardingViewersListContainer as HTMLDivElement), mappedSerializedAuditors, mappedViewers, ["shortid", "obligationtitle", "obligationtype"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
24595
+ // html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
24596
+ // html += '<div class="d-flex flex-col w-100">';
24597
+ // html += '<label part="input-label">Search Compliances</label>';
24598
+ // html += '<div class="d-flex">';
24599
+ // html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
24600
+ // html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
24601
+ // html += '</div>';
24602
+ // html += '</div>';
23361
24603
 
23362
- }
24604
+ // html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
24605
+ // html += '</div>';
24606
+ // html += '</div>';
23363
24607
 
23364
- renderOnboardingTags = (mappedTags: any, mappedSerializedFunctions: any, tagsJobs: any) => {
24608
+ // (this._SfOnboardingCompliancesContainer as HTMLDivElement).innerHTML = html;
23365
24609
 
23366
- var html = '';
24610
+ // (this._SfButtonSearch as HTMLButtonElement)?.addEventListener('click', async () => {
24611
+ // //console.log('clicked', mappedStatutes.data.mappings.mappings);
24612
+ // const searchString = (this._SfInputSearch as HTMLButtonElement).value;
24613
+ // //console.log('searchstring', searchString);
24614
+ // if (searchString.length > 0) {
23367
24615
 
23368
- html += '<div id="tags-list-container" class="d-flex flex-col w-100 scroll-x">';
23369
- html += '</div>';
24616
+ // const arrSearchString = searchString.split('|');
23370
24617
 
23371
- (this._SfOnboardingTagsContainer as HTMLDivElement).innerHTML = html;
24618
+ // const arrSearchStringProcessed: any = [];
23372
24619
 
23373
- this.renderTaggingTable((this._SfOnboardingTagsListContainer as HTMLDivElement), mappedSerializedFunctions, mappedTags, ["shortid", "obligationtitle", "obligationtype"], this.uploadTagsMapping, this.loadOnboardingTags, "tags", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Tag", ["tags"], tagsJobs, "tagtype", ["Client remarks", "FlaggGRC response"], null, "", "");
24620
+ // arrSearchString.forEach((complianceId: string) => {
23374
24621
 
23375
- }
24622
+ // if (complianceId.length === 36) {
24623
+ // arrSearchStringProcessed.push(complianceId);
24624
+ // }
23376
24625
 
23377
- renderOnboardingFunctions = (mappedFunctions: any, mappedSerializedLocations: any, functionsJobs: any) => {
24626
+ // });
23378
24627
 
23379
- var html = '';
24628
+ // var resultCompliances: any = {};
24629
+ // resultCompliances.values = [];
24630
+ // const chunkSize = 20;
24631
+ // for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
23380
24632
 
23381
- html += '<div id="functions-list-container" class="d-flex flex-col w-100 scroll-x">';
23382
- html += '</div>';
24633
+ // const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
24634
+ // console.log('chunk', chunk);
24635
+ // // do whatever
24636
+ // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
24637
+ // console.log(tempResultCompliances)
24638
+ // resultCompliances.values.push(...tempResultCompliances.values);
24639
+ // //console.log(resultCompliances);
23383
24640
 
23384
- for (var i = 0; i < mappedSerializedLocations.data.mappings.mappings.length; i++) {
24641
+ // }
23385
24642
 
23386
- if (mappedSerializedLocations.data.mappings.mappings[i].id == "33a0deab-e93e-41b7-831a-473f9ea3eea2") {
23387
- //console.log('mappedSerializedLocations', mappedSerializedLocations.data.mappings.mappings[i]);
23388
- }
24643
+ // // var resultCompliances : any = {};
24644
+ // // resultCompliances.values = [];
24645
+ // // const chunkSize = 20;
24646
+ // // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
23389
24647
 
23390
- }
24648
+ // // const chunk = arrSearchString.slice(k, k + chunkSize);
24649
+ // // console.log('chunk', chunk);
24650
+ // // // do whatever
24651
+ // // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
24652
+ // // console.log(tempResultCompliances)
24653
+ // // resultCompliances.values.push(...tempResultCompliances.values);
24654
+ // // //console.log(resultCompliances);
23391
24655
 
23392
- (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
24656
+ // // }
23393
24657
 
23394
- this.renderTaggingTable((this._SfOnboardingFunctionsListContainer as HTMLDivElement), mappedSerializedLocations, mappedFunctions, ["shortid", "obligationtitle", "obligationtype"], this.uploadFunctionsMapping, this.loadOnboardingFunctions, "functions", ["id", "countryname", "entityname", "locationname"], this.apiIdTags, "&Function", ["functions"], functionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24658
+ // if (resultCompliances != null) {
23395
24659
 
23396
- }
24660
+ // const jsonData = [];
23397
24661
 
23398
- renderOnboardingLocations = (mappedLocations: any, mappedSerializedEntities: any, locationsJobs: any) => {
24662
+ // const arrCompliancesFrequencies: any = {};
23399
24663
 
23400
- var html = '';
24664
+ // for (var i = 0; i < resultCompliances.values.length; i++) {
23401
24665
 
23402
- html += '<div id="locations-list-container" class="d-flex flex-col w-100 scroll-x">';
23403
- html += '</div>';
24666
+ // if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
24667
+ // continue;
24668
+ // } else {
24669
+ // arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
24670
+ // }
23404
24671
 
23405
- (this._SfOnboardingLocationsContainer as HTMLDivElement).innerHTML = html;
24672
+ // var mapped = false;
24673
+ // var extraFields = null;
24674
+ // var previousExtraFields = null;
24675
+ // console.log('mappedcompliances', mappedCompliances)
24676
+ // for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
24677
+ // if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
24678
+ // if (mappedCompliances.data.mappings.mappings[j].selected) {
24679
+ // mapped = true;
24680
+ // }
24681
+ // extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
24682
+ // }
24683
+ // }
23406
24684
 
23407
- this.renderTaggingTable((this._SfOnboardingLocationsListContainer as HTMLDivElement), mappedSerializedEntities, mappedLocations, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference", "activations", "invalidations"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
24685
+ // for (j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23408
24686
 
23409
- }
24687
+ // // console.log('mappedStatutes.data.mappings.mappings[j]', mappedStatutes.data.mappings.mappings[j]);
24688
+ // if (Array.isArray(mappedStatutes.data.mappings.mappings[j].statutename)) {
24689
+ // // sometimes this error occurs
24690
+ // continue;
23410
24691
 
23411
- renderOnboardingCompliances = (mappedStatutes: any, mappedCompliances: any) => {
24692
+ // }
23412
24693
 
23413
- //console.log('mappedcompliances', mappedCompliances);
23414
- //console.log('mappedstatutes', mappedStatutes);
24694
+ // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
23415
24695
 
23416
- var searchString = "";
24696
+ // // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
24697
+ // // console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
24698
+ // // }
24699
+ // previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields
24700
+ // }
24701
+ // }
24702
+ // jsonData.push({ id: resultCompliances.values[i].id, mapped: mapped, data: resultCompliances.values[i].fields, cols: ["country", "jurisdiction", "state", "category", "subcategory", "statute", "applicability", "obligationtitle", "obligation", "risk", "riskarea", "frequency", "penalty", "reference", "form", "subfrequency", "obligationtype", "duedate"], extraFields: extraFields, previousExtraFields: previousExtraFields })
24703
+ // }
23417
24704
 
23418
- for (var i = 0; i < (mappedStatutes.data.mappings.mappings as Array<any>).length; i++) {
23419
- if ((mappedStatutes.data.mappings.mappings as Array<any>)[i].selected) {
23420
- searchString += (mappedStatutes.data.mappings.mappings as Array<any>)[i].id + "|";
23421
- }
23422
- }
23423
- searchString = searchString.slice(0, -1);
23424
24705
 
23425
- //console.log('searchstring', searchString);
24706
+ // this.renderMappingTable((this._SfOnboardingCompliancesListContainer as HTMLDivElement), jsonData, [{ prev: initCursor, next: resultCompliances.cursor }], this.fetchSearchCompliances, searchString, mappedCompliances, resultCompliances.values.length, this.uploadCompliancesMapping, this.loadOnboardingCompliances, ["Client remarks", "FlaggGRC response"], -1, 0, "compliances", "", "statute", ["optional", "optional"]);
23426
24707
 
23427
- var initCursor = "";
24708
+ // }
23428
24709
 
23429
- var html = '';
24710
+ // }
23430
24711
 
23431
- html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
23432
- html += '<div class="d-flex flex-col w-100">';
23433
- html += '<label part="input-label">Search Compliances</label>';
23434
- html += '<div class="d-flex">';
23435
- html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
23436
- html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
23437
- html += '</div>';
23438
- html += '</div>';
24712
+ // });
23439
24713
 
23440
- html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
23441
- html += '</div>';
23442
- html += '</div>';
24714
+ //console.log('compliances searchstring', searchString);
23443
24715
 
23444
- (this._SfOnboardingCompliancesContainer as HTMLDivElement).innerHTML = html;
24716
+ // if (searchString != "") {
24717
+ // (this._SfInputSearch as HTMLInputElement).value = searchString;
24718
+ // (this._SfButtonSearch as HTMLButtonElement).click();
24719
+ // }
23445
24720
 
23446
- (this._SfButtonSearch as HTMLButtonElement).addEventListener('click', async () => {
23447
- //console.log('clicked', mappedStatutes.data.mappings.mappings);
23448
- const searchString = (this._SfInputSearch as HTMLButtonElement).value;
23449
- //console.log('searchstring', searchString);
23450
- if (searchString.length > 0) {
24721
+ if (searchString.length > 0) {
23451
24722
 
23452
- const arrSearchString = searchString.split('|');
24723
+ const arrSearchString = searchString.split('|');
23453
24724
 
23454
- const arrSearchStringProcessed: any = [];
24725
+ const arrSearchStringProcessed: any = [];
23455
24726
 
23456
- arrSearchString.forEach((complianceId: string) => {
24727
+ arrSearchString.forEach((complianceId: string) => {
23457
24728
 
23458
- if (complianceId.length === 36) {
23459
- arrSearchStringProcessed.push(complianceId);
23460
- }
24729
+ if (complianceId.length === 36) {
24730
+ arrSearchStringProcessed.push(complianceId);
24731
+ }
23461
24732
 
23462
- });
24733
+ });
23463
24734
 
23464
- var resultCompliances: any = {};
23465
- resultCompliances.values = [];
23466
- const chunkSize = 20;
23467
- for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
24735
+ var resultCompliances: any = {};
24736
+ resultCompliances.values = [];
24737
+ const chunkSize = 20;
24738
+ for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
23468
24739
 
23469
- const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
23470
- console.log('chunk', chunk);
23471
- // do whatever
23472
- const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
23473
- console.log(tempResultCompliances)
23474
- resultCompliances.values.push(...tempResultCompliances.values);
23475
- //console.log(resultCompliances);
24740
+ const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
24741
+ console.log('chunk', chunk);
24742
+ // do whatever
24743
+ const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
24744
+ console.log(tempResultCompliances)
24745
+ resultCompliances.values.push(...tempResultCompliances.values);
24746
+ //console.log(resultCompliances);
23476
24747
 
23477
- }
24748
+ }
23478
24749
 
23479
- // var resultCompliances : any = {};
23480
- // resultCompliances.values = [];
23481
- // const chunkSize = 20;
23482
- // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
24750
+ // var resultCompliances : any = {};
24751
+ // resultCompliances.values = [];
24752
+ // const chunkSize = 20;
24753
+ // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
23483
24754
 
23484
- // const chunk = arrSearchString.slice(k, k + chunkSize);
23485
- // console.log('chunk', chunk);
23486
- // // do whatever
23487
- // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
23488
- // console.log(tempResultCompliances)
23489
- // resultCompliances.values.push(...tempResultCompliances.values);
23490
- // //console.log(resultCompliances);
24755
+ // const chunk = arrSearchString.slice(k, k + chunkSize);
24756
+ // console.log('chunk', chunk);
24757
+ // // do whatever
24758
+ // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
24759
+ // console.log(tempResultCompliances)
24760
+ // resultCompliances.values.push(...tempResultCompliances.values);
24761
+ // //console.log(resultCompliances);
23491
24762
 
23492
- // }
24763
+ // }
23493
24764
 
23494
- if (resultCompliances != null) {
24765
+ if (resultCompliances != null) {
23495
24766
 
23496
- const jsonData = [];
24767
+ const jsonData = [];
23497
24768
 
23498
- const arrCompliancesFrequencies: any = {};
24769
+ const arrCompliancesFrequencies: any = {};
23499
24770
 
23500
- for (var i = 0; i < resultCompliances.values.length; i++) {
24771
+ for (var i = 0; i < resultCompliances.values.length; i++) {
23501
24772
 
23502
- if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
23503
- continue;
23504
- } else {
23505
- arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
23506
- }
24773
+ if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
24774
+ continue;
24775
+ } else {
24776
+ arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
24777
+ }
23507
24778
 
23508
- var mapped = false;
23509
- var extraFields = null;
23510
- var previousExtraFields = null;
23511
- console.log('mappedcompliances', mappedCompliances)
23512
- for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
23513
- if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
23514
- if (mappedCompliances.data.mappings.mappings[j].selected) {
24779
+ var mapped = false;
24780
+ var extraFields = null;
24781
+ var previousExtraFields = null;
24782
+ console.log('mappedcompliances', mappedCompliances)
24783
+ if (mappedCompliances.data.mappings.mappings == null) {
24784
+ for (var j = 0; j < Object.keys(mappedCompliances.data.mappings).length; j++) {
24785
+ let statuteKey = Object.keys(mappedCompliances.data.mappings)[j];
24786
+ for (var k = 0; k < Object.keys(mappedCompliances.data.mappings[statuteKey]).length; k++) {
24787
+ let complianceKey = Object.keys(mappedCompliances.data.mappings[statuteKey])[k];
24788
+ if (mappedCompliances.data.mappings[statuteKey][complianceKey].id == resultCompliances.values[i].id) {
23515
24789
  mapped = true;
24790
+ extraFields = mappedCompliances.data.mappings[statuteKey][complianceKey].extraFields;
23516
24791
  }
24792
+ }
24793
+ }
24794
+ } else {
24795
+ for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
24796
+ if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
24797
+ mapped = true;
23517
24798
  extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
23518
24799
  }
23519
24800
  }
23520
24801
 
24802
+
23521
24803
  for (j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23522
24804
 
23523
24805
  // console.log('mappedStatutes.data.mappings.mappings[j]', mappedStatutes.data.mappings.mappings[j]);
@@ -23529,76 +24811,34 @@ export class SfIEvents extends LitElement {
23529
24811
 
23530
24812
  if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
23531
24813
 
23532
- if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
23533
- //console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
23534
- }
24814
+ // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
24815
+ // //console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
24816
+ // }
23535
24817
  previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields
23536
24818
  }
23537
24819
  }
23538
- jsonData.push({ id: resultCompliances.values[i].id, mapped: mapped, data: resultCompliances.values[i].fields, cols: ["country", "jurisdiction", "state", "category", "subcategory", "statute", "applicability", "obligationtitle", "obligation", "risk", "riskarea", "frequency", "penalty", "reference", "form", "subfrequency", "obligationtype", "duedate"], extraFields: extraFields, previousExtraFields: previousExtraFields })
23539
24820
  }
23540
-
23541
-
23542
- this.renderMappingTable((this._SfOnboardingCompliancesListContainer as HTMLDivElement), jsonData, [{ prev: initCursor, next: resultCompliances.cursor }], this.fetchSearchCompliances, searchString, mappedCompliances, resultCompliances.values.length, this.uploadCompliancesMapping, this.loadOnboardingCompliances, ["Client remarks", "FlaggGRC response"], -1, 0, "compliances", "", "statute", ["optional", "optional"]);
23543
-
24821
+ jsonData.push({ id: resultCompliances.values[i].id, mapped: mapped, data: resultCompliances.values[i].fields, cols: ["country", "jurisdiction", "state", "category", "subcategory", "statute", "applicability", "obligationtitle", "obligation", "risk", "riskarea", "frequency", "penalty", "reference", "form", "subfrequency", "obligationtype", "duedate"], extraFields: extraFields, previousExtraFields: previousExtraFields })
23544
24822
  }
23545
24823
 
23546
- }
23547
24824
 
23548
- });
24825
+ this.renderMappingTable((this._SfOnboardingCompliancesListContainer as HTMLDivElement), jsonData, [{ prev: initCursor, next: resultCompliances.cursor }], this.fetchSearchCompliances, searchString, mappedCompliances, resultCompliances.values.length, this.uploadCompliancesMapping, this.loadOnboardingCompliances, [], -1, 0, "compliances", "", "statute", ["optional", "optional"], mappedStatutes.data.mappings.mappings);
23549
24826
 
23550
- //console.log('compliances searchstring', searchString);
24827
+ }
23551
24828
 
23552
- if (searchString != "") {
23553
- (this._SfInputSearch as HTMLInputElement).value = searchString;
23554
- (this._SfButtonSearch as HTMLButtonElement).click();
23555
24829
  }
23556
24830
 
23557
24831
  }
23558
24832
 
23559
- renderOnboardingEntities = (mappedEntities: any, mappedSerializedCountries: any, entitiesJobs: any, arrFeedbackReference: any) => {
23560
-
23561
- var html = '';
23562
-
23563
- html += '<div id="entities-list-container" class="d-flex flex-col w-100 scroll-x">';
23564
- html += '</div>';
23565
-
23566
- (this._SfOnboardingEntitiesContainer as HTMLDivElement).innerHTML = html;
24833
+ renderOnboardingEntities = (selectedStatutes: any, mappedCompliances: any, mappedCountries: any, mappedEntities: any) => {
23567
24834
 
23568
- this.renderTaggingTable((this._SfOnboardingEntitiesListContainer as HTMLDivElement), mappedSerializedCountries, mappedEntities, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
24835
+ this.renderTaggingTableNew((this._SfOnboardingEntitiesListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, mappedCountries, mappedEntities, ["shortid", "applicability", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entityname", "entityid"], ["id", "countryid"], null, [], [], "Guideline", "");
23569
24836
 
23570
24837
  }
23571
24838
 
23572
- renderOnboardingCountries = (mappedCountries: any, mappedCompliances: any, countriesJobs: any) => {
23573
-
23574
- var html = '';
23575
-
23576
- html += '<div id="countries-list-container" class="d-flex flex-col w-100 scroll-x">';
23577
- html += '</div>';
23578
-
23579
- (this._SfOnboardingCountriesContainer as HTMLDivElement).innerHTML = html;
23580
-
23581
- const arr1 = [];
23582
-
23583
- for (var i = 0; i < mappedCompliances.data.mappings.mappings.length; i++) {
23584
- if (mappedCompliances.data.mappings.mappings[i].selected) {
23585
- arr1.push(mappedCompliances.data.mappings.mappings[i]);
23586
- }
23587
- }
23588
-
23589
- mappedCompliances.data.mappings.mappings = arr1;
23590
-
23591
- // const arr2 = [];
23592
- // for(var i = 0; i < mappedCountries.data.mappings.mappings.length; i++) {
23593
- // if(mappedCountries.data.mappings.mappings[i].selected) {
23594
- // arr2.push(mappedCountries.data.mappings.mappings[i]);
23595
- // }
23596
- // }
23597
-
23598
- // mappedCountries.data.mappings.mappings = arr2;
23599
-
23600
- this.renderTaggingTable((this._SfOnboardingCountriesListContainer as HTMLDivElement), mappedCompliances, mappedCountries, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
23601
-
24839
+ renderOnboardingCountries = (selectedStatutes: any, mappedCompliances: any, sourceMapping: any, mappedCountries: any) => {
24840
+ sourceMapping = {}
24841
+ this.renderTaggingTableNew((this._SfOnboardingCountriesListContainer as HTMLDivElement), selectedStatutes, mappedCompliances, sourceMapping, mappedCountries, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countryname", "countryid"], ["id"], null, [], null, "", "");
23602
24842
  }
23603
24843
 
23604
24844
  renderOnboardingStatutes = (mappedStatutes: any) => {
@@ -23644,9 +24884,9 @@ export class SfIEvents extends LitElement {
23644
24884
  for (var j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23645
24885
  if (mappedStatutes.data.mappings.mappings[j].id == resultStatutes.values[i].id) {
23646
24886
  //console.log('comparing',mappedStatutes.data.mappings.mappings[j].id,resultStatutes.values[i].id);
23647
- if (mappedStatutes.data.mappings.mappings[j].selected) {
23648
- mapped = true;
23649
- }
24887
+ // if (mappedStatutes.data.mappings.mappings[j].selected) {
24888
+ mapped = true;
24889
+ // }
23650
24890
  extraFields = mappedStatutes.data.mappings.mappings[j].extraFields;
23651
24891
  }
23652
24892
  }
@@ -23912,7 +25152,7 @@ export class SfIEvents extends LitElement {
23912
25152
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-statutes')?.addEventListener('click', async () => {
23913
25153
 
23914
25154
  this.myOnboardingTab = this.TAB_STATUTES;
23915
- this.renderOnboardingTabs();
25155
+ await this.renderOnboardingTabs();
23916
25156
  await this.loadOnboardingStatutes();
23917
25157
 
23918
25158
  });
@@ -23920,7 +25160,7 @@ export class SfIEvents extends LitElement {
23920
25160
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-compliances')?.addEventListener('click', async () => {
23921
25161
 
23922
25162
  this.myOnboardingTab = this.TAB_COMPLIANCES;
23923
- this.renderOnboardingTabs();
25163
+ await this.renderOnboardingTabs();
23924
25164
  this.loadOnboardingCompliances();
23925
25165
 
23926
25166
  });
@@ -23928,7 +25168,7 @@ export class SfIEvents extends LitElement {
23928
25168
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-countries')?.addEventListener('click', async () => {
23929
25169
 
23930
25170
  this.myOnboardingTab = this.TAB_COUNTRIES;
23931
- this.renderOnboardingTabs();
25171
+ await this.renderOnboardingTabs();
23932
25172
  this.loadOnboardingCountries();
23933
25173
 
23934
25174
  });
@@ -23936,7 +25176,7 @@ export class SfIEvents extends LitElement {
23936
25176
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-entities')?.addEventListener('click', async () => {
23937
25177
 
23938
25178
  this.myOnboardingTab = this.TAB_ENTITIES;
23939
- this.renderOnboardingTabs();
25179
+ await this.renderOnboardingTabs();
23940
25180
  this.loadOnboardingEntities();
23941
25181
 
23942
25182
  });
@@ -23944,7 +25184,7 @@ export class SfIEvents extends LitElement {
23944
25184
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-locations')?.addEventListener('click', async () => {
23945
25185
 
23946
25186
  this.myOnboardingTab = this.TAB_LOCATIONS;
23947
- this.renderOnboardingTabs();
25187
+ await this.renderOnboardingTabs();
23948
25188
  this.loadOnboardingLocations();
23949
25189
 
23950
25190
  });
@@ -23952,7 +25192,7 @@ export class SfIEvents extends LitElement {
23952
25192
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-functions')?.addEventListener('click', async () => {
23953
25193
 
23954
25194
  this.myOnboardingTab = this.TAB_FUNCTIONS;
23955
- this.renderOnboardingTabs();
25195
+ await this.renderOnboardingTabs();
23956
25196
  this.loadOnboardingFunctions();
23957
25197
 
23958
25198
  });
@@ -23960,7 +25200,7 @@ export class SfIEvents extends LitElement {
23960
25200
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-tags')?.addEventListener('click', async () => {
23961
25201
 
23962
25202
  this.myOnboardingTab = this.TAB_TAGS;
23963
- this.renderOnboardingTabs();
25203
+ await this.renderOnboardingTabs();
23964
25204
  this.loadOnboardingTags();
23965
25205
 
23966
25206
  });
@@ -23968,7 +25208,7 @@ export class SfIEvents extends LitElement {
23968
25208
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-reporters')?.addEventListener('click', async () => {
23969
25209
 
23970
25210
  this.myOnboardingTab = this.TAB_REPORTERS;
23971
- this.renderOnboardingTabs();
25211
+ await this.renderOnboardingTabs();
23972
25212
  this.loadOnboardingReporters();
23973
25213
 
23974
25214
  });
@@ -23976,7 +25216,7 @@ export class SfIEvents extends LitElement {
23976
25216
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-approvers')?.addEventListener('click', async () => {
23977
25217
 
23978
25218
  this.myOnboardingTab = this.TAB_APPROVERS;
23979
- this.renderOnboardingTabs();
25219
+ await this.renderOnboardingTabs();
23980
25220
  this.loadOnboardingApprovers();
23981
25221
 
23982
25222
  });
@@ -23984,7 +25224,7 @@ export class SfIEvents extends LitElement {
23984
25224
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-functionheads')?.addEventListener('click', async () => {
23985
25225
 
23986
25226
  this.myOnboardingTab = this.TAB_FUNCTION_HEADS;
23987
- this.renderOnboardingTabs();
25227
+ await this.renderOnboardingTabs();
23988
25228
  this.loadOnboardingFunctionHeads();
23989
25229
 
23990
25230
  });
@@ -23992,7 +25232,7 @@ export class SfIEvents extends LitElement {
23992
25232
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-auditors')?.addEventListener('click', async () => {
23993
25233
 
23994
25234
  this.myOnboardingTab = this.TAB_AUDITORS;
23995
- this.renderOnboardingTabs();
25235
+ await this.renderOnboardingTabs();
23996
25236
  this.loadOnboardingAuditors();
23997
25237
 
23998
25238
  });
@@ -24000,7 +25240,7 @@ export class SfIEvents extends LitElement {
24000
25240
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-viewers')?.addEventListener('click', async () => {
24001
25241
 
24002
25242
  this.myOnboardingTab = this.TAB_VIEWERS;
24003
- this.renderOnboardingTabs();
25243
+ await this.renderOnboardingTabs();
24004
25244
  this.loadOnboardingViewers();
24005
25245
 
24006
25246
  });
@@ -24008,7 +25248,7 @@ export class SfIEvents extends LitElement {
24008
25248
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-makercheckers')?.addEventListener('click', async () => {
24009
25249
 
24010
25250
  this.myOnboardingTab = this.TAB_MAKER_CHECKERS;
24011
- this.renderOnboardingTabs();
25251
+ await this.renderOnboardingTabs();
24012
25252
  this.loadOnboardingMakerCheckers();
24013
25253
 
24014
25254
  });
@@ -24016,7 +25256,7 @@ export class SfIEvents extends LitElement {
24016
25256
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-docs')?.addEventListener('click', async () => {
24017
25257
 
24018
25258
  this.myOnboardingTab = this.TAB_DOCS;
24019
- this.renderOnboardingTabs();
25259
+ await this.renderOnboardingTabs();
24020
25260
  this.loadOnboardingDocs();
24021
25261
 
24022
25262
  });
@@ -24024,7 +25264,7 @@ export class SfIEvents extends LitElement {
24024
25264
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-duedates')?.addEventListener('click', async () => {
24025
25265
 
24026
25266
  this.myOnboardingTab = this.TAB_DUEDATES;
24027
- this.renderOnboardingTabs();
25267
+ await this.renderOnboardingTabs();
24028
25268
  this.loadOnboardingDuedates();
24029
25269
 
24030
25270
  });
@@ -24032,7 +25272,7 @@ export class SfIEvents extends LitElement {
24032
25272
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-alertschedules')?.addEventListener('click', async () => {
24033
25273
 
24034
25274
  this.myOnboardingTab = this.TAB_ALERTSCHEDULES;
24035
- this.renderOnboardingTabs();
25275
+ await this.renderOnboardingTabs();
24036
25276
  this.loadOnboardingAlertSchedules();
24037
25277
 
24038
25278
  });
@@ -24040,7 +25280,7 @@ export class SfIEvents extends LitElement {
24040
25280
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-activations')?.addEventListener('click', async () => {
24041
25281
 
24042
25282
  this.myOnboardingTab = this.TAB_ACTIVATIONS;
24043
- this.renderOnboardingTabs();
25283
+ await this.renderOnboardingTabs();
24044
25284
  this.loadOnboardingActivations();
24045
25285
 
24046
25286
  });
@@ -24048,7 +25288,7 @@ export class SfIEvents extends LitElement {
24048
25288
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-invalidations')?.addEventListener('click', async () => {
24049
25289
 
24050
25290
  this.myOnboardingTab = this.TAB_INVALIDATION;
24051
- this.renderOnboardingTabs();
25291
+ await this.renderOnboardingTabs();
24052
25292
  this.loadOnboardingInvalidations();
24053
25293
 
24054
25294
  });
@@ -24056,7 +25296,7 @@ export class SfIEvents extends LitElement {
24056
25296
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-triggers')?.addEventListener('click', async () => {
24057
25297
 
24058
25298
  this.myOnboardingTab = this.TAB_TRIGGERS;
24059
- this.renderOnboardingTabs();
25299
+ await this.renderOnboardingTabs();
24060
25300
  this.loadOnboardingTriggers();
24061
25301
 
24062
25302
  });
@@ -24064,7 +25304,7 @@ export class SfIEvents extends LitElement {
24064
25304
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-extensions')?.addEventListener('click', async () => {
24065
25305
 
24066
25306
  this.myOnboardingTab = this.TAB_EXTENSIONS;
24067
- this.renderOnboardingTabs();
25307
+ await this.renderOnboardingTabs();
24068
25308
  this.loadOnboardingExtensions();
24069
25309
 
24070
25310
  });
@@ -24072,7 +25312,7 @@ export class SfIEvents extends LitElement {
24072
25312
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-internalcontrols')?.addEventListener('click', async () => {
24073
25313
 
24074
25314
  this.myOnboardingTab = this.TAB_INTERNALCONTROLS;
24075
- this.renderOnboardingTabs();
25315
+ await this.renderOnboardingTabs();
24076
25316
  this.loadOnboardingInternalControls();
24077
25317
 
24078
25318
  });
@@ -24080,7 +25320,7 @@ export class SfIEvents extends LitElement {
24080
25320
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-reportedlocations')?.addEventListener('click', async () => {
24081
25321
 
24082
25322
  this.myOnboardingTab = this.TAB_REPORTEDLOCATIONS;
24083
- this.renderOnboardingTabs();
25323
+ await this.renderOnboardingTabs();
24084
25324
  this.loadOnboardingReportedLocations();
24085
25325
 
24086
25326
  });
@@ -28140,90 +29380,90 @@ export class SfIEvents extends LitElement {
28140
29380
 
28141
29381
  }
28142
29382
 
28143
- uploadTriggersMapping = async (data: any) => {
28144
- await this.uploadOnboardingMapping(data, 'triggers');
29383
+ uploadTriggersMapping = async (data: any, statuteids: string[]) => {
29384
+ await this.uploadOnboardingMapping(data, 'triggers', statuteids);
28145
29385
  }
28146
29386
 
28147
- uploadInternalControlsMapping = async (data: any) => {
28148
- await this.uploadOnboardingMapping(data, 'internalcontrols');
29387
+ uploadInternalControlsMapping = async (data: any, statuteids: string[]) => {
29388
+ await this.uploadOnboardingMapping(data, 'internalcontrols', statuteids);
28149
29389
  }
28150
29390
 
28151
- uploadReportedLocationsMapping = async (data: any) => {
28152
- await this.uploadOnboardingMapping(data, 'reportedlocations');
29391
+ uploadReportedLocationsMapping = async (data: any, statuteids: string[]) => {
29392
+ await this.uploadOnboardingMapping(data, 'reportedlocations', statuteids);
28153
29393
  }
28154
29394
 
28155
- uploadAlertSchedulesMapping = async (data: any) => {
28156
- await this.uploadOnboardingMapping(data, 'alertschedules');
29395
+ uploadAlertSchedulesMapping = async (data: any, statuteids: string[]) => {
29396
+ await this.uploadOnboardingMapping(data, 'alertschedules', statuteids);
28157
29397
  }
28158
29398
 
28159
- uploadActivationsMapping = async (data: any) => {
28160
- await this.uploadOnboardingMapping(data, 'activations');
29399
+ uploadActivationsMapping = async (data: any, statuteids: string[]) => {
29400
+ await this.uploadOnboardingMapping(data, 'activations', statuteids);
28161
29401
  }
28162
29402
 
28163
- uploadInvalidationsMapping = async (data: any) => {
28164
- await this.uploadOnboardingMapping(data, 'invalidations');
29403
+ uploadInvalidationsMapping = async (data: any, statuteids: string[]) => {
29404
+ await this.uploadOnboardingMapping(data, 'invalidations', statuteids);
28165
29405
  }
28166
29406
 
28167
- uploadDuedatesMapping = async (data: any) => {
28168
- await this.uploadOnboardingMapping(data, 'duedates');
29407
+ uploadDuedatesMapping = async (data: any, statuteids: string[]) => {
29408
+ await this.uploadOnboardingMapping(data, 'duedates', statuteids);
28169
29409
 
28170
29410
  }
28171
29411
 
28172
- uploadExtensionsMapping = async (data: any) => {
28173
- await this.uploadOnboardingMapping(data, 'extensions');
29412
+ uploadExtensionsMapping = async (data: any, statuteids: string[]) => {
29413
+ await this.uploadOnboardingMapping(data, 'extensions', statuteids);
28174
29414
 
28175
29415
  }
28176
29416
 
28177
- uploadApproversMapping = async (data: any) => {
28178
- await this.uploadOnboardingMapping(data, 'approvers');
29417
+ uploadApproversMapping = async (data: any, statuteids: string[]) => {
29418
+ await this.uploadOnboardingMapping(data, 'approvers', statuteids);
28179
29419
 
28180
29420
  }
28181
29421
 
28182
- uploadFunctionHeadsMapping = async (data: any) => {
28183
- await this.uploadOnboardingMapping(data, 'functionheads');
29422
+ uploadFunctionHeadsMapping = async (data: any, statuteids: string[]) => {
29423
+ await this.uploadOnboardingMapping(data, 'functionheads', statuteids);
28184
29424
  }
28185
29425
 
28186
- uploadMakerCheckersMapping = async (data: any) => {
28187
- await this.uploadOnboardingMapping(data, 'makercheckers');
29426
+ uploadMakerCheckersMapping = async (data: any, statuteids: string[]) => {
29427
+ await this.uploadOnboardingMapping(data, 'makercheckers', statuteids);
28188
29428
  }
28189
29429
 
28190
- uploadDocsMapping = async (data: any) => {
28191
- await this.uploadOnboardingMapping(data, 'docs');
29430
+ uploadDocsMapping = async (data: any, statuteids: string[]) => {
29431
+ await this.uploadOnboardingMapping(data, 'docs', statuteids);
28192
29432
 
28193
29433
  }
28194
29434
 
28195
- uploadAuditorsMapping = async (data: any) => {
28196
- await this.uploadOnboardingMapping(data, 'auditors');
29435
+ uploadAuditorsMapping = async (data: any, statuteids: string[]) => {
29436
+ await this.uploadOnboardingMapping(data, 'auditors', statuteids);
28197
29437
 
28198
29438
  }
28199
29439
 
28200
- uploadViewersMapping = async (data: any) => {
28201
- await this.uploadOnboardingMapping(data, 'viewers');
29440
+ uploadViewersMapping = async (data: any, statuteids: string[]) => {
29441
+ await this.uploadOnboardingMapping(data, 'viewers', statuteids);
28202
29442
 
28203
29443
  }
28204
29444
 
28205
- uploadReportersMapping = async (data: any) => {
28206
- await this.uploadOnboardingMapping(data, 'reporters');
29445
+ uploadReportersMapping = async (data: any, statuteids: string[]) => {
29446
+ await this.uploadOnboardingMapping(data, 'reporters', statuteids);
28207
29447
  }
28208
29448
 
28209
- uploadTagsMapping = async (data: any) => {
28210
- await this.uploadOnboardingMapping(data, 'tags');
29449
+ uploadTagsMapping = async (data: any, statuteids: string[]) => {
29450
+ await this.uploadOnboardingMapping(data, 'tags', statuteids);
28211
29451
  }
28212
29452
 
28213
- uploadFunctionsMapping = async (data: any) => {
28214
- await this.uploadOnboardingMapping(data, 'functions');
29453
+ uploadFunctionsMapping = async (data: any, statuteids: string[]) => {
29454
+ await this.uploadOnboardingMapping(data, 'functions', statuteids);
28215
29455
  }
28216
29456
 
28217
- uploadLocationsMapping = async (data: any) => {
28218
- await this.uploadOnboardingMapping(data, 'locations');
29457
+ uploadLocationsMapping = async (data: any, statuteids: string[]) => {
29458
+ await this.uploadOnboardingMapping(data, 'locations', statuteids);
28219
29459
  }
28220
29460
 
28221
- uploadEntitiesMapping = async (data: any) => {
28222
- await this.uploadOnboardingMapping(data, 'entities');
29461
+ uploadEntitiesMapping = async (data: any, statuteids: string[]) => {
29462
+ await this.uploadOnboardingMapping(data, 'entities', statuteids);
28223
29463
  }
28224
29464
 
28225
- uploadCountriesMapping = async (data: any) => {
28226
- await this.uploadOnboardingMapping(data, 'countries');
29465
+ uploadCountriesMapping = async (data: any, statuteids: string[]) => {
29466
+ await this.uploadOnboardingMapping(data, 'countries', statuteids);
28227
29467
  }
28228
29468
 
28229
29469
  uploadMappedSuspense = async (data: any, year: string) => {
@@ -28260,11 +29500,11 @@ export class SfIEvents extends LitElement {
28260
29500
 
28261
29501
  }
28262
29502
 
28263
- uploadOnboardingMapping = async (data: any, onboardingstep: string) => {
29503
+ uploadOnboardingMapping = async (data: any, onboardingstep: string, statuteids: string[]) => {
28264
29504
 
28265
29505
  //console.log('uploading..', data);
28266
29506
 
28267
- let url = "https://" + this.apiId + "/updatemappedonboarding";
29507
+ let url = "https://" + this.apiId + "/updatemappedonboarding1";
28268
29508
 
28269
29509
  // const body = {
28270
29510
  // "projectid": this.projectId,
@@ -28275,7 +29515,8 @@ export class SfIEvents extends LitElement {
28275
29515
  let body: any = {
28276
29516
  "projectid": this.projectId,
28277
29517
  "presigned": true,
28278
- "onboardingstep": onboardingstep
29518
+ "onboardingstep": onboardingstep,
29519
+ "statuteids": statuteids
28279
29520
  }
28280
29521
 
28281
29522
  let authorization: any = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -28290,7 +29531,8 @@ export class SfIEvents extends LitElement {
28290
29531
  body = {
28291
29532
  "projectid": this.projectId,
28292
29533
  "key": jsonRespose.key,
28293
- "onboardingstep": onboardingstep
29534
+ "onboardingstep": onboardingstep,
29535
+ "statuteids": statuteids
28294
29536
  }
28295
29537
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
28296
29538
  xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
@@ -28318,11 +29560,14 @@ export class SfIEvents extends LitElement {
28318
29560
  }
28319
29561
  }
28320
29562
 
28321
- uploadCompliancesMapping = async (data: any) => {
28322
-
28323
- //console.log('uploading..', data);
28324
- let url = "https://" + this.apiId + "/updatemappedcompliances";
29563
+ uploadCompliancesMapping = async (data: any, mappedstatutes: Array<any>) => {
28325
29564
 
29565
+ console.log('uploading..', data, mappedstatutes);
29566
+ let url = "https://" + this.apiId + "/updatemappedcompliances1";
29567
+ let statuteids = []
29568
+ for (let statuteObj of mappedstatutes) {
29569
+ statuteids.push(statuteObj.id);
29570
+ }
28326
29571
  let body: any = {
28327
29572
  "projectid": this.projectId,
28328
29573
  "presigned": true,
@@ -28339,6 +29584,7 @@ export class SfIEvents extends LitElement {
28339
29584
 
28340
29585
  body = {
28341
29586
  "projectid": this.projectId,
29587
+ "statuteids": statuteids,
28342
29588
  "key": jsonRespose.key
28343
29589
  }
28344
29590
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -28361,28 +29607,35 @@ export class SfIEvents extends LitElement {
28361
29607
 
28362
29608
  uploadStatutesMapping = async (data: any) => {
28363
29609
 
28364
- //console.log('uploading..', data);
28365
- let url = "https://" + this.apiId + "/updatemappedstatutes";
28366
-
28367
- var searchstring = '';
29610
+ // console.log('uploading..', data);
29611
+ let url = "https://" + this.apiId + "/updatemappedstatutes1";
28368
29612
 
28369
- for (var i = 0; i < data.mappings.length; i++) {
29613
+ // var searchstring = '';
28370
29614
 
28371
- const dataItem = JSON.parse(data.mappings[i].data);
28372
- // //console.log(dataItem[3])
28373
- searchstring += dataItem[3];
28374
- if (i < (data.mappings.length - 1)) {
28375
- searchstring += '|';
28376
- }
29615
+ // for (var i = 0; i < data.mappings.length; i++) {
28377
29616
 
28378
- }
29617
+ // // const dataItem = JSON.parse(data.mappings[i].data);
29618
+ // const dataId = data.mappings[i].id;
29619
+ // // console.log(dataItem[3])
29620
+ // if (data.mappings[i].selected == true) {
29621
+ // searchstring += dataId;
29622
+ // // if (i < (data.mappings.length - 1)) {
29623
+ // searchstring += '|';
29624
+ // // }
29625
+ // }
28379
29626
 
28380
- // const body = {
29627
+ // }
29628
+ // if(searchstring.length > 0){
29629
+ // searchstring = searchstring.slice(0, -1);
29630
+ // }
29631
+ // const bodyUpload = {
28381
29632
  // "projectid": this.projectId,
28382
- // "data": JSON.stringify(data),
29633
+ // // "data": JSON.stringify(data),
28383
29634
  // "compliancessearchstring": searchstring
28384
29635
  // }
28385
29636
 
29637
+ // console.log("upload body", bodyUpload)
29638
+ // return;
28386
29639
 
28387
29640
  let body: any = {
28388
29641
  "projectid": this.projectId,
@@ -28400,7 +29653,6 @@ export class SfIEvents extends LitElement {
28400
29653
  body = {
28401
29654
  "projectid": this.projectId,
28402
29655
  "key": jsonRespose.key,
28403
- "compliancessearchstring": searchstring
28404
29656
  }
28405
29657
 
28406
29658
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -28610,7 +29862,7 @@ export class SfIEvents extends LitElement {
28610
29862
 
28611
29863
  uploadReview = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, approved: any, module: string = "compliance") => {
28612
29864
  let url = "https://" + this.apiId + "/uploadreview";
28613
- if(module == "rcmresource" && this.apiId2 != null) {
29865
+ if (module == "rcmresource" && this.apiId2 != null) {
28614
29866
  url = "https://" + this.apiId2 + "/uploadreview1";
28615
29867
  }
28616
29868
  const body = {
@@ -28712,7 +29964,7 @@ export class SfIEvents extends LitElement {
28712
29964
 
28713
29965
  uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "compliance", percentage: string = "100", makercheckers: any, reportedlocations: string = "") => {
28714
29966
  let url = "https://" + this.apiId + "/uploadreport";
28715
- if(module == "rcmresource" && this.apiId2 != null) {
29967
+ if (module == "rcmresource" && this.apiId2 != null) {
28716
29968
  url = "https://" + this.apiId2 + "/uploadreport";
28717
29969
  }
28718
29970
  let yearStr = this.getFinancialYear(mmddyyyy)
@@ -29655,11 +30907,11 @@ export class SfIEvents extends LitElement {
29655
30907
 
29656
30908
  }
29657
30909
 
29658
- fetchMappedCompliances = async () => {
30910
+ fetchMappedCompliances = async (statuteids = []) => {
29659
30911
 
29660
- let url = "https://" + this.apiId + "/getmappedcompliances";
30912
+ let url = "https://" + this.apiId + "/getmappedcompliances1";
29661
30913
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
29662
- const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
30914
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "statuteids": statuteids }, url, this._SfLoader, authorization)) as any;
29663
30915
  this._SfLoader.innerHTML = '';
29664
30916
  if (xhr.status == 200) {
29665
30917
 
@@ -29841,7 +31093,7 @@ export class SfIEvents extends LitElement {
29841
31093
 
29842
31094
  fetchSerializedMapping = async (onboardingstep: string) => {
29843
31095
 
29844
- const url = "https://" + this.apiId + "/getmappedserializedonboarding";
31096
+ const url = "https://" + this.apiId + "/getmappedserializedonboarding1";
29845
31097
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
29846
31098
  const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization)) as any;
29847
31099
  this._SfLoader.innerHTML = '';
@@ -29950,129 +31202,129 @@ export class SfIEvents extends LitElement {
29950
31202
 
29951
31203
  }
29952
31204
 
29953
- fetchMappedTriggers = async () => {
31205
+ fetchMappedTriggers = async (statuteids = []) => {
29954
31206
 
29955
- return (await this.fetchMappedOnboarding('triggers'));
31207
+ return (await this.fetchMappedOnboarding('triggers', statuteids));
29956
31208
 
29957
31209
  }
29958
31210
 
29959
- fetchMappedInternalControls = async () => {
31211
+ fetchMappedInternalControls = async (statuteids = []) => {
29960
31212
 
29961
- return (await this.fetchMappedOnboarding('internalcontrols'));
31213
+ return (await this.fetchMappedOnboarding('internalcontrols', statuteids));
29962
31214
 
29963
31215
  }
29964
31216
 
29965
- fetchMappedReportedLocations = async () => {
31217
+ fetchMappedReportedLocations = async (statuteids = []) => {
29966
31218
 
29967
- return (await this.fetchMappedOnboarding('reportedlocations'));
31219
+ return (await this.fetchMappedOnboarding('reportedlocations', statuteids));
29968
31220
 
29969
31221
  }
29970
31222
 
29971
- fetchMappedAlertSchedules = async () => {
31223
+ fetchMappedAlertSchedules = async (statuteids = []) => {
29972
31224
 
29973
- return (await this.fetchMappedOnboarding('alertschedules'));
31225
+ return (await this.fetchMappedOnboarding('alertschedules', statuteids));
29974
31226
 
29975
31227
  }
29976
31228
 
29977
- fetchMappedActivations = async () => {
31229
+ fetchMappedActivations = async (statuteids = []) => {
29978
31230
 
29979
- return (await this.fetchMappedOnboarding('activations'));
31231
+ return (await this.fetchMappedOnboarding('activations', statuteids));
29980
31232
 
29981
31233
  }
29982
31234
 
29983
- fetchMappedInvalidations = async () => {
31235
+ fetchMappedInvalidations = async (statuteids = []) => {
29984
31236
 
29985
- return (await this.fetchMappedOnboarding('invalidations'));
31237
+ return (await this.fetchMappedOnboarding('invalidations', statuteids));
29986
31238
 
29987
31239
  }
29988
31240
 
29989
- fetchMappedExtensions = async () => {
31241
+ fetchMappedExtensions = async (statuteids = []) => {
29990
31242
 
29991
- return (await this.fetchMappedOnboarding('extensions'));
31243
+ return (await this.fetchMappedOnboarding('extensions', statuteids));
29992
31244
 
29993
31245
  }
29994
31246
 
29995
- fetchMappedDuedates = async () => {
31247
+ fetchMappedDuedates = async (statuteids = []) => {
29996
31248
 
29997
- return (await this.fetchMappedOnboarding('duedates'));
31249
+ return (await this.fetchMappedOnboarding('duedates', statuteids));
29998
31250
 
29999
31251
  }
30000
31252
 
30001
- fetchMappedReporters = async () => {
31253
+ fetchMappedReporters = async (statuteids = []) => {
30002
31254
 
30003
- return (await this.fetchMappedOnboarding('reporters'));
31255
+ return (await this.fetchMappedOnboarding('reporters', statuteids));
30004
31256
 
30005
31257
  }
30006
31258
 
30007
- fetchMappedApprovers = async () => {
31259
+ fetchMappedApprovers = async (statuteids = []) => {
30008
31260
 
30009
- return (await this.fetchMappedOnboarding('approvers'));
31261
+ return (await this.fetchMappedOnboarding('approvers', statuteids));
30010
31262
 
30011
31263
  }
30012
31264
 
30013
- fetchMappedFunctionHeads = async () => {
31265
+ fetchMappedFunctionHeads = async (statuteids = []) => {
30014
31266
 
30015
- return (await this.fetchMappedOnboarding('functionheads'));
31267
+ return (await this.fetchMappedOnboarding('functionheads', statuteids));
30016
31268
 
30017
31269
  }
30018
31270
 
30019
- fetchMappedMakerCheckers = async () => {
31271
+ fetchMappedMakerCheckers = async (statuteids = []) => {
30020
31272
 
30021
- return (await this.fetchMappedOnboarding('makercheckers'));
31273
+ return (await this.fetchMappedOnboarding('makercheckers', statuteids));
30022
31274
 
30023
31275
  }
30024
31276
 
30025
- fetchMappedDocs = async () => {
31277
+ fetchMappedDocs = async (statuteids = []) => {
30026
31278
 
30027
- return (await this.fetchMappedOnboarding('docs'));
31279
+ return (await this.fetchMappedOnboarding('docs', statuteids));
30028
31280
 
30029
31281
  }
30030
31282
 
30031
- fetchMappedAuditors = async () => {
31283
+ fetchMappedAuditors = async (statuteids = []) => {
30032
31284
 
30033
- return (await this.fetchMappedOnboarding('auditors'));
31285
+ return (await this.fetchMappedOnboarding('auditors', statuteids));
30034
31286
 
30035
31287
  }
30036
31288
 
30037
- fetchMappedViewers = async () => {
31289
+ fetchMappedViewers = async (statuteids = []) => {
30038
31290
 
30039
- return (await this.fetchMappedOnboarding('viewers'));
31291
+ return (await this.fetchMappedOnboarding('viewers', statuteids));
30040
31292
 
30041
31293
  }
30042
31294
 
30043
- fetchMappedTags = async () => {
31295
+ fetchMappedTags = async (statuteids = []) => {
30044
31296
 
30045
- return (await this.fetchMappedOnboarding('tags'));
31297
+ return (await this.fetchMappedOnboarding('tags', statuteids));
30046
31298
 
30047
31299
  }
30048
31300
 
30049
- fetchMappedLocations = async () => {
31301
+ fetchMappedLocations = async (statuteids = []) => {
30050
31302
 
30051
- return (await this.fetchMappedOnboarding('locations'));
31303
+ return (await this.fetchMappedOnboarding('locations', statuteids));
30052
31304
 
30053
31305
  }
30054
31306
 
30055
- fetchMappedFunctions = async () => {
31307
+ fetchMappedFunctions = async (statuteids = []) => {
30056
31308
 
30057
- return (await this.fetchMappedOnboarding('functions'));
31309
+ return (await this.fetchMappedOnboarding('functions', statuteids));
30058
31310
  }
30059
31311
 
30060
- fetchMappedEntities = async () => {
31312
+ fetchMappedEntities = async (statuteids = []) => {
30061
31313
 
30062
- return (await this.fetchMappedOnboarding('entities'));
31314
+ return (await this.fetchMappedOnboarding('entities', statuteids));
30063
31315
  }
30064
31316
 
30065
- fetchMappedCountries = async () => {
31317
+ fetchMappedCountries = async (statuteids = []) => {
30066
31318
 
30067
- return (await this.fetchMappedOnboarding('countries'));
31319
+ return (await this.fetchMappedOnboarding('countries', statuteids));
30068
31320
 
30069
31321
  }
30070
31322
 
30071
- fetchMappedOnboarding = async (onboardingstep: string) => {
31323
+ fetchMappedOnboarding = async (onboardingstep: string, statuteids: string[]) => {
30072
31324
 
30073
- const url = "https://" + this.apiId + "/getmappedonboarding";
31325
+ const url = "https://" + this.apiId + "/getmappedonboarding1";
30074
31326
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
30075
- const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization)) as any;
31327
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep, "statuteids": statuteids }, url, this._SfLoader, authorization)) as any;
30076
31328
  this._SfLoader.innerHTML = '';
30077
31329
  if (xhr.status == 200) {
30078
31330
 
@@ -30081,7 +31333,17 @@ export class SfIEvents extends LitElement {
30081
31333
  resultPresigned = {};
30082
31334
  resultPresigned.data = {};
30083
31335
  let tempObj = await this.fetchPresignedUrl(jsRespose.signedUrlGet)
30084
- resultPresigned.data.mappings = (tempObj.mappings != null) ? tempObj : { mappings: [] };
31336
+ let tempArr = [];
31337
+ for (let statuteid of statuteids) {
31338
+ for (let foundObjId of Object.keys(tempObj[statuteid] ?? [])) {
31339
+ let tempPushObj = tempObj[statuteid][foundObjId];
31340
+ tempPushObj.id = foundObjId.split(';')[foundObjId.split(';').length - 1];
31341
+ tempPushObj.statuteid = statuteid;
31342
+ tempArr.push(tempPushObj);
31343
+ }
31344
+ }
31345
+ // resultPresigned.data.mappings = (tempObj.mappings != null) ? tempObj : { mappings: [] };
31346
+ resultPresigned.data.mappings = tempArr;
30085
31347
  console.log('resultPresigned onboarding1', tempObj);
30086
31348
  console.log('resultPresigned onboarding', resultPresigned);
30087
31349
  // await this.fetchPresignedUrlDelete(jsRespose.signedUrlDelete)
@@ -30125,7 +31387,7 @@ export class SfIEvents extends LitElement {
30125
31387
 
30126
31388
  fetchMappedStatutes = async () => {
30127
31389
 
30128
- let url = "https://" + this.apiId + "/getmappedstatutes";
31390
+ let url = "https://" + this.apiId + "/getmappedstatutes1";
30129
31391
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
30130
31392
  const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
30131
31393
  this._SfLoader.innerHTML = '';
@@ -30147,6 +31409,30 @@ export class SfIEvents extends LitElement {
30147
31409
 
30148
31410
  }
30149
31411
 
31412
+ fetchMappedStatutesList = async () => {
31413
+
31414
+ let url = "https://" + this.apiId + "/getmappedstatuteslist";
31415
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
31416
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
31417
+ this._SfLoader.innerHTML = '';
31418
+ if (xhr.status == 200) {
31419
+
31420
+ const jsonRespose = JSON.parse(xhr.responseText);
31421
+ //console.log(jsonRespose);
31422
+ return jsonRespose.data;
31423
+
31424
+ } else {
31425
+ if (xhr.status == 401) {
31426
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
31427
+ this.dispatchEvent(changeEvent);
31428
+ }
31429
+ const jsonRespose = JSON.parse(xhr.responseText);
31430
+ this.setError(jsonRespose.error);
31431
+
31432
+ }
31433
+
31434
+ }
31435
+
30150
31436
  fetchCreateRcmJob = async (complianceid: string, data: any, triggerDate: string, triggerMessage: string, projects: any) => {
30151
31437
 
30152
31438
  data.trigger = {};