sf-i-events 1.0.977 → 1.0.979

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
 
@@ -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);
@@ -20169,6 +20208,63 @@ export class SfIEvents extends LitElement {
20169
20208
 
20170
20209
  }
20171
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
+
20172
20268
  getDataValue = (jsonData: any, id: string) => {
20173
20269
 
20174
20270
  let ret: any = null;
@@ -20203,7 +20299,7 @@ export class SfIEvents extends LitElement {
20203
20299
 
20204
20300
  }
20205
20301
 
20206
- 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>) => {
20207
20303
 
20208
20304
  const process = async () => {
20209
20305
  const tableRowArr = (divElement as HTMLDivElement).querySelectorAll('.tablerow') as NodeListOf<HTMLTableRowElement>;
@@ -20218,33 +20314,85 @@ export class SfIEvents extends LitElement {
20218
20314
  let updatedRows = [];
20219
20315
  let jsonArr = [];
20220
20316
  if (uploadBlock < 0) {
20221
- for (var i = 0; i < checkboxArr.length; i++) {
20317
+ if (mappedStatutes.length == 0) {
20318
+ for (var i = 0; i < checkboxArr.length; i++) {
20222
20319
 
20223
- //console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
20320
+ //console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
20321
+ if (checkboxArr[i].checked !== true) {
20322
+ continue;
20323
+ }
20224
20324
 
20225
- if ((tableRowArr[i] as HTMLTableRowElement).style.display == 'none') {
20226
- } else {
20227
- updatedRows.push((statuteArr[i] as SfIElasticText).text);
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
+ } */
20342
+
20343
+ jsonArr.push(dataToBePushed)
20228
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 });
20229
20349
 
20230
- 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[] };
20231
- for (var j = 0; j < extraFields.length; j++) {
20232
- const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20233
- const value = inputArr[i].getValues();
20234
- // //console.log('value', value);
20235
- dataToBePushed.extraFields.push(value);
20236
- if (j === 0) {
20237
- const fields = inputArr[i].getFields();
20238
- 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
+ }
20239
20391
  }
20240
20392
  }
20241
20393
 
20242
- jsonArr.push(dataToBePushed)
20394
+ await uploadFunction(jsonObj, mappedStatutes);
20243
20395
  }
20244
- //console.log('jsonArr', jsonArr);
20245
- //console.log('updatedRows', updatedRows);
20246
- const batchNum = new Date().getTime();
20247
- await uploadFunction({ "searchstring": searchString, "mappings": jsonArr, "batch": batchNum, "updatedrows": updatedRows });
20248
20396
 
20249
20397
  } else {
20250
20398
 
@@ -20261,7 +20409,7 @@ export class SfIEvents extends LitElement {
20261
20409
 
20262
20410
  if ((statuteArr[k] as SfIElasticText) != null) {
20263
20411
 
20264
- 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[] };
20265
20413
  for (var j = 0; j < extraFields.length; j++) {
20266
20414
  const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
20267
20415
  const value = inputArr[k].getValues();
@@ -20287,7 +20435,7 @@ export class SfIEvents extends LitElement {
20287
20435
 
20288
20436
  }
20289
20437
 
20290
- if (!saveInBackground) refreshFunction();
20438
+ if (!saveInBackground) refreshFunction(mappedStatutes);
20291
20439
  }
20292
20440
 
20293
20441
  if (this.disablesave == "yes") {
@@ -20312,14 +20460,54 @@ export class SfIEvents extends LitElement {
20312
20460
 
20313
20461
  }
20314
20462
 
20315
- 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) => {
20316
20464
 
20317
20465
  async function process() {
20318
20466
 
20319
- //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
+ }
20320
20497
 
20321
- await uploadFunction(mapping);
20322
- 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);
20323
20511
  }
20324
20512
 
20325
20513
  if (this.disablesave == "yes") {
@@ -21497,7 +21685,7 @@ export class SfIEvents extends LitElement {
21497
21685
 
21498
21686
  const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
21499
21687
  buttonSave?.addEventListener('click', async () => {
21500
- await this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, false);
21688
+ await this.saveTagging(taggingArray.data.mappings, [], uploadFunction, refreshFunction, false, colName);
21501
21689
  });
21502
21690
 
21503
21691
  const buttonCancel = (divElement as HTMLDivElement).querySelector('.button-cancel') as HTMLButtonElement;
@@ -21541,145 +21729,1113 @@ export class SfIEvents extends LitElement {
21541
21729
  this.changedOnboardingItemIds = []
21542
21730
  }
21543
21731
 
21544
- 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>) => {
21545
- console.log('cols1', jsonData);
21546
- // console.log('cols', jsonData[0].data.cols);
21547
- //console.log('divelement', divElement);
21548
- //console.log('jsonData', jsonData);
21549
- //console.log('cursor', cursor);
21550
- //console.log('fetch', fetchFunction);
21551
- //console.log('searchstring', searchString);
21552
- //console.log('subfiltervalue', subfilter);
21553
-
21554
- const arrCompliancesFrequencies: any = {};
21555
-
21556
- 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);
21557
21745
 
21558
21746
  this.selectedCbs = [];
21559
21747
 
21560
- let colCountry = -1;
21561
- let colState = -1;
21562
- let colSubcategory = -1;
21563
- let colStatute = -1;
21564
-
21565
- const unfilteredDict: any[] = [];
21566
-
21567
- var html = '';
21568
-
21569
- html += '<div>';
21570
- html += '<h3 part="results-title">Total Items (' + found + ')</h3>';
21571
- html += '<h4 id="span-filtered" part="results-title"></h4>'
21572
- html += '<h4 id="span-extra-filled" part="results-title"></h4>'
21573
- html += '</div>';
21574
-
21575
-
21576
- html += '<div class="d-flex justify-between align-center left-sticky flex-wrap mb-20">';
21577
-
21578
- html += '<div id="div-subfiltered"></div>';
21579
- html += '<div id="scroll-overlay" part="onboarding-scroll-overlay" class="pos-fixed-scroll justify-center align-center">';
21580
- html += '<div id="scroll-overlay-left" class="mr-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_left_alt</span></button></div>';
21581
- html += '<div id="scroll-overlay-right" class="ml-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_right_alt</span></button></div>';
21582
- html += '</div>';
21583
-
21584
- html += '<div id="detail-overlay" part="onboarding-detail-overlay" class="pos-fixed justify-center align-center hide">';
21585
- html += '<div class="cover-slide"></div>';
21586
- html += '<div class="detail-container p-10">';
21587
- html += '<div class="d-flex justify-between align-center mb-20">';
21588
- html += '<div part="results-title">Row Details</div>';
21589
- html += '<button part="button-icon" class="detail-close"><span class="material-symbols-outlined">close</span></button>';
21590
- html += '</div>';
21591
- html += '<div id="detail-overlay-list">';
21592
- html += '</div>';
21593
- html += '</div>';
21594
- html += '</div>';
21595
-
21596
- html += '<div class="d-flex align-center">';
21597
- html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
21598
- html += '<div class="mr-10">';
21599
- 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>'
21600
- 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>'
21601
- html += '</div>';
21602
- html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
21603
- html += '</div>';
21604
-
21605
- html += '</div>';
21606
-
21607
- html += '<table id="table-data">';
21748
+ for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
21608
21749
 
21609
- html += '<thead>';
21610
- html += '<th part="td-head" class="td-head">'
21611
- // html += 'Select';
21612
- html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
21613
- html += '</th>'
21614
- html += '<th part="td-head" class="td-head">'
21615
- html += '<div>View</div>';
21616
- html += '</th>'
21617
- if (extraFieldPosition === 0) {
21618
- for (var i = 0; i < extraFields.length; i++) {
21619
- html += '<th part="td-head" class="td-head">'
21620
- html += extraFields[i];
21621
- html += '</th>'
21750
+ if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] == null) {
21751
+ taggingArray.data.mappings.mappings.splice(i, 1)
21622
21752
  }
21623
21753
  }
21624
- if (colName.toLowerCase() == "compliances") {
21625
- html += '<th part="td-head" class="td-head">'
21626
- html += 'Proposed Users';
21627
- html += '</th>'
21628
- }
21629
- html += '<th part="td-head" class="td-head">'
21630
- html += 'Id';
21631
- html += '</th>'
21754
+ let mandatoryPresent = true;
21755
+ console.log('mandatoryFields', mandatoryFields);
21756
+ for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
21632
21757
 
21633
- // for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
21758
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21634
21759
 
21635
- // if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
21636
- // html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
21637
- // html += JSON.parse(jsonData[0].data.cols)[j]
21638
- // html += '</th>'
21639
- // }
21640
21760
 
21641
- // }
21761
+ if (taggingArray.data.mappings.mappings[j][mandatoryFields[i]] == null) {
21762
+ console.log('mandatory not found', mandatoryFields[i])
21763
+ mandatoryPresent = false;
21764
+ }
21642
21765
 
21643
- for (var j = 0; j < jsonData[0].cols.length; j++) {
21644
- console.log('jsoncols', JSON.parse(jsonData[0].data.cols), jsonData[0].cols.length, j)
21645
- html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == (JSON.parse(jsonData[0].data.cols)[j] ?? "").toLowerCase() ? 'left-sticky' : '') + '">'
21646
- // html += jsonData[0].cols[j]
21647
- html += '</th>'
21766
+ }
21648
21767
 
21649
21768
  }
21650
21769
 
21651
- if (extraFieldPosition === 1) {
21652
- for (var i = 0; i < extraFields.length; i++) {
21653
- html += '<th part="td-head" class="td-head">'
21654
- html += extraFields[i];
21655
- html += '</th>'
21770
+ var taggedIds = []
21771
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21772
+ if (taggingArray.data.mappings.mappings[j] != null) {
21773
+ if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
21774
+ if (taggedIds.indexOf(taggingArray.data.mappings.mappings[j].id) < 0) {
21775
+ taggedIds.push(taggingArray.data.mappings.mappings[j].id)
21776
+ }
21777
+ }
21656
21778
  }
21657
21779
  }
21658
- html += '</thead>'
21659
-
21660
- //console.log('colstate', JSON.parse(jsonData[0].data.cols));
21661
-
21662
- for (var i = 0; i < JSON.parse(jsonData[0].data.cols).length; i++) {
21663
- if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "country") {
21664
- console.log('colstate country', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
21665
- colCountry = i;
21666
- }
21667
- if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "state") {
21668
- //console.log('colstate state', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
21669
- colState = i;
21780
+ if(sourceMapping.data == null){
21781
+ sourceMapping = {data:{mappings:Object.values(sourceArray.data.mappings.mappings)}}
21782
+ }
21783
+ for (var i = 0; i < (sourceMapping.data?.mappings ?? []).length; i++) {
21784
+ let flagMatch = false;
21785
+ if (sourceArray.data.mappings.mappings[sourceMapping.data.mappings[i].id] == null) {
21786
+ continue;
21670
21787
  }
21671
- if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "subcategory") {
21672
- //console.log('colstate subcategory', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
21673
- colSubcategory = i;
21788
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21789
+ if (taggingArray.data.mappings.mappings[j] != null) {
21790
+ if (sourceMapping.data.mappings[i].id == taggingArray.data.mappings.mappings[j].id) {
21791
+ let flagMatchObj = true;
21792
+ for (let objKey of compareFields) {
21793
+ if (sourceMapping.data.mappings[i][objKey] !== taggingArray.data.mappings.mappings[j][objKey] && taggingArray.data.mappings.mappings[j][objKey] != null) {
21794
+ console.log('Flag Mismatch', objKey, sourceMapping.data.mappings[i][objKey], taggingArray.data.mappings.mappings[j][objKey])
21795
+ flagMatchObj = false;
21796
+ break;
21797
+ }
21798
+ }
21799
+ if (flagMatchObj == true) {
21800
+ flagMatch = true;
21801
+ continue;
21802
+ }
21803
+ }
21804
+ }
21674
21805
  }
21675
- if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == statuteColName) {
21676
- //console.log('colstate statute', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
21677
- colStatute = i;
21806
+ if (!flagMatch) {
21807
+ let objToPush: any = sourceMapping.data.mappings[i]
21808
+ for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
21809
+ objToPush[mandatoryFields[i]] = ""
21810
+ }
21811
+ taggingArray.data.mappings.mappings.push(objToPush);
21678
21812
  }
21679
21813
  }
21680
21814
 
21681
- //var countExtra0 = 0;
21682
- var countextra = [];
21815
+
21816
+ var tagged = 0;
21817
+ var changed = 0;
21818
+ var total = 0;
21819
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
21820
+ if (taggingArray.data.mappings.mappings[j] != null) {
21821
+ if (sourceMapping.data == null) {
21822
+ if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
21823
+ total++;
21824
+ let tagStr = ""
21825
+ for (let col of compareFields) {
21826
+ tagStr += `${taggingArray.data.mappings.mappings[j][col]};`
21827
+ }
21828
+ tagStr.slice(0, -1)
21829
+ if (this.changedOnboardingItemIds.length > 0) {
21830
+ let changedId = tagStr
21831
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
21832
+ changed++;
21833
+ }
21834
+ }
21835
+ if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
21836
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
21837
+ let flagNull = false;
21838
+ for (let mandatoryfield of mandatoryFields) {
21839
+ if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
21840
+ flagNull = true;
21841
+ break;
21842
+ }
21843
+ }
21844
+ if (flagNull) {
21845
+ continue
21846
+ }
21847
+ } else {
21848
+ continue;
21849
+ }
21850
+ }
21851
+ tagged++;
21852
+ }else{
21853
+ console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject)
21854
+ }
21855
+ } else {
21856
+ let flagFound = false;
21857
+ for (let sourceObj of sourceMapping.data.mappings) {
21858
+ if (sourceObj.id == taggingArray.data.mappings.mappings[j].id) {
21859
+ let flagEqual = true;
21860
+ for (let col of compareFields) {
21861
+ if (sourceObj[col] != taggingArray.data.mappings.mappings[j][col] && taggingArray.data.mappings.mappings[j][col] != null) {
21862
+ flagEqual = false;
21863
+ break;
21864
+ }
21865
+ }
21866
+ if (flagEqual) {
21867
+ flagFound = true;
21868
+ break;
21869
+ }
21870
+ }
21871
+ }
21872
+ if (flagFound) {
21873
+ let tagStr = ""
21874
+ for (let col of compareFields) {
21875
+ tagStr += `${taggingArray.data.mappings.mappings[j][col]};`
21876
+ }
21877
+ tagStr.slice(0, -1)
21878
+ total++;
21879
+ if (this.changedOnboardingItemIds.length > 0) {
21880
+ let changedId = tagStr
21881
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
21882
+ changed++;
21883
+ }
21884
+ }
21885
+ if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
21886
+ if (colName == "countries" || colName == "entities" || colName == "locations") {
21887
+ let flagNull = false;
21888
+ for (let mandatoryfield of mandatoryFields) {
21889
+ if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
21890
+ flagNull = true;
21891
+ break;
21892
+ }
21893
+ }
21894
+ if (flagNull) {
21895
+ continue
21896
+ }
21897
+ } else {
21898
+ continue;
21899
+ }
21900
+ }
21901
+ tagged++;
21902
+ } else {
21903
+ console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject)
21904
+ }
21905
+ }
21906
+ }
21907
+ }
21908
+ console.log('taggingarray3', JSON.stringify(taggingArray.data.mappings.mappings));
21909
+ console.log('tagged', tagged, 'total', total);
21910
+ const unfilteredDict: any[] = [];
21911
+ if (divElement == null) {
21912
+ return;
21913
+ }
21914
+ var html = '';
21915
+
21916
+ var showTable = true;
21917
+
21918
+ html += '<div class="d-flex justify-between flex-wrap align-center"> ';
21919
+
21920
+ var status = '';
21921
+ if (tagged < total) {
21922
+ status = '<span class="color-pending material-icons">pending</span>';
21923
+ } else {
21924
+ status = '<span class="color-done material-icons">check_circle</span>';
21925
+ }
21926
+
21927
+ var mandatoryStatus = '';
21928
+ if (!mandatoryPresent) {
21929
+ mandatoryStatus = '<span class="color-late-executed material-icons">error</span>&nbsp;&nbsp;Mandatory fields are not present';
21930
+ } else {
21931
+ mandatoryStatus = '<span class="color-done material-icons">check_circle</span>&nbsp;&nbsp;Mandatory fields are present';
21932
+ }
21933
+
21934
+ if (showTable) {
21935
+
21936
+ 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>');
21937
+
21938
+ } else {
21939
+
21940
+ 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>')
21941
+
21942
+ }
21943
+ if (changed > 0) {
21944
+ 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>')
21945
+ }
21946
+ 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>')
21947
+
21948
+ 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>')
21949
+
21950
+ html += '<div class="d-flex align-center">';
21951
+ html += '<div class="mr-10">';
21952
+ 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>'
21953
+
21954
+ html += '<div style="position: absolute; margin-top: 5px;">'
21955
+ 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>'
21956
+
21957
+ // console.log('jobs', jobs);
21958
+ 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>');
21959
+ html += '</div>';
21960
+ html += '</div>';
21961
+ 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>'
21962
+ 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>'
21963
+ html += '</div>';
21964
+
21965
+ html += '</div>';
21966
+
21967
+ html += '<div>';
21968
+ html += '<h4 id="span-filtered" part="results-title"></h4>'
21969
+ html += '<div id="div-subfiltered"></div>'
21970
+ html += '</div>';
21971
+
21972
+ html += '<br />';
21973
+
21974
+ var subfiltered = 0;
21975
+
21976
+ if (showTable) {
21977
+
21978
+ html += '<table id="table-data" class="mt-20" style="height: 200px">';
21979
+
21980
+ html += '<thead>';
21981
+ html += '<th part="td-head" class="td-head">'
21982
+ html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
21983
+ html += '</th>'
21984
+ for (var i = 0; i < extraFields.length; i++) {
21985
+ html += '<th part="td-head" class="td-head">'
21986
+ html += extraFields[i];
21987
+ html += '</th>'
21988
+ }
21989
+ html += '<th part="td-head" class="td-head">'
21990
+ html += colName;
21991
+ html += '</th>'
21992
+
21993
+ for (i = 0; i < uniqCols.length; i++) {
21994
+ html += '<th part="td-head" class="td-head">'
21995
+ html += uniqCols[i];
21996
+ html += '</th>'
21997
+ }
21998
+ for (i = 0; i < sourceCols.length; i++) {
21999
+ html += '<th part="td-head" class="td-head">'
22000
+ html += sourceCols[i];
22001
+ html += '</th>'
22002
+ }
22003
+
22004
+ html += '</thead>';
22005
+ html += '<tbody>';
22006
+ // console.log('changedIds', this.changedOnboardingItemIds);
22007
+ for (i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
22008
+
22009
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22010
+ console.log('compliance id', complianceid);
22011
+ var showSearch = false;
22012
+
22013
+ if (subfilter == "") {
22014
+ //console.log('showsearch true 1');
22015
+ showSearch = true;
22016
+ }
22017
+
22018
+ var classBg = "";
22019
+
22020
+ if (i % 2 === 0) {
22021
+ if (this.changedOnboardingItemIds.length > 0) {
22022
+ let changedId = ""
22023
+ for (let [k, col] of uniqCols.entries()) {
22024
+ // console.log('taggingarray rendered', i, col)
22025
+ changedId += taggingArray.data.mappings.mappings[i][col];
22026
+ if (k < (uniqCols.length - 1)) {
22027
+ changedId += ";"
22028
+ }
22029
+ }
22030
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
22031
+ classBg = 'td-light-selected';
22032
+ } else {
22033
+ classBg = 'td-light';
22034
+ }
22035
+ } else {
22036
+ classBg = 'td-light';
22037
+ }
22038
+ } else {
22039
+ if (this.changedOnboardingItemIds.length > 0) {
22040
+ let changedId = ""
22041
+ for (let [k, col] of uniqCols.entries()) {
22042
+ if (taggingArray.data.mappings.mappings[i] == null) {
22043
+ // console.log('id not found', i, taggingArray.data.mappings.mappings.length, sourceArray.data.mappings.mappings.length)
22044
+ }
22045
+ changedId += taggingArray.data.mappings.mappings[i][col];
22046
+ if (k < (uniqCols.length - 1)) {
22047
+ changedId += ";"
22048
+ }
22049
+ }
22050
+ if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
22051
+ classBg = 'td-dark-selected';
22052
+ } else {
22053
+ classBg = 'td-dark';
22054
+ }
22055
+ } else {
22056
+ classBg = 'td-dark';
22057
+ }
22058
+ }
22059
+
22060
+ html += '<tr class="" id="tablerow-' + i + '">';
22061
+
22062
+ 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>';
22063
+
22064
+ for (var j = 0; j < extraFields.length; j++) {
22065
+
22066
+ if (i < taggingArray.data.mappings.mappings.length) {
22067
+
22068
+ html += '<td part="td-body" class="' + classBg + '">';
22069
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">'
22070
+ 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>';
22071
+ html += '</div>';
22072
+ html += '</td>';
22073
+ } else {
22074
+
22075
+ html += '<td part="td-body" class="' + classBg + '">';
22076
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22077
+ 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>';
22078
+ html += '</div>';
22079
+ html += '</td>';
22080
+ }
22081
+
22082
+
22083
+ }
22084
+
22085
+ html += '<td class="td-body ' + classBg + '" part="td-key">'
22086
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22087
+ if (apiIdDropdown.length > 0) {
22088
+ if (anotherProjection != null) {
22089
+ 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>';
22090
+ } else {
22091
+ 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>';
22092
+ }
22093
+
22094
+ } else {
22095
+
22096
+ if (colName.toLowerCase() == "internalcontrols") {
22097
+ html += '<textarea id="tags-' + i + '" type="text" part="input" class="tags-input"></textarea>';
22098
+ } else {
22099
+ html += '<input id="tags-' + i + '" type="text" part="input" class="tags-input"/>';
22100
+ }
22101
+
22102
+ }
22103
+ html += '</div>';
22104
+ html += '</td>'
22105
+
22106
+ for (var l = 0; l < uniqCols.length; l++) {
22107
+ html += '<td class="td-body ' + classBg + '" part="td-key">'
22108
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22109
+ 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>';
22110
+ html += '</div>';
22111
+ html += '</td>'
22112
+ }
22113
+
22114
+
22115
+ for (l = 0; l < sourceCols.length; l++) {
22116
+
22117
+ for (var j = 0; j < JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols).length; j++) {
22118
+
22119
+ if (sourceCols[l] == JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols)[j]) {
22120
+
22121
+ if (sourceArray.data.mappings.mappings[complianceid].data != null) {
22122
+
22123
+ html += '<td class="td-body ' + classBg + '" part="td-body">';
22124
+ html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
22125
+
22126
+ if (Array.isArray(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
22127
+
22128
+ for (var k = 0; k < JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j].length; k++) {
22129
+ 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>');
22130
+ }
22131
+
22132
+ } else {
22133
+ if (typeof JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j] == "string" && Util.isJSONParsable(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
22134
+ 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>')
22135
+
22136
+ } else {
22137
+ 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>')
22138
+ }
22139
+ }
22140
+
22141
+ html += '</div>';
22142
+ html += '</td>';
22143
+
22144
+ }
22145
+
22146
+ }
22147
+
22148
+ }
22149
+
22150
+ }
22151
+
22152
+ html += '</tr>';
22153
+ //console.log('i=', i);
22154
+
22155
+ }
22156
+ html += '</tbody>';
22157
+ html += '</table>';
22158
+
22159
+ }
22160
+ if (divElement == null) {
22161
+ return;
22162
+ }
22163
+ divElement.innerHTML = html;
22164
+
22165
+ if (unfilteredDict.length > 0) {
22166
+ var html = '';
22167
+ html += '<div class="mb-10">Items In Your Category (' + unfilteredDict.length + ")</div>";
22168
+ html += this.getFilterOnboardingString();
22169
+ ((divElement as HTMLDivElement).querySelector('#span-filtered') as HTMLDivElement).innerHTML = html;
22170
+
22171
+ } else {
22172
+ ((divElement as HTMLDivElement).querySelector('#span-filtered') as HTMLDivElement).style.display = 'none';
22173
+ }
22174
+
22175
+ if (subfiltered > 0) {
22176
+ ((divElement as HTMLDivElement).querySelector('#div-subfiltered') as HTMLDivElement).innerHTML = '<h4 part="results-title">Filtered Results (' + subfiltered + ')</h4>';
22177
+ }
22178
+
22179
+ if (this.getfilterOnboarding().length > 0) {
22180
+ for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
22181
+
22182
+ if (!unfilteredDict.includes(i)) {
22183
+ const tableRow = (divElement as HTMLDivElement).querySelector('#tablerow-' + i);
22184
+ if (tableRow != null) {
22185
+ (tableRow as HTMLTableRowElement).style.display = 'none';
22186
+ }
22187
+
22188
+ }
22189
+
22190
+ }
22191
+ }
22192
+
22193
+ (divElement as HTMLDivElement).querySelector('.checkbox-all')?.addEventListener('change', (e: any) => {
22194
+
22195
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22196
+
22197
+ const arrCheckBoxes = (divElement as HTMLDivElement).querySelectorAll('.checkbox-row') as NodeListOf<HTMLInputElement>;
22198
+ //console.log('cb-length', arrCheckBoxes.length);
22199
+ for (var i = 0; i < arrCheckBoxes.length; i++) {
22200
+ const tableRow = (divElement as HTMLDivElement).querySelector('#tablerow-' + (i)) as HTMLElement;
22201
+ //console.log('tablerow', i, tableRow);
22202
+ if (tableRow != null) {
22203
+ if (tableRow.style.display != 'none') {
22204
+ //console.log('tablerow setting', e.currentTarget.checked, (arrCheckBoxes[i] as HTMLInputElement));
22205
+ (arrCheckBoxes[i] as HTMLInputElement).checked = e.currentTarget.checked;
22206
+ if (e.currentTarget.checked) {
22207
+ if (!this.selectedCbs.includes(i + '')) {
22208
+ this.selectedCbs.push(i + '');
22209
+ }
22210
+ } else {
22211
+ this.selectedCbs = [];
22212
+ }
22213
+ }
22214
+ }
22215
+ }
22216
+
22217
+ //console.log('checkedarr', this.selectedCbs);
22218
+
22219
+ });
22220
+
22221
+ for (var j = 0; j < extraFields.length; j++) {
22222
+
22223
+ const inputArrJ = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIForm | HTMLInputElement>;
22224
+ for (var k = 0; k < inputArrJ.length; k++) {
22225
+ inputArrJ[k].addEventListener('keyup', (e: any) => {
22226
+
22227
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22228
+
22229
+ if (e.key == "Enter") {
22230
+
22231
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22232
+
22233
+ const activeIndex = e.target.id.split('-')[2];
22234
+
22235
+ for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
22236
+
22237
+ taggingArray.data.mappings.mappings[count].extraFields = [];
22238
+
22239
+ if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
22240
+
22241
+ for (var l = 0; l < extraFields.length; l++) {
22242
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + activeIndex + '-' + l) as HTMLInputElement);
22243
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22244
+ }
22245
+
22246
+ } else {
22247
+
22248
+ for (var l = 0; l < extraFields.length; l++) {
22249
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + count + '-' + l) as HTMLInputElement);
22250
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22251
+ }
22252
+
22253
+ }
22254
+
22255
+ }
22256
+
22257
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22258
+
22259
+ }
22260
+
22261
+ // this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, true);
22262
+
22263
+ });
22264
+
22265
+ inputArrJ[k].addEventListener('focusout', (e: any) => {
22266
+
22267
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22268
+
22269
+ const activeIndex = e.target.id.split('-')[2];
22270
+
22271
+ for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
22272
+
22273
+ taggingArray.data.mappings.mappings[count].extraFields = [];
22274
+
22275
+ if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
22276
+
22277
+ for (var l = 0; l < extraFields.length; l++) {
22278
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + activeIndex + '-' + l) as HTMLInputElement);
22279
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22280
+ }
22281
+
22282
+ } else {
22283
+
22284
+ for (var l = 0; l < extraFields.length; l++) {
22285
+ const inputExtraField = ((divElement as HTMLDivElement).querySelector('#extra-field-' + count + '-' + l) as HTMLInputElement);
22286
+ taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value)
22287
+ }
22288
+
22289
+ }
22290
+
22291
+ }
22292
+
22293
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22294
+
22295
+ });
22296
+ }
22297
+
22298
+ }
22299
+
22300
+ const multiArr = (divElement as HTMLDivElement).querySelectorAll('.tags-input') as NodeListOf<SfIForm | HTMLInputElement>;
22301
+
22302
+ for (var i = 0; i < multiArr.length; i++) {
22303
+
22304
+ if (apiIdDropdown.length > 0) {
22305
+
22306
+
22307
+ // for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22308
+
22309
+ var equal = true;
22310
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22311
+ for (var k = 0; k < uniqCols.length; k++) {
22312
+ if (uniqCols[k] != "id") { continue; }
22313
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
22314
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
22315
+ equal = false;
22316
+ }
22317
+ }
22318
+
22319
+ }
22320
+
22321
+ if (equal) {
22322
+ let preselctedVals = []
22323
+ if ((colName == "countries" || colName == "entities" || colName == "locations") && taggingArray.data.mappings.mappings[i][colName] == null) {
22324
+ let preselctedValsStr = ""
22325
+ for (let mandatoryfield of mandatoryFields) {
22326
+ if (taggingArray.data.mappings.mappings[i][mandatoryfield] == null || taggingArray.data.mappings.mappings[i][mandatoryfield] == "") {
22327
+ preselctedValsStr = ""
22328
+ } else {
22329
+ preselctedValsStr += `${taggingArray.data.mappings.mappings[i][mandatoryfield]};`
22330
+ }
22331
+ }
22332
+
22333
+ preselctedValsStr = preselctedValsStr.slice(0, -1);
22334
+ if (preselctedValsStr.indexOf(';') >= 0) {
22335
+ preselctedVals.push(preselctedValsStr)
22336
+ }
22337
+ } else {
22338
+ preselctedVals = taggingArray.data.mappings.mappings[i][colName];
22339
+ }
22340
+ (multiArr[i] as SfIForm).preselectedValues = JSON.stringify(preselctedVals);
22341
+ if (preselctedVals.length > 0) {
22342
+ ((multiArr[i] as SfIForm).parentElement as HTMLTableCellElement).setAttribute("part", "row-mapped");
22343
+ }
22344
+
22345
+ }
22346
+
22347
+ // }
22348
+
22349
+ multiArr[i].addEventListener('valueChanged', async (e: any) => {
22350
+
22351
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22352
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22353
+ });
22354
+
22355
+ } else {
22356
+
22357
+ // for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22358
+
22359
+ var equal = true;
22360
+ let complianceid = taggingArray.data.mappings.mappings[i].id
22361
+ for (var k = 0; k < uniqCols.length; k++) {
22362
+ if (uniqCols[k] != "id") { continue; }
22363
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
22364
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
22365
+ equal = false;
22366
+ }
22367
+ }
22368
+
22369
+ }
22370
+
22371
+ if (equal) {
22372
+
22373
+ if (taggingArray.data.mappings.mappings[i] != null) {
22374
+ if (Util.isJSONParsable(sourceArray.data.mappings.mappings[complianceid][colName])) {
22375
+ (multiArr[i] as HTMLInputElement).value = JSON.parse(sourceArray.data.mappings.mappings[complianceid][colName])[0];
22376
+ } else {
22377
+ (multiArr[i] as HTMLInputElement).value = sourceArray.data.mappings.mappings[complianceid][colName] ?? "";
22378
+ }
22379
+ }
22380
+
22381
+ }
22382
+
22383
+ // }
22384
+
22385
+
22386
+
22387
+ multiArr[i].addEventListener('keyup', async (e: any) => {
22388
+
22389
+ if (e.key == "Enter") {
22390
+
22391
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22392
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22393
+ }
22394
+
22395
+ });
22396
+
22397
+ multiArr[i].addEventListener('focusout', async (e: any) => {
22398
+
22399
+ ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22400
+ this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
22401
+ });
22402
+
22403
+
22404
+ }
22405
+
22406
+
22407
+ }
22408
+
22409
+ const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22410
+ buttonApply.addEventListener('click', () => {
22411
+ // console.log('applied');
22412
+ // this.applyAndReloadTagging(e,colName, taggingArray, sourceArray, divElement);
22413
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
22414
+ })
22415
+
22416
+ const buttonToggleMoreBack = (divElement as HTMLDivElement).querySelector('.button-toggle-more-back') as HTMLButtonElement;
22417
+ const buttonToggleMore = (divElement as HTMLDivElement).querySelector('.button-toggle-more') as HTMLButtonElement;
22418
+
22419
+ buttonToggleMore.addEventListener('click', async (ev: any) => {
22420
+
22421
+ ev.target.classList.add('hide');
22422
+ buttonToggleMoreBack.classList.remove('hide');
22423
+ const buttonDownloadBackups = (divElement as HTMLDivElement).querySelector('.button-download-backups') as HTMLButtonElement;
22424
+ buttonDownloadBackups.style.display = 'flex';
22425
+ const buttonExportMapping = (divElement as HTMLDivElement).querySelector('.button-export-mapping') as HTMLButtonElement;
22426
+ buttonExportMapping.style.display = 'flex';
22427
+ const buttonExportMappingCSV = (divElement as HTMLDivElement).querySelector('.button-export-mapping-csv') as HTMLButtonElement;
22428
+ buttonExportMappingCSV.style.display = 'flex';
22429
+ // const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22430
+ // buttonApply.style.display = 'flex';
22431
+ const buttonLoadLocal = (divElement as HTMLDivElement).querySelector('.button-local-load') as HTMLButtonElement;
22432
+ buttonLoadLocal.style.display = 'flex';
22433
+ const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
22434
+ buttonSaveLocal.style.display = 'flex';
22435
+ // const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22436
+ // buttonSave.style.display = 'flex';
22437
+
22438
+ const buttonDownloadBackupsNew = Util.clearListeners(buttonDownloadBackups);
22439
+ buttonDownloadBackupsNew.addEventListener('click', async () => {
22440
+
22441
+ const result = await this.fetchGetStoredMapping(colName);
22442
+
22443
+ for (var i = 0; i < result.data.length; i++) {
22444
+
22445
+ const blob = new Blob([result.data[i].mappings != null ? JSON.stringify(result.data[i].mappings) : JSON.stringify(result.data[i])], { type: 'text/html' });
22446
+ const url = window.URL.createObjectURL(blob)
22447
+ const a = document.createElement('a')
22448
+ a.setAttribute('href', url)
22449
+ a.setAttribute('download', 'report_' + colName + '_' + i + '.json');
22450
+ a.click()
22451
+
22452
+ }
22453
+
22454
+ (buttonToggleMoreBack as HTMLButtonElement).click();
22455
+
22456
+ if (result.data.length === 0) {
22457
+
22458
+ this.setError("No backups found!")
22459
+ setTimeout(() => {
22460
+ this.clearMessages();
22461
+ }, 3000);
22462
+
22463
+ }
22464
+
22465
+ });
22466
+
22467
+ const buttonExportMappingNew = Util.clearListeners(buttonExportMapping);
22468
+ buttonExportMappingNew.addEventListener('click', async () => {
22469
+
22470
+ let valueStr: string[] = [];
22471
+
22472
+ for (var i = 0; i < multiArr.length; i++) {
22473
+
22474
+ if (apiIdDropdown.length > 0) {
22475
+
22476
+ for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
22477
+
22478
+ var equal = true;
22479
+ let complianceid = taggingArray.data.mappings.mappings[j].id
22480
+ for (var k = 0; k < uniqCols.length; k++) {
22481
+ if (uniqCols[k] != "id") { continue; }
22482
+ if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[j] != null) {
22483
+ if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[j][uniqCols[k]]) {
22484
+ equal = false;
22485
+ }
22486
+ }
22487
+
22488
+ }
22489
+
22490
+ if (equal) {
22491
+ valueStr.push(JSON.stringify(taggingArray.data.mappings.mappings[j][colName]));
22492
+ }
22493
+ }
22494
+
22495
+ } else {
22496
+
22497
+ if (taggingArray.data.mappings.mappings[i] != null) {
22498
+ valueStr.push(taggingArray.data.mappings.mappings[i][colName]);
22499
+ } else {
22500
+ valueStr.push('');
22501
+ }
22502
+
22503
+ }
22504
+
22505
+ }
22506
+
22507
+ //console.log('valueStr', valueStr);
22508
+
22509
+ const valuesHTML = JSON.stringify(valueStr);
22510
+
22511
+ 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;
22512
+
22513
+ let tableHTML = this.TAGGING_HTML.replace(/TABLE_DATA/g, outerHTML);
22514
+ tableHTML = tableHTML.replace(/TABLE_VALUES/g, valuesHTML);
22515
+
22516
+ const blob = new Blob([tableHTML], { type: 'text/html' });
22517
+ const url = window.URL.createObjectURL(blob)
22518
+ const a = document.createElement('a')
22519
+ a.setAttribute('href', url)
22520
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.html');
22521
+ a.click()
22522
+
22523
+ });
22524
+
22525
+ const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
22526
+ buttonExportMappingCSVNew?.addEventListener('click', async () => {
22527
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings))
22528
+ for (let [i, obj] of csvArray.entries()) {
22529
+ let tempCsvObj = obj
22530
+ let tempId = obj.id;
22531
+ let tempCompliance = sourceArray.data.mappings.mappings[tempId]
22532
+ if (tempCompliance['cols'] != null && tempCompliance['data'] != null) {
22533
+ let dataArr = JSON.parse(tempCompliance['data'])
22534
+ let colsArr = JSON.parse(tempCompliance['cols'])
22535
+ for (let [j, colKey] of colsArr.entries()) {
22536
+ tempCsvObj['cols_' + colKey] = dataArr[j]
22537
+ }
22538
+ }
22539
+ csvArray[i] = tempCsvObj
22540
+ }
22541
+ console.log('csv array', csvArray)
22542
+ let csvData = Util.convertToCSV(csvArray);
22543
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
22544
+ console.log('csvData', csvData);
22545
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
22546
+ const url = window.URL.createObjectURL(blob)
22547
+ const a = document.createElement('a')
22548
+ a.setAttribute('href', url)
22549
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.csv');
22550
+ a.click()
22551
+ })
22552
+
22553
+ const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
22554
+ buttonLoadLocalNew?.addEventListener('click', async () => {
22555
+ console.log('load-local');
22556
+ ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
22557
+ });
22558
+
22559
+ const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
22560
+ fileInput.value = '';
22561
+ const fileInputNew = Util.clearListeners(fileInput);
22562
+ fileInputNew.addEventListener('change', (e: any) => {
22563
+ var fr = new FileReader();
22564
+ fr.onload = () => {
22565
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
22566
+ };
22567
+ var frCsv = new FileReader();
22568
+ frCsv.onload = () => {
22569
+ console.log('taggingarray onload called');
22570
+ console.log('csv result', frCsv.result);
22571
+ const tempArr = Util.parseCsv(frCsv.result + "");
22572
+ console.log('csv data', tempArr)
22573
+ let changeCount = 0;
22574
+ for (let [i, obj] of tempArr.entries()) {
22575
+ let tempObj = taggingArray.data.mappings.mappings[i]
22576
+ for(let key of Object.keys(tempObj)){
22577
+ if(key.indexOf('cols_') >= 0){
22578
+ delete tempObj[key]
22579
+ }
22580
+ }
22581
+ delete tempObj['delta'];
22582
+ delete tempObj['lastupdated'];
22583
+ let tempNewObj = obj
22584
+ for(let key of Object.keys(tempNewObj)){
22585
+ if(key.indexOf('cols_') >= 0){
22586
+ delete tempNewObj[key]
22587
+ }
22588
+ }
22589
+ delete tempNewObj['delta'];
22590
+ delete tempNewObj['lastupdated'];
22591
+ if (JSON.stringify(tempObj) !== JSON.stringify(tempNewObj)) {
22592
+ // console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
22593
+ let changedId = ""
22594
+ for (let [k, col] of uniqCols.entries()) {
22595
+ // if (col != "id") { continue; }
22596
+ changedId += tempObj[col];
22597
+ if (k < (uniqCols.length - 1)) {
22598
+ changedId += ";"
22599
+ }
22600
+ }
22601
+
22602
+ this.changedOnboardingItemIds.push(changedId)
22603
+ changeCount++
22604
+ }
22605
+ }
22606
+ this.setSuccessBtn(changeCount + " items changed. Do you wish to apply?", ["No", "Yes"], [
22607
+ () => {
22608
+ this.clearMessages();
22609
+ this.changedOnboardingItemIds = [];
22610
+ (buttonToggleMoreBack as HTMLButtonElement).click();
22611
+ },
22612
+ () => {
22613
+ this.clearMessages();
22614
+ let tempObj: any = {}
22615
+ tempObj["data"] = {}
22616
+ tempObj["data"]["mappings"] = {}
22617
+ tempObj["data"]["mappings"]["mappings"] = tempArr
22618
+ let tempObjStr = JSON.stringify(tempObj)
22619
+
22620
+ console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]), sourceMapping)
22621
+
22622
+ this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
22623
+ }
22624
+ ])
22625
+ }
22626
+ if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
22627
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1]
22628
+ if (ext.toLowerCase() == "csv") {
22629
+ frCsv.readAsText(e.target.files[0]);
22630
+ } else {
22631
+ fr.readAsText(e.target.files[0]);
22632
+ }
22633
+ }
22634
+ })
22635
+
22636
+ const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
22637
+ buttonSaveLocalNew?.addEventListener('click', async () => {
22638
+ console.log('save-local');
22639
+ const blob = new Blob([JSON.stringify(taggingArray)], { type: 'text/plain' });
22640
+ const url = window.URL.createObjectURL(blob)
22641
+ const a = document.createElement('a')
22642
+ a.setAttribute('href', url)
22643
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().toLocaleString() + '.txt');
22644
+ a.click()
22645
+ });
22646
+
22647
+ });
22648
+
22649
+ buttonToggleMoreBack.addEventListener('click', async (ev: any) => {
22650
+
22651
+ ev.target.classList.add('hide');
22652
+ buttonToggleMore.classList.remove('hide');
22653
+ const buttonDownloadBackups = (divElement as HTMLDivElement).querySelector('.button-download-backups') as HTMLButtonElement;
22654
+ buttonDownloadBackups.style.display = 'none';
22655
+ const buttonExportMapping = (divElement as HTMLDivElement).querySelector('.button-export-mapping') as HTMLButtonElement;
22656
+ buttonExportMapping.style.display = 'none';
22657
+ const buttonExportMappingCSV = (divElement as HTMLDivElement).querySelector('.button-export-mapping-csv') as HTMLButtonElement;
22658
+ buttonExportMappingCSV.style.display = 'none';
22659
+ // const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
22660
+ // buttonApply.style.display = 'none';
22661
+ const buttonLoadLocal = (divElement as HTMLDivElement).querySelector('.button-local-load') as HTMLButtonElement;
22662
+ buttonLoadLocal.style.display = 'none';
22663
+ const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
22664
+ buttonSaveLocal.style.display = 'none';
22665
+ // const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22666
+ // buttonSave.style.display = 'none';
22667
+
22668
+ });
22669
+
22670
+ const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
22671
+ buttonSave?.addEventListener('click', async () => {
22672
+ await this.saveTagging(taggingArray.data.mappings, selectedStatutes, uploadFunction, refreshFunction, false, colName);
22673
+ });
22674
+
22675
+ const buttonCancel = (divElement as HTMLDivElement).querySelector('.button-cancel') as HTMLButtonElement;
22676
+ buttonCancel?.addEventListener('click', async () => {
22677
+ //console.log('cancel clicked');
22678
+ await this.fetchCancelOnboardingJob(colName);
22679
+ refreshFunction();
22680
+ });
22681
+
22682
+ const cbArr = (divElement as HTMLDivElement).querySelectorAll('.cb-select') as NodeListOf<HTMLInputElement>;
22683
+ for (i = 0; i < cbArr.length; i++) {
22684
+ cbArr[i].addEventListener('change', (ev: any) => {
22685
+ const cbSelectId = ev.currentTarget.id;
22686
+ const cbSelectIndex = cbSelectId.split('-')[1];
22687
+
22688
+ if (!this.selectedCbs.includes(cbSelectIndex)) {
22689
+ this.selectedCbs.push(cbSelectIndex);
22690
+ } else {
22691
+ this.selectedCbs.splice(this.selectedCbs.indexOf(cbSelectIndex), 1);
22692
+ }
22693
+ //console.log(this.selectedCbs);
22694
+ })
22695
+ }
22696
+
22697
+ this.changedOnboardingItemIds = []
22698
+ }
22699
+
22700
+ 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> = []) => {
22701
+ console.log('cols1', jsonData);
22702
+ // console.log('cols', jsonData[0].data.cols);
22703
+ //console.log('divelement', divElement);
22704
+ //console.log('jsonData', jsonData);
22705
+ //console.log('cursor', cursor);
22706
+ //console.log('fetch', fetchFunction);
22707
+ //console.log('searchstring', searchString);
22708
+ //console.log('subfiltervalue', subfilter);
22709
+
22710
+ const arrCompliancesFrequencies: any = {};
22711
+
22712
+ if (jsonData.length === 0) return;
22713
+
22714
+ this.selectedCbs = [];
22715
+
22716
+ let colCountry = -1;
22717
+ let colState = -1;
22718
+ let colSubcategory = -1;
22719
+ let colStatute = -1;
22720
+
22721
+ const unfilteredDict: any[] = [];
22722
+
22723
+ var html = '';
22724
+
22725
+ html += '<div>';
22726
+ html += '<h3 part="results-title">Total Items (' + found + ')</h3>';
22727
+ html += '<h4 id="span-filtered" part="results-title"></h4>'
22728
+ html += '<h4 id="span-extra-filled" part="results-title"></h4>'
22729
+ html += '</div>';
22730
+
22731
+
22732
+ html += '<div class="d-flex justify-between align-center left-sticky flex-wrap mb-20">';
22733
+
22734
+ html += '<div id="div-subfiltered"></div>';
22735
+ html += '<div id="scroll-overlay" part="onboarding-scroll-overlay" class="pos-fixed-scroll justify-center align-center">';
22736
+ html += '<div id="scroll-overlay-left" class="mr-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_left_alt</span></button></div>';
22737
+ html += '<div id="scroll-overlay-right" class="ml-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_right_alt</span></button></div>';
22738
+ html += '</div>';
22739
+
22740
+ html += '<div id="detail-overlay" part="onboarding-detail-overlay" class="pos-fixed justify-center align-center hide">';
22741
+ html += '<div class="cover-slide"></div>';
22742
+ html += '<div class="detail-container p-10">';
22743
+ html += '<div class="d-flex justify-between align-center mb-20">';
22744
+ html += '<div part="results-title">Row Details</div>';
22745
+ html += '<button part="button-icon" class="detail-close"><span class="material-symbols-outlined">close</span></button>';
22746
+ html += '</div>';
22747
+ html += '<div id="detail-overlay-list">';
22748
+ html += '</div>';
22749
+ html += '</div>';
22750
+ html += '</div>';
22751
+
22752
+ html += '<div class="d-flex align-center">';
22753
+ // html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
22754
+ html += '<div class="mr-10">';
22755
+ 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>'
22756
+ 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>'
22757
+ html += '</div>';
22758
+ html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
22759
+ html += '</div>';
22760
+
22761
+ html += '</div>';
22762
+
22763
+ html += '<table id="table-data">';
22764
+
22765
+ html += '<thead>';
22766
+ html += '<th part="td-head" class="td-head">'
22767
+ // html += 'Select';
22768
+ html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
22769
+ html += '</th>'
22770
+ html += '<th part="td-head" class="td-head">'
22771
+ html += '<div>View</div>';
22772
+ html += '</th>'
22773
+ if (extraFieldPosition === 0) {
22774
+ for (var i = 0; i < extraFields.length; i++) {
22775
+ html += '<th part="td-head" class="td-head">'
22776
+ html += extraFields[i];
22777
+ html += '</th>'
22778
+ }
22779
+ }
22780
+ if (colName.toLowerCase() == "compliances") {
22781
+ html += '<th part="td-head" class="td-head">'
22782
+ html += 'Proposed Users';
22783
+ html += '</th>'
22784
+ }
22785
+ html += '<th part="td-head" class="td-head">'
22786
+ html += 'Id';
22787
+ html += '</th>'
22788
+
22789
+ // for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
22790
+
22791
+ // if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
22792
+ // html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
22793
+ // html += JSON.parse(jsonData[0].data.cols)[j]
22794
+ // html += '</th>'
22795
+ // }
22796
+
22797
+ // }
22798
+
22799
+ for (var j = 0; j < jsonData[0].cols.length; j++) {
22800
+ console.log('jsoncols', JSON.parse(jsonData[0].data.cols), jsonData[0].cols.length, j)
22801
+ html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == (JSON.parse(jsonData[0].data.cols)[j] ?? "").toLowerCase() ? 'left-sticky' : '') + '">'
22802
+ // html += jsonData[0].cols[j]
22803
+ html += '</th>'
22804
+
22805
+ }
22806
+
22807
+ if (extraFieldPosition === 1) {
22808
+ for (var i = 0; i < extraFields.length; i++) {
22809
+ html += '<th part="td-head" class="td-head">'
22810
+ html += extraFields[i];
22811
+ html += '</th>'
22812
+ }
22813
+ }
22814
+ html += '</thead>'
22815
+
22816
+ //console.log('colstate', JSON.parse(jsonData[0].data.cols));
22817
+
22818
+ for (var i = 0; i < JSON.parse(jsonData[0].data.cols).length; i++) {
22819
+ if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "country") {
22820
+ console.log('colstate country', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
22821
+ colCountry = i;
22822
+ }
22823
+ if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "state") {
22824
+ //console.log('colstate state', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
22825
+ colState = i;
22826
+ }
22827
+ if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "subcategory") {
22828
+ //console.log('colstate subcategory', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
22829
+ colSubcategory = i;
22830
+ }
22831
+ if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == statuteColName) {
22832
+ //console.log('colstate statute', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
22833
+ colStatute = i;
22834
+ }
22835
+ }
22836
+
22837
+ //var countExtra0 = 0;
22838
+ var countextra = [];
21683
22839
 
21684
22840
  var subfiltered = 0;
21685
22841
 
@@ -22141,25 +23297,25 @@ export class SfIEvents extends LitElement {
22141
23297
 
22142
23298
  }
22143
23299
 
22144
- // Filter field handlers
23300
+ // // Filter field handlers
22145
23301
 
22146
- const inputFilter = (divElement as HTMLDivElement).querySelector('.input-filter') as HTMLInputElement;
22147
- inputFilter.addEventListener('keyup', (e: any) => {
23302
+ // const inputFilter = (divElement as HTMLDivElement).querySelector('.input-filter') as HTMLInputElement;
23303
+ // inputFilter.addEventListener('keyup', (e: any) => {
22148
23304
 
22149
- if (e.key == 'Enter') {
22150
- //console.log(inputFilter.value);
22151
- if (this._SfLoader != null) {
22152
- this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
22153
- this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
22154
- }
22155
- setTimeout(() => {
22156
- this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
22157
- this._SfLoader.innerHTML = '';
22158
- }, 1000);
23305
+ // if (e.key == 'Enter') {
23306
+ // //console.log(inputFilter.value);
23307
+ // if (this._SfLoader != null) {
23308
+ // this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
23309
+ // this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
23310
+ // }
23311
+ // setTimeout(() => {
23312
+ // this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
23313
+ // this._SfLoader.innerHTML = '';
23314
+ // }, 1000);
22159
23315
 
22160
- }
23316
+ // }
22161
23317
 
22162
- });
23318
+ // });
22163
23319
 
22164
23320
  // More button handlers
22165
23321
 
@@ -22331,7 +23487,7 @@ export class SfIEvents extends LitElement {
22331
23487
  //console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
22332
23488
  ((divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement).disabled = false;
22333
23489
  if (extraFieldPosition === 1) {
22334
- await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true)
23490
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true, mappedStatutes)
22335
23491
  }
22336
23492
  });
22337
23493
  }
@@ -22409,7 +23565,7 @@ export class SfIEvents extends LitElement {
22409
23565
 
22410
23566
  (this._SfButtonSave as HTMLButtonElement)?.addEventListener('click', async () => {
22411
23567
 
22412
- await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false)
23568
+ await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false, mappedStatutes)
22413
23569
 
22414
23570
  });
22415
23571
 
@@ -23158,368 +24314,450 @@ export class SfIEvents extends LitElement {
23158
24314
 
23159
24315
  });
23160
24316
 
23161
- //this.refreshCalendar();
23162
-
23163
- }
23164
-
23165
- renderOnboardingTriggers = (mappedTriggers: any, mappedSerializedAlertSchedules: any, triggersJobs: any) => {
23166
-
23167
- var html = '';
23168
-
23169
- html += '<div id="triggers-list-container" class="d-flex flex-col w-100 scroll-x">';
23170
- html += '</div>';
23171
-
23172
- (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML = html;
23173
-
23174
- //console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
23175
-
23176
- 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, "", "");
24317
+ //this.refreshCalendar();
23177
24318
 
23178
24319
  }
23179
24320
 
23180
- renderOnboardingInternalControls = (mappedInternalControls: any, mappedSerializedTriggers: any, internalcontrolsJobs: any) => {
24321
+ renderOnboardingTriggers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedTriggers: any) => {
23181
24322
 
23182
- var html = '';
24323
+ 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, "", "");
23183
24324
 
23184
- html += '<div id="internalcontrols-list-container" class="d-flex flex-col w-100 scroll-x">';
23185
- html += '</div>';
24325
+ }
23186
24326
 
23187
- (this._SfOnboardingInternalControlsContainer as HTMLDivElement).innerHTML = html;
24327
+ renderOnboardingInternalControls = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedInternalControls: any) => {
23188
24328
 
23189
- 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, "", "");
24329
+ 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, "", "");
23190
24330
 
23191
24331
  }
23192
24332
 
23193
- renderOnboardingReportedLocations = (mappedReportedLocations: any, mappedSerializedTriggers: any, reportedlocationsJobs: any) => {
24333
+ renderOnboardingReportedLocations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedReportedLocations: any) => {
23194
24334
 
23195
- var html = '';
24335
+ 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, "", "");
23196
24336
 
23197
- html += '<div id="reportedlocations-list-container" class="d-flex flex-col w-100 scroll-x">';
23198
- html += '</div>';
24337
+ }
23199
24338
 
23200
- (this._SfOnboardingReportedLocationsContainer as HTMLDivElement).innerHTML = html;
24339
+ renderOnboardingActivations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedActivations: any) => {
23201
24340
 
23202
- 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, "", "");
24341
+ 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, "", "");
23203
24342
 
23204
24343
  }
23205
24344
 
23206
- renderOnboardingActivations = (mappedActivations: any, mappedSerializedExtensions: any, activationsJobs: any) => {
24345
+ renderOnboardingInvalidations = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedInvalidations: any) => {
23207
24346
 
23208
- var html = '';
24347
+ 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, "", "");
23209
24348
 
23210
- html += '<div id="activations-list-container" class="d-flex flex-col w-100 scroll-x">';
23211
- html += '</div>';
24349
+ }
23212
24350
 
23213
- (this._SfOnboardingActivationsContainer as HTMLDivElement).innerHTML = html;
24351
+ renderOnboardingAlertSchedules = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedAlertSchedules: any) => {
23214
24352
 
23215
- 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, "", "");
24353
+ 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, "", "");
23216
24354
 
23217
24355
  }
23218
24356
 
23219
- renderOnboardingInvalidations = (mappedInvalidations: any, mappedSerializedExtensions: any, invalidationsJobs: any) => {
24357
+ renderOnboardingExtensions = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedExtensions: any) => {
23220
24358
 
23221
- var html = '';
24359
+ 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, "", "");
23222
24360
 
23223
- html += '<div id="invalidations-list-container" class="d-flex flex-col w-100 scroll-x">';
23224
- html += '</div>';
24361
+ }
23225
24362
 
23226
- (this._SfOnboardingInvalidationsContainer as HTMLDivElement).innerHTML = html;
24363
+ renderOnboardingDuedates = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedDuedates: any) => {
23227
24364
 
23228
- 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, "", "");
24365
+ 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, "", "");
23229
24366
 
23230
24367
  }
23231
24368
 
23232
- renderOnboardingAlertSchedules = (mappedAlertSchedules: any, mappedSerializedExtensions: any, alertschedulesJobs: any) => {
24369
+ renderOnboardingReporters = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedReporters: any) => {
23233
24370
 
23234
- var html = '';
24371
+ 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", "");
23235
24372
 
23236
- html += '<div id="alertschedules-list-container" class="d-flex flex-col w-100 scroll-x">';
23237
- html += '</div>';
24373
+ }
23238
24374
 
23239
- (this._SfOnboardingAlertSchedulesContainer as HTMLDivElement).innerHTML = html;
24375
+ renderOnboardingApprovers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedApprovers: any) => {
23240
24376
 
23241
- 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, "", "");
24377
+ 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", "");
23242
24378
 
23243
24379
  }
23244
24380
 
23245
- renderOnboardingExtensions = (mappedExtensions: any, mappedSerializedDuedates: any, extensionsJobs: any) => {
24381
+ renderOnboardingFunctionHeads = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedFunctionHeads: any) => {
23246
24382
 
23247
- var html = '';
23248
-
23249
- html += '<div id="extensions-list-container" class="d-flex flex-col w-100 scroll-x">';
23250
- html += '</div>';
23251
-
23252
- (this._SfOnboardingExtensionsContainer as HTMLDivElement).innerHTML = html;
23253
24383
 
23254
- 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, "", "");
24384
+ 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", "");
23255
24385
 
23256
24386
  }
23257
24387
 
23258
- renderOnboardingDuedates = (mappedDuedates: any, mappedSerializedMakerCheckers: any, duedatesJobs: any) => {
23259
-
23260
- var html = '';
23261
-
23262
- html += '<div id="duedates-list-container" class="d-flex flex-col w-100 scroll-x">';
23263
- html += '</div>';
23264
-
23265
- (this._SfOnboardingDuedatesContainer as HTMLDivElement).innerHTML = html;
24388
+ renderOnboardingMakerCheckers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedMakerCheckers: any) => {
23266
24389
 
23267
- 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, "", "");
24390
+ 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, "", "");
23268
24391
 
23269
24392
  }
23270
24393
 
23271
- renderOnboardingReporters = (mappedReporters: any, mappedSerializedTags: any, reportersJobs: any, _arrFeedbackReference: any) => {
24394
+ renderOnboardingDocs = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedDocs: any) => {
23272
24395
 
23273
- var html = '';
24396
+ 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, "", "");
23274
24397
 
23275
- html += '<div id="reporters-list-container" class="d-flex flex-col w-100 scroll-x">';
23276
- html += '</div>';
24398
+ }
23277
24399
 
23278
- (this._SfOnboardingReportersContainer as HTMLDivElement).innerHTML = html;
24400
+ renderOnboardingAuditors = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedAuditors: any) => {
23279
24401
 
23280
- 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", "");
24402
+ 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", "");
23281
24403
 
23282
24404
  }
23283
24405
 
23284
- renderOnboardingApprovers = (mappedApprovers: any, mappedSerializedReporters: any, approversJobs: any, _arrFeedbackReference: any) => {
24406
+ renderOnboardingViewers = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedViewers: any) => {
23285
24407
 
23286
- var html = '';
24408
+ 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", "");
23287
24409
 
23288
- html += '<div id="approvers-list-container" class="d-flex flex-col w-100 scroll-x">';
23289
- html += '</div>';
24410
+ }
23290
24411
 
23291
- (this._SfOnboardingApproversContainer as HTMLDivElement).innerHTML = html;
24412
+ renderOnboardingTags = (selectedStatutes: any, mappedCompliances: any, mappedFunctions: any, mappedTags: any) => {
23292
24413
 
23293
- 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", "");
24414
+ 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, "", "");
23294
24415
 
23295
24416
  }
23296
24417
 
23297
- renderOnboardingFunctionHeads = (mappedFunctionHeads: any, mappedSerializedApprovers: any, functionHeadsJobs: any, _arrFeedbackReference: any) => {
24418
+ renderOnboardingFunctions = (selectedStatutes: any, mappedCompliances: any, mappedLocations: any, mappedFunctions: any) => {
23298
24419
 
23299
- var html = '';
24420
+ 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, "", "");
23300
24421
 
23301
- html += '<div id="functionheads-list-container" class="d-flex flex-col w-100 scroll-x">';
23302
- html += '</div>';
24422
+ }
23303
24423
 
23304
- (this._SfOnboardingFunctionHeadsContainer as HTMLDivElement).innerHTML = html;
24424
+ renderOnboardingLocations = (selectedStatutes: any, mappedCompliances: any, mappedEntities: any, mappedLocations: any) => {
23305
24425
 
23306
- 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", "");
24426
+ 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, "", "");
23307
24427
 
23308
24428
  }
23309
24429
 
23310
- renderOnboardingMakerCheckers = (mappedMakerCheckers: any, mappedSerializedDocs: any, makerCheckerJobs: any) => {
23311
-
24430
+ renderOnboardingStatutesDropdownMapping = (container: HTMLDivElement, mappedStatutes: any, selectedStatutes: any, fetchtaggingfunction: Function, rendermappingfunction: Function) => {
24431
+ console.log('rendering dropdown', mappedStatutes.length);
23312
24432
  var html = '';
23313
24433
 
23314
- html += '<div id="makercheckers-list-container" class="d-flex flex-col w-100 scroll-x">';
24434
+ html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
24435
+ html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
24436
+ html += '<label part="input-label">Select Statute</label>';
24437
+ html += '<sf-multiselect-search mode="edit" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
23315
24438
  html += '</div>';
23316
24439
 
23317
- (this._SfOnboardingMakerCheckersContainer as HTMLDivElement).innerHTML = html;
23318
-
23319
- 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, "", "");
23320
-
23321
- }
23322
-
23323
- renderOnboardingDocs = (mappedDocs: any, mappedSerializedViewers: any, docsJobs: any) => {
23324
-
23325
- var html = '';
23326
-
23327
- html += '<div id="docs-list-container" class="d-flex flex-col w-100 scroll-x">';
24440
+ html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
23328
24441
  html += '</div>';
24442
+ html += '</div>';
24443
+ console.log('attaching html', html);
24444
+ container.innerHTML = html;
23329
24445
 
23330
- (this._SfOnboardingDocsContainer as HTMLDivElement).innerHTML = html;
24446
+ let multiselectStatute = container.querySelector('#statute-select') as SfMultiselectSearch;
24447
+ multiselectStatute.listelements = mappedStatutes;
24448
+ let selectedStatutesObj: any = {}
24449
+ for (let statuteObj of selectedStatutes) {
24450
+ selectedStatutesObj[statuteObj.id] = true
24451
+ }
24452
+ multiselectStatute.listselection = selectedStatutesObj;
24453
+ multiselectStatute.loadMode();
24454
+ multiselectStatute.addEventListener('valueChanged', async (e: any) => {
24455
+ let multiselect = e.currentTarget as SfMultiselectSearch;
24456
+ console.log('selected statutes', multiselect.selectedValuesNames());
24457
+ if (Object.keys(multiselect.selectedValuesNames()).length == 0) {
24458
+ return;
24459
+ }
24460
+ let selectedStatutes = [];
24461
+ const regex = /^\[.*?\] - /;
24462
+ for (let statuteid of Object.keys(multiselect.selectedValuesNames())) {
24463
+ selectedStatutes.push({ id: statuteid, selected: true, statutename: multiselect.selectedValuesNames()[statuteid].name.replace(regex, '') });
24464
+ }
23331
24465
 
23332
- 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, "", "");
24466
+ let mappedCompliances = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
23333
24467
 
24468
+ rendermappingfunction({ data: { mappings: { mappings: selectedStatutes } } }, mappedCompliances);
24469
+ })
23334
24470
  }
23335
24471
 
23336
- renderOnboardingAuditors = (mappedAuditors: any, mappedSerializedFunctionheads: any, auditorsJobs: any, _arrFeedbackReference: any) => {
23337
-
23338
- //console.log('inside rendering auditors..');
23339
-
24472
+ renderOnboardingStatutesDropdownTagging = (container: HTMLDivElement, listcontainerid: string, mappedStatutes: any, selectedStatutes: any, fetchcompliancesfunction: Function, fetchsourcemapping: Function, fetchtaggingfunction: Function, rendertaggingfunction: Function) => {
24473
+ console.log('rendering dropdown', mappedStatutes.length);
23340
24474
  var html = '';
23341
24475
 
23342
- html += '<div id="auditors-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" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
23343
24480
  html += '</div>';
23344
24481
 
23345
- (this._SfOnboardingAuditorsContainer as HTMLDivElement).innerHTML = html;
24482
+ html += '<div id="' + listcontainerid + '" class="d-flex flex-col w-100 scroll-x">';
24483
+ html += '</div>';
24484
+ html += '</div>';
24485
+ console.log('attaching html', html);
24486
+ container.innerHTML = html;
23346
24487
 
23347
- 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", "");
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
+ }
23348
24507
 
24508
+ let sourceMappingArray = await fetchsourcemapping(Object.keys(multiselect.selectedValuesNames()));
24509
+ let mappingArray = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
24510
+ let mappedCompliances = await fetchcompliancesfunction(Object.keys(multiselect.selectedValuesNames()));
24511
+ let mappedCompliancesArr: any = { data: { mappings: {} } };
24512
+ console.log('mapped compliances', mappedCompliances)
24513
+ for (let statuteObj of selectedStatutes) {
24514
+ for (let complianceid of Object.keys(mappedCompliances.data.mappings[statuteObj.id])) {
24515
+ let pushObj = mappedCompliances.data.mappings[statuteObj.id][complianceid];
24516
+ pushObj.id = complianceid;
24517
+ pushObj.statuteid = statuteObj.id;
24518
+ mappedCompliancesArr.data.mappings[complianceid] = pushObj;
24519
+ }
24520
+ }
24521
+ rendertaggingfunction(selectedStatutes, mappedCompliancesArr, sourceMappingArray, mappingArray);
24522
+ })
23349
24523
  }
23350
24524
 
23351
- renderOnboardingViewers = (mappedViewers: any, mappedSerializedAuditors: any, viewersJobs: any, _arrFeedbackReference: any) => {
24525
+ renderOnboardingCompliances = async (mappedStatutes: any, mappedCompliancesArr: any) => {
24526
+
24527
+ //console.log('mappedcompliances', mappedCompliances);
24528
+ //console.log('mappedstatutes', mappedStatutes);
23352
24529
 
23353
- //console.log('inside rendering viewers..');
24530
+ var searchString = "";
24531
+ let mappedCompliances: any = { data: { mappings: { mappings: [] } } };
24532
+ for (var i = 0; i < (mappedStatutes.data.mappings.mappings as Array<any>).length; i++) {
24533
+ if ((mappedStatutes.data.mappings.mappings as Array<any>)[i].selected) {
24534
+ let statuteid = (mappedStatutes.data.mappings.mappings as Array<any>)[i].id
24535
+ if (mappedCompliancesArr.data.mappings[statuteid] != null) {
24536
+ for (let complianceid of Object.keys(mappedCompliancesArr.data.mappings[statuteid])) {
24537
+ let pushObj = mappedCompliancesArr.data.mappings[statuteid][complianceid];
24538
+ pushObj.id = complianceid;
24539
+ mappedCompliances.data.mappings.mappings.push(pushObj);
24540
+ }
24541
+ }
24542
+ searchString += statuteid + "|";
24543
+ }
24544
+ }
24545
+ searchString = searchString.slice(0, -1);
23354
24546
 
23355
- var html = '';
24547
+ //console.log('searchstring', searchString);
23356
24548
 
23357
- html += '<div id="viewers-list-container" class="d-flex flex-col w-100 scroll-x">';
23358
- html += '</div>';
24549
+ var initCursor = "";
23359
24550
 
23360
- (this._SfOnboardingViewersContainer as HTMLDivElement).innerHTML = html;
24551
+ // var html = '';
23361
24552
 
23362
- 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", "");
24553
+ // html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
24554
+ // html += '<div class="d-flex flex-col w-100">';
24555
+ // html += '<label part="input-label">Search Compliances</label>';
24556
+ // html += '<div class="d-flex">';
24557
+ // html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
24558
+ // html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
24559
+ // html += '</div>';
24560
+ // html += '</div>';
23363
24561
 
23364
- }
24562
+ // html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
24563
+ // html += '</div>';
24564
+ // html += '</div>';
23365
24565
 
23366
- renderOnboardingTags = (mappedTags: any, mappedSerializedFunctions: any, tagsJobs: any) => {
24566
+ // (this._SfOnboardingCompliancesContainer as HTMLDivElement).innerHTML = html;
23367
24567
 
23368
- var html = '';
24568
+ // (this._SfButtonSearch as HTMLButtonElement)?.addEventListener('click', async () => {
24569
+ // //console.log('clicked', mappedStatutes.data.mappings.mappings);
24570
+ // const searchString = (this._SfInputSearch as HTMLButtonElement).value;
24571
+ // //console.log('searchstring', searchString);
24572
+ // if (searchString.length > 0) {
23369
24573
 
23370
- html += '<div id="tags-list-container" class="d-flex flex-col w-100 scroll-x">';
23371
- html += '</div>';
24574
+ // const arrSearchString = searchString.split('|');
23372
24575
 
23373
- (this._SfOnboardingTagsContainer as HTMLDivElement).innerHTML = html;
24576
+ // const arrSearchStringProcessed: any = [];
23374
24577
 
23375
- 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, "", "");
24578
+ // arrSearchString.forEach((complianceId: string) => {
23376
24579
 
23377
- }
24580
+ // if (complianceId.length === 36) {
24581
+ // arrSearchStringProcessed.push(complianceId);
24582
+ // }
23378
24583
 
23379
- renderOnboardingFunctions = (mappedFunctions: any, mappedSerializedLocations: any, functionsJobs: any) => {
24584
+ // });
23380
24585
 
23381
- var html = '';
24586
+ // var resultCompliances: any = {};
24587
+ // resultCompliances.values = [];
24588
+ // const chunkSize = 20;
24589
+ // for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
23382
24590
 
23383
- html += '<div id="functions-list-container" class="d-flex flex-col w-100 scroll-x">';
23384
- html += '</div>';
24591
+ // const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
24592
+ // console.log('chunk', chunk);
24593
+ // // do whatever
24594
+ // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
24595
+ // console.log(tempResultCompliances)
24596
+ // resultCompliances.values.push(...tempResultCompliances.values);
24597
+ // //console.log(resultCompliances);
23385
24598
 
23386
- for (var i = 0; i < mappedSerializedLocations.data.mappings.mappings.length; i++) {
24599
+ // }
23387
24600
 
23388
- if (mappedSerializedLocations.data.mappings.mappings[i].id == "33a0deab-e93e-41b7-831a-473f9ea3eea2") {
23389
- //console.log('mappedSerializedLocations', mappedSerializedLocations.data.mappings.mappings[i]);
23390
- }
24601
+ // // var resultCompliances : any = {};
24602
+ // // resultCompliances.values = [];
24603
+ // // const chunkSize = 20;
24604
+ // // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
23391
24605
 
23392
- }
24606
+ // // const chunk = arrSearchString.slice(k, k + chunkSize);
24607
+ // // console.log('chunk', chunk);
24608
+ // // // do whatever
24609
+ // // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
24610
+ // // console.log(tempResultCompliances)
24611
+ // // resultCompliances.values.push(...tempResultCompliances.values);
24612
+ // // //console.log(resultCompliances);
23393
24613
 
23394
- (this._SfOnboardingFunctionsContainer as HTMLDivElement).innerHTML = html;
24614
+ // // }
23395
24615
 
23396
- 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, "", "");
24616
+ // if (resultCompliances != null) {
23397
24617
 
23398
- }
24618
+ // const jsonData = [];
23399
24619
 
23400
- renderOnboardingLocations = (mappedLocations: any, mappedSerializedEntities: any, locationsJobs: any) => {
24620
+ // const arrCompliancesFrequencies: any = {};
23401
24621
 
23402
- var html = '';
24622
+ // for (var i = 0; i < resultCompliances.values.length; i++) {
23403
24623
 
23404
- html += '<div id="locations-list-container" class="d-flex flex-col w-100 scroll-x">';
23405
- html += '</div>';
24624
+ // if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
24625
+ // continue;
24626
+ // } else {
24627
+ // arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
24628
+ // }
23406
24629
 
23407
- (this._SfOnboardingLocationsContainer as HTMLDivElement).innerHTML = html;
24630
+ // var mapped = false;
24631
+ // var extraFields = null;
24632
+ // var previousExtraFields = null;
24633
+ // console.log('mappedcompliances', mappedCompliances)
24634
+ // for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
24635
+ // if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
24636
+ // if (mappedCompliances.data.mappings.mappings[j].selected) {
24637
+ // mapped = true;
24638
+ // }
24639
+ // extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
24640
+ // }
24641
+ // }
23408
24642
 
23409
- 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, "", "");
24643
+ // for (j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23410
24644
 
23411
- }
24645
+ // // console.log('mappedStatutes.data.mappings.mappings[j]', mappedStatutes.data.mappings.mappings[j]);
24646
+ // if (Array.isArray(mappedStatutes.data.mappings.mappings[j].statutename)) {
24647
+ // // sometimes this error occurs
24648
+ // continue;
23412
24649
 
23413
- renderOnboardingCompliances = (mappedStatutes: any, mappedCompliances: any) => {
24650
+ // }
23414
24651
 
23415
- //console.log('mappedcompliances', mappedCompliances);
23416
- //console.log('mappedstatutes', mappedStatutes);
24652
+ // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
23417
24653
 
23418
- var searchString = "";
24654
+ // // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
24655
+ // // console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
24656
+ // // }
24657
+ // previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields
24658
+ // }
24659
+ // }
24660
+ // 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 })
24661
+ // }
23419
24662
 
23420
- for (var i = 0; i < (mappedStatutes.data.mappings.mappings as Array<any>).length; i++) {
23421
- if ((mappedStatutes.data.mappings.mappings as Array<any>)[i].selected) {
23422
- searchString += (mappedStatutes.data.mappings.mappings as Array<any>)[i].id + "|";
23423
- }
23424
- }
23425
- searchString = searchString.slice(0, -1);
23426
24663
 
23427
- //console.log('searchstring', searchString);
24664
+ // 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"]);
23428
24665
 
23429
- var initCursor = "";
24666
+ // }
23430
24667
 
23431
- var html = '';
24668
+ // }
23432
24669
 
23433
- html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
23434
- html += '<div class="d-flex flex-col w-100">';
23435
- html += '<label part="input-label">Search Compliances</label>';
23436
- html += '<div class="d-flex">';
23437
- html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
23438
- html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
23439
- html += '</div>';
23440
- html += '</div>';
24670
+ // });
23441
24671
 
23442
- html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
23443
- html += '</div>';
23444
- html += '</div>';
24672
+ //console.log('compliances searchstring', searchString);
23445
24673
 
23446
- (this._SfOnboardingCompliancesContainer as HTMLDivElement).innerHTML = html;
24674
+ // if (searchString != "") {
24675
+ // (this._SfInputSearch as HTMLInputElement).value = searchString;
24676
+ // (this._SfButtonSearch as HTMLButtonElement).click();
24677
+ // }
23447
24678
 
23448
- (this._SfButtonSearch as HTMLButtonElement).addEventListener('click', async () => {
23449
- //console.log('clicked', mappedStatutes.data.mappings.mappings);
23450
- const searchString = (this._SfInputSearch as HTMLButtonElement).value;
23451
- //console.log('searchstring', searchString);
23452
- if (searchString.length > 0) {
24679
+ if (searchString.length > 0) {
23453
24680
 
23454
- const arrSearchString = searchString.split('|');
24681
+ const arrSearchString = searchString.split('|');
23455
24682
 
23456
- const arrSearchStringProcessed: any = [];
24683
+ const arrSearchStringProcessed: any = [];
23457
24684
 
23458
- arrSearchString.forEach((complianceId: string) => {
24685
+ arrSearchString.forEach((complianceId: string) => {
23459
24686
 
23460
- if (complianceId.length === 36) {
23461
- arrSearchStringProcessed.push(complianceId);
23462
- }
24687
+ if (complianceId.length === 36) {
24688
+ arrSearchStringProcessed.push(complianceId);
24689
+ }
23463
24690
 
23464
- });
24691
+ });
23465
24692
 
23466
- var resultCompliances: any = {};
23467
- resultCompliances.values = [];
23468
- const chunkSize = 20;
23469
- for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
24693
+ var resultCompliances: any = {};
24694
+ resultCompliances.values = [];
24695
+ const chunkSize = 20;
24696
+ for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
23470
24697
 
23471
- const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
23472
- console.log('chunk', chunk);
23473
- // do whatever
23474
- const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
23475
- console.log(tempResultCompliances)
23476
- resultCompliances.values.push(...tempResultCompliances.values);
23477
- //console.log(resultCompliances);
24698
+ const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
24699
+ console.log('chunk', chunk);
24700
+ // do whatever
24701
+ const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
24702
+ console.log(tempResultCompliances)
24703
+ resultCompliances.values.push(...tempResultCompliances.values);
24704
+ //console.log(resultCompliances);
23478
24705
 
23479
- }
24706
+ }
23480
24707
 
23481
- // var resultCompliances : any = {};
23482
- // resultCompliances.values = [];
23483
- // const chunkSize = 20;
23484
- // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
24708
+ // var resultCompliances : any = {};
24709
+ // resultCompliances.values = [];
24710
+ // const chunkSize = 20;
24711
+ // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
23485
24712
 
23486
- // const chunk = arrSearchString.slice(k, k + chunkSize);
23487
- // console.log('chunk', chunk);
23488
- // // do whatever
23489
- // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
23490
- // console.log(tempResultCompliances)
23491
- // resultCompliances.values.push(...tempResultCompliances.values);
23492
- // //console.log(resultCompliances);
24713
+ // const chunk = arrSearchString.slice(k, k + chunkSize);
24714
+ // console.log('chunk', chunk);
24715
+ // // do whatever
24716
+ // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
24717
+ // console.log(tempResultCompliances)
24718
+ // resultCompliances.values.push(...tempResultCompliances.values);
24719
+ // //console.log(resultCompliances);
23493
24720
 
23494
- // }
24721
+ // }
23495
24722
 
23496
- if (resultCompliances != null) {
24723
+ if (resultCompliances != null) {
23497
24724
 
23498
- const jsonData = [];
24725
+ const jsonData = [];
23499
24726
 
23500
- const arrCompliancesFrequencies: any = {};
24727
+ const arrCompliancesFrequencies: any = {};
23501
24728
 
23502
- for (var i = 0; i < resultCompliances.values.length; i++) {
24729
+ for (var i = 0; i < resultCompliances.values.length; i++) {
23503
24730
 
23504
- if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
23505
- continue;
23506
- } else {
23507
- arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
23508
- }
24731
+ if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
24732
+ continue;
24733
+ } else {
24734
+ arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
24735
+ }
23509
24736
 
23510
- var mapped = false;
23511
- var extraFields = null;
23512
- var previousExtraFields = null;
23513
- console.log('mappedcompliances', mappedCompliances)
23514
- for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
23515
- if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
23516
- if (mappedCompliances.data.mappings.mappings[j].selected) {
24737
+ var mapped = false;
24738
+ var extraFields = null;
24739
+ var previousExtraFields = null;
24740
+ console.log('mappedcompliances', mappedCompliances)
24741
+ if (mappedCompliances.data.mappings.mappings == null) {
24742
+ for (var j = 0; j < Object.keys(mappedCompliances.data.mappings).length; j++) {
24743
+ let statuteKey = Object.keys(mappedCompliances.data.mappings)[j];
24744
+ for (var k = 0; k < Object.keys(mappedCompliances.data.mappings[statuteKey]).length; k++) {
24745
+ let complianceKey = Object.keys(mappedCompliances.data.mappings[statuteKey])[k];
24746
+ if (mappedCompliances.data.mappings[statuteKey][complianceKey].id == resultCompliances.values[i].id) {
23517
24747
  mapped = true;
24748
+ extraFields = mappedCompliances.data.mappings[statuteKey][complianceKey].extraFields;
23518
24749
  }
24750
+ }
24751
+ }
24752
+ } else {
24753
+ for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
24754
+ if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
24755
+ mapped = true;
23519
24756
  extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
23520
24757
  }
23521
24758
  }
23522
24759
 
24760
+
23523
24761
  for (j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23524
24762
 
23525
24763
  // console.log('mappedStatutes.data.mappings.mappings[j]', mappedStatutes.data.mappings.mappings[j]);
@@ -23531,76 +24769,34 @@ export class SfIEvents extends LitElement {
23531
24769
 
23532
24770
  if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
23533
24771
 
23534
- if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
23535
- //console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
23536
- }
24772
+ // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
24773
+ // //console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
24774
+ // }
23537
24775
  previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields
23538
24776
  }
23539
24777
  }
23540
- 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 })
23541
24778
  }
23542
-
23543
-
23544
- 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"]);
23545
-
24779
+ 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 })
23546
24780
  }
23547
24781
 
23548
- }
23549
24782
 
23550
- });
24783
+ 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);
23551
24784
 
23552
- //console.log('compliances searchstring', searchString);
24785
+ }
23553
24786
 
23554
- if (searchString != "") {
23555
- (this._SfInputSearch as HTMLInputElement).value = searchString;
23556
- (this._SfButtonSearch as HTMLButtonElement).click();
23557
24787
  }
23558
24788
 
23559
24789
  }
23560
24790
 
23561
- renderOnboardingEntities = (mappedEntities: any, mappedSerializedCountries: any, entitiesJobs: any, arrFeedbackReference: any) => {
23562
-
23563
- var html = '';
23564
-
23565
- html += '<div id="entities-list-container" class="d-flex flex-col w-100 scroll-x">';
23566
- html += '</div>';
23567
-
23568
- (this._SfOnboardingEntitiesContainer as HTMLDivElement).innerHTML = html;
24791
+ renderOnboardingEntities = (selectedStatutes: any, mappedCompliances: any, mappedCountries: any, mappedEntities: any) => {
23569
24792
 
23570
- 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", "");
24793
+ 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", "");
23571
24794
 
23572
24795
  }
23573
24796
 
23574
- renderOnboardingCountries = (mappedCountries: any, mappedCompliances: any, countriesJobs: any) => {
23575
-
23576
- var html = '';
23577
-
23578
- html += '<div id="countries-list-container" class="d-flex flex-col w-100 scroll-x">';
23579
- html += '</div>';
23580
-
23581
- (this._SfOnboardingCountriesContainer as HTMLDivElement).innerHTML = html;
23582
-
23583
- const arr1 = [];
23584
-
23585
- for (var i = 0; i < mappedCompliances.data.mappings.mappings.length; i++) {
23586
- if (mappedCompliances.data.mappings.mappings[i].selected) {
23587
- arr1.push(mappedCompliances.data.mappings.mappings[i]);
23588
- }
23589
- }
23590
-
23591
- mappedCompliances.data.mappings.mappings = arr1;
23592
-
23593
- // const arr2 = [];
23594
- // for(var i = 0; i < mappedCountries.data.mappings.mappings.length; i++) {
23595
- // if(mappedCountries.data.mappings.mappings[i].selected) {
23596
- // arr2.push(mappedCountries.data.mappings.mappings[i]);
23597
- // }
23598
- // }
23599
-
23600
- // mappedCountries.data.mappings.mappings = arr2;
23601
-
23602
- 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, "", "");
23603
-
24797
+ renderOnboardingCountries = (selectedStatutes: any, mappedCompliances: any, sourceMapping: any, mappedCountries: any) => {
24798
+ sourceMapping = {}
24799
+ 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, "", "");
23604
24800
  }
23605
24801
 
23606
24802
  renderOnboardingStatutes = (mappedStatutes: any) => {
@@ -23646,9 +24842,9 @@ export class SfIEvents extends LitElement {
23646
24842
  for (var j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
23647
24843
  if (mappedStatutes.data.mappings.mappings[j].id == resultStatutes.values[i].id) {
23648
24844
  //console.log('comparing',mappedStatutes.data.mappings.mappings[j].id,resultStatutes.values[i].id);
23649
- if (mappedStatutes.data.mappings.mappings[j].selected) {
23650
- mapped = true;
23651
- }
24845
+ // if (mappedStatutes.data.mappings.mappings[j].selected) {
24846
+ mapped = true;
24847
+ // }
23652
24848
  extraFields = mappedStatutes.data.mappings.mappings[j].extraFields;
23653
24849
  }
23654
24850
  }
@@ -23914,7 +25110,7 @@ export class SfIEvents extends LitElement {
23914
25110
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-statutes')?.addEventListener('click', async () => {
23915
25111
 
23916
25112
  this.myOnboardingTab = this.TAB_STATUTES;
23917
- this.renderOnboardingTabs();
25113
+ await this.renderOnboardingTabs();
23918
25114
  await this.loadOnboardingStatutes();
23919
25115
 
23920
25116
  });
@@ -23922,7 +25118,7 @@ export class SfIEvents extends LitElement {
23922
25118
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-compliances')?.addEventListener('click', async () => {
23923
25119
 
23924
25120
  this.myOnboardingTab = this.TAB_COMPLIANCES;
23925
- this.renderOnboardingTabs();
25121
+ await this.renderOnboardingTabs();
23926
25122
  this.loadOnboardingCompliances();
23927
25123
 
23928
25124
  });
@@ -23930,7 +25126,7 @@ export class SfIEvents extends LitElement {
23930
25126
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-countries')?.addEventListener('click', async () => {
23931
25127
 
23932
25128
  this.myOnboardingTab = this.TAB_COUNTRIES;
23933
- this.renderOnboardingTabs();
25129
+ await this.renderOnboardingTabs();
23934
25130
  this.loadOnboardingCountries();
23935
25131
 
23936
25132
  });
@@ -23938,7 +25134,7 @@ export class SfIEvents extends LitElement {
23938
25134
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-entities')?.addEventListener('click', async () => {
23939
25135
 
23940
25136
  this.myOnboardingTab = this.TAB_ENTITIES;
23941
- this.renderOnboardingTabs();
25137
+ await this.renderOnboardingTabs();
23942
25138
  this.loadOnboardingEntities();
23943
25139
 
23944
25140
  });
@@ -23946,7 +25142,7 @@ export class SfIEvents extends LitElement {
23946
25142
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-locations')?.addEventListener('click', async () => {
23947
25143
 
23948
25144
  this.myOnboardingTab = this.TAB_LOCATIONS;
23949
- this.renderOnboardingTabs();
25145
+ await this.renderOnboardingTabs();
23950
25146
  this.loadOnboardingLocations();
23951
25147
 
23952
25148
  });
@@ -23954,7 +25150,7 @@ export class SfIEvents extends LitElement {
23954
25150
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-functions')?.addEventListener('click', async () => {
23955
25151
 
23956
25152
  this.myOnboardingTab = this.TAB_FUNCTIONS;
23957
- this.renderOnboardingTabs();
25153
+ await this.renderOnboardingTabs();
23958
25154
  this.loadOnboardingFunctions();
23959
25155
 
23960
25156
  });
@@ -23962,7 +25158,7 @@ export class SfIEvents extends LitElement {
23962
25158
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-tags')?.addEventListener('click', async () => {
23963
25159
 
23964
25160
  this.myOnboardingTab = this.TAB_TAGS;
23965
- this.renderOnboardingTabs();
25161
+ await this.renderOnboardingTabs();
23966
25162
  this.loadOnboardingTags();
23967
25163
 
23968
25164
  });
@@ -23970,7 +25166,7 @@ export class SfIEvents extends LitElement {
23970
25166
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-reporters')?.addEventListener('click', async () => {
23971
25167
 
23972
25168
  this.myOnboardingTab = this.TAB_REPORTERS;
23973
- this.renderOnboardingTabs();
25169
+ await this.renderOnboardingTabs();
23974
25170
  this.loadOnboardingReporters();
23975
25171
 
23976
25172
  });
@@ -23978,7 +25174,7 @@ export class SfIEvents extends LitElement {
23978
25174
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-approvers')?.addEventListener('click', async () => {
23979
25175
 
23980
25176
  this.myOnboardingTab = this.TAB_APPROVERS;
23981
- this.renderOnboardingTabs();
25177
+ await this.renderOnboardingTabs();
23982
25178
  this.loadOnboardingApprovers();
23983
25179
 
23984
25180
  });
@@ -23986,7 +25182,7 @@ export class SfIEvents extends LitElement {
23986
25182
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-functionheads')?.addEventListener('click', async () => {
23987
25183
 
23988
25184
  this.myOnboardingTab = this.TAB_FUNCTION_HEADS;
23989
- this.renderOnboardingTabs();
25185
+ await this.renderOnboardingTabs();
23990
25186
  this.loadOnboardingFunctionHeads();
23991
25187
 
23992
25188
  });
@@ -23994,7 +25190,7 @@ export class SfIEvents extends LitElement {
23994
25190
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-auditors')?.addEventListener('click', async () => {
23995
25191
 
23996
25192
  this.myOnboardingTab = this.TAB_AUDITORS;
23997
- this.renderOnboardingTabs();
25193
+ await this.renderOnboardingTabs();
23998
25194
  this.loadOnboardingAuditors();
23999
25195
 
24000
25196
  });
@@ -24002,7 +25198,7 @@ export class SfIEvents extends LitElement {
24002
25198
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-viewers')?.addEventListener('click', async () => {
24003
25199
 
24004
25200
  this.myOnboardingTab = this.TAB_VIEWERS;
24005
- this.renderOnboardingTabs();
25201
+ await this.renderOnboardingTabs();
24006
25202
  this.loadOnboardingViewers();
24007
25203
 
24008
25204
  });
@@ -24010,7 +25206,7 @@ export class SfIEvents extends LitElement {
24010
25206
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-makercheckers')?.addEventListener('click', async () => {
24011
25207
 
24012
25208
  this.myOnboardingTab = this.TAB_MAKER_CHECKERS;
24013
- this.renderOnboardingTabs();
25209
+ await this.renderOnboardingTabs();
24014
25210
  this.loadOnboardingMakerCheckers();
24015
25211
 
24016
25212
  });
@@ -24018,7 +25214,7 @@ export class SfIEvents extends LitElement {
24018
25214
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-docs')?.addEventListener('click', async () => {
24019
25215
 
24020
25216
  this.myOnboardingTab = this.TAB_DOCS;
24021
- this.renderOnboardingTabs();
25217
+ await this.renderOnboardingTabs();
24022
25218
  this.loadOnboardingDocs();
24023
25219
 
24024
25220
  });
@@ -24026,7 +25222,7 @@ export class SfIEvents extends LitElement {
24026
25222
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-duedates')?.addEventListener('click', async () => {
24027
25223
 
24028
25224
  this.myOnboardingTab = this.TAB_DUEDATES;
24029
- this.renderOnboardingTabs();
25225
+ await this.renderOnboardingTabs();
24030
25226
  this.loadOnboardingDuedates();
24031
25227
 
24032
25228
  });
@@ -24034,7 +25230,7 @@ export class SfIEvents extends LitElement {
24034
25230
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-alertschedules')?.addEventListener('click', async () => {
24035
25231
 
24036
25232
  this.myOnboardingTab = this.TAB_ALERTSCHEDULES;
24037
- this.renderOnboardingTabs();
25233
+ await this.renderOnboardingTabs();
24038
25234
  this.loadOnboardingAlertSchedules();
24039
25235
 
24040
25236
  });
@@ -24042,7 +25238,7 @@ export class SfIEvents extends LitElement {
24042
25238
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-activations')?.addEventListener('click', async () => {
24043
25239
 
24044
25240
  this.myOnboardingTab = this.TAB_ACTIVATIONS;
24045
- this.renderOnboardingTabs();
25241
+ await this.renderOnboardingTabs();
24046
25242
  this.loadOnboardingActivations();
24047
25243
 
24048
25244
  });
@@ -24050,7 +25246,7 @@ export class SfIEvents extends LitElement {
24050
25246
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-invalidations')?.addEventListener('click', async () => {
24051
25247
 
24052
25248
  this.myOnboardingTab = this.TAB_INVALIDATION;
24053
- this.renderOnboardingTabs();
25249
+ await this.renderOnboardingTabs();
24054
25250
  this.loadOnboardingInvalidations();
24055
25251
 
24056
25252
  });
@@ -24058,7 +25254,7 @@ export class SfIEvents extends LitElement {
24058
25254
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-triggers')?.addEventListener('click', async () => {
24059
25255
 
24060
25256
  this.myOnboardingTab = this.TAB_TRIGGERS;
24061
- this.renderOnboardingTabs();
25257
+ await this.renderOnboardingTabs();
24062
25258
  this.loadOnboardingTriggers();
24063
25259
 
24064
25260
  });
@@ -24066,7 +25262,7 @@ export class SfIEvents extends LitElement {
24066
25262
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-extensions')?.addEventListener('click', async () => {
24067
25263
 
24068
25264
  this.myOnboardingTab = this.TAB_EXTENSIONS;
24069
- this.renderOnboardingTabs();
25265
+ await this.renderOnboardingTabs();
24070
25266
  this.loadOnboardingExtensions();
24071
25267
 
24072
25268
  });
@@ -24074,7 +25270,7 @@ export class SfIEvents extends LitElement {
24074
25270
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-internalcontrols')?.addEventListener('click', async () => {
24075
25271
 
24076
25272
  this.myOnboardingTab = this.TAB_INTERNALCONTROLS;
24077
- this.renderOnboardingTabs();
25273
+ await this.renderOnboardingTabs();
24078
25274
  this.loadOnboardingInternalControls();
24079
25275
 
24080
25276
  });
@@ -24082,7 +25278,7 @@ export class SfIEvents extends LitElement {
24082
25278
  (this._SfOnboardingTabContainer as HTMLDivElement).querySelector('#onboarding-tab-reportedlocations')?.addEventListener('click', async () => {
24083
25279
 
24084
25280
  this.myOnboardingTab = this.TAB_REPORTEDLOCATIONS;
24085
- this.renderOnboardingTabs();
25281
+ await this.renderOnboardingTabs();
24086
25282
  this.loadOnboardingReportedLocations();
24087
25283
 
24088
25284
  });
@@ -28142,90 +29338,90 @@ export class SfIEvents extends LitElement {
28142
29338
 
28143
29339
  }
28144
29340
 
28145
- uploadTriggersMapping = async (data: any) => {
28146
- await this.uploadOnboardingMapping(data, 'triggers');
29341
+ uploadTriggersMapping = async (data: any, statuteids: string[]) => {
29342
+ await this.uploadOnboardingMapping(data, 'triggers', statuteids);
28147
29343
  }
28148
29344
 
28149
- uploadInternalControlsMapping = async (data: any) => {
28150
- await this.uploadOnboardingMapping(data, 'internalcontrols');
29345
+ uploadInternalControlsMapping = async (data: any, statuteids: string[]) => {
29346
+ await this.uploadOnboardingMapping(data, 'internalcontrols', statuteids);
28151
29347
  }
28152
29348
 
28153
- uploadReportedLocationsMapping = async (data: any) => {
28154
- await this.uploadOnboardingMapping(data, 'reportedlocations');
29349
+ uploadReportedLocationsMapping = async (data: any, statuteids: string[]) => {
29350
+ await this.uploadOnboardingMapping(data, 'reportedlocations', statuteids);
28155
29351
  }
28156
29352
 
28157
- uploadAlertSchedulesMapping = async (data: any) => {
28158
- await this.uploadOnboardingMapping(data, 'alertschedules');
29353
+ uploadAlertSchedulesMapping = async (data: any, statuteids: string[]) => {
29354
+ await this.uploadOnboardingMapping(data, 'alertschedules', statuteids);
28159
29355
  }
28160
29356
 
28161
- uploadActivationsMapping = async (data: any) => {
28162
- await this.uploadOnboardingMapping(data, 'activations');
29357
+ uploadActivationsMapping = async (data: any, statuteids: string[]) => {
29358
+ await this.uploadOnboardingMapping(data, 'activations', statuteids);
28163
29359
  }
28164
29360
 
28165
- uploadInvalidationsMapping = async (data: any) => {
28166
- await this.uploadOnboardingMapping(data, 'invalidations');
29361
+ uploadInvalidationsMapping = async (data: any, statuteids: string[]) => {
29362
+ await this.uploadOnboardingMapping(data, 'invalidations', statuteids);
28167
29363
  }
28168
29364
 
28169
- uploadDuedatesMapping = async (data: any) => {
28170
- await this.uploadOnboardingMapping(data, 'duedates');
29365
+ uploadDuedatesMapping = async (data: any, statuteids: string[]) => {
29366
+ await this.uploadOnboardingMapping(data, 'duedates', statuteids);
28171
29367
 
28172
29368
  }
28173
29369
 
28174
- uploadExtensionsMapping = async (data: any) => {
28175
- await this.uploadOnboardingMapping(data, 'extensions');
29370
+ uploadExtensionsMapping = async (data: any, statuteids: string[]) => {
29371
+ await this.uploadOnboardingMapping(data, 'extensions', statuteids);
28176
29372
 
28177
29373
  }
28178
29374
 
28179
- uploadApproversMapping = async (data: any) => {
28180
- await this.uploadOnboardingMapping(data, 'approvers');
29375
+ uploadApproversMapping = async (data: any, statuteids: string[]) => {
29376
+ await this.uploadOnboardingMapping(data, 'approvers', statuteids);
28181
29377
 
28182
29378
  }
28183
29379
 
28184
- uploadFunctionHeadsMapping = async (data: any) => {
28185
- await this.uploadOnboardingMapping(data, 'functionheads');
29380
+ uploadFunctionHeadsMapping = async (data: any, statuteids: string[]) => {
29381
+ await this.uploadOnboardingMapping(data, 'functionheads', statuteids);
28186
29382
  }
28187
29383
 
28188
- uploadMakerCheckersMapping = async (data: any) => {
28189
- await this.uploadOnboardingMapping(data, 'makercheckers');
29384
+ uploadMakerCheckersMapping = async (data: any, statuteids: string[]) => {
29385
+ await this.uploadOnboardingMapping(data, 'makercheckers', statuteids);
28190
29386
  }
28191
29387
 
28192
- uploadDocsMapping = async (data: any) => {
28193
- await this.uploadOnboardingMapping(data, 'docs');
29388
+ uploadDocsMapping = async (data: any, statuteids: string[]) => {
29389
+ await this.uploadOnboardingMapping(data, 'docs', statuteids);
28194
29390
 
28195
29391
  }
28196
29392
 
28197
- uploadAuditorsMapping = async (data: any) => {
28198
- await this.uploadOnboardingMapping(data, 'auditors');
29393
+ uploadAuditorsMapping = async (data: any, statuteids: string[]) => {
29394
+ await this.uploadOnboardingMapping(data, 'auditors', statuteids);
28199
29395
 
28200
29396
  }
28201
29397
 
28202
- uploadViewersMapping = async (data: any) => {
28203
- await this.uploadOnboardingMapping(data, 'viewers');
29398
+ uploadViewersMapping = async (data: any, statuteids: string[]) => {
29399
+ await this.uploadOnboardingMapping(data, 'viewers', statuteids);
28204
29400
 
28205
29401
  }
28206
29402
 
28207
- uploadReportersMapping = async (data: any) => {
28208
- await this.uploadOnboardingMapping(data, 'reporters');
29403
+ uploadReportersMapping = async (data: any, statuteids: string[]) => {
29404
+ await this.uploadOnboardingMapping(data, 'reporters', statuteids);
28209
29405
  }
28210
29406
 
28211
- uploadTagsMapping = async (data: any) => {
28212
- await this.uploadOnboardingMapping(data, 'tags');
29407
+ uploadTagsMapping = async (data: any, statuteids: string[]) => {
29408
+ await this.uploadOnboardingMapping(data, 'tags', statuteids);
28213
29409
  }
28214
29410
 
28215
- uploadFunctionsMapping = async (data: any) => {
28216
- await this.uploadOnboardingMapping(data, 'functions');
29411
+ uploadFunctionsMapping = async (data: any, statuteids: string[]) => {
29412
+ await this.uploadOnboardingMapping(data, 'functions', statuteids);
28217
29413
  }
28218
29414
 
28219
- uploadLocationsMapping = async (data: any) => {
28220
- await this.uploadOnboardingMapping(data, 'locations');
29415
+ uploadLocationsMapping = async (data: any, statuteids: string[]) => {
29416
+ await this.uploadOnboardingMapping(data, 'locations', statuteids);
28221
29417
  }
28222
29418
 
28223
- uploadEntitiesMapping = async (data: any) => {
28224
- await this.uploadOnboardingMapping(data, 'entities');
29419
+ uploadEntitiesMapping = async (data: any, statuteids: string[]) => {
29420
+ await this.uploadOnboardingMapping(data, 'entities', statuteids);
28225
29421
  }
28226
29422
 
28227
- uploadCountriesMapping = async (data: any) => {
28228
- await this.uploadOnboardingMapping(data, 'countries');
29423
+ uploadCountriesMapping = async (data: any, statuteids: string[]) => {
29424
+ await this.uploadOnboardingMapping(data, 'countries', statuteids);
28229
29425
  }
28230
29426
 
28231
29427
  uploadMappedSuspense = async (data: any, year: string) => {
@@ -28262,11 +29458,11 @@ export class SfIEvents extends LitElement {
28262
29458
 
28263
29459
  }
28264
29460
 
28265
- uploadOnboardingMapping = async (data: any, onboardingstep: string) => {
29461
+ uploadOnboardingMapping = async (data: any, onboardingstep: string, statuteids: string[]) => {
28266
29462
 
28267
29463
  //console.log('uploading..', data);
28268
29464
 
28269
- let url = "https://" + this.apiId + "/updatemappedonboarding";
29465
+ let url = "https://" + this.apiId + "/updatemappedonboarding1";
28270
29466
 
28271
29467
  // const body = {
28272
29468
  // "projectid": this.projectId,
@@ -28277,7 +29473,8 @@ export class SfIEvents extends LitElement {
28277
29473
  let body: any = {
28278
29474
  "projectid": this.projectId,
28279
29475
  "presigned": true,
28280
- "onboardingstep": onboardingstep
29476
+ "onboardingstep": onboardingstep,
29477
+ "statuteids": statuteids
28281
29478
  }
28282
29479
 
28283
29480
  let authorization: any = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -28292,7 +29489,8 @@ export class SfIEvents extends LitElement {
28292
29489
  body = {
28293
29490
  "projectid": this.projectId,
28294
29491
  "key": jsonRespose.key,
28295
- "onboardingstep": onboardingstep
29492
+ "onboardingstep": onboardingstep,
29493
+ "statuteids": statuteids
28296
29494
  }
28297
29495
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
28298
29496
  xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
@@ -28320,11 +29518,14 @@ export class SfIEvents extends LitElement {
28320
29518
  }
28321
29519
  }
28322
29520
 
28323
- uploadCompliancesMapping = async (data: any) => {
28324
-
28325
- //console.log('uploading..', data);
28326
- let url = "https://" + this.apiId + "/updatemappedcompliances";
29521
+ uploadCompliancesMapping = async (data: any, mappedstatutes: Array<any>) => {
28327
29522
 
29523
+ console.log('uploading..', data, mappedstatutes);
29524
+ let url = "https://" + this.apiId + "/updatemappedcompliances1";
29525
+ let statuteids = []
29526
+ for (let statuteObj of mappedstatutes) {
29527
+ statuteids.push(statuteObj.id);
29528
+ }
28328
29529
  let body: any = {
28329
29530
  "projectid": this.projectId,
28330
29531
  "presigned": true,
@@ -28341,6 +29542,7 @@ export class SfIEvents extends LitElement {
28341
29542
 
28342
29543
  body = {
28343
29544
  "projectid": this.projectId,
29545
+ "statuteids": statuteids,
28344
29546
  "key": jsonRespose.key
28345
29547
  }
28346
29548
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -28363,28 +29565,35 @@ export class SfIEvents extends LitElement {
28363
29565
 
28364
29566
  uploadStatutesMapping = async (data: any) => {
28365
29567
 
28366
- //console.log('uploading..', data);
28367
- let url = "https://" + this.apiId + "/updatemappedstatutes";
28368
-
28369
- var searchstring = '';
29568
+ // console.log('uploading..', data);
29569
+ let url = "https://" + this.apiId + "/updatemappedstatutes1";
28370
29570
 
28371
- for (var i = 0; i < data.mappings.length; i++) {
29571
+ // var searchstring = '';
28372
29572
 
28373
- const dataItem = JSON.parse(data.mappings[i].data);
28374
- // //console.log(dataItem[3])
28375
- searchstring += dataItem[3];
28376
- if (i < (data.mappings.length - 1)) {
28377
- searchstring += '|';
28378
- }
29573
+ // for (var i = 0; i < data.mappings.length; i++) {
28379
29574
 
28380
- }
29575
+ // // const dataItem = JSON.parse(data.mappings[i].data);
29576
+ // const dataId = data.mappings[i].id;
29577
+ // // console.log(dataItem[3])
29578
+ // if (data.mappings[i].selected == true) {
29579
+ // searchstring += dataId;
29580
+ // // if (i < (data.mappings.length - 1)) {
29581
+ // searchstring += '|';
29582
+ // // }
29583
+ // }
28381
29584
 
28382
- // const body = {
29585
+ // }
29586
+ // if(searchstring.length > 0){
29587
+ // searchstring = searchstring.slice(0, -1);
29588
+ // }
29589
+ // const bodyUpload = {
28383
29590
  // "projectid": this.projectId,
28384
- // "data": JSON.stringify(data),
29591
+ // // "data": JSON.stringify(data),
28385
29592
  // "compliancessearchstring": searchstring
28386
29593
  // }
28387
29594
 
29595
+ // console.log("upload body", bodyUpload)
29596
+ // return;
28388
29597
 
28389
29598
  let body: any = {
28390
29599
  "projectid": this.projectId,
@@ -28402,7 +29611,6 @@ export class SfIEvents extends LitElement {
28402
29611
  body = {
28403
29612
  "projectid": this.projectId,
28404
29613
  "key": jsonRespose.key,
28405
- "compliancessearchstring": searchstring
28406
29614
  }
28407
29615
 
28408
29616
  authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
@@ -29657,11 +30865,11 @@ export class SfIEvents extends LitElement {
29657
30865
 
29658
30866
  }
29659
30867
 
29660
- fetchMappedCompliances = async () => {
30868
+ fetchMappedCompliances = async (statuteids = []) => {
29661
30869
 
29662
- let url = "https://" + this.apiId + "/getmappedcompliances";
30870
+ let url = "https://" + this.apiId + "/getmappedcompliances1";
29663
30871
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
29664
- const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
30872
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "statuteids": statuteids }, url, this._SfLoader, authorization)) as any;
29665
30873
  this._SfLoader.innerHTML = '';
29666
30874
  if (xhr.status == 200) {
29667
30875
 
@@ -29843,7 +31051,7 @@ export class SfIEvents extends LitElement {
29843
31051
 
29844
31052
  fetchSerializedMapping = async (onboardingstep: string) => {
29845
31053
 
29846
- const url = "https://" + this.apiId + "/getmappedserializedonboarding";
31054
+ const url = "https://" + this.apiId + "/getmappedserializedonboarding1";
29847
31055
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
29848
31056
  const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization)) as any;
29849
31057
  this._SfLoader.innerHTML = '';
@@ -29952,129 +31160,129 @@ export class SfIEvents extends LitElement {
29952
31160
 
29953
31161
  }
29954
31162
 
29955
- fetchMappedTriggers = async () => {
31163
+ fetchMappedTriggers = async (statuteids = []) => {
29956
31164
 
29957
- return (await this.fetchMappedOnboarding('triggers'));
31165
+ return (await this.fetchMappedOnboarding('triggers', statuteids));
29958
31166
 
29959
31167
  }
29960
31168
 
29961
- fetchMappedInternalControls = async () => {
31169
+ fetchMappedInternalControls = async (statuteids = []) => {
29962
31170
 
29963
- return (await this.fetchMappedOnboarding('internalcontrols'));
31171
+ return (await this.fetchMappedOnboarding('internalcontrols', statuteids));
29964
31172
 
29965
31173
  }
29966
31174
 
29967
- fetchMappedReportedLocations = async () => {
31175
+ fetchMappedReportedLocations = async (statuteids = []) => {
29968
31176
 
29969
- return (await this.fetchMappedOnboarding('reportedlocations'));
31177
+ return (await this.fetchMappedOnboarding('reportedlocations', statuteids));
29970
31178
 
29971
31179
  }
29972
31180
 
29973
- fetchMappedAlertSchedules = async () => {
31181
+ fetchMappedAlertSchedules = async (statuteids = []) => {
29974
31182
 
29975
- return (await this.fetchMappedOnboarding('alertschedules'));
31183
+ return (await this.fetchMappedOnboarding('alertschedules', statuteids));
29976
31184
 
29977
31185
  }
29978
31186
 
29979
- fetchMappedActivations = async () => {
31187
+ fetchMappedActivations = async (statuteids = []) => {
29980
31188
 
29981
- return (await this.fetchMappedOnboarding('activations'));
31189
+ return (await this.fetchMappedOnboarding('activations', statuteids));
29982
31190
 
29983
31191
  }
29984
31192
 
29985
- fetchMappedInvalidations = async () => {
31193
+ fetchMappedInvalidations = async (statuteids = []) => {
29986
31194
 
29987
- return (await this.fetchMappedOnboarding('invalidations'));
31195
+ return (await this.fetchMappedOnboarding('invalidations', statuteids));
29988
31196
 
29989
31197
  }
29990
31198
 
29991
- fetchMappedExtensions = async () => {
31199
+ fetchMappedExtensions = async (statuteids = []) => {
29992
31200
 
29993
- return (await this.fetchMappedOnboarding('extensions'));
31201
+ return (await this.fetchMappedOnboarding('extensions', statuteids));
29994
31202
 
29995
31203
  }
29996
31204
 
29997
- fetchMappedDuedates = async () => {
31205
+ fetchMappedDuedates = async (statuteids = []) => {
29998
31206
 
29999
- return (await this.fetchMappedOnboarding('duedates'));
31207
+ return (await this.fetchMappedOnboarding('duedates', statuteids));
30000
31208
 
30001
31209
  }
30002
31210
 
30003
- fetchMappedReporters = async () => {
31211
+ fetchMappedReporters = async (statuteids = []) => {
30004
31212
 
30005
- return (await this.fetchMappedOnboarding('reporters'));
31213
+ return (await this.fetchMappedOnboarding('reporters', statuteids));
30006
31214
 
30007
31215
  }
30008
31216
 
30009
- fetchMappedApprovers = async () => {
31217
+ fetchMappedApprovers = async (statuteids = []) => {
30010
31218
 
30011
- return (await this.fetchMappedOnboarding('approvers'));
31219
+ return (await this.fetchMappedOnboarding('approvers', statuteids));
30012
31220
 
30013
31221
  }
30014
31222
 
30015
- fetchMappedFunctionHeads = async () => {
31223
+ fetchMappedFunctionHeads = async (statuteids = []) => {
30016
31224
 
30017
- return (await this.fetchMappedOnboarding('functionheads'));
31225
+ return (await this.fetchMappedOnboarding('functionheads', statuteids));
30018
31226
 
30019
31227
  }
30020
31228
 
30021
- fetchMappedMakerCheckers = async () => {
31229
+ fetchMappedMakerCheckers = async (statuteids = []) => {
30022
31230
 
30023
- return (await this.fetchMappedOnboarding('makercheckers'));
31231
+ return (await this.fetchMappedOnboarding('makercheckers', statuteids));
30024
31232
 
30025
31233
  }
30026
31234
 
30027
- fetchMappedDocs = async () => {
31235
+ fetchMappedDocs = async (statuteids = []) => {
30028
31236
 
30029
- return (await this.fetchMappedOnboarding('docs'));
31237
+ return (await this.fetchMappedOnboarding('docs', statuteids));
30030
31238
 
30031
31239
  }
30032
31240
 
30033
- fetchMappedAuditors = async () => {
31241
+ fetchMappedAuditors = async (statuteids = []) => {
30034
31242
 
30035
- return (await this.fetchMappedOnboarding('auditors'));
31243
+ return (await this.fetchMappedOnboarding('auditors', statuteids));
30036
31244
 
30037
31245
  }
30038
31246
 
30039
- fetchMappedViewers = async () => {
31247
+ fetchMappedViewers = async (statuteids = []) => {
30040
31248
 
30041
- return (await this.fetchMappedOnboarding('viewers'));
31249
+ return (await this.fetchMappedOnboarding('viewers', statuteids));
30042
31250
 
30043
31251
  }
30044
31252
 
30045
- fetchMappedTags = async () => {
31253
+ fetchMappedTags = async (statuteids = []) => {
30046
31254
 
30047
- return (await this.fetchMappedOnboarding('tags'));
31255
+ return (await this.fetchMappedOnboarding('tags', statuteids));
30048
31256
 
30049
31257
  }
30050
31258
 
30051
- fetchMappedLocations = async () => {
31259
+ fetchMappedLocations = async (statuteids = []) => {
30052
31260
 
30053
- return (await this.fetchMappedOnboarding('locations'));
31261
+ return (await this.fetchMappedOnboarding('locations', statuteids));
30054
31262
 
30055
31263
  }
30056
31264
 
30057
- fetchMappedFunctions = async () => {
31265
+ fetchMappedFunctions = async (statuteids = []) => {
30058
31266
 
30059
- return (await this.fetchMappedOnboarding('functions'));
31267
+ return (await this.fetchMappedOnboarding('functions', statuteids));
30060
31268
  }
30061
31269
 
30062
- fetchMappedEntities = async () => {
31270
+ fetchMappedEntities = async (statuteids = []) => {
30063
31271
 
30064
- return (await this.fetchMappedOnboarding('entities'));
31272
+ return (await this.fetchMappedOnboarding('entities', statuteids));
30065
31273
  }
30066
31274
 
30067
- fetchMappedCountries = async () => {
31275
+ fetchMappedCountries = async (statuteids = []) => {
30068
31276
 
30069
- return (await this.fetchMappedOnboarding('countries'));
31277
+ return (await this.fetchMappedOnboarding('countries', statuteids));
30070
31278
 
30071
31279
  }
30072
31280
 
30073
- fetchMappedOnboarding = async (onboardingstep: string) => {
31281
+ fetchMappedOnboarding = async (onboardingstep: string, statuteids: string[]) => {
30074
31282
 
30075
- const url = "https://" + this.apiId + "/getmappedonboarding";
31283
+ const url = "https://" + this.apiId + "/getmappedonboarding1";
30076
31284
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
30077
- const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization)) as any;
31285
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep, "statuteids": statuteids }, url, this._SfLoader, authorization)) as any;
30078
31286
  this._SfLoader.innerHTML = '';
30079
31287
  if (xhr.status == 200) {
30080
31288
 
@@ -30083,7 +31291,17 @@ export class SfIEvents extends LitElement {
30083
31291
  resultPresigned = {};
30084
31292
  resultPresigned.data = {};
30085
31293
  let tempObj = await this.fetchPresignedUrl(jsRespose.signedUrlGet)
30086
- resultPresigned.data.mappings = (tempObj.mappings != null) ? tempObj : { mappings: [] };
31294
+ let tempArr = [];
31295
+ for (let statuteid of statuteids) {
31296
+ for (let foundObjId of Object.keys(tempObj[statuteid] ?? [])) {
31297
+ let tempPushObj = tempObj[statuteid][foundObjId];
31298
+ tempPushObj.id = foundObjId.split(';')[foundObjId.split(';').length - 1];
31299
+ tempPushObj.statuteid = statuteid;
31300
+ tempArr.push(tempPushObj);
31301
+ }
31302
+ }
31303
+ // resultPresigned.data.mappings = (tempObj.mappings != null) ? tempObj : { mappings: [] };
31304
+ resultPresigned.data.mappings = tempArr;
30087
31305
  console.log('resultPresigned onboarding1', tempObj);
30088
31306
  console.log('resultPresigned onboarding', resultPresigned);
30089
31307
  // await this.fetchPresignedUrlDelete(jsRespose.signedUrlDelete)
@@ -30127,7 +31345,7 @@ export class SfIEvents extends LitElement {
30127
31345
 
30128
31346
  fetchMappedStatutes = async () => {
30129
31347
 
30130
- let url = "https://" + this.apiId + "/getmappedstatutes";
31348
+ let url = "https://" + this.apiId + "/getmappedstatutes1";
30131
31349
  const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
30132
31350
  const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
30133
31351
  this._SfLoader.innerHTML = '';
@@ -30149,6 +31367,30 @@ export class SfIEvents extends LitElement {
30149
31367
 
30150
31368
  }
30151
31369
 
31370
+ fetchMappedStatutesList = async () => {
31371
+
31372
+ let url = "https://" + this.apiId + "/getmappedstatuteslist";
31373
+ const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
31374
+ const xhr: any = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization)) as any;
31375
+ this._SfLoader.innerHTML = '';
31376
+ if (xhr.status == 200) {
31377
+
31378
+ const jsonRespose = JSON.parse(xhr.responseText);
31379
+ //console.log(jsonRespose);
31380
+ return jsonRespose.data;
31381
+
31382
+ } else {
31383
+ if (xhr.status == 401) {
31384
+ let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
31385
+ this.dispatchEvent(changeEvent);
31386
+ }
31387
+ const jsonRespose = JSON.parse(xhr.responseText);
31388
+ this.setError(jsonRespose.error);
31389
+
31390
+ }
31391
+
31392
+ }
31393
+
30152
31394
  fetchCreateRcmJob = async (complianceid: string, data: any, triggerDate: string, triggerMessage: string, projects: any) => {
30153
31395
 
30154
31396
  data.trigger = {};