sf-i-events 1.0.976 → 1.0.978
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/index.html +51 -33
- package/package.json +2 -1
- package/sf-i-events.d.ts +95 -89
- package/sf-i-events.js +1730 -584
- package/src/sf-i-events.ts +1933 -647
package/sf-i-events.js
CHANGED
|
@@ -5280,7 +5280,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5280
5280
|
console.log('idArr', idArr);
|
|
5281
5281
|
const mmdd = idArr[2] + "/" + idArr[3];
|
|
5282
5282
|
const j = idArr[4];
|
|
5283
|
-
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[
|
|
5283
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
|
|
5284
5284
|
let renewEvent = this.events[mmdd][j];
|
|
5285
5285
|
let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
|
|
5286
5286
|
console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
|
|
@@ -7395,73 +7395,81 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7395
7395
|
//console.log('mappedstatutes', mappedStatutes);
|
|
7396
7396
|
this.renderOnboardingStatutes(mappedStatutes);
|
|
7397
7397
|
};
|
|
7398
|
-
this.loadOnboardingCompliances = async () => {
|
|
7398
|
+
this.loadOnboardingCompliances = async (selectedStatutes = []) => {
|
|
7399
7399
|
this.hideTabContainers();
|
|
7400
7400
|
this._SfOnboardingCompliancesContainer.style.display = 'flex';
|
|
7401
|
-
const mappedStatutes = await this.
|
|
7402
|
-
|
|
7403
|
-
this.
|
|
7401
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7402
|
+
console.log("mapped statutes", mappedStatutes);
|
|
7403
|
+
// const mappedStatutes = await this.fetchMappedStatutes();
|
|
7404
|
+
// const mappedCompliances = await this.fetchMappedCompliances();
|
|
7405
|
+
// this.renderOnboardingCompliances(mappedStatutes, mappedCompliances);
|
|
7406
|
+
this.renderOnboardingStatutesDropdownMapping(this._SfOnboardingCompliancesContainer, mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.renderOnboardingCompliances);
|
|
7404
7407
|
};
|
|
7405
|
-
this.loadOnboardingCountries = async () => {
|
|
7408
|
+
this.loadOnboardingCountries = async (selectedStatutes = []) => {
|
|
7406
7409
|
this.hideTabContainers();
|
|
7407
7410
|
this._SfOnboardingCountriesContainer.style.display = 'flex';
|
|
7411
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7408
7412
|
// const countriesJobs = await this.fetchCountriesJobs();
|
|
7409
|
-
const mappedCountries = await this.fetchMappedCountries();
|
|
7410
|
-
const mappedCompliances = await this.fetchMappedCompliances();
|
|
7413
|
+
// const mappedCountries = await this.fetchMappedCountries();
|
|
7414
|
+
// const mappedCompliances = await this.fetchMappedCompliances();
|
|
7411
7415
|
// const mappedStatutes = await this.fetchMappedStatutes();
|
|
7412
|
-
//console.log('countriesJobs', countriesJobs);
|
|
7413
|
-
console.log('mappedCompliances', mappedCompliances);
|
|
7414
|
-
console.log('mappedCountries', mappedCountries);
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
//console.log('uniqcol zero', mappedCompliances.data.mappings.mappings[i]);
|
|
7418
|
-
}
|
|
7419
|
-
}
|
|
7420
|
-
this.renderOnboardingCountries(mappedCountries, mappedCompliances, null);
|
|
7416
|
+
// //console.log('countriesJobs', countriesJobs);
|
|
7417
|
+
// console.log('mappedCompliances', mappedCompliances);
|
|
7418
|
+
// console.log('mappedCountries', mappedCountries);
|
|
7419
|
+
// this.renderOnboardingCountries(mappedCountries, mappedCompliances, null);
|
|
7420
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingCountriesContainer, 'countries-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, () => { return []; }, this.fetchMappedCountries, this.renderOnboardingCountries);
|
|
7421
7421
|
};
|
|
7422
|
-
this.loadOnboardingEntities = async () => {
|
|
7422
|
+
this.loadOnboardingEntities = async (selectedStatutes = []) => {
|
|
7423
7423
|
this.hideTabContainers();
|
|
7424
7424
|
this._SfOnboardingEntitiesContainer.style.display = 'flex';
|
|
7425
7425
|
// const entitiesJobs = await this.fetchEntitiesJobs();
|
|
7426
|
-
const
|
|
7427
|
-
const
|
|
7428
|
-
const
|
|
7429
|
-
// const
|
|
7426
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7427
|
+
// const mappedEntities = await this.fetchMappedEntities();
|
|
7428
|
+
// const mappedSerializedCountries = await this.fetchMappedSerializedCountries();
|
|
7429
|
+
// const arrStatuteEntitiesApplicabilities = await this.loadProposedFromStatutes(1);
|
|
7430
|
+
// // const mappedStatutes = await this.fetchMappedStatutes();
|
|
7430
7431
|
//console.log('mappedSerializedCountries', mappedSerializedCountries);
|
|
7431
7432
|
//console.log('mappedEntities', mappedEntities);
|
|
7432
7433
|
//console.log('entitiesApplicabilities', arrStatuteEntitiesApplicabilities);
|
|
7433
|
-
this.renderOnboardingEntities(mappedEntities, mappedSerializedCountries, null, arrStatuteEntitiesApplicabilities);
|
|
7434
|
+
// this.renderOnboardingEntities(mappedEntities, mappedSerializedCountries, null, arrStatuteEntitiesApplicabilities);
|
|
7435
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingEntitiesContainer, 'entities-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedCountries, this.fetchMappedEntities, this.renderOnboardingEntities);
|
|
7434
7436
|
};
|
|
7435
|
-
this.loadOnboardingLocations = async () => {
|
|
7437
|
+
this.loadOnboardingLocations = async (selectedStatutes = []) => {
|
|
7436
7438
|
this.hideTabContainers();
|
|
7437
7439
|
this._SfOnboardingLocationsContainer.style.display = 'flex';
|
|
7438
7440
|
// const locationsJobs = await this.fetchLocationsJobs();
|
|
7439
|
-
const
|
|
7440
|
-
const
|
|
7441
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7442
|
+
// const mappedSerializedEntities = await this.fetchMappedSerializedEntities();
|
|
7443
|
+
// const mappedLocations = await this.fetchMappedLocations();
|
|
7441
7444
|
//console.log('mappedserializedentities', mappedSerializedEntities);
|
|
7442
|
-
//console.log('mappedlocations', mappedLocations);
|
|
7443
|
-
this.renderOnboardingLocations(mappedLocations, mappedSerializedEntities, null);
|
|
7445
|
+
//console.log('mappedlocations', mappedLocations);
|
|
7446
|
+
// this.renderOnboardingLocations(mappedLocations, mappedSerializedEntities, null);
|
|
7447
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingLocationsContainer, 'locations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedEntities, this.fetchMappedLocations, this.renderOnboardingLocations);
|
|
7444
7448
|
};
|
|
7445
|
-
this.loadOnboardingFunctions = async () => {
|
|
7449
|
+
this.loadOnboardingFunctions = async (selectedStatutes = []) => {
|
|
7446
7450
|
this.hideTabContainers();
|
|
7447
7451
|
this._SfOnboardingFunctionsContainer.style.display = 'flex';
|
|
7452
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7448
7453
|
// const functionsJobs = await this.fetchFunctionJobs();
|
|
7449
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7450
|
-
const mappedFunctions = await this.fetchMappedFunctions();
|
|
7454
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7455
|
+
// const mappedFunctions = await this.fetchMappedFunctions();
|
|
7451
7456
|
//console.log('functionjobs', functionsJobs);
|
|
7452
7457
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7453
7458
|
//console.log('mappedfunctions', mappedFunctions);
|
|
7454
|
-
this.renderOnboardingFunctions(mappedFunctions, mappedSerializedLocations, null);
|
|
7459
|
+
// this.renderOnboardingFunctions(mappedFunctions, mappedSerializedLocations, null);
|
|
7460
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingFunctionsContainer, 'functions-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedLocations, this.fetchMappedFunctions, this.renderOnboardingFunctions);
|
|
7455
7461
|
};
|
|
7456
|
-
this.loadOnboardingTags = async () => {
|
|
7462
|
+
this.loadOnboardingTags = async (selectedStatutes = []) => {
|
|
7457
7463
|
this.hideTabContainers();
|
|
7458
7464
|
this._SfOnboardingTagsContainer.style.display = 'flex';
|
|
7465
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7459
7466
|
// const tagsJobs = await this.fetchTagsJobs();
|
|
7460
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7461
|
-
const mappedTags = await this.fetchMappedTags();
|
|
7467
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7468
|
+
// const mappedTags = await this.fetchMappedTags();
|
|
7462
7469
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7463
7470
|
//console.log('mappedtags', mappedTags);
|
|
7464
|
-
this.renderOnboardingTags(mappedTags, mappedSerializedLocations, null);
|
|
7471
|
+
// this.renderOnboardingTags(mappedTags, mappedSerializedLocations, null);
|
|
7472
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingTagsContainer, 'tags-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedTags, this.renderOnboardingTags);
|
|
7465
7473
|
};
|
|
7466
7474
|
this.loadProposedFromStatutes = async (fieldIndex) => {
|
|
7467
7475
|
const mappedStatutes = await this.fetchMappedStatutes();
|
|
@@ -7479,161 +7487,191 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7479
7487
|
//console.log('mappedstatutesend', arrStatuteReporters);
|
|
7480
7488
|
return arrStatuteReporters;
|
|
7481
7489
|
};
|
|
7482
|
-
this.loadOnboardingReporters = async () => {
|
|
7490
|
+
this.loadOnboardingReporters = async (selectedStatutes = []) => {
|
|
7483
7491
|
this.hideTabContainers();
|
|
7484
7492
|
this._SfOnboardingReportersContainer.style.display = 'flex';
|
|
7493
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7485
7494
|
// const reportersJobs = await this.fetchReportersJobs();
|
|
7486
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7487
|
-
const mappedReporters = await this.fetchMappedReporters();
|
|
7495
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7496
|
+
// const mappedReporters = await this.fetchMappedReporters();
|
|
7488
7497
|
// const arrStatuteReporters = await this.loadProposedFromStatutes(1);
|
|
7489
7498
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7490
7499
|
//console.log('mappedreporters', mappedReporters);
|
|
7491
7500
|
//console.log('arrstatutereporters', arrStatuteReporters);
|
|
7492
|
-
this.renderOnboardingReporters(mappedReporters, mappedSerializedLocations, null, null);
|
|
7501
|
+
// this.renderOnboardingReporters(mappedReporters, mappedSerializedLocations, null, null);
|
|
7502
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingReportersContainer, 'reporters-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedReporters, this.renderOnboardingReporters);
|
|
7493
7503
|
};
|
|
7494
|
-
this.loadOnboardingApprovers = async () => {
|
|
7504
|
+
this.loadOnboardingApprovers = async (selectedStatutes = []) => {
|
|
7495
7505
|
this.hideTabContainers();
|
|
7496
7506
|
this._SfOnboardingApproversContainer.style.display = 'flex';
|
|
7507
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7497
7508
|
// const approversJobs = await this.fetchApproversJobs();
|
|
7498
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7499
|
-
const mappedApprovers = await this.fetchMappedApprovers();
|
|
7509
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7510
|
+
// const mappedApprovers = await this.fetchMappedApprovers();
|
|
7500
7511
|
// const arrStatuteApprovers = await this.loadProposedFromStatutes(2);
|
|
7501
7512
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7502
7513
|
//console.log('mappedapprovers', mappedApprovers);
|
|
7503
|
-
this.renderOnboardingApprovers(mappedApprovers, mappedSerializedLocations, null, null);
|
|
7514
|
+
// this.renderOnboardingApprovers(mappedApprovers, mappedSerializedLocations, null, null);
|
|
7515
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingApproversContainer, 'approvers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedApprovers, this.renderOnboardingApprovers);
|
|
7504
7516
|
};
|
|
7505
|
-
this.loadOnboardingFunctionHeads = async () => {
|
|
7517
|
+
this.loadOnboardingFunctionHeads = async (selectedStatutes = []) => {
|
|
7506
7518
|
this.hideTabContainers();
|
|
7507
7519
|
this._SfOnboardingFunctionHeadsContainer.style.display = 'flex';
|
|
7520
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7508
7521
|
// const functionHeadsJobs = await this.fetchFunctionHeadsJobs();
|
|
7509
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7510
|
-
const mappedFunctionHeads = await this.fetchMappedFunctionHeads();
|
|
7522
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7523
|
+
// const mappedFunctionHeads = await this.fetchMappedFunctionHeads();
|
|
7511
7524
|
// const arrStatuteFunctionheads = await this.loadProposedFromStatutes(3);
|
|
7512
7525
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7513
7526
|
//console.log('mappedfunctionheads', mappedFunctionHeads);
|
|
7514
|
-
this.renderOnboardingFunctionHeads(mappedFunctionHeads, mappedSerializedLocations, null, null);
|
|
7527
|
+
// this.renderOnboardingFunctionHeads(mappedFunctionHeads, mappedSerializedLocations, null, null);
|
|
7528
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingFunctionHeadsContainer, 'functionheads-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedFunctionHeads, this.renderOnboardingFunctionHeads);
|
|
7515
7529
|
};
|
|
7516
|
-
this.loadOnboardingViewers = async () => {
|
|
7530
|
+
this.loadOnboardingViewers = async (selectedStatutes = []) => {
|
|
7517
7531
|
this.hideTabContainers();
|
|
7518
7532
|
this._SfOnboardingViewersContainer.style.display = 'flex';
|
|
7533
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7519
7534
|
// const makerViewersJobs = await this.fetchViewersJobs();
|
|
7520
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7521
|
-
const mappedViewers = await this.fetchMappedViewers();
|
|
7535
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7536
|
+
// const mappedViewers = await this.fetchMappedViewers();
|
|
7522
7537
|
// const arrStatuteViewers = await this.loadProposedFromStatutes(5);
|
|
7523
7538
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7524
7539
|
//console.log('mappedViewers', mappedViewers);
|
|
7525
|
-
this.renderOnboardingViewers(mappedViewers, mappedSerializedLocations, null, null);
|
|
7540
|
+
// this.renderOnboardingViewers(mappedViewers, mappedSerializedLocations, null, null);
|
|
7541
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingViewersContainer, 'viewers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedViewers, this.renderOnboardingViewers);
|
|
7526
7542
|
};
|
|
7527
|
-
this.loadOnboardingDocs = async () => {
|
|
7543
|
+
this.loadOnboardingDocs = async (selectedStatutes = []) => {
|
|
7528
7544
|
this.hideTabContainers();
|
|
7529
7545
|
this._SfOnboardingDocsContainer.style.display = 'flex';
|
|
7546
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7530
7547
|
// const docsJobs = await this.fetchDocsJobs();
|
|
7531
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7532
|
-
const mappedDocs = await this.fetchMappedDocs();
|
|
7548
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7549
|
+
// const mappedDocs = await this.fetchMappedDocs();
|
|
7533
7550
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7534
7551
|
//console.log('mappedDocs', mappedDocs);
|
|
7535
|
-
this.renderOnboardingDocs(mappedDocs, mappedSerializedLocations, null);
|
|
7552
|
+
// this.renderOnboardingDocs(mappedDocs, mappedSerializedLocations, null);
|
|
7553
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingDocsContainer, 'docs-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedDocs, this.renderOnboardingDocs);
|
|
7536
7554
|
};
|
|
7537
|
-
this.loadOnboardingMakerCheckers = async () => {
|
|
7555
|
+
this.loadOnboardingMakerCheckers = async (selectedStatutes = []) => {
|
|
7538
7556
|
this.hideTabContainers();
|
|
7539
7557
|
this._SfOnboardingMakerCheckersContainer.style.display = 'flex';
|
|
7558
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7540
7559
|
// const makerCheckersJobs = await this.fetchMakerCheckersJobs();
|
|
7541
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7542
|
-
const mappedMakerCheckers = await this.fetchMappedMakerCheckers();
|
|
7560
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7561
|
+
// const mappedMakerCheckers = await this.fetchMappedMakerCheckers();
|
|
7543
7562
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7544
7563
|
//console.log('mappedMakerCheckers', mappedMakerCheckers);
|
|
7545
|
-
this.renderOnboardingMakerCheckers(mappedMakerCheckers, mappedSerializedLocations, null);
|
|
7564
|
+
// this.renderOnboardingMakerCheckers(mappedMakerCheckers, mappedSerializedLocations, null);
|
|
7565
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingMakerCheckersContainer, 'makercheckers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedMakerCheckers, this.renderOnboardingMakerCheckers);
|
|
7546
7566
|
};
|
|
7547
|
-
this.loadOnboardingAuditors = async () => {
|
|
7567
|
+
this.loadOnboardingAuditors = async (selectedStatutes = []) => {
|
|
7548
7568
|
this.hideTabContainers();
|
|
7549
7569
|
this._SfOnboardingAuditorsContainer.style.display = 'flex';
|
|
7570
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7550
7571
|
// const auditorsJobs = await this.fetchAuditorsJobs();
|
|
7551
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7552
|
-
const mappedAuditors = await this.fetchMappedAuditors();
|
|
7572
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7573
|
+
// const mappedAuditors = await this.fetchMappedAuditors();
|
|
7553
7574
|
// const arrStatuteAuditors = await this.loadProposedFromStatutes(4);
|
|
7554
7575
|
//console.log('mappedSerializedFunctionheads', mappedSerializedLocations);
|
|
7555
7576
|
//console.log('mappedAuditors', mappedAuditors);
|
|
7556
|
-
this.renderOnboardingAuditors(mappedAuditors, mappedSerializedLocations, null, null);
|
|
7577
|
+
// this.renderOnboardingAuditors(mappedAuditors, mappedSerializedLocations, null, null);
|
|
7578
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingAuditorsContainer, 'auditors-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedAuditors, this.renderOnboardingAuditors);
|
|
7557
7579
|
};
|
|
7558
|
-
this.loadOnboardingDuedates = async () => {
|
|
7580
|
+
this.loadOnboardingDuedates = async (selectedStatutes = []) => {
|
|
7559
7581
|
this.hideTabContainers();
|
|
7560
7582
|
this._SfOnboardingDuedatesContainer.style.display = 'flex';
|
|
7583
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7561
7584
|
// const duedatesJobs = await this.fetchDueDatesJobs();
|
|
7562
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7563
|
-
const mappedDuedates = await this.fetchMappedDuedates();
|
|
7585
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7586
|
+
// const mappedDuedates = await this.fetchMappedDuedates();
|
|
7564
7587
|
//console.log('mappedSerializedLocations', mappedSerializedLocations);
|
|
7565
7588
|
//console.log('mappedduedates', mappedDuedates);
|
|
7566
|
-
this.renderOnboardingDuedates(mappedDuedates, mappedSerializedLocations, null);
|
|
7589
|
+
// this.renderOnboardingDuedates(mappedDuedates, mappedSerializedLocations, null);
|
|
7590
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingDuedatesContainer, 'duedates-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedDuedates, this.renderOnboardingDuedates);
|
|
7567
7591
|
};
|
|
7568
|
-
this.loadOnboardingActivations = async () => {
|
|
7592
|
+
this.loadOnboardingActivations = async (selectedStatutes = []) => {
|
|
7569
7593
|
this.hideTabContainers();
|
|
7570
7594
|
this._SfOnboardingActivationsContainer.style.display = 'flex';
|
|
7595
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7571
7596
|
// const activationsJobs = await this.fetchExtensionsJobs();
|
|
7572
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7573
|
-
const mappedActivations = await this.fetchMappedActivations();
|
|
7597
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7598
|
+
// const mappedActivations = await this.fetchMappedActivations();
|
|
7574
7599
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7575
7600
|
//console.log('mappedactivations', mappedActivations);
|
|
7576
|
-
this.renderOnboardingActivations(mappedActivations, mappedSerializedLocations, null);
|
|
7601
|
+
// this.renderOnboardingActivations(mappedActivations, mappedSerializedLocations, null);
|
|
7602
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingActivationsContainer, 'activations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedActivations, this.renderOnboardingActivations);
|
|
7577
7603
|
};
|
|
7578
|
-
this.loadOnboardingInvalidations = async () => {
|
|
7604
|
+
this.loadOnboardingInvalidations = async (selectedStatutes = []) => {
|
|
7579
7605
|
this.hideTabContainers();
|
|
7580
7606
|
this._SfOnboardingInvalidationsContainer.style.display = 'flex';
|
|
7607
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7581
7608
|
// const invalidationsJobs = await this.fetchExtensionsJobs();
|
|
7582
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7583
|
-
const mappedInvalidations = await this.fetchMappedInvalidations();
|
|
7609
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7610
|
+
// const mappedInvalidations = await this.fetchMappedInvalidations();
|
|
7584
7611
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7585
7612
|
//console.log('mappedinvalidations', mappedInvalidations);
|
|
7586
|
-
this.renderOnboardingInvalidations(mappedInvalidations, mappedSerializedLocations, null);
|
|
7613
|
+
// this.renderOnboardingInvalidations(mappedInvalidations, mappedSerializedLocations, null);
|
|
7614
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingInvalidationsContainer, 'invalidations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedInvalidations, this.renderOnboardingInvalidations);
|
|
7587
7615
|
};
|
|
7588
|
-
this.loadOnboardingAlertSchedules = async () => {
|
|
7616
|
+
this.loadOnboardingAlertSchedules = async (selectedStatutes = []) => {
|
|
7589
7617
|
this.hideTabContainers();
|
|
7590
7618
|
this._SfOnboardingAlertSchedulesContainer.style.display = 'flex';
|
|
7619
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7591
7620
|
// const alertschedulesJobs = await this.fetchAlertSchedulesJobs();
|
|
7592
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7593
|
-
const mappedAlertSchedules = await this.fetchMappedAlertSchedules();
|
|
7621
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7622
|
+
// const mappedAlertSchedules = await this.fetchMappedAlertSchedules();
|
|
7594
7623
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7595
7624
|
//console.log('mappedalertschedules', mappedAlertSchedules);
|
|
7596
|
-
this.renderOnboardingAlertSchedules(mappedAlertSchedules, mappedSerializedLocations, null);
|
|
7625
|
+
// this.renderOnboardingAlertSchedules(mappedAlertSchedules, mappedSerializedLocations, null);
|
|
7626
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingAlertSchedulesContainer, 'alertschedules-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedAlertSchedules, this.renderOnboardingAlertSchedules);
|
|
7597
7627
|
};
|
|
7598
|
-
this.loadOnboardingExtensions = async () => {
|
|
7628
|
+
this.loadOnboardingExtensions = async (selectedStatutes = []) => {
|
|
7599
7629
|
this.hideTabContainers();
|
|
7600
7630
|
this._SfOnboardingExtensionsContainer.style.display = 'flex';
|
|
7631
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7601
7632
|
// const extensionsJobs = await this.fetchExtensionsJobs();
|
|
7602
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7603
|
-
const mappedExtensions = await this.fetchMappedExtensions();
|
|
7633
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7634
|
+
// const mappedExtensions = await this.fetchMappedExtensions();
|
|
7604
7635
|
//console.log('mappedserializedlocations', mappedSerializedLocations);
|
|
7605
7636
|
//console.log('mappedextensions', mappedExtensions);
|
|
7606
|
-
this.renderOnboardingExtensions(mappedExtensions, mappedSerializedLocations, null);
|
|
7637
|
+
// this.renderOnboardingExtensions(mappedExtensions, mappedSerializedLocations, null);
|
|
7638
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingExtensionsContainer, 'extensions-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedExtensions, this.renderOnboardingExtensions);
|
|
7607
7639
|
};
|
|
7608
|
-
this.loadOnboardingTriggers = async () => {
|
|
7640
|
+
this.loadOnboardingTriggers = async (selectedStatutes = []) => {
|
|
7609
7641
|
this.hideTabContainers();
|
|
7610
7642
|
this._SfOnboardingTriggersContainer.style.display = 'flex';
|
|
7643
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7611
7644
|
// const triggersJobs = await this.fetchInternalControlsJobs();
|
|
7612
7645
|
// const mappedSerializedAlertSchedules = await this.fetchMappedSerializedAlertSchedules();
|
|
7613
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7614
|
-
const mappedTriggers = await this.fetchMappedTriggers();
|
|
7646
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7647
|
+
// const mappedTriggers = await this.fetchMappedTriggers();
|
|
7615
7648
|
//console.log('mappedSerializedAlertSchedules', mappedSerializedAlertSchedules);
|
|
7616
7649
|
//console.log('mappedTriggers', mappedTriggers);
|
|
7617
|
-
this.renderOnboardingTriggers(mappedTriggers, mappedSerializedLocations, null);
|
|
7650
|
+
// this.renderOnboardingTriggers(mappedTriggers, mappedSerializedLocations, null);
|
|
7651
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingTriggersContainer, 'triggers-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedTriggers, this.renderOnboardingTriggers);
|
|
7618
7652
|
};
|
|
7619
|
-
this.loadOnboardingInternalControls = async () => {
|
|
7653
|
+
this.loadOnboardingInternalControls = async (selectedStatutes = []) => {
|
|
7620
7654
|
this.hideTabContainers();
|
|
7621
7655
|
this._SfOnboardingInternalControlsContainer.style.display = 'flex';
|
|
7656
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7622
7657
|
// const internalcontrolsJobs = await this.fetchInternalControlsJobs();
|
|
7623
|
-
const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7624
|
-
const mappedInternalControls = await this.fetchMappedInternalControls();
|
|
7658
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7659
|
+
// const mappedInternalControls = await this.fetchMappedInternalControls();
|
|
7625
7660
|
//console.log('mappedSerializedlocations', mappedSerializedLocations);
|
|
7626
7661
|
//console.log('mappedinternalcontrols', mappedInternalControls);
|
|
7627
|
-
this.renderOnboardingInternalControls(mappedInternalControls, mappedSerializedLocations, null);
|
|
7662
|
+
// this.renderOnboardingInternalControls(mappedInternalControls, mappedSerializedLocations, null);
|
|
7663
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingInternalControlsContainer, 'internalcontrols-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedInternalControls, this.renderOnboardingInternalControls);
|
|
7628
7664
|
};
|
|
7629
|
-
this.loadOnboardingReportedLocations = async () => {
|
|
7665
|
+
this.loadOnboardingReportedLocations = async (selectedStatutes = []) => {
|
|
7630
7666
|
this.hideTabContainers();
|
|
7631
7667
|
this._SfOnboardingReportedLocationsContainer.style.display = 'flex';
|
|
7632
|
-
const
|
|
7633
|
-
const
|
|
7668
|
+
const mappedStatutes = await this.fetchMappedStatutesList();
|
|
7669
|
+
// const mappedSerializedLocations = await this.fetchMappedSerializedLocations();
|
|
7670
|
+
// const mappedReportedLocations = await this.fetchMappedReportedLocations();
|
|
7634
7671
|
//console.log('mappedSerializedlocations', mappedSerializedLocations);
|
|
7635
7672
|
//console.log('mappedReportedLocations', mappedReportedLocations);
|
|
7636
|
-
this.renderOnboardingReportedLocations(mappedReportedLocations, mappedSerializedLocations, null);
|
|
7673
|
+
// this.renderOnboardingReportedLocations(mappedReportedLocations, mappedSerializedLocations, null);
|
|
7674
|
+
this.renderOnboardingStatutesDropdownTagging(this._SfOnboardingReportedLocationsContainer, 'reportedlocations-list-container', mappedStatutes, selectedStatutes, this.fetchMappedCompliances, this.fetchMappedFunctions, this.fetchMappedReportedLocations, this.renderOnboardingReportedLocations);
|
|
7637
7675
|
};
|
|
7638
7676
|
this.loadOnboardingSignoff = async () => {
|
|
7639
7677
|
this.hideTabContainers();
|
|
@@ -9274,7 +9312,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9274
9312
|
console.log('idArr', idArr);
|
|
9275
9313
|
const mmdd = idArr[2] + "/" + idArr[3];
|
|
9276
9314
|
const j = idArr[4];
|
|
9277
|
-
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[
|
|
9315
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
|
|
9278
9316
|
let renewEvent = this.events[mmdd][j];
|
|
9279
9317
|
let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
|
|
9280
9318
|
console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
|
|
@@ -9919,7 +9957,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9919
9957
|
console.log('idArr', idArr);
|
|
9920
9958
|
const mmdd = idArr[2] + "/" + idArr[3];
|
|
9921
9959
|
const j = idArr[4];
|
|
9922
|
-
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[
|
|
9960
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
|
|
9923
9961
|
let renewEvent = this.events[mmdd][j];
|
|
9924
9962
|
let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
|
|
9925
9963
|
console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
|
|
@@ -10100,6 +10138,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
10100
10138
|
const startDate = new Date(startDateStr);
|
|
10101
10139
|
const endDate = new Date(endDateStr);
|
|
10102
10140
|
const month = parseInt(monthStr, 10); // Ensure month is a number
|
|
10141
|
+
console.log('getting date', startDate, endDate, month);
|
|
10103
10142
|
if (isNaN(month) || month < 1 || month > 12) {
|
|
10104
10143
|
return this.calendarStartYYYY;
|
|
10105
10144
|
}
|
|
@@ -11000,7 +11039,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
11000
11039
|
console.log('idArr', idArr);
|
|
11001
11040
|
const mmdd = idArr[2] + "/" + idArr[3];
|
|
11002
11041
|
const j = idArr[4];
|
|
11003
|
-
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[
|
|
11042
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[2]);
|
|
11004
11043
|
let renewEvent = this.events[mmdd][j];
|
|
11005
11044
|
let fullEvent = await this.fetchRCMResourceDetails(renewEvent, mmdd + "/" + yyyy, true);
|
|
11006
11045
|
console.log('renew clicked', fullEvent, fullEvent.reportformatvalues);
|
|
@@ -15261,14 +15300,16 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
15261
15300
|
if (this.selectedItemIds.length <= 1) {
|
|
15262
15301
|
console.log('selectedevent', JSON.stringify(event));
|
|
15263
15302
|
if (await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], comments, approved, (_a = event.module) !== null && _a !== void 0 ? _a : "compliance")) {
|
|
15264
|
-
|
|
15265
|
-
|
|
15266
|
-
this.events[mmdd][p].
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15303
|
+
if (this.mode != "next") {
|
|
15304
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15305
|
+
if (this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid) {
|
|
15306
|
+
this.events[mmdd][p].approved = approved;
|
|
15307
|
+
console.log('selected event', this.events[mmdd][p]);
|
|
15308
|
+
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() });
|
|
15309
|
+
this.events[mmdd][p].lastupdated = new Date().toString();
|
|
15310
|
+
if (approved) {
|
|
15311
|
+
this.events[mmdd][p].dateofcompletion = new Date().getTime() + "";
|
|
15312
|
+
}
|
|
15272
15313
|
}
|
|
15273
15314
|
}
|
|
15274
15315
|
}
|
|
@@ -15986,6 +16027,61 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
15986
16027
|
taggingArray.data.mappings.mappings = tempArray;
|
|
15987
16028
|
//console.log('selectedindexchecking', colName, taggingArray);
|
|
15988
16029
|
};
|
|
16030
|
+
this.applyAndReloadTaggingNew = (e, colName, taggingArray, sourceArray, divElement) => {
|
|
16031
|
+
const selectedIndex = e.currentTarget.id.split('-')[1];
|
|
16032
|
+
const tempArray = [];
|
|
16033
|
+
console.log('sourceArray apply', sourceArray, taggingArray);
|
|
16034
|
+
console.log('selectedindexchecking 1', this.selectedCbs);
|
|
16035
|
+
for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
|
|
16036
|
+
console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex + ""), this.selectedCbs.includes(count + ""));
|
|
16037
|
+
tempArray.push(taggingArray.data.mappings.mappings[count]);
|
|
16038
|
+
if (this.selectedCbs.includes(selectedIndex + '') && this.selectedCbs.includes(count + '')) {
|
|
16039
|
+
if (divElement.querySelector('#tags-' + selectedIndex).selectedValues != null) {
|
|
16040
|
+
if (tempArray[count] == null)
|
|
16041
|
+
tempArray[count] = {};
|
|
16042
|
+
tempArray[count][colName] = divElement.querySelector('#tags-' + selectedIndex).selectedValues();
|
|
16043
|
+
}
|
|
16044
|
+
else {
|
|
16045
|
+
if (tempArray[count] == null)
|
|
16046
|
+
tempArray[count] = {};
|
|
16047
|
+
tempArray[count][colName] = divElement.querySelector('#tags-' + selectedIndex).value;
|
|
16048
|
+
}
|
|
16049
|
+
}
|
|
16050
|
+
else {
|
|
16051
|
+
if (divElement.querySelector('#tags-' + count).selectedValues != null) {
|
|
16052
|
+
if (tempArray[count] == null)
|
|
16053
|
+
tempArray[count] = {};
|
|
16054
|
+
if (colName == "countries" || colName == "entities" || colName == "locations") {
|
|
16055
|
+
let selectedValues = divElement.querySelector('#tags-' + count).selectedValues();
|
|
16056
|
+
if (selectedValues == null || selectedValues.length == 0) {
|
|
16057
|
+
tempArray[count] = {};
|
|
16058
|
+
console.log('deleting1', tempArray);
|
|
16059
|
+
}
|
|
16060
|
+
else {
|
|
16061
|
+
tempArray[count][colName] = divElement.querySelector('#tags-' + count).selectedValues();
|
|
16062
|
+
}
|
|
16063
|
+
}
|
|
16064
|
+
else {
|
|
16065
|
+
tempArray[count][colName] = divElement.querySelector('#tags-' + count).selectedValues();
|
|
16066
|
+
}
|
|
16067
|
+
}
|
|
16068
|
+
else {
|
|
16069
|
+
//console.log('selectedindexchecking D');
|
|
16070
|
+
if (tempArray[count] == null)
|
|
16071
|
+
tempArray[count] = {};
|
|
16072
|
+
if (colName == "countries" || colName == "entities" || colName == "locations") {
|
|
16073
|
+
tempArray[count] = {};
|
|
16074
|
+
console.log('deleting2', tempArray);
|
|
16075
|
+
}
|
|
16076
|
+
else {
|
|
16077
|
+
tempArray[count][colName] = divElement.querySelector('#tags-' + count).value;
|
|
16078
|
+
}
|
|
16079
|
+
}
|
|
16080
|
+
}
|
|
16081
|
+
}
|
|
16082
|
+
taggingArray.data.mappings.mappings = tempArray;
|
|
16083
|
+
console.log('selectedindexchecking', colName, taggingArray);
|
|
16084
|
+
};
|
|
15989
16085
|
this.getDataValue = (jsonData, id) => {
|
|
15990
16086
|
let ret = null;
|
|
15991
16087
|
//console.log('pushing up again..', id, jsonData);
|
|
@@ -16005,7 +16101,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16005
16101
|
}
|
|
16006
16102
|
return ret;
|
|
16007
16103
|
};
|
|
16008
|
-
this.saveMapping = async (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, saveInBackground = false) => {
|
|
16104
|
+
this.saveMapping = async (divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, saveInBackground = false, mappedStatutes) => {
|
|
16009
16105
|
const process = async () => {
|
|
16010
16106
|
const tableRowArr = divElement.querySelectorAll('.tablerow');
|
|
16011
16107
|
const checkboxArr = divElement.querySelectorAll('.checkbox-row');
|
|
@@ -16019,30 +16115,79 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16019
16115
|
let updatedRows = [];
|
|
16020
16116
|
let jsonArr = [];
|
|
16021
16117
|
if (uploadBlock < 0) {
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16118
|
+
if (mappedStatutes.length == 0) {
|
|
16119
|
+
for (var i = 0; i < checkboxArr.length; i++) {
|
|
16120
|
+
//console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
|
|
16121
|
+
if (checkboxArr[i].checked !== true) {
|
|
16122
|
+
continue;
|
|
16123
|
+
}
|
|
16124
|
+
if (tableRowArr[i].style.display == 'none') {
|
|
16125
|
+
}
|
|
16126
|
+
else {
|
|
16127
|
+
updatedRows.push(statuteArr[i].text);
|
|
16128
|
+
}
|
|
16129
|
+
let cols = JSON.parse(this.getColsValue(jsonData, statuteArr[i].text)[0]);
|
|
16130
|
+
let data = JSON.parse(this.getDataValue(jsonData, statuteArr[i].text)[0]);
|
|
16131
|
+
var dataToBePushed = { id: statuteArr[i].text, name: data[cols.indexOf('name')], countryname: data[cols.indexOf('country')][0] };
|
|
16132
|
+
/* 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[] };
|
|
16133
|
+
for (var j = 0; j < extraFields.length; j++) {
|
|
16134
|
+
const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
|
|
16135
|
+
const value = inputArr[k].getValues();
|
|
16136
|
+
dataToBePushed.extraFields.push(value);
|
|
16137
|
+
if (j === 0) {
|
|
16138
|
+
const fields = inputArr[i].getFields();
|
|
16139
|
+
dataToBePushed.updatedFields.push(...fields);
|
|
16140
|
+
}
|
|
16141
|
+
} */
|
|
16142
|
+
jsonArr.push(dataToBePushed);
|
|
16028
16143
|
}
|
|
16029
|
-
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16144
|
+
console.log('jsonArr', jsonArr);
|
|
16145
|
+
//console.log('updatedRows', updatedRows);
|
|
16146
|
+
// const batchNum = new Date().getTime();
|
|
16147
|
+
// await uploadFunction({ "searchstring": searchString, "mappings": jsonArr, "batch": batchNum, "updatedrows": updatedRows });
|
|
16148
|
+
await uploadFunction({ "searchstring": searchString, "mappings": jsonArr });
|
|
16149
|
+
}
|
|
16150
|
+
else {
|
|
16151
|
+
for (var i = 0; i < checkboxArr.length; i++) {
|
|
16152
|
+
//console.log('tablerow', (tableRowArr[i] as HTMLTableRowElement));
|
|
16153
|
+
if (checkboxArr[i].checked !== true) {
|
|
16154
|
+
continue;
|
|
16155
|
+
}
|
|
16156
|
+
if (tableRowArr[i].style.display == 'none') {
|
|
16157
|
+
}
|
|
16158
|
+
else {
|
|
16159
|
+
updatedRows.push(statuteArr[i].text);
|
|
16160
|
+
}
|
|
16161
|
+
let cols = JSON.parse(this.getColsValue(jsonData, statuteArr[i].text)[0]);
|
|
16162
|
+
let data = JSON.parse(this.getDataValue(jsonData, statuteArr[i].text)[0]);
|
|
16163
|
+
var dataToBePushed = { id: statuteArr[i].text, data: [JSON.stringify(data)], cols: [JSON.stringify(cols)] };
|
|
16164
|
+
/* 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[] };
|
|
16165
|
+
for (var j = 0; j < extraFields.length; j++) {
|
|
16166
|
+
const inputArr = (divElement as HTMLDivElement).querySelectorAll('.extra-field-' + j) as NodeListOf<SfIMultitextarea>;
|
|
16167
|
+
const value = inputArr[k].getValues();
|
|
16168
|
+
dataToBePushed.extraFields.push(value);
|
|
16169
|
+
if (j === 0) {
|
|
16036
16170
|
const fields = inputArr[i].getFields();
|
|
16037
16171
|
dataToBePushed.updatedFields.push(...fields);
|
|
16172
|
+
}
|
|
16173
|
+
} */
|
|
16174
|
+
jsonArr.push(dataToBePushed);
|
|
16175
|
+
}
|
|
16176
|
+
let jsonObj = {};
|
|
16177
|
+
for (let statuteObj of mappedStatutes) {
|
|
16178
|
+
let statuteid = statuteObj.id;
|
|
16179
|
+
if (jsonObj[statuteid] == null) {
|
|
16180
|
+
jsonObj[statuteid] = {};
|
|
16181
|
+
}
|
|
16182
|
+
for (let mappingObj of jsonArr) {
|
|
16183
|
+
console.log('mappingObj', mappingObj.data, statuteid);
|
|
16184
|
+
if (mappingObj.data[0].indexOf(statuteid) >= 0) {
|
|
16185
|
+
jsonObj[statuteid][mappingObj.id] = mappingObj;
|
|
16186
|
+
}
|
|
16038
16187
|
}
|
|
16039
16188
|
}
|
|
16040
|
-
|
|
16189
|
+
await uploadFunction(jsonObj, mappedStatutes);
|
|
16041
16190
|
}
|
|
16042
|
-
//console.log('jsonArr', jsonArr);
|
|
16043
|
-
//console.log('updatedRows', updatedRows);
|
|
16044
|
-
const batchNum = new Date().getTime();
|
|
16045
|
-
await uploadFunction({ "searchstring": searchString, "mappings": jsonArr, "batch": batchNum, "updatedrows": updatedRows });
|
|
16046
16191
|
}
|
|
16047
16192
|
else {
|
|
16048
16193
|
const batchNum = new Date().getTime();
|
|
@@ -16075,7 +16220,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16075
16220
|
}
|
|
16076
16221
|
}
|
|
16077
16222
|
if (!saveInBackground)
|
|
16078
|
-
refreshFunction();
|
|
16223
|
+
refreshFunction(mappedStatutes);
|
|
16079
16224
|
};
|
|
16080
16225
|
if (this.disablesave == "yes") {
|
|
16081
16226
|
return;
|
|
@@ -16097,12 +16242,49 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16097
16242
|
process();
|
|
16098
16243
|
}
|
|
16099
16244
|
};
|
|
16100
|
-
this.saveTagging = async (mapping, uploadFunction, refreshFunction, saveInBackground) => {
|
|
16245
|
+
this.saveTagging = async (mapping, selectedStatutes, uploadFunction, refreshFunction, saveInBackground, colName) => {
|
|
16101
16246
|
async function process() {
|
|
16102
|
-
|
|
16103
|
-
|
|
16247
|
+
console.log('Saving...', JSON.stringify(mapping));
|
|
16248
|
+
let statuteids = [];
|
|
16249
|
+
let statutewiseMapping = {};
|
|
16250
|
+
for (let statutesObj of selectedStatutes) {
|
|
16251
|
+
statuteids.push(statutesObj.id);
|
|
16252
|
+
statutewiseMapping[statutesObj.id] = {};
|
|
16253
|
+
for (let mapObj of mapping.mappings) {
|
|
16254
|
+
if (mapObj.statuteid == statutesObj.id) {
|
|
16255
|
+
let pushObj = mapObj;
|
|
16256
|
+
delete pushObj.statuteid;
|
|
16257
|
+
let compoundid = mapObj.id;
|
|
16258
|
+
// if (colName == "countries" || colName == "entities" || colName == "locations") {
|
|
16259
|
+
switch (colName) {
|
|
16260
|
+
case "countries":
|
|
16261
|
+
compoundid = mapObj.id;
|
|
16262
|
+
break;
|
|
16263
|
+
case "entities":
|
|
16264
|
+
compoundid = mapObj.countryid + ';' + mapObj.id;
|
|
16265
|
+
break;
|
|
16266
|
+
case "locations":
|
|
16267
|
+
compoundid = mapObj.entityid + ';' + mapObj.id;
|
|
16268
|
+
break;
|
|
16269
|
+
default:
|
|
16270
|
+
compoundid = mapObj.entityid + ';' + mapObj.locationid + ';' + mapObj.id;
|
|
16271
|
+
break;
|
|
16272
|
+
}
|
|
16273
|
+
// }
|
|
16274
|
+
if (statutewiseMapping[statutesObj.id][compoundid] != null) {
|
|
16275
|
+
let pushObjOld = statutewiseMapping[statutesObj.id][compoundid];
|
|
16276
|
+
pushObj[colName] = [...pushObjOld[colName], ...mapObj[colName]];
|
|
16277
|
+
}
|
|
16278
|
+
else {
|
|
16279
|
+
statutewiseMapping[statutesObj.id][compoundid] = pushObj;
|
|
16280
|
+
}
|
|
16281
|
+
}
|
|
16282
|
+
}
|
|
16283
|
+
}
|
|
16284
|
+
console.log('Uploading ...', JSON.stringify(statutewiseMapping));
|
|
16285
|
+
await uploadFunction(statutewiseMapping, statuteids);
|
|
16104
16286
|
if (!saveInBackground)
|
|
16105
|
-
refreshFunction();
|
|
16287
|
+
refreshFunction(selectedStatutes);
|
|
16106
16288
|
}
|
|
16107
16289
|
if (this.disablesave == "yes") {
|
|
16108
16290
|
return;
|
|
@@ -16982,7 +17164,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
16982
17164
|
// });
|
|
16983
17165
|
const buttonSave = divElement.querySelector('.button-save');
|
|
16984
17166
|
buttonSave === null || buttonSave === void 0 ? void 0 : buttonSave.addEventListener('click', async () => {
|
|
16985
|
-
await this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, false);
|
|
17167
|
+
await this.saveTagging(taggingArray.data.mappings, [], uploadFunction, refreshFunction, false, colName);
|
|
16986
17168
|
});
|
|
16987
17169
|
const buttonCancel = divElement.querySelector('.button-cancel');
|
|
16988
17170
|
buttonCancel === null || buttonCancel === void 0 ? void 0 : buttonCancel.addEventListener('click', async () => {
|
|
@@ -17022,117 +17204,959 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17022
17204
|
}
|
|
17023
17205
|
this.changedOnboardingItemIds = [];
|
|
17024
17206
|
};
|
|
17025
|
-
this.
|
|
17026
|
-
var _a, _b, _c, _f
|
|
17027
|
-
console.log('
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
|
|
17037
|
-
|
|
17207
|
+
this.renderTaggingTableNew = (divElement, selectedStatutes, sourceObject, sourceMapping, taggingObject, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter) => {
|
|
17208
|
+
var _a, _b, _c, _f;
|
|
17209
|
+
console.log('sourceObj', sourceObject);
|
|
17210
|
+
console.log('taggingObj', taggingObject);
|
|
17211
|
+
let sourceArray = { data: { mappings: { mappings: sourceObject.data.mappings } } };
|
|
17212
|
+
let taggingArray = { data: { mappings: { mappings: taggingObject.data.mappings } } };
|
|
17213
|
+
if (taggingObject.data.mappings.mappings != null) {
|
|
17214
|
+
taggingArray = taggingObject;
|
|
17215
|
+
}
|
|
17216
|
+
console.log('divelement', divElement);
|
|
17217
|
+
console.log('sourcearray', sourceArray);
|
|
17218
|
+
console.log('sourceMapping', sourceMapping);
|
|
17219
|
+
console.log('taggingarray', JSON.stringify(taggingArray));
|
|
17220
|
+
console.log('selectedStatutes', selectedStatutes);
|
|
17038
17221
|
this.selectedCbs = [];
|
|
17039
|
-
|
|
17040
|
-
|
|
17041
|
-
|
|
17042
|
-
|
|
17043
|
-
|
|
17044
|
-
|
|
17045
|
-
|
|
17046
|
-
|
|
17047
|
-
|
|
17048
|
-
|
|
17049
|
-
|
|
17050
|
-
|
|
17051
|
-
|
|
17052
|
-
|
|
17053
|
-
|
|
17054
|
-
|
|
17055
|
-
|
|
17056
|
-
|
|
17057
|
-
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17063
|
-
|
|
17064
|
-
html += '</div>';
|
|
17065
|
-
html += '</div>';
|
|
17066
|
-
html += '</div>';
|
|
17067
|
-
html += '<div class="d-flex align-center">';
|
|
17068
|
-
html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
17069
|
-
html += '<div class="mr-10">';
|
|
17070
|
-
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>';
|
|
17071
|
-
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>';
|
|
17072
|
-
html += '</div>';
|
|
17073
|
-
html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
|
|
17074
|
-
html += '</div>';
|
|
17075
|
-
html += '</div>';
|
|
17076
|
-
html += '<table id="table-data">';
|
|
17077
|
-
html += '<thead>';
|
|
17078
|
-
html += '<th part="td-head" class="td-head">';
|
|
17079
|
-
// html += 'Select';
|
|
17080
|
-
html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
|
|
17081
|
-
html += '</th>';
|
|
17082
|
-
html += '<th part="td-head" class="td-head">';
|
|
17083
|
-
html += '<div>View</div>';
|
|
17084
|
-
html += '</th>';
|
|
17085
|
-
if (extraFieldPosition === 0) {
|
|
17086
|
-
for (var i = 0; i < extraFields.length; i++) {
|
|
17087
|
-
html += '<th part="td-head" class="td-head">';
|
|
17088
|
-
html += extraFields[i];
|
|
17089
|
-
html += '</th>';
|
|
17090
|
-
}
|
|
17091
|
-
}
|
|
17092
|
-
if (colName.toLowerCase() == "compliances") {
|
|
17093
|
-
html += '<th part="td-head" class="td-head">';
|
|
17094
|
-
html += 'Proposed Users';
|
|
17095
|
-
html += '</th>';
|
|
17096
|
-
}
|
|
17097
|
-
html += '<th part="td-head" class="td-head">';
|
|
17098
|
-
html += 'Id';
|
|
17099
|
-
html += '</th>';
|
|
17100
|
-
// for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
|
|
17101
|
-
// if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
|
|
17102
|
-
// html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
|
|
17103
|
-
// html += JSON.parse(jsonData[0].data.cols)[j]
|
|
17104
|
-
// html += '</th>'
|
|
17222
|
+
// const foundArr = [];
|
|
17223
|
+
// if (taggingArray.data.mappings != null && taggingArray.data.mappings.mappings.length > 0) {
|
|
17224
|
+
// console.log('scanning taggingarray', taggingArray.data.mappings.mappings.length + "");
|
|
17225
|
+
// for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
17226
|
+
// var found = false;
|
|
17227
|
+
// // console.log('source array search', sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id], taggingArray.data.mappings.mappings[i].id)
|
|
17228
|
+
// if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null) {
|
|
17229
|
+
// var equal = true;
|
|
17230
|
+
// for (var k = 0; k < uniqCols.length; k++) {
|
|
17231
|
+
// console.log('checking uniqCols', uniqCols[k]);
|
|
17232
|
+
// if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null && taggingArray.data.mappings.mappings[i] != null) {
|
|
17233
|
+
// if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
|
|
17234
|
+
// equal = false;
|
|
17235
|
+
// }
|
|
17236
|
+
// }
|
|
17237
|
+
// }
|
|
17238
|
+
// if (equal) {
|
|
17239
|
+
// found = true;
|
|
17240
|
+
// }
|
|
17241
|
+
// }
|
|
17242
|
+
// if (found) {
|
|
17243
|
+
// foundArr.push(taggingArray.data.mappings.mappings[i]);
|
|
17244
|
+
// } else {
|
|
17245
|
+
// console.log('taggingarray not found', taggingArray.data.mappings.mappings[i], i)
|
|
17246
|
+
// }
|
|
17105
17247
|
// }
|
|
17248
|
+
// } else {
|
|
17249
|
+
// console.log('taggingArray1', taggingArray.data.mappings, taggingArray.data.mappings.mappings)
|
|
17106
17250
|
// }
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17251
|
+
// console.log('taggingarray2', taggingArray.data.mappings.mappings.length + "");
|
|
17252
|
+
// if (taggingArray.data.mappings == null) {
|
|
17253
|
+
// taggingArray.data.mappings = {};
|
|
17254
|
+
// }
|
|
17255
|
+
// taggingArray.data.mappings.mappings = foundArr;
|
|
17256
|
+
for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
17257
|
+
if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] == null) {
|
|
17258
|
+
taggingArray.data.mappings.mappings.splice(i, 1);
|
|
17259
|
+
}
|
|
17112
17260
|
}
|
|
17113
|
-
|
|
17114
|
-
|
|
17115
|
-
|
|
17116
|
-
|
|
17117
|
-
|
|
17261
|
+
let mandatoryPresent = true;
|
|
17262
|
+
console.log('mandatoryFields', mandatoryFields);
|
|
17263
|
+
for (i = 0; i < mandatoryFields.length; i++) {
|
|
17264
|
+
for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17265
|
+
if (taggingArray.data.mappings.mappings[j][mandatoryFields[i]] == null) {
|
|
17266
|
+
console.log('mandatory not found', mandatoryFields[i]);
|
|
17267
|
+
mandatoryPresent = false;
|
|
17268
|
+
}
|
|
17118
17269
|
}
|
|
17119
17270
|
}
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17271
|
+
var taggedIds = [];
|
|
17272
|
+
for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17273
|
+
if (taggingArray.data.mappings.mappings[j] != null) {
|
|
17274
|
+
if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
|
|
17275
|
+
if (taggedIds.indexOf(taggingArray.data.mappings.mappings[j].id) < 0) {
|
|
17276
|
+
taggedIds.push(taggingArray.data.mappings.mappings[j].id);
|
|
17277
|
+
}
|
|
17278
|
+
}
|
|
17126
17279
|
}
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
|
|
17280
|
+
}
|
|
17281
|
+
// if (taggedIds.length < Object.keys(sourceArray.data.mappings.mappings).length) {
|
|
17282
|
+
// for (let sourceid of Object.keys(sourceArray.data.mappings.mappings)) {
|
|
17283
|
+
// if (taggedIds.indexOf(sourceid) >= 0) {
|
|
17284
|
+
// continue;
|
|
17285
|
+
// }
|
|
17286
|
+
// let objToPush: any = { id: sourceid }
|
|
17287
|
+
// for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
|
|
17288
|
+
// objToPush[mandatoryFields[i]] = ""
|
|
17289
|
+
// }
|
|
17290
|
+
// taggingArray.data.mappings.mappings.push(objToPush);
|
|
17291
|
+
// }
|
|
17292
|
+
// }
|
|
17293
|
+
for (var i = 0; i < ((_b = (_a = sourceMapping.data) === null || _a === void 0 ? void 0 : _a.mappings) !== null && _b !== void 0 ? _b : []).length; i++) {
|
|
17294
|
+
let flagMatch = false;
|
|
17295
|
+
if (sourceArray.data.mappings.mappings[sourceMapping.data.mappings[i].id] == null) {
|
|
17296
|
+
continue;
|
|
17130
17297
|
}
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17298
|
+
for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17299
|
+
if (taggingArray.data.mappings.mappings[j] != null) {
|
|
17300
|
+
if (sourceMapping.data.mappings[i].id == taggingArray.data.mappings.mappings[j].id) {
|
|
17301
|
+
let flagMatchObj = true;
|
|
17302
|
+
for (let objKey of compareFields) {
|
|
17303
|
+
if (sourceMapping.data.mappings[i][objKey] !== taggingArray.data.mappings.mappings[j][objKey] && taggingArray.data.mappings.mappings[j][objKey] != null) {
|
|
17304
|
+
console.log('Flag Mismatch', objKey, sourceMapping.data.mappings[i][objKey], taggingArray.data.mappings.mappings[j][objKey]);
|
|
17305
|
+
flagMatchObj = false;
|
|
17306
|
+
break;
|
|
17307
|
+
}
|
|
17308
|
+
}
|
|
17309
|
+
if (flagMatchObj == true) {
|
|
17310
|
+
flagMatch = true;
|
|
17311
|
+
continue;
|
|
17312
|
+
}
|
|
17313
|
+
}
|
|
17314
|
+
}
|
|
17134
17315
|
}
|
|
17135
|
-
if (
|
|
17316
|
+
if (!flagMatch) {
|
|
17317
|
+
let objToPush = sourceMapping.data.mappings[i];
|
|
17318
|
+
for (i = 0; i < mandatoryFields.length; i++) {
|
|
17319
|
+
objToPush[mandatoryFields[i]] = "";
|
|
17320
|
+
}
|
|
17321
|
+
taggingArray.data.mappings.mappings.push(objToPush);
|
|
17322
|
+
}
|
|
17323
|
+
}
|
|
17324
|
+
var tagged = 0;
|
|
17325
|
+
var changed = 0;
|
|
17326
|
+
var total = 0;
|
|
17327
|
+
for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17328
|
+
if (taggingArray.data.mappings.mappings[j] != null) {
|
|
17329
|
+
if (sourceMapping.data == null) {
|
|
17330
|
+
if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[j].id] != null) {
|
|
17331
|
+
total++;
|
|
17332
|
+
let tagStr = "";
|
|
17333
|
+
for (let col of compareFields) {
|
|
17334
|
+
tagStr += `${taggingArray.data.mappings.mappings[j][col]};`;
|
|
17335
|
+
}
|
|
17336
|
+
tagStr.slice(0, -1);
|
|
17337
|
+
if (this.changedOnboardingItemIds.length > 0) {
|
|
17338
|
+
let changedId = tagStr;
|
|
17339
|
+
if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
|
|
17340
|
+
changed++;
|
|
17341
|
+
}
|
|
17342
|
+
}
|
|
17343
|
+
if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
|
|
17344
|
+
if (colName == "countries" || colName == "entities" || colName == "locations") {
|
|
17345
|
+
let flagNull = false;
|
|
17346
|
+
for (let mandatoryfield of mandatoryFields) {
|
|
17347
|
+
if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
|
|
17348
|
+
flagNull = true;
|
|
17349
|
+
break;
|
|
17350
|
+
}
|
|
17351
|
+
}
|
|
17352
|
+
if (flagNull) {
|
|
17353
|
+
continue;
|
|
17354
|
+
}
|
|
17355
|
+
}
|
|
17356
|
+
else {
|
|
17357
|
+
continue;
|
|
17358
|
+
}
|
|
17359
|
+
}
|
|
17360
|
+
tagged++;
|
|
17361
|
+
}
|
|
17362
|
+
}
|
|
17363
|
+
else {
|
|
17364
|
+
let flagFound = false;
|
|
17365
|
+
for (let sourceObj of sourceMapping.data.mappings) {
|
|
17366
|
+
if (sourceObj.id == taggingArray.data.mappings.mappings[j].id) {
|
|
17367
|
+
let flagEqual = true;
|
|
17368
|
+
for (let col of compareFields) {
|
|
17369
|
+
if (sourceObj[col] != taggingArray.data.mappings.mappings[j][col] && taggingArray.data.mappings.mappings[j][col] != null) {
|
|
17370
|
+
flagEqual = false;
|
|
17371
|
+
break;
|
|
17372
|
+
}
|
|
17373
|
+
}
|
|
17374
|
+
if (flagEqual) {
|
|
17375
|
+
flagFound = true;
|
|
17376
|
+
break;
|
|
17377
|
+
}
|
|
17378
|
+
}
|
|
17379
|
+
}
|
|
17380
|
+
if (flagFound) {
|
|
17381
|
+
let tagStr = "";
|
|
17382
|
+
for (let col of compareFields) {
|
|
17383
|
+
tagStr += `${taggingArray.data.mappings.mappings[j][col]};`;
|
|
17384
|
+
}
|
|
17385
|
+
tagStr.slice(0, -1);
|
|
17386
|
+
total++;
|
|
17387
|
+
if (this.changedOnboardingItemIds.length > 0) {
|
|
17388
|
+
let changedId = tagStr;
|
|
17389
|
+
if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
|
|
17390
|
+
changed++;
|
|
17391
|
+
}
|
|
17392
|
+
}
|
|
17393
|
+
if (taggingArray.data.mappings.mappings[j][colName] == null || taggingArray.data.mappings.mappings[j][colName] == "" || taggingArray.data.mappings.mappings[j][colName].length == 0) {
|
|
17394
|
+
if (colName == "countries" || colName == "entities" || colName == "locations") {
|
|
17395
|
+
let flagNull = false;
|
|
17396
|
+
for (let mandatoryfield of mandatoryFields) {
|
|
17397
|
+
if (taggingArray.data.mappings.mappings[j][mandatoryfield] == null || taggingArray.data.mappings.mappings[j][mandatoryfield] == "") {
|
|
17398
|
+
flagNull = true;
|
|
17399
|
+
break;
|
|
17400
|
+
}
|
|
17401
|
+
}
|
|
17402
|
+
if (flagNull) {
|
|
17403
|
+
continue;
|
|
17404
|
+
}
|
|
17405
|
+
}
|
|
17406
|
+
else {
|
|
17407
|
+
continue;
|
|
17408
|
+
}
|
|
17409
|
+
}
|
|
17410
|
+
tagged++;
|
|
17411
|
+
}
|
|
17412
|
+
else {
|
|
17413
|
+
console.log('tagged not found', taggingArray.data.mappings.mappings[j]);
|
|
17414
|
+
}
|
|
17415
|
+
}
|
|
17416
|
+
}
|
|
17417
|
+
}
|
|
17418
|
+
console.log('taggingarray3', JSON.stringify(taggingArray.data.mappings.mappings));
|
|
17419
|
+
console.log('tagged', tagged, 'total', total);
|
|
17420
|
+
const unfilteredDict = [];
|
|
17421
|
+
if (divElement == null) {
|
|
17422
|
+
return;
|
|
17423
|
+
}
|
|
17424
|
+
var html = '';
|
|
17425
|
+
var showTable = true;
|
|
17426
|
+
html += '<div class="d-flex justify-between flex-wrap align-center"> ';
|
|
17427
|
+
var status = '';
|
|
17428
|
+
if (tagged < total) {
|
|
17429
|
+
status = '<span class="color-pending material-icons">pending</span>';
|
|
17430
|
+
}
|
|
17431
|
+
else {
|
|
17432
|
+
status = '<span class="color-done material-icons">check_circle</span>';
|
|
17433
|
+
}
|
|
17434
|
+
var mandatoryStatus = '';
|
|
17435
|
+
if (!mandatoryPresent) {
|
|
17436
|
+
mandatoryStatus = '<span class="color-late-executed material-icons">error</span> Mandatory fields are not present';
|
|
17437
|
+
}
|
|
17438
|
+
else {
|
|
17439
|
+
mandatoryStatus = '<span class="color-done material-icons">check_circle</span> Mandatory fields are present';
|
|
17440
|
+
}
|
|
17441
|
+
if (showTable) {
|
|
17442
|
+
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 + ' Mapped ' + tagged + ' out of ' + total + '</h4></div>');
|
|
17443
|
+
}
|
|
17444
|
+
else {
|
|
17445
|
+
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 + ' Mapped ' + tagged + ' out of ' + total + '</h4></div>');
|
|
17446
|
+
}
|
|
17447
|
+
if (changed > 0) {
|
|
17448
|
+
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> ' + changed + ' Items changed</h4></div>');
|
|
17449
|
+
}
|
|
17450
|
+
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>');
|
|
17451
|
+
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>');
|
|
17452
|
+
html += '<div class="d-flex align-center">';
|
|
17453
|
+
html += '<div class="mr-10">';
|
|
17454
|
+
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>';
|
|
17455
|
+
html += '<div style="position: absolute; margin-top: 5px;">';
|
|
17456
|
+
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>';
|
|
17457
|
+
// console.log('jobs', jobs);
|
|
17458
|
+
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>');
|
|
17459
|
+
html += '</div>';
|
|
17460
|
+
html += '</div>';
|
|
17461
|
+
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>';
|
|
17462
|
+
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>';
|
|
17463
|
+
html += '</div>';
|
|
17464
|
+
html += '</div>';
|
|
17465
|
+
html += '<div>';
|
|
17466
|
+
html += '<h4 id="span-filtered" part="results-title"></h4>';
|
|
17467
|
+
html += '<div id="div-subfiltered"></div>';
|
|
17468
|
+
html += '</div>';
|
|
17469
|
+
html += '<br />';
|
|
17470
|
+
var subfiltered = 0;
|
|
17471
|
+
if (showTable) {
|
|
17472
|
+
html += '<table id="table-data" class="mt-20" style="height: 200px">';
|
|
17473
|
+
html += '<thead>';
|
|
17474
|
+
html += '<th part="td-head" class="td-head">';
|
|
17475
|
+
html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
|
|
17476
|
+
html += '</th>';
|
|
17477
|
+
for (var i = 0; i < extraFields.length; i++) {
|
|
17478
|
+
html += '<th part="td-head" class="td-head">';
|
|
17479
|
+
html += extraFields[i];
|
|
17480
|
+
html += '</th>';
|
|
17481
|
+
}
|
|
17482
|
+
html += '<th part="td-head" class="td-head">';
|
|
17483
|
+
html += colName;
|
|
17484
|
+
html += '</th>';
|
|
17485
|
+
for (i = 0; i < uniqCols.length; i++) {
|
|
17486
|
+
html += '<th part="td-head" class="td-head">';
|
|
17487
|
+
html += uniqCols[i];
|
|
17488
|
+
html += '</th>';
|
|
17489
|
+
}
|
|
17490
|
+
for (i = 0; i < sourceCols.length; i++) {
|
|
17491
|
+
html += '<th part="td-head" class="td-head">';
|
|
17492
|
+
html += sourceCols[i];
|
|
17493
|
+
html += '</th>';
|
|
17494
|
+
}
|
|
17495
|
+
html += '</thead>';
|
|
17496
|
+
html += '<tbody>';
|
|
17497
|
+
// console.log('changedIds', this.changedOnboardingItemIds);
|
|
17498
|
+
for (i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
17499
|
+
let complianceid = taggingArray.data.mappings.mappings[i].id;
|
|
17500
|
+
console.log('compliance id', complianceid);
|
|
17501
|
+
var showSearch = false;
|
|
17502
|
+
if (subfilter == "") {
|
|
17503
|
+
//console.log('showsearch true 1');
|
|
17504
|
+
showSearch = true;
|
|
17505
|
+
}
|
|
17506
|
+
var classBg = "";
|
|
17507
|
+
if (i % 2 === 0) {
|
|
17508
|
+
if (this.changedOnboardingItemIds.length > 0) {
|
|
17509
|
+
let changedId = "";
|
|
17510
|
+
for (let [k, col] of uniqCols.entries()) {
|
|
17511
|
+
// console.log('taggingarray rendered', i, col)
|
|
17512
|
+
changedId += taggingArray.data.mappings.mappings[i][col];
|
|
17513
|
+
if (k < (uniqCols.length - 1)) {
|
|
17514
|
+
changedId += ";";
|
|
17515
|
+
}
|
|
17516
|
+
}
|
|
17517
|
+
if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
|
|
17518
|
+
classBg = 'td-light-selected';
|
|
17519
|
+
}
|
|
17520
|
+
else {
|
|
17521
|
+
classBg = 'td-light';
|
|
17522
|
+
}
|
|
17523
|
+
}
|
|
17524
|
+
else {
|
|
17525
|
+
classBg = 'td-light';
|
|
17526
|
+
}
|
|
17527
|
+
}
|
|
17528
|
+
else {
|
|
17529
|
+
if (this.changedOnboardingItemIds.length > 0) {
|
|
17530
|
+
let changedId = "";
|
|
17531
|
+
for (let [k, col] of uniqCols.entries()) {
|
|
17532
|
+
if (taggingArray.data.mappings.mappings[i] == null) {
|
|
17533
|
+
// console.log('id not found', i, taggingArray.data.mappings.mappings.length, sourceArray.data.mappings.mappings.length)
|
|
17534
|
+
}
|
|
17535
|
+
changedId += taggingArray.data.mappings.mappings[i][col];
|
|
17536
|
+
if (k < (uniqCols.length - 1)) {
|
|
17537
|
+
changedId += ";";
|
|
17538
|
+
}
|
|
17539
|
+
}
|
|
17540
|
+
if (this.changedOnboardingItemIds.indexOf(changedId) >= 0) {
|
|
17541
|
+
classBg = 'td-dark-selected';
|
|
17542
|
+
}
|
|
17543
|
+
else {
|
|
17544
|
+
classBg = 'td-dark';
|
|
17545
|
+
}
|
|
17546
|
+
}
|
|
17547
|
+
else {
|
|
17548
|
+
classBg = 'td-dark';
|
|
17549
|
+
}
|
|
17550
|
+
}
|
|
17551
|
+
html += '<tr class="" id="tablerow-' + i + '">';
|
|
17552
|
+
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>';
|
|
17553
|
+
for (var j = 0; j < extraFields.length; j++) {
|
|
17554
|
+
if (i < taggingArray.data.mappings.mappings.length) {
|
|
17555
|
+
html += '<td part="td-body" class="' + classBg + '">';
|
|
17556
|
+
html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
|
|
17557
|
+
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>';
|
|
17558
|
+
html += '</div>';
|
|
17559
|
+
html += '</td>';
|
|
17560
|
+
}
|
|
17561
|
+
else {
|
|
17562
|
+
html += '<td part="td-body" class="' + classBg + '">';
|
|
17563
|
+
html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
|
|
17564
|
+
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>';
|
|
17565
|
+
html += '</div>';
|
|
17566
|
+
html += '</td>';
|
|
17567
|
+
}
|
|
17568
|
+
}
|
|
17569
|
+
html += '<td class="td-body ' + classBg + '" part="td-key">';
|
|
17570
|
+
html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
|
|
17571
|
+
if (apiIdDropdown.length > 0) {
|
|
17572
|
+
if (anotherProjection != null) {
|
|
17573
|
+
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>';
|
|
17574
|
+
}
|
|
17575
|
+
else {
|
|
17576
|
+
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>';
|
|
17577
|
+
}
|
|
17578
|
+
}
|
|
17579
|
+
else {
|
|
17580
|
+
if (colName.toLowerCase() == "internalcontrols") {
|
|
17581
|
+
html += '<textarea id="tags-' + i + '" type="text" part="input" class="tags-input"></textarea>';
|
|
17582
|
+
}
|
|
17583
|
+
else {
|
|
17584
|
+
html += '<input id="tags-' + i + '" type="text" part="input" class="tags-input"/>';
|
|
17585
|
+
}
|
|
17586
|
+
}
|
|
17587
|
+
html += '</div>';
|
|
17588
|
+
html += '</td>';
|
|
17589
|
+
for (var l = 0; l < uniqCols.length; l++) {
|
|
17590
|
+
html += '<td class="td-body ' + classBg + '" part="td-key">';
|
|
17591
|
+
html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
|
|
17592
|
+
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>';
|
|
17593
|
+
html += '</div>';
|
|
17594
|
+
html += '</td>';
|
|
17595
|
+
}
|
|
17596
|
+
for (l = 0; l < sourceCols.length; l++) {
|
|
17597
|
+
for (var j = 0; j < JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols).length; j++) {
|
|
17598
|
+
if (sourceCols[l] == JSON.parse(sourceArray.data.mappings.mappings[complianceid].cols)[j]) {
|
|
17599
|
+
if (sourceArray.data.mappings.mappings[complianceid].data != null) {
|
|
17600
|
+
html += '<td class="td-body ' + classBg + '" part="td-body">';
|
|
17601
|
+
html += '<div class="' + (!showSearch ? 'truncate' : '') + '">';
|
|
17602
|
+
if (Array.isArray(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
|
|
17603
|
+
for (var k = 0; k < JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j].length; k++) {
|
|
17604
|
+
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>');
|
|
17605
|
+
}
|
|
17606
|
+
}
|
|
17607
|
+
else {
|
|
17608
|
+
if (typeof JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j] == "string" && Util.isJSONParsable(JSON.parse(sourceArray.data.mappings.mappings[complianceid].data)[j])) {
|
|
17609
|
+
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>');
|
|
17610
|
+
}
|
|
17611
|
+
else {
|
|
17612
|
+
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>');
|
|
17613
|
+
}
|
|
17614
|
+
}
|
|
17615
|
+
html += '</div>';
|
|
17616
|
+
html += '</td>';
|
|
17617
|
+
}
|
|
17618
|
+
}
|
|
17619
|
+
}
|
|
17620
|
+
}
|
|
17621
|
+
html += '</tr>';
|
|
17622
|
+
//console.log('i=', i);
|
|
17623
|
+
}
|
|
17624
|
+
html += '</tbody>';
|
|
17625
|
+
html += '</table>';
|
|
17626
|
+
}
|
|
17627
|
+
if (divElement == null) {
|
|
17628
|
+
return;
|
|
17629
|
+
}
|
|
17630
|
+
divElement.innerHTML = html;
|
|
17631
|
+
if (unfilteredDict.length > 0) {
|
|
17632
|
+
var html = '';
|
|
17633
|
+
html += '<div class="mb-10">Items In Your Category (' + unfilteredDict.length + ")</div>";
|
|
17634
|
+
html += this.getFilterOnboardingString();
|
|
17635
|
+
divElement.querySelector('#span-filtered').innerHTML = html;
|
|
17636
|
+
}
|
|
17637
|
+
else {
|
|
17638
|
+
divElement.querySelector('#span-filtered').style.display = 'none';
|
|
17639
|
+
}
|
|
17640
|
+
if (subfiltered > 0) {
|
|
17641
|
+
divElement.querySelector('#div-subfiltered').innerHTML = '<h4 part="results-title">Filtered Results (' + subfiltered + ')</h4>';
|
|
17642
|
+
}
|
|
17643
|
+
if (this.getfilterOnboarding().length > 0) {
|
|
17644
|
+
for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
17645
|
+
if (!unfilteredDict.includes(i)) {
|
|
17646
|
+
const tableRow = divElement.querySelector('#tablerow-' + i);
|
|
17647
|
+
if (tableRow != null) {
|
|
17648
|
+
tableRow.style.display = 'none';
|
|
17649
|
+
}
|
|
17650
|
+
}
|
|
17651
|
+
}
|
|
17652
|
+
}
|
|
17653
|
+
(_c = divElement.querySelector('.checkbox-all')) === null || _c === void 0 ? void 0 : _c.addEventListener('change', (e) => {
|
|
17654
|
+
divElement.querySelector('.button-save').disabled = false;
|
|
17655
|
+
const arrCheckBoxes = divElement.querySelectorAll('.checkbox-row');
|
|
17656
|
+
//console.log('cb-length', arrCheckBoxes.length);
|
|
17657
|
+
for (var i = 0; i < arrCheckBoxes.length; i++) {
|
|
17658
|
+
const tableRow = divElement.querySelector('#tablerow-' + (i));
|
|
17659
|
+
//console.log('tablerow', i, tableRow);
|
|
17660
|
+
if (tableRow != null) {
|
|
17661
|
+
if (tableRow.style.display != 'none') {
|
|
17662
|
+
//console.log('tablerow setting', e.currentTarget.checked, (arrCheckBoxes[i] as HTMLInputElement));
|
|
17663
|
+
arrCheckBoxes[i].checked = e.currentTarget.checked;
|
|
17664
|
+
if (e.currentTarget.checked) {
|
|
17665
|
+
if (!this.selectedCbs.includes(i + '')) {
|
|
17666
|
+
this.selectedCbs.push(i + '');
|
|
17667
|
+
}
|
|
17668
|
+
}
|
|
17669
|
+
else {
|
|
17670
|
+
this.selectedCbs = [];
|
|
17671
|
+
}
|
|
17672
|
+
}
|
|
17673
|
+
}
|
|
17674
|
+
}
|
|
17675
|
+
//console.log('checkedarr', this.selectedCbs);
|
|
17676
|
+
});
|
|
17677
|
+
for (var j = 0; j < extraFields.length; j++) {
|
|
17678
|
+
const inputArrJ = divElement.querySelectorAll('.extra-field-' + j);
|
|
17679
|
+
for (var k = 0; k < inputArrJ.length; k++) {
|
|
17680
|
+
inputArrJ[k].addEventListener('keyup', (e) => {
|
|
17681
|
+
divElement.querySelector('.button-save').disabled = false;
|
|
17682
|
+
if (e.key == "Enter") {
|
|
17683
|
+
this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
|
|
17684
|
+
const activeIndex = e.target.id.split('-')[2];
|
|
17685
|
+
for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
|
|
17686
|
+
taggingArray.data.mappings.mappings[count].extraFields = [];
|
|
17687
|
+
if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
|
|
17688
|
+
for (var l = 0; l < extraFields.length; l++) {
|
|
17689
|
+
const inputExtraField = divElement.querySelector('#extra-field-' + activeIndex + '-' + l);
|
|
17690
|
+
taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value);
|
|
17691
|
+
}
|
|
17692
|
+
}
|
|
17693
|
+
else {
|
|
17694
|
+
for (var l = 0; l < extraFields.length; l++) {
|
|
17695
|
+
const inputExtraField = divElement.querySelector('#extra-field-' + count + '-' + l);
|
|
17696
|
+
taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value);
|
|
17697
|
+
}
|
|
17698
|
+
}
|
|
17699
|
+
}
|
|
17700
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17701
|
+
}
|
|
17702
|
+
// this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, true);
|
|
17703
|
+
});
|
|
17704
|
+
inputArrJ[k].addEventListener('focusout', (e) => {
|
|
17705
|
+
this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
|
|
17706
|
+
const activeIndex = e.target.id.split('-')[2];
|
|
17707
|
+
for (var count = 0; count < taggingArray.data.mappings.mappings.length; count++) {
|
|
17708
|
+
taggingArray.data.mappings.mappings[count].extraFields = [];
|
|
17709
|
+
if (this.selectedCbs.length > 0 && this.selectedCbs.includes(count + "")) {
|
|
17710
|
+
for (var l = 0; l < extraFields.length; l++) {
|
|
17711
|
+
const inputExtraField = divElement.querySelector('#extra-field-' + activeIndex + '-' + l);
|
|
17712
|
+
taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value);
|
|
17713
|
+
}
|
|
17714
|
+
}
|
|
17715
|
+
else {
|
|
17716
|
+
for (var l = 0; l < extraFields.length; l++) {
|
|
17717
|
+
const inputExtraField = divElement.querySelector('#extra-field-' + count + '-' + l);
|
|
17718
|
+
taggingArray.data.mappings.mappings[count].extraFields.push(inputExtraField.value);
|
|
17719
|
+
}
|
|
17720
|
+
}
|
|
17721
|
+
}
|
|
17722
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17723
|
+
});
|
|
17724
|
+
}
|
|
17725
|
+
}
|
|
17726
|
+
const multiArr = divElement.querySelectorAll('.tags-input');
|
|
17727
|
+
for (var i = 0; i < multiArr.length; i++) {
|
|
17728
|
+
if (apiIdDropdown.length > 0) {
|
|
17729
|
+
// for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17730
|
+
var equal = true;
|
|
17731
|
+
let complianceid = taggingArray.data.mappings.mappings[i].id;
|
|
17732
|
+
for (var k = 0; k < uniqCols.length; k++) {
|
|
17733
|
+
if (uniqCols[k] != "id") {
|
|
17734
|
+
continue;
|
|
17735
|
+
}
|
|
17736
|
+
if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
|
|
17737
|
+
if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
|
|
17738
|
+
equal = false;
|
|
17739
|
+
}
|
|
17740
|
+
}
|
|
17741
|
+
}
|
|
17742
|
+
if (equal) {
|
|
17743
|
+
let preselctedVals = [];
|
|
17744
|
+
if ((colName == "countries" || colName == "entities" || colName == "locations") && taggingArray.data.mappings.mappings[i][colName] == null) {
|
|
17745
|
+
let preselctedValsStr = "";
|
|
17746
|
+
for (let mandatoryfield of mandatoryFields) {
|
|
17747
|
+
if (taggingArray.data.mappings.mappings[i][mandatoryfield] == null || taggingArray.data.mappings.mappings[i][mandatoryfield] == "") {
|
|
17748
|
+
preselctedValsStr = "";
|
|
17749
|
+
}
|
|
17750
|
+
else {
|
|
17751
|
+
preselctedValsStr += `${taggingArray.data.mappings.mappings[i][mandatoryfield]};`;
|
|
17752
|
+
}
|
|
17753
|
+
}
|
|
17754
|
+
preselctedValsStr = preselctedValsStr.slice(0, -1);
|
|
17755
|
+
if (preselctedValsStr.indexOf(';') >= 0) {
|
|
17756
|
+
preselctedVals.push(preselctedValsStr);
|
|
17757
|
+
}
|
|
17758
|
+
}
|
|
17759
|
+
else {
|
|
17760
|
+
preselctedVals = taggingArray.data.mappings.mappings[i][colName];
|
|
17761
|
+
}
|
|
17762
|
+
multiArr[i].preselectedValues = JSON.stringify(preselctedVals);
|
|
17763
|
+
if (preselctedVals.length > 0) {
|
|
17764
|
+
multiArr[i].parentElement.setAttribute("part", "row-mapped");
|
|
17765
|
+
}
|
|
17766
|
+
}
|
|
17767
|
+
// }
|
|
17768
|
+
multiArr[i].addEventListener('valueChanged', async (e) => {
|
|
17769
|
+
divElement.querySelector('.button-save').disabled = false;
|
|
17770
|
+
this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
|
|
17771
|
+
});
|
|
17772
|
+
}
|
|
17773
|
+
else {
|
|
17774
|
+
// for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17775
|
+
var equal = true;
|
|
17776
|
+
let complianceid = taggingArray.data.mappings.mappings[i].id;
|
|
17777
|
+
for (var k = 0; k < uniqCols.length; k++) {
|
|
17778
|
+
if (uniqCols[k] != "id") {
|
|
17779
|
+
continue;
|
|
17780
|
+
}
|
|
17781
|
+
if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[i] != null) {
|
|
17782
|
+
if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
|
|
17783
|
+
equal = false;
|
|
17784
|
+
}
|
|
17785
|
+
}
|
|
17786
|
+
}
|
|
17787
|
+
if (equal) {
|
|
17788
|
+
if (taggingArray.data.mappings.mappings[i] != null) {
|
|
17789
|
+
if (Util.isJSONParsable(sourceArray.data.mappings.mappings[complianceid][colName])) {
|
|
17790
|
+
multiArr[i].value = JSON.parse(sourceArray.data.mappings.mappings[complianceid][colName])[0];
|
|
17791
|
+
}
|
|
17792
|
+
else {
|
|
17793
|
+
multiArr[i].value = (_f = sourceArray.data.mappings.mappings[complianceid][colName]) !== null && _f !== void 0 ? _f : "";
|
|
17794
|
+
}
|
|
17795
|
+
}
|
|
17796
|
+
}
|
|
17797
|
+
// }
|
|
17798
|
+
multiArr[i].addEventListener('keyup', async (e) => {
|
|
17799
|
+
if (e.key == "Enter") {
|
|
17800
|
+
divElement.querySelector('.button-save').disabled = false;
|
|
17801
|
+
this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
|
|
17802
|
+
}
|
|
17803
|
+
});
|
|
17804
|
+
multiArr[i].addEventListener('focusout', async (e) => {
|
|
17805
|
+
divElement.querySelector('.button-save').disabled = false;
|
|
17806
|
+
this.applyAndReloadTaggingNew(e, colName, taggingArray, sourceArray, divElement);
|
|
17807
|
+
});
|
|
17808
|
+
}
|
|
17809
|
+
}
|
|
17810
|
+
const buttonApply = divElement.querySelector('.button-apply');
|
|
17811
|
+
buttonApply.addEventListener('click', () => {
|
|
17812
|
+
// console.log('applied');
|
|
17813
|
+
// this.applyAndReloadTagging(e,colName, taggingArray, sourceArray, divElement);
|
|
17814
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17815
|
+
});
|
|
17816
|
+
const buttonToggleMoreBack = divElement.querySelector('.button-toggle-more-back');
|
|
17817
|
+
const buttonToggleMore = divElement.querySelector('.button-toggle-more');
|
|
17818
|
+
buttonToggleMore.addEventListener('click', async (ev) => {
|
|
17819
|
+
ev.target.classList.add('hide');
|
|
17820
|
+
buttonToggleMoreBack.classList.remove('hide');
|
|
17821
|
+
const buttonDownloadBackups = divElement.querySelector('.button-download-backups');
|
|
17822
|
+
buttonDownloadBackups.style.display = 'flex';
|
|
17823
|
+
const buttonExportMapping = divElement.querySelector('.button-export-mapping');
|
|
17824
|
+
buttonExportMapping.style.display = 'flex';
|
|
17825
|
+
const buttonExportMappingCSV = divElement.querySelector('.button-export-mapping-csv');
|
|
17826
|
+
buttonExportMappingCSV.style.display = 'flex';
|
|
17827
|
+
// const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
|
|
17828
|
+
// buttonApply.style.display = 'flex';
|
|
17829
|
+
const buttonLoadLocal = divElement.querySelector('.button-local-load');
|
|
17830
|
+
buttonLoadLocal.style.display = 'flex';
|
|
17831
|
+
const buttonSaveLocal = divElement.querySelector('.button-local-save');
|
|
17832
|
+
buttonSaveLocal.style.display = 'flex';
|
|
17833
|
+
// const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
|
|
17834
|
+
// buttonSave.style.display = 'flex';
|
|
17835
|
+
const buttonDownloadBackupsNew = Util.clearListeners(buttonDownloadBackups);
|
|
17836
|
+
buttonDownloadBackupsNew.addEventListener('click', async () => {
|
|
17837
|
+
const result = await this.fetchGetStoredMapping(colName);
|
|
17838
|
+
for (var i = 0; i < result.data.length; i++) {
|
|
17839
|
+
const blob = new Blob([result.data[i].mappings != null ? JSON.stringify(result.data[i].mappings) : JSON.stringify(result.data[i])], { type: 'text/html' });
|
|
17840
|
+
const url = window.URL.createObjectURL(blob);
|
|
17841
|
+
const a = document.createElement('a');
|
|
17842
|
+
a.setAttribute('href', url);
|
|
17843
|
+
a.setAttribute('download', 'report_' + colName + '_' + i + '.json');
|
|
17844
|
+
a.click();
|
|
17845
|
+
}
|
|
17846
|
+
buttonToggleMoreBack.click();
|
|
17847
|
+
if (result.data.length === 0) {
|
|
17848
|
+
this.setError("No backups found!");
|
|
17849
|
+
setTimeout(() => {
|
|
17850
|
+
this.clearMessages();
|
|
17851
|
+
}, 3000);
|
|
17852
|
+
}
|
|
17853
|
+
});
|
|
17854
|
+
const buttonExportMappingNew = Util.clearListeners(buttonExportMapping);
|
|
17855
|
+
buttonExportMappingNew.addEventListener('click', async () => {
|
|
17856
|
+
let valueStr = [];
|
|
17857
|
+
for (var i = 0; i < multiArr.length; i++) {
|
|
17858
|
+
if (apiIdDropdown.length > 0) {
|
|
17859
|
+
for (var j = 0; j < taggingArray.data.mappings.mappings.length; j++) {
|
|
17860
|
+
var equal = true;
|
|
17861
|
+
let complianceid = taggingArray.data.mappings.mappings[j].id;
|
|
17862
|
+
for (var k = 0; k < uniqCols.length; k++) {
|
|
17863
|
+
if (uniqCols[k] != "id") {
|
|
17864
|
+
continue;
|
|
17865
|
+
}
|
|
17866
|
+
if (sourceArray.data.mappings.mappings[complianceid] != null && taggingArray.data.mappings.mappings[j] != null) {
|
|
17867
|
+
if (sourceArray.data.mappings.mappings[complianceid][uniqCols[k]] != taggingArray.data.mappings.mappings[j][uniqCols[k]]) {
|
|
17868
|
+
equal = false;
|
|
17869
|
+
}
|
|
17870
|
+
}
|
|
17871
|
+
}
|
|
17872
|
+
if (equal) {
|
|
17873
|
+
valueStr.push(JSON.stringify(taggingArray.data.mappings.mappings[j][colName]));
|
|
17874
|
+
}
|
|
17875
|
+
}
|
|
17876
|
+
}
|
|
17877
|
+
else {
|
|
17878
|
+
if (taggingArray.data.mappings.mappings[i] != null) {
|
|
17879
|
+
valueStr.push(taggingArray.data.mappings.mappings[i][colName]);
|
|
17880
|
+
}
|
|
17881
|
+
else {
|
|
17882
|
+
valueStr.push('');
|
|
17883
|
+
}
|
|
17884
|
+
}
|
|
17885
|
+
}
|
|
17886
|
+
//console.log('valueStr', valueStr);
|
|
17887
|
+
const valuesHTML = JSON.stringify(valueStr);
|
|
17888
|
+
const outerHTML = '<h3>This extract is generated on ' + new Date() + '</h3>' + divElement.querySelector('#span-filtered').outerHTML + '<br /><h2>' + divElement.querySelector('#mapped-stats-title').outerHTML + '</h2>' + divElement.querySelector('#table-data').outerHTML;
|
|
17889
|
+
let tableHTML = this.TAGGING_HTML.replace(/TABLE_DATA/g, outerHTML);
|
|
17890
|
+
tableHTML = tableHTML.replace(/TABLE_VALUES/g, valuesHTML);
|
|
17891
|
+
const blob = new Blob([tableHTML], { type: 'text/html' });
|
|
17892
|
+
const url = window.URL.createObjectURL(blob);
|
|
17893
|
+
const a = document.createElement('a');
|
|
17894
|
+
a.setAttribute('href', url);
|
|
17895
|
+
a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.html');
|
|
17896
|
+
a.click();
|
|
17897
|
+
});
|
|
17898
|
+
const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
|
|
17899
|
+
buttonExportMappingCSVNew === null || buttonExportMappingCSVNew === void 0 ? void 0 : buttonExportMappingCSVNew.addEventListener('click', async () => {
|
|
17900
|
+
let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings));
|
|
17901
|
+
for (let [i, obj] of csvArray.entries()) {
|
|
17902
|
+
let tempCsvObj = obj;
|
|
17903
|
+
if (obj['cols'] != null && obj['data'] != null) {
|
|
17904
|
+
let dataArr = JSON.parse(obj['data']);
|
|
17905
|
+
let colsArr = JSON.parse(obj['cols']);
|
|
17906
|
+
for (let [j, colKey] of colsArr.entries()) {
|
|
17907
|
+
tempCsvObj['cols_' + colKey] = dataArr[j];
|
|
17908
|
+
}
|
|
17909
|
+
}
|
|
17910
|
+
csvArray[i] = tempCsvObj;
|
|
17911
|
+
}
|
|
17912
|
+
console.log('csv array', csvArray);
|
|
17913
|
+
let csvData = Util.convertToCSV(csvArray);
|
|
17914
|
+
// let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
|
|
17915
|
+
console.log('csvData', csvData);
|
|
17916
|
+
const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
|
|
17917
|
+
const url = window.URL.createObjectURL(blob);
|
|
17918
|
+
const a = document.createElement('a');
|
|
17919
|
+
a.setAttribute('href', url);
|
|
17920
|
+
a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.csv');
|
|
17921
|
+
a.click();
|
|
17922
|
+
});
|
|
17923
|
+
const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
|
|
17924
|
+
buttonLoadLocalNew === null || buttonLoadLocalNew === void 0 ? void 0 : buttonLoadLocalNew.addEventListener('click', async () => {
|
|
17925
|
+
console.log('load-local');
|
|
17926
|
+
divElement.querySelector('#fileInput').click();
|
|
17927
|
+
});
|
|
17928
|
+
const fileInput = divElement.querySelector('#fileInput');
|
|
17929
|
+
fileInput.value = '';
|
|
17930
|
+
const fileInputNew = Util.clearListeners(fileInput);
|
|
17931
|
+
fileInputNew.addEventListener('change', (e) => {
|
|
17932
|
+
var fr = new FileReader();
|
|
17933
|
+
fr.onload = () => {
|
|
17934
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17935
|
+
};
|
|
17936
|
+
var frCsv = new FileReader();
|
|
17937
|
+
frCsv.onload = () => {
|
|
17938
|
+
console.log('taggingarray onload called');
|
|
17939
|
+
console.log('csv result', frCsv.result);
|
|
17940
|
+
const tempArr = Util.parseCsv(frCsv.result + "");
|
|
17941
|
+
console.log('csv data', tempArr);
|
|
17942
|
+
let changeCount = 0;
|
|
17943
|
+
for (let [i, obj] of tempArr.entries()) {
|
|
17944
|
+
let tempObj = taggingArray.data.mappings.mappings[i];
|
|
17945
|
+
delete tempObj['delta'];
|
|
17946
|
+
delete tempObj['lastupdated'];
|
|
17947
|
+
let tempNewObj = obj;
|
|
17948
|
+
delete tempNewObj['delta'];
|
|
17949
|
+
delete tempNewObj['lastupdated'];
|
|
17950
|
+
if (JSON.stringify(tempObj) !== JSON.stringify(tempNewObj)) {
|
|
17951
|
+
// console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
|
|
17952
|
+
let changedId = "";
|
|
17953
|
+
for (let [k, col] of uniqCols.entries()) {
|
|
17954
|
+
if (col != "id") {
|
|
17955
|
+
continue;
|
|
17956
|
+
}
|
|
17957
|
+
changedId += tempObj[col];
|
|
17958
|
+
if (k < (uniqCols.length - 1)) {
|
|
17959
|
+
changedId += ";";
|
|
17960
|
+
}
|
|
17961
|
+
}
|
|
17962
|
+
this.changedOnboardingItemIds.push(changedId);
|
|
17963
|
+
changeCount++;
|
|
17964
|
+
}
|
|
17965
|
+
}
|
|
17966
|
+
this.setSuccessBtn(changeCount + " items changed. Do you wish to apply?", ["No", "Yes"], [
|
|
17967
|
+
() => {
|
|
17968
|
+
this.clearMessages();
|
|
17969
|
+
this.changedOnboardingItemIds = [];
|
|
17970
|
+
buttonToggleMoreBack.click();
|
|
17971
|
+
},
|
|
17972
|
+
() => {
|
|
17973
|
+
this.clearMessages();
|
|
17974
|
+
let tempObj = {};
|
|
17975
|
+
tempObj["data"] = {};
|
|
17976
|
+
tempObj["data"]["mappings"] = {};
|
|
17977
|
+
tempObj["data"]["mappings"]["mappings"] = tempArr;
|
|
17978
|
+
let tempObjStr = JSON.stringify(tempObj);
|
|
17979
|
+
console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]));
|
|
17980
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceArray, sourceMapping, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17981
|
+
}
|
|
17982
|
+
]);
|
|
17983
|
+
};
|
|
17984
|
+
if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
|
|
17985
|
+
let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1];
|
|
17986
|
+
if (ext.toLowerCase() == "csv") {
|
|
17987
|
+
frCsv.readAsText(e.target.files[0]);
|
|
17988
|
+
}
|
|
17989
|
+
else {
|
|
17990
|
+
fr.readAsText(e.target.files[0]);
|
|
17991
|
+
}
|
|
17992
|
+
}
|
|
17993
|
+
});
|
|
17994
|
+
const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
|
|
17995
|
+
buttonSaveLocalNew === null || buttonSaveLocalNew === void 0 ? void 0 : buttonSaveLocalNew.addEventListener('click', async () => {
|
|
17996
|
+
console.log('save-local');
|
|
17997
|
+
const blob = new Blob([JSON.stringify(taggingArray)], { type: 'text/plain' });
|
|
17998
|
+
const url = window.URL.createObjectURL(blob);
|
|
17999
|
+
const a = document.createElement('a');
|
|
18000
|
+
a.setAttribute('href', url);
|
|
18001
|
+
a.setAttribute('download', 'mapping_' + colName + '_' + new Date().toLocaleString() + '.txt');
|
|
18002
|
+
a.click();
|
|
18003
|
+
});
|
|
18004
|
+
});
|
|
18005
|
+
buttonToggleMoreBack.addEventListener('click', async (ev) => {
|
|
18006
|
+
ev.target.classList.add('hide');
|
|
18007
|
+
buttonToggleMore.classList.remove('hide');
|
|
18008
|
+
const buttonDownloadBackups = divElement.querySelector('.button-download-backups');
|
|
18009
|
+
buttonDownloadBackups.style.display = 'none';
|
|
18010
|
+
const buttonExportMapping = divElement.querySelector('.button-export-mapping');
|
|
18011
|
+
buttonExportMapping.style.display = 'none';
|
|
18012
|
+
const buttonExportMappingCSV = divElement.querySelector('.button-export-mapping-csv');
|
|
18013
|
+
buttonExportMappingCSV.style.display = 'none';
|
|
18014
|
+
// const buttonApply = (divElement as HTMLDivElement).querySelector('.button-apply') as HTMLButtonElement;
|
|
18015
|
+
// buttonApply.style.display = 'none';
|
|
18016
|
+
const buttonLoadLocal = divElement.querySelector('.button-local-load');
|
|
18017
|
+
buttonLoadLocal.style.display = 'none';
|
|
18018
|
+
const buttonSaveLocal = divElement.querySelector('.button-local-save');
|
|
18019
|
+
buttonSaveLocal.style.display = 'none';
|
|
18020
|
+
// const buttonSave = (divElement as HTMLDivElement).querySelector('.button-save') as HTMLButtonElement;
|
|
18021
|
+
// buttonSave.style.display = 'none';
|
|
18022
|
+
});
|
|
18023
|
+
const buttonSave = divElement.querySelector('.button-save');
|
|
18024
|
+
buttonSave === null || buttonSave === void 0 ? void 0 : buttonSave.addEventListener('click', async () => {
|
|
18025
|
+
await this.saveTagging(taggingArray.data.mappings, selectedStatutes, uploadFunction, refreshFunction, false, colName);
|
|
18026
|
+
});
|
|
18027
|
+
const buttonCancel = divElement.querySelector('.button-cancel');
|
|
18028
|
+
buttonCancel === null || buttonCancel === void 0 ? void 0 : buttonCancel.addEventListener('click', async () => {
|
|
18029
|
+
//console.log('cancel clicked');
|
|
18030
|
+
await this.fetchCancelOnboardingJob(colName);
|
|
18031
|
+
refreshFunction();
|
|
18032
|
+
});
|
|
18033
|
+
const cbArr = divElement.querySelectorAll('.cb-select');
|
|
18034
|
+
for (i = 0; i < cbArr.length; i++) {
|
|
18035
|
+
cbArr[i].addEventListener('change', (ev) => {
|
|
18036
|
+
const cbSelectId = ev.currentTarget.id;
|
|
18037
|
+
const cbSelectIndex = cbSelectId.split('-')[1];
|
|
18038
|
+
if (!this.selectedCbs.includes(cbSelectIndex)) {
|
|
18039
|
+
this.selectedCbs.push(cbSelectIndex);
|
|
18040
|
+
}
|
|
18041
|
+
else {
|
|
18042
|
+
this.selectedCbs.splice(this.selectedCbs.indexOf(cbSelectIndex), 1);
|
|
18043
|
+
}
|
|
18044
|
+
//console.log(this.selectedCbs);
|
|
18045
|
+
});
|
|
18046
|
+
}
|
|
18047
|
+
this.changedOnboardingItemIds = [];
|
|
18048
|
+
};
|
|
18049
|
+
this.renderMappingTable = (divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, subfilter, statuteColName, extraHintsArr, mappedStatutes = []) => {
|
|
18050
|
+
var _a, _b, _c, _f, _g, _h, _j;
|
|
18051
|
+
console.log('cols1', jsonData);
|
|
18052
|
+
// console.log('cols', jsonData[0].data.cols);
|
|
18053
|
+
//console.log('divelement', divElement);
|
|
18054
|
+
//console.log('jsonData', jsonData);
|
|
18055
|
+
//console.log('cursor', cursor);
|
|
18056
|
+
//console.log('fetch', fetchFunction);
|
|
18057
|
+
//console.log('searchstring', searchString);
|
|
18058
|
+
//console.log('subfiltervalue', subfilter);
|
|
18059
|
+
const arrCompliancesFrequencies = {};
|
|
18060
|
+
if (jsonData.length === 0)
|
|
18061
|
+
return;
|
|
18062
|
+
this.selectedCbs = [];
|
|
18063
|
+
let colCountry = -1;
|
|
18064
|
+
let colState = -1;
|
|
18065
|
+
let colSubcategory = -1;
|
|
18066
|
+
let colStatute = -1;
|
|
18067
|
+
const unfilteredDict = [];
|
|
18068
|
+
var html = '';
|
|
18069
|
+
html += '<div>';
|
|
18070
|
+
html += '<h3 part="results-title">Total Items (' + found + ')</h3>';
|
|
18071
|
+
html += '<h4 id="span-filtered" part="results-title"></h4>';
|
|
18072
|
+
html += '<h4 id="span-extra-filled" part="results-title"></h4>';
|
|
18073
|
+
html += '</div>';
|
|
18074
|
+
html += '<div class="d-flex justify-between align-center left-sticky flex-wrap mb-20">';
|
|
18075
|
+
html += '<div id="div-subfiltered"></div>';
|
|
18076
|
+
html += '<div id="scroll-overlay" part="onboarding-scroll-overlay" class="pos-fixed-scroll justify-center align-center">';
|
|
18077
|
+
html += '<div id="scroll-overlay-left" class="mr-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_left_alt</span></button></div>';
|
|
18078
|
+
html += '<div id="scroll-overlay-right" class="ml-10"><button part="button-icon"><span class="material-symbols-outlined">arrow_right_alt</span></button></div>';
|
|
18079
|
+
html += '</div>';
|
|
18080
|
+
html += '<div id="detail-overlay" part="onboarding-detail-overlay" class="pos-fixed justify-center align-center hide">';
|
|
18081
|
+
html += '<div class="cover-slide"></div>';
|
|
18082
|
+
html += '<div class="detail-container p-10">';
|
|
18083
|
+
html += '<div class="d-flex justify-between align-center mb-20">';
|
|
18084
|
+
html += '<div part="results-title">Row Details</div>';
|
|
18085
|
+
html += '<button part="button-icon" class="detail-close"><span class="material-symbols-outlined">close</span></button>';
|
|
18086
|
+
html += '</div>';
|
|
18087
|
+
html += '<div id="detail-overlay-list">';
|
|
18088
|
+
html += '</div>';
|
|
18089
|
+
html += '</div>';
|
|
18090
|
+
html += '</div>';
|
|
18091
|
+
html += '<div class="d-flex align-center">';
|
|
18092
|
+
html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
18093
|
+
html += '<div class="mr-10">';
|
|
18094
|
+
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>';
|
|
18095
|
+
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>';
|
|
18096
|
+
html += '</div>';
|
|
18097
|
+
html += (this.disablesave == "yes" ? '' : '<button part="button" class="button-save" disabled>Save</button>');
|
|
18098
|
+
html += '</div>';
|
|
18099
|
+
html += '</div>';
|
|
18100
|
+
html += '<table id="table-data">';
|
|
18101
|
+
html += '<thead>';
|
|
18102
|
+
html += '<th part="td-head" class="td-head">';
|
|
18103
|
+
// html += 'Select';
|
|
18104
|
+
html += '<div id="select-all"><input class="checkbox checkbox-all" part="input-checkbox" type="checkbox" ' + ((this.disableflagggrcresponse.toLowerCase() == "yes") ? 'disabled' : '') + '/></div>';
|
|
18105
|
+
html += '</th>';
|
|
18106
|
+
html += '<th part="td-head" class="td-head">';
|
|
18107
|
+
html += '<div>View</div>';
|
|
18108
|
+
html += '</th>';
|
|
18109
|
+
if (extraFieldPosition === 0) {
|
|
18110
|
+
for (var i = 0; i < extraFields.length; i++) {
|
|
18111
|
+
html += '<th part="td-head" class="td-head">';
|
|
18112
|
+
html += extraFields[i];
|
|
18113
|
+
html += '</th>';
|
|
18114
|
+
}
|
|
18115
|
+
}
|
|
18116
|
+
if (colName.toLowerCase() == "compliances") {
|
|
18117
|
+
html += '<th part="td-head" class="td-head">';
|
|
18118
|
+
html += 'Proposed Users';
|
|
18119
|
+
html += '</th>';
|
|
18120
|
+
}
|
|
18121
|
+
html += '<th part="td-head" class="td-head">';
|
|
18122
|
+
html += 'Id';
|
|
18123
|
+
html += '</th>';
|
|
18124
|
+
// for(var j = 0; j < JSON.parse(jsonData[0].data.cols).length; j++) {
|
|
18125
|
+
// if(jsonData[0].cols.includes(JSON.parse(jsonData[0].data.cols)[j])) {
|
|
18126
|
+
// html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == JSON.parse(jsonData[0].data.cols)[j].toLowerCase() ? 'left-sticky' : '') + '">'
|
|
18127
|
+
// html += JSON.parse(jsonData[0].data.cols)[j]
|
|
18128
|
+
// html += '</th>'
|
|
18129
|
+
// }
|
|
18130
|
+
// }
|
|
18131
|
+
for (var j = 0; j < jsonData[0].cols.length; j++) {
|
|
18132
|
+
console.log('jsoncols', JSON.parse(jsonData[0].data.cols), jsonData[0].cols.length, j);
|
|
18133
|
+
html += '<th part="td-head" class="td-head ' + (statuteColName.toLowerCase() == ((_a = JSON.parse(jsonData[0].data.cols)[j]) !== null && _a !== void 0 ? _a : "").toLowerCase() ? 'left-sticky' : '') + '">';
|
|
18134
|
+
// html += jsonData[0].cols[j]
|
|
18135
|
+
html += '</th>';
|
|
18136
|
+
}
|
|
18137
|
+
if (extraFieldPosition === 1) {
|
|
18138
|
+
for (var i = 0; i < extraFields.length; i++) {
|
|
18139
|
+
html += '<th part="td-head" class="td-head">';
|
|
18140
|
+
html += extraFields[i];
|
|
18141
|
+
html += '</th>';
|
|
18142
|
+
}
|
|
18143
|
+
}
|
|
18144
|
+
html += '</thead>';
|
|
18145
|
+
//console.log('colstate', JSON.parse(jsonData[0].data.cols));
|
|
18146
|
+
for (var i = 0; i < JSON.parse(jsonData[0].data.cols).length; i++) {
|
|
18147
|
+
if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "country") {
|
|
18148
|
+
console.log('colstate country', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
|
|
18149
|
+
colCountry = i;
|
|
18150
|
+
}
|
|
18151
|
+
if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "state") {
|
|
18152
|
+
//console.log('colstate state', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
|
|
18153
|
+
colState = i;
|
|
18154
|
+
}
|
|
18155
|
+
if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == "subcategory") {
|
|
18156
|
+
//console.log('colstate subcategory', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
|
|
18157
|
+
colSubcategory = i;
|
|
18158
|
+
}
|
|
18159
|
+
if (JSON.parse(jsonData[0].data.cols)[i].toLowerCase() == statuteColName) {
|
|
17136
18160
|
//console.log('colstate statute', JSON.parse(jsonData[0].data.cols)[i].toLowerCase(), i);
|
|
17137
18161
|
colStatute = i;
|
|
17138
18162
|
}
|
|
@@ -17635,7 +18659,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17635
18659
|
//console.log(e.currentTarget, (e.currentTarget as HTMLInputElement).checked);
|
|
17636
18660
|
divElement.querySelector('.button-save').disabled = false;
|
|
17637
18661
|
if (extraFieldPosition === 1) {
|
|
17638
|
-
await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true);
|
|
18662
|
+
await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, true, mappedStatutes);
|
|
17639
18663
|
}
|
|
17640
18664
|
});
|
|
17641
18665
|
}
|
|
@@ -17703,7 +18727,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17703
18727
|
}
|
|
17704
18728
|
});
|
|
17705
18729
|
(_j = this._SfButtonSave) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async () => {
|
|
17706
|
-
await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false);
|
|
18730
|
+
await this.saveMapping(divElement, uploadBlock, jsonData, extraFields, searchString, uploadFunction, refreshFunction, false, mappedStatutes);
|
|
17707
18731
|
});
|
|
17708
18732
|
// const arrExtraFields = (divElement as HTMLDivElement).querySelectorAll('.extra-field') as NodeListOf<SfIMultitextarea>;
|
|
17709
18733
|
// var totalFields = 0;
|
|
@@ -18324,220 +19348,321 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18324
19348
|
});
|
|
18325
19349
|
//this.refreshCalendar();
|
|
18326
19350
|
};
|
|
18327
|
-
this.renderOnboardingTriggers = (
|
|
18328
|
-
|
|
18329
|
-
html += '<div id="triggers-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18330
|
-
html += '</div>';
|
|
18331
|
-
this._SfOnboardingTriggersContainer.innerHTML = html;
|
|
18332
|
-
//console.log('rendering triggers...', (this._SfOnboardingTriggersContainer as HTMLDivElement).innerHTML);
|
|
18333
|
-
this.renderTaggingTable(this._SfOnboardingTriggersListContainer, mappedSerializedAlertSchedules, mappedTriggers, ["shortid", "obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id", "entityname", "locationname"], '', "", ["triggers"], triggersJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19351
|
+
this.renderOnboardingTriggers = (selectedStatutes, mappedCompliances, mappedFunctions, mappedTriggers) => {
|
|
19352
|
+
this.renderTaggingTableNew(this._SfOnboardingTriggersListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedTriggers, ["shortid", "obligationtitle", "obligationtype"], this.uploadTriggersMapping, this.loadOnboardingTriggers, "triggers", ["id"], '', "", ["triggers"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18334
19353
|
};
|
|
18335
|
-
this.renderOnboardingInternalControls = (
|
|
18336
|
-
|
|
18337
|
-
html += '<div id="internalcontrols-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18338
|
-
html += '</div>';
|
|
18339
|
-
this._SfOnboardingInternalControlsContainer.innerHTML = html;
|
|
18340
|
-
this.renderTaggingTable(this._SfOnboardingInternalControlsListContainer, mappedSerializedTriggers, mappedInternalControls, ["shortid", "obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], internalcontrolsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19354
|
+
this.renderOnboardingInternalControls = (selectedStatutes, mappedCompliances, mappedFunctions, mappedInternalControls) => {
|
|
19355
|
+
this.renderTaggingTableNew(this._SfOnboardingInternalControlsListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedInternalControls, ["shortid", "obligationtitle", "obligationtype"], this.uploadInternalControlsMapping, this.loadOnboardingInternalControls, "internalcontrols", ["id", "entityname", "locationname"], '', "", ["internalcontrols"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18341
19356
|
};
|
|
18342
|
-
this.renderOnboardingReportedLocations = (
|
|
18343
|
-
|
|
18344
|
-
html += '<div id="reportedlocations-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18345
|
-
html += '</div>';
|
|
18346
|
-
this._SfOnboardingReportedLocationsContainer.innerHTML = html;
|
|
18347
|
-
this.renderTaggingTable(this._SfOnboardingReportedLocationsContainer, mappedSerializedTriggers, mappedReportedLocations, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportedLocationsMapping, this.loadOnboardingReportedLocations, "reportedlocations", ["id", "entityname", "locationname"], '', "", ["reportedlocations"], reportedlocationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19357
|
+
this.renderOnboardingReportedLocations = (selectedStatutes, mappedCompliances, mappedFunctions, mappedReportedLocations) => {
|
|
19358
|
+
this.renderTaggingTableNew(this._SfOnboardingReportedLocationsListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedReportedLocations, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportedLocationsMapping, this.loadOnboardingReportedLocations, "reportedlocations", ["id", "entityname", "locationname"], '', "", ["reportedlocations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18348
19359
|
};
|
|
18349
|
-
this.renderOnboardingActivations = (
|
|
18350
|
-
|
|
18351
|
-
html += '<div id="activations-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18352
|
-
html += '</div>';
|
|
18353
|
-
this._SfOnboardingActivationsContainer.innerHTML = html;
|
|
18354
|
-
this.renderTaggingTable(this._SfOnboardingActivationListContainer, mappedSerializedExtensions, mappedActivations, ["shortid", "obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], activationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19360
|
+
this.renderOnboardingActivations = (selectedStatutes, mappedCompliances, mappedFunctions, mappedActivations) => {
|
|
19361
|
+
this.renderTaggingTableNew(this._SfOnboardingActivationListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedActivations, ["shortid", "obligationtitle", "obligationtype"], this.uploadActivationsMapping, this.loadOnboardingActivations, "activations", ["id", "entityname", "locationname"], '', "", ["activations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18355
19362
|
};
|
|
18356
|
-
this.renderOnboardingInvalidations = (
|
|
18357
|
-
|
|
18358
|
-
html += '<div id="invalidations-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18359
|
-
html += '</div>';
|
|
18360
|
-
this._SfOnboardingInvalidationsContainer.innerHTML = html;
|
|
18361
|
-
this.renderTaggingTable(this._SfOnboardingInvalidationListContainer, mappedSerializedExtensions, mappedInvalidations, ["shortid", "obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], invalidationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19363
|
+
this.renderOnboardingInvalidations = (selectedStatutes, mappedCompliances, mappedFunctions, mappedInvalidations) => {
|
|
19364
|
+
this.renderTaggingTableNew(this._SfOnboardingInvalidationListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedInvalidations, ["shortid", "obligationtitle", "obligationtype"], this.uploadInvalidationsMapping, this.loadOnboardingInvalidations, "invalidations", ["id", "entityname", "locationname"], '', "", ["invalidations"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18362
19365
|
};
|
|
18363
|
-
this.renderOnboardingAlertSchedules = (
|
|
18364
|
-
|
|
18365
|
-
html += '<div id="alertschedules-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18366
|
-
html += '</div>';
|
|
18367
|
-
this._SfOnboardingAlertSchedulesContainer.innerHTML = html;
|
|
18368
|
-
this.renderTaggingTable(this._SfOnboardingAlertSchedulesListContainer, mappedSerializedExtensions, mappedAlertSchedules, ["shortid", "obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], alertschedulesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19366
|
+
this.renderOnboardingAlertSchedules = (selectedStatutes, mappedCompliances, mappedFunctions, mappedAlertSchedules) => {
|
|
19367
|
+
this.renderTaggingTableNew(this._SfOnboardingAlertSchedulesListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedAlertSchedules, ["shortid", "obligationtitle", "obligationtype"], this.uploadAlertSchedulesMapping, this.loadOnboardingAlertSchedules, "alertschedules", ["id", "entityname", "locationname"], '', "", ["alertschedules"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18369
19368
|
};
|
|
18370
|
-
this.renderOnboardingExtensions = (
|
|
18371
|
-
|
|
18372
|
-
html += '<div id="extensions-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18373
|
-
html += '</div>';
|
|
18374
|
-
this._SfOnboardingExtensionsContainer.innerHTML = html;
|
|
18375
|
-
this.renderTaggingTable(this._SfOnboardingExtensionsListContainer, mappedSerializedDuedates, mappedExtensions, ["shortid", "obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], extensionsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19369
|
+
this.renderOnboardingExtensions = (selectedStatutes, mappedCompliances, mappedFunctions, mappedExtensions) => {
|
|
19370
|
+
this.renderTaggingTableNew(this._SfOnboardingExtensionsListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedExtensions, ["shortid", "obligationtitle", "obligationtype"], this.uploadExtensionsMapping, this.loadOnboardingExtensions, "extensions", ["id", "entityname", "locationname"], '', "", ["extensions"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18376
19371
|
};
|
|
18377
|
-
this.renderOnboardingDuedates = (
|
|
18378
|
-
|
|
18379
|
-
html += '<div id="duedates-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18380
|
-
html += '</div>';
|
|
18381
|
-
this._SfOnboardingDuedatesContainer.innerHTML = html;
|
|
18382
|
-
this.renderTaggingTable(this._SfOnboardingDuedatesListContainer, mappedSerializedMakerCheckers, mappedDuedates, ["shortid", "obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], duedatesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19372
|
+
this.renderOnboardingDuedates = (selectedStatutes, mappedCompliances, mappedFunctions, mappedDuedates) => {
|
|
19373
|
+
this.renderTaggingTableNew(this._SfOnboardingDuedatesListContainer, selectedStatutes, mappedCompliances, mappedFunctions, mappedDuedates, ["shortid", "obligationtitle", "obligationtype"], this.uploadDuedatesMapping, this.loadOnboardingDuedates, "duedates", ["id", "entityname", "locationname"], '', "", ["duedates"], ["id", "countryid", "entityid", "locationid"], null, [], null, "", "");
|
|
18383
19374
|
};
|
|
18384
|
-
this.renderOnboardingReporters = (
|
|
18385
|
-
|
|
18386
|
-
html += '<div id="reporters-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18387
|
-
html += '</div>';
|
|
18388
|
-
this._SfOnboardingReportersContainer.innerHTML = html;
|
|
18389
|
-
this.renderTaggingTable(this._SfOnboardingReportersListContainer, mappedSerializedTags, mappedReporters, ["shortid", "obligationtitle", "obligationtype"], this.uploadReportersMapping, this.loadOnboardingReporters, "reporters", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["reporters"], reportersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
|
|
19375
|
+
this.renderOnboardingReporters = (selectedStatutes, mappedCompliances, mappedFunctions, mappedReporters) => {
|
|
19376
|
+
this.renderTaggingTableNew(this._SfOnboardingReportersListContainer, 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", "");
|
|
18390
19377
|
};
|
|
18391
|
-
this.renderOnboardingApprovers = (
|
|
18392
|
-
|
|
18393
|
-
html += '<div id="approvers-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18394
|
-
html += '</div>';
|
|
18395
|
-
this._SfOnboardingApproversContainer.innerHTML = html;
|
|
18396
|
-
this.renderTaggingTable(this._SfOnboardingApproversListContainer, mappedSerializedReporters, mappedApprovers, ["shortid", "obligationtitle", "obligationtype"], this.uploadApproversMapping, this.loadOnboardingApprovers, "approvers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["approvers"], approversJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
|
|
19378
|
+
this.renderOnboardingApprovers = (selectedStatutes, mappedCompliances, mappedFunctions, mappedApprovers) => {
|
|
19379
|
+
this.renderTaggingTableNew(this._SfOnboardingApproversListContainer, 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", "");
|
|
18397
19380
|
};
|
|
18398
|
-
this.renderOnboardingFunctionHeads = (
|
|
18399
|
-
|
|
18400
|
-
html += '<div id="functionheads-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18401
|
-
html += '</div>';
|
|
18402
|
-
this._SfOnboardingFunctionHeadsContainer.innerHTML = html;
|
|
18403
|
-
this.renderTaggingTable(this._SfOnboardingFunctionHeadsListContainer, mappedSerializedApprovers, mappedFunctionHeads, ["shortid", "obligationtitle", "obligationtype"], this.uploadFunctionHeadsMapping, this.loadOnboardingFunctionHeads, "functionheads", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["functionheads"], functionHeadsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
|
|
19381
|
+
this.renderOnboardingFunctionHeads = (selectedStatutes, mappedCompliances, mappedFunctions, mappedFunctionHeads) => {
|
|
19382
|
+
this.renderTaggingTableNew(this._SfOnboardingFunctionHeadsListContainer, 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", "");
|
|
18404
19383
|
};
|
|
18405
|
-
this.renderOnboardingMakerCheckers = (
|
|
18406
|
-
|
|
18407
|
-
html += '<div id="makercheckers-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18408
|
-
html += '</div>';
|
|
18409
|
-
this._SfOnboardingMakerCheckersContainer.innerHTML = html;
|
|
18410
|
-
this.renderTaggingTable(this._SfOnboardingMakerCheckersListContainer, mappedSerializedDocs, mappedMakerCheckers, ["shortid", "obligationtitle", "obligationtype"], this.uploadMakerCheckersMapping, this.loadOnboardingMakerCheckers, "makercheckers", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["makercheckers"], makerCheckerJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19384
|
+
this.renderOnboardingMakerCheckers = (selectedStatutes, mappedCompliances, mappedFunctions, mappedMakerCheckers) => {
|
|
19385
|
+
this.renderTaggingTableNew(this._SfOnboardingMakerCheckersListContainer, 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, "", "");
|
|
18411
19386
|
};
|
|
18412
|
-
this.renderOnboardingDocs = (
|
|
18413
|
-
|
|
18414
|
-
html += '<div id="docs-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18415
|
-
html += '</div>';
|
|
18416
|
-
this._SfOnboardingDocsContainer.innerHTML = html;
|
|
18417
|
-
this.renderTaggingTable(this._SfOnboardingDocsListContainer, mappedSerializedViewers, mappedDocs, ["shortid", "obligationtitle", "obligationtype"], this.uploadDocsMapping, this.loadOnboardingDocs, "docs", ["id", "entityname", "locationname"], this.apiIdTags, "&MakerChecker", ["docs"], docsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
|
|
19387
|
+
this.renderOnboardingDocs = (selectedStatutes, mappedCompliances, mappedFunctions, mappedDocs) => {
|
|
19388
|
+
this.renderTaggingTableNew(this._SfOnboardingDocsListContainer, 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, "", "");
|
|
18418
19389
|
};
|
|
18419
|
-
this.renderOnboardingAuditors = (
|
|
18420
|
-
|
|
18421
|
-
var html = '';
|
|
18422
|
-
html += '<div id="auditors-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18423
|
-
html += '</div>';
|
|
18424
|
-
this._SfOnboardingAuditorsContainer.innerHTML = html;
|
|
18425
|
-
this.renderTaggingTable(this._SfOnboardingAuditorsListContainer, mappedSerializedFunctionheads, mappedAuditors, ["shortid", "obligationtitle", "obligationtype"], this.uploadAuditorsMapping, this.loadOnboardingAuditors, "auditors", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["auditors"], auditorsJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
|
|
19390
|
+
this.renderOnboardingAuditors = (selectedStatutes, mappedCompliances, mappedFunctions, mappedAuditors) => {
|
|
19391
|
+
this.renderTaggingTableNew(this._SfOnboardingAuditorsListContainer, 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", "");
|
|
18426
19392
|
};
|
|
18427
|
-
this.renderOnboardingViewers = (
|
|
18428
|
-
|
|
18429
|
-
var html = '';
|
|
18430
|
-
html += '<div id="viewers-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18431
|
-
html += '</div>';
|
|
18432
|
-
this._SfOnboardingViewersContainer.innerHTML = html;
|
|
18433
|
-
this.renderTaggingTable(this._SfOnboardingViewersListContainer, mappedSerializedAuditors, mappedViewers, ["shortid", "obligationtitle", "obligationtype"], this.uploadViewersMapping, this.loadOnboardingViewers, "viewers", ["id", "entityname", "locationname"], this.apiIdUsers, "", ["viewers"], viewersJobs, null, ["Client remarks", "FlaggGRC response"], null, "Guidelines", "");
|
|
19393
|
+
this.renderOnboardingViewers = (selectedStatutes, mappedCompliances, mappedFunctions, mappedViewers) => {
|
|
19394
|
+
this.renderTaggingTableNew(this._SfOnboardingViewersListContainer, 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", "");
|
|
18434
19395
|
};
|
|
18435
|
-
this.renderOnboardingTags = (
|
|
18436
|
-
|
|
18437
|
-
html += '<div id="tags-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18438
|
-
html += '</div>';
|
|
18439
|
-
this._SfOnboardingTagsContainer.innerHTML = html;
|
|
18440
|
-
this.renderTaggingTable(this._SfOnboardingTagsListContainer, 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, "", "");
|
|
19396
|
+
this.renderOnboardingTags = (selectedStatutes, mappedCompliances, mappedFunctions, mappedTags) => {
|
|
19397
|
+
this.renderTaggingTableNew(this._SfOnboardingTagsListContainer, 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, "", "");
|
|
18441
19398
|
};
|
|
18442
|
-
this.renderOnboardingFunctions = (
|
|
19399
|
+
this.renderOnboardingFunctions = (selectedStatutes, mappedCompliances, mappedLocations, mappedFunctions) => {
|
|
19400
|
+
this.renderTaggingTableNew(this._SfOnboardingFunctionsListContainer, 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, "", "");
|
|
19401
|
+
};
|
|
19402
|
+
this.renderOnboardingLocations = (selectedStatutes, mappedCompliances, mappedEntities, mappedLocations) => {
|
|
19403
|
+
this.renderTaggingTableNew(this._SfOnboardingLocationsListContainer, 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, "", "");
|
|
19404
|
+
};
|
|
19405
|
+
this.renderOnboardingStatutesDropdownMapping = (container, mappedStatutes, selectedStatutes, fetchtaggingfunction, rendermappingfunction) => {
|
|
19406
|
+
console.log('rendering dropdown', mappedStatutes.length);
|
|
18443
19407
|
var html = '';
|
|
18444
|
-
html += '<div
|
|
19408
|
+
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
19409
|
+
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
19410
|
+
html += '<label part="input-label">Select Statute</label>';
|
|
19411
|
+
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
19412
|
+
html += '</div>';
|
|
19413
|
+
html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
19414
|
+
html += '</div>';
|
|
18445
19415
|
html += '</div>';
|
|
18446
|
-
|
|
18447
|
-
|
|
18448
|
-
|
|
19416
|
+
console.log('attaching html', html);
|
|
19417
|
+
container.innerHTML = html;
|
|
19418
|
+
let multiselectStatute = container.querySelector('#statute-select');
|
|
19419
|
+
multiselectStatute.listelements = mappedStatutes;
|
|
19420
|
+
let selectedStatutesObj = {};
|
|
19421
|
+
for (let statuteObj of selectedStatutes) {
|
|
19422
|
+
selectedStatutesObj[statuteObj.id] = true;
|
|
19423
|
+
}
|
|
19424
|
+
multiselectStatute.listselection = selectedStatutesObj;
|
|
19425
|
+
multiselectStatute.loadMode();
|
|
19426
|
+
multiselectStatute.addEventListener('valueChanged', async (e) => {
|
|
19427
|
+
let multiselect = e.currentTarget;
|
|
19428
|
+
console.log('selected statutes', multiselect.selectedValuesNames());
|
|
19429
|
+
if (Object.keys(multiselect.selectedValuesNames()).length == 0) {
|
|
19430
|
+
return;
|
|
18449
19431
|
}
|
|
18450
|
-
|
|
18451
|
-
|
|
18452
|
-
|
|
19432
|
+
let selectedStatutes = [];
|
|
19433
|
+
const regex = /^\[.*?\] - /;
|
|
19434
|
+
for (let statuteid of Object.keys(multiselect.selectedValuesNames())) {
|
|
19435
|
+
selectedStatutes.push({ id: statuteid, selected: true, statutename: multiselect.selectedValuesNames()[statuteid].name.replace(regex, '') });
|
|
19436
|
+
}
|
|
19437
|
+
let mappedCompliances = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
|
|
19438
|
+
rendermappingfunction({ data: { mappings: { mappings: selectedStatutes } } }, mappedCompliances);
|
|
19439
|
+
});
|
|
18453
19440
|
};
|
|
18454
|
-
this.
|
|
19441
|
+
this.renderOnboardingStatutesDropdownTagging = (container, listcontainerid, mappedStatutes, selectedStatutes, fetchcompliancesfunction, fetchsourcemapping, fetchtaggingfunction, rendertaggingfunction) => {
|
|
19442
|
+
console.log('rendering dropdown', mappedStatutes.length);
|
|
18455
19443
|
var html = '';
|
|
18456
|
-
html += '<div
|
|
19444
|
+
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
19445
|
+
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
19446
|
+
html += '<label part="input-label">Select Statute</label>';
|
|
19447
|
+
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
18457
19448
|
html += '</div>';
|
|
18458
|
-
|
|
18459
|
-
|
|
19449
|
+
html += '<div id="' + listcontainerid + '" class="d-flex flex-col w-100 scroll-x">';
|
|
19450
|
+
html += '</div>';
|
|
19451
|
+
html += '</div>';
|
|
19452
|
+
console.log('attaching html', html);
|
|
19453
|
+
container.innerHTML = html;
|
|
19454
|
+
let multiselectStatute = container.querySelector('#statute-select');
|
|
19455
|
+
multiselectStatute.listelements = mappedStatutes;
|
|
19456
|
+
let selectedStatutesObj = {};
|
|
19457
|
+
for (let statuteObj of selectedStatutes) {
|
|
19458
|
+
selectedStatutesObj[statuteObj.id] = true;
|
|
19459
|
+
}
|
|
19460
|
+
multiselectStatute.listselection = selectedStatutesObj;
|
|
19461
|
+
multiselectStatute.loadMode();
|
|
19462
|
+
multiselectStatute.addEventListener('valueChanged', async (e) => {
|
|
19463
|
+
let multiselect = e.currentTarget;
|
|
19464
|
+
console.log('selected statutes', multiselect.selectedValuesNames());
|
|
19465
|
+
if (Object.keys(multiselect.selectedValuesNames()).length == 0) {
|
|
19466
|
+
return;
|
|
19467
|
+
}
|
|
19468
|
+
let selectedStatutes = [];
|
|
19469
|
+
const regex = /^\[.*?\] - /;
|
|
19470
|
+
for (let statuteid of Object.keys(multiselect.selectedValuesNames())) {
|
|
19471
|
+
selectedStatutes.push({ id: statuteid, selected: true, statutename: multiselect.selectedValuesNames()[statuteid].name.replace(regex, '') });
|
|
19472
|
+
}
|
|
19473
|
+
let sourceMappingArray = await fetchsourcemapping(Object.keys(multiselect.selectedValuesNames()));
|
|
19474
|
+
let mappingArray = await fetchtaggingfunction(Object.keys(multiselect.selectedValuesNames()));
|
|
19475
|
+
let mappedCompliances = await fetchcompliancesfunction(Object.keys(multiselect.selectedValuesNames()));
|
|
19476
|
+
let mappedCompliancesArr = { data: { mappings: {} } };
|
|
19477
|
+
console.log('mapped compliances', mappedCompliances);
|
|
19478
|
+
for (let statuteObj of selectedStatutes) {
|
|
19479
|
+
for (let complianceid of Object.keys(mappedCompliances.data.mappings[statuteObj.id])) {
|
|
19480
|
+
let pushObj = mappedCompliances.data.mappings[statuteObj.id][complianceid];
|
|
19481
|
+
pushObj.id = complianceid;
|
|
19482
|
+
pushObj.statuteid = statuteObj.id;
|
|
19483
|
+
mappedCompliancesArr.data.mappings[complianceid] = pushObj;
|
|
19484
|
+
}
|
|
19485
|
+
}
|
|
19486
|
+
rendertaggingfunction(selectedStatutes, mappedCompliancesArr, sourceMappingArray, mappingArray);
|
|
19487
|
+
});
|
|
18460
19488
|
};
|
|
18461
|
-
this.renderOnboardingCompliances = (mappedStatutes,
|
|
19489
|
+
this.renderOnboardingCompliances = async (mappedStatutes, mappedCompliancesArr) => {
|
|
18462
19490
|
//console.log('mappedcompliances', mappedCompliances);
|
|
18463
19491
|
//console.log('mappedstatutes', mappedStatutes);
|
|
18464
19492
|
var searchString = "";
|
|
19493
|
+
let mappedCompliances = { data: { mappings: { mappings: [] } } };
|
|
18465
19494
|
for (var i = 0; i < mappedStatutes.data.mappings.mappings.length; i++) {
|
|
18466
19495
|
if (mappedStatutes.data.mappings.mappings[i].selected) {
|
|
18467
|
-
|
|
19496
|
+
let statuteid = mappedStatutes.data.mappings.mappings[i].id;
|
|
19497
|
+
if (mappedCompliancesArr.data.mappings[statuteid] != null) {
|
|
19498
|
+
for (let complianceid of Object.keys(mappedCompliancesArr.data.mappings[statuteid])) {
|
|
19499
|
+
let pushObj = mappedCompliancesArr.data.mappings[statuteid][complianceid];
|
|
19500
|
+
pushObj.id = complianceid;
|
|
19501
|
+
mappedCompliances.data.mappings.mappings.push(pushObj);
|
|
19502
|
+
}
|
|
19503
|
+
}
|
|
19504
|
+
searchString += statuteid + "|";
|
|
18468
19505
|
}
|
|
18469
19506
|
}
|
|
18470
19507
|
searchString = searchString.slice(0, -1);
|
|
18471
19508
|
//console.log('searchstring', searchString);
|
|
18472
19509
|
var initCursor = "";
|
|
18473
|
-
var html = '';
|
|
18474
|
-
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
18475
|
-
html += '<div class="d-flex flex-col w-100">';
|
|
18476
|
-
html += '<label part="input-label">Search Compliances</label>';
|
|
18477
|
-
html += '<div class="d-flex">';
|
|
18478
|
-
html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
|
|
18479
|
-
html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
|
|
18480
|
-
html += '</div>';
|
|
18481
|
-
html += '</div>';
|
|
18482
|
-
html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18483
|
-
html += '</div>';
|
|
18484
|
-
html += '</div>';
|
|
18485
|
-
this._SfOnboardingCompliancesContainer.innerHTML = html;
|
|
18486
|
-
this._SfButtonSearch
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18494
|
-
|
|
18495
|
-
|
|
19510
|
+
// var html = '';
|
|
19511
|
+
// html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
19512
|
+
// html += '<div class="d-flex flex-col w-100">';
|
|
19513
|
+
// html += '<label part="input-label">Search Compliances</label>';
|
|
19514
|
+
// html += '<div class="d-flex">';
|
|
19515
|
+
// html += '<input part="input" type="text" class="w-100 input-search" placeholder="Use | to separate..." disabled/>'
|
|
19516
|
+
// html += '<button part="button-icon" class="ml-10 material-icons button-search">search</button>'
|
|
19517
|
+
// html += '</div>';
|
|
19518
|
+
// html += '</div>';
|
|
19519
|
+
// html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
19520
|
+
// html += '</div>';
|
|
19521
|
+
// html += '</div>';
|
|
19522
|
+
// (this._SfOnboardingCompliancesContainer as HTMLDivElement).innerHTML = html;
|
|
19523
|
+
// (this._SfButtonSearch as HTMLButtonElement)?.addEventListener('click', async () => {
|
|
19524
|
+
// //console.log('clicked', mappedStatutes.data.mappings.mappings);
|
|
19525
|
+
// const searchString = (this._SfInputSearch as HTMLButtonElement).value;
|
|
19526
|
+
// //console.log('searchstring', searchString);
|
|
19527
|
+
// if (searchString.length > 0) {
|
|
19528
|
+
// const arrSearchString = searchString.split('|');
|
|
19529
|
+
// const arrSearchStringProcessed: any = [];
|
|
19530
|
+
// arrSearchString.forEach((complianceId: string) => {
|
|
19531
|
+
// if (complianceId.length === 36) {
|
|
19532
|
+
// arrSearchStringProcessed.push(complianceId);
|
|
19533
|
+
// }
|
|
19534
|
+
// });
|
|
19535
|
+
// var resultCompliances: any = {};
|
|
19536
|
+
// resultCompliances.values = [];
|
|
19537
|
+
// const chunkSize = 20;
|
|
19538
|
+
// for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
|
|
19539
|
+
// const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
|
|
19540
|
+
// console.log('chunk', chunk);
|
|
19541
|
+
// // do whatever
|
|
19542
|
+
// const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
|
|
19543
|
+
// console.log(tempResultCompliances)
|
|
19544
|
+
// resultCompliances.values.push(...tempResultCompliances.values);
|
|
19545
|
+
// //console.log(resultCompliances);
|
|
19546
|
+
// }
|
|
19547
|
+
// // var resultCompliances : any = {};
|
|
19548
|
+
// // resultCompliances.values = [];
|
|
19549
|
+
// // const chunkSize = 20;
|
|
19550
|
+
// // for (let k = 0; k < arrSearchString.length; k += chunkSize) {
|
|
19551
|
+
// // const chunk = arrSearchString.slice(k, k + chunkSize);
|
|
19552
|
+
// // console.log('chunk', chunk);
|
|
19553
|
+
// // // do whatever
|
|
19554
|
+
// // const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
|
|
19555
|
+
// // console.log(tempResultCompliances)
|
|
19556
|
+
// // resultCompliances.values.push(...tempResultCompliances.values);
|
|
19557
|
+
// // //console.log(resultCompliances);
|
|
19558
|
+
// // }
|
|
19559
|
+
// if (resultCompliances != null) {
|
|
19560
|
+
// const jsonData = [];
|
|
19561
|
+
// const arrCompliancesFrequencies: any = {};
|
|
19562
|
+
// for (var i = 0; i < resultCompliances.values.length; i++) {
|
|
19563
|
+
// if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
|
|
19564
|
+
// continue;
|
|
19565
|
+
// } else {
|
|
19566
|
+
// arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
|
|
19567
|
+
// }
|
|
19568
|
+
// var mapped = false;
|
|
19569
|
+
// var extraFields = null;
|
|
19570
|
+
// var previousExtraFields = null;
|
|
19571
|
+
// console.log('mappedcompliances', mappedCompliances)
|
|
19572
|
+
// for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
|
|
19573
|
+
// if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
|
|
19574
|
+
// if (mappedCompliances.data.mappings.mappings[j].selected) {
|
|
19575
|
+
// mapped = true;
|
|
19576
|
+
// }
|
|
19577
|
+
// extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
|
|
19578
|
+
// }
|
|
19579
|
+
// }
|
|
19580
|
+
// for (j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
|
|
19581
|
+
// // console.log('mappedStatutes.data.mappings.mappings[j]', mappedStatutes.data.mappings.mappings[j]);
|
|
19582
|
+
// if (Array.isArray(mappedStatutes.data.mappings.mappings[j].statutename)) {
|
|
19583
|
+
// // sometimes this error occurs
|
|
19584
|
+
// continue;
|
|
19585
|
+
// }
|
|
19586
|
+
// if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
|
|
19587
|
+
// // if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
|
|
19588
|
+
// // console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
|
|
19589
|
+
// // }
|
|
19590
|
+
// previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields
|
|
19591
|
+
// }
|
|
19592
|
+
// }
|
|
19593
|
+
// 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 })
|
|
19594
|
+
// }
|
|
19595
|
+
// 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"]);
|
|
19596
|
+
// }
|
|
19597
|
+
// }
|
|
19598
|
+
// });
|
|
19599
|
+
//console.log('compliances searchstring', searchString);
|
|
19600
|
+
// if (searchString != "") {
|
|
19601
|
+
// (this._SfInputSearch as HTMLInputElement).value = searchString;
|
|
19602
|
+
// (this._SfButtonSearch as HTMLButtonElement).click();
|
|
19603
|
+
// }
|
|
19604
|
+
if (searchString.length > 0) {
|
|
19605
|
+
const arrSearchString = searchString.split('|');
|
|
19606
|
+
const arrSearchStringProcessed = [];
|
|
19607
|
+
arrSearchString.forEach((complianceId) => {
|
|
19608
|
+
if (complianceId.length === 36) {
|
|
19609
|
+
arrSearchStringProcessed.push(complianceId);
|
|
19610
|
+
}
|
|
19611
|
+
});
|
|
19612
|
+
var resultCompliances = {};
|
|
19613
|
+
resultCompliances.values = [];
|
|
19614
|
+
const chunkSize = 20;
|
|
19615
|
+
for (let k = 0; k < arrSearchStringProcessed.length; k += chunkSize) {
|
|
19616
|
+
const chunk = arrSearchStringProcessed.slice(k, k + chunkSize);
|
|
19617
|
+
console.log('chunk', chunk);
|
|
19618
|
+
// do whatever
|
|
19619
|
+
const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchStringProcessed.length);
|
|
19620
|
+
console.log(tempResultCompliances);
|
|
19621
|
+
resultCompliances.values.push(...tempResultCompliances.values);
|
|
19622
|
+
//console.log(resultCompliances);
|
|
19623
|
+
}
|
|
19624
|
+
// var resultCompliances : any = {};
|
|
19625
|
+
// resultCompliances.values = [];
|
|
19626
|
+
// const chunkSize = 20;
|
|
19627
|
+
// for (let k = 0; k < arrSearchString.length; k += chunkSize) {
|
|
19628
|
+
// const chunk = arrSearchString.slice(k, k + chunkSize);
|
|
19629
|
+
// console.log('chunk', chunk);
|
|
19630
|
+
// // do whatever
|
|
19631
|
+
// const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
|
|
19632
|
+
// console.log(tempResultCompliances)
|
|
19633
|
+
// resultCompliances.values.push(...tempResultCompliances.values);
|
|
19634
|
+
// //console.log(resultCompliances);
|
|
19635
|
+
// }
|
|
19636
|
+
if (resultCompliances != null) {
|
|
19637
|
+
const jsonData = [];
|
|
19638
|
+
const arrCompliancesFrequencies = {};
|
|
19639
|
+
for (var i = 0; i < resultCompliances.values.length; i++) {
|
|
19640
|
+
if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
|
|
19641
|
+
continue;
|
|
18496
19642
|
}
|
|
18497
|
-
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
|
|
18503
|
-
console.log('
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
|
|
18514
|
-
// const chunk = arrSearchString.slice(k, k + chunkSize);
|
|
18515
|
-
// console.log('chunk', chunk);
|
|
18516
|
-
// // do whatever
|
|
18517
|
-
// const tempResultCompliances = await this.fetchSearchCompliances(chunk.join('|'), "", k, arrSearchString.length);
|
|
18518
|
-
// console.log(tempResultCompliances)
|
|
18519
|
-
// resultCompliances.values.push(...tempResultCompliances.values);
|
|
18520
|
-
// //console.log(resultCompliances);
|
|
18521
|
-
// }
|
|
18522
|
-
if (resultCompliances != null) {
|
|
18523
|
-
const jsonData = [];
|
|
18524
|
-
const arrCompliancesFrequencies = {};
|
|
18525
|
-
for (var i = 0; i < resultCompliances.values.length; i++) {
|
|
18526
|
-
if (arrCompliancesFrequencies[resultCompliances.values[i].id] != null) {
|
|
18527
|
-
continue;
|
|
18528
|
-
}
|
|
18529
|
-
else {
|
|
18530
|
-
arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
|
|
19643
|
+
else {
|
|
19644
|
+
arrCompliancesFrequencies[resultCompliances.values[i].id] = 0;
|
|
19645
|
+
}
|
|
19646
|
+
var mapped = false;
|
|
19647
|
+
var extraFields = null;
|
|
19648
|
+
var previousExtraFields = null;
|
|
19649
|
+
console.log('mappedcompliances', mappedCompliances);
|
|
19650
|
+
if (mappedCompliances.data.mappings.mappings == null) {
|
|
19651
|
+
for (var j = 0; j < Object.keys(mappedCompliances.data.mappings).length; j++) {
|
|
19652
|
+
let statuteKey = Object.keys(mappedCompliances.data.mappings)[j];
|
|
19653
|
+
for (var k = 0; k < Object.keys(mappedCompliances.data.mappings[statuteKey]).length; k++) {
|
|
19654
|
+
let complianceKey = Object.keys(mappedCompliances.data.mappings[statuteKey])[k];
|
|
19655
|
+
if (mappedCompliances.data.mappings[statuteKey][complianceKey].id == resultCompliances.values[i].id) {
|
|
19656
|
+
mapped = true;
|
|
19657
|
+
extraFields = mappedCompliances.data.mappings[statuteKey][complianceKey].extraFields;
|
|
19658
|
+
}
|
|
19659
|
+
}
|
|
18531
19660
|
}
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
var previousExtraFields = null;
|
|
18535
|
-
console.log('mappedcompliances', mappedCompliances);
|
|
19661
|
+
}
|
|
19662
|
+
else {
|
|
18536
19663
|
for (var j = 0; j < mappedCompliances.data.mappings.mappings.length; j++) {
|
|
18537
19664
|
if (mappedCompliances.data.mappings.mappings[j].id == resultCompliances.values[i].id) {
|
|
18538
|
-
|
|
18539
|
-
mapped = true;
|
|
18540
|
-
}
|
|
19665
|
+
mapped = true;
|
|
18541
19666
|
extraFields = mappedCompliances.data.mappings.mappings[j].extraFields;
|
|
18542
19667
|
}
|
|
18543
19668
|
}
|
|
@@ -18548,51 +19673,25 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18548
19673
|
continue;
|
|
18549
19674
|
}
|
|
18550
19675
|
if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == JSON.parse(resultCompliances.values[i].fields.data[0])[6][0].trim()) {
|
|
18551
|
-
if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
|
|
18552
|
-
|
|
18553
|
-
}
|
|
19676
|
+
// if (mappedStatutes.data.mappings.mappings[j].statutename.trim() == "Corporation Act, 2001") {
|
|
19677
|
+
// //console.log('pushpreviousvalues', mappedStatutes.data.mappings.mappings[j], Object.keys(mappedStatutes.data.mappings.mappings[j].extraFields[0]));
|
|
19678
|
+
// }
|
|
18554
19679
|
previousExtraFields = mappedStatutes.data.mappings.mappings[j].extraFields;
|
|
18555
19680
|
}
|
|
18556
19681
|
}
|
|
18557
|
-
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 });
|
|
18558
19682
|
}
|
|
18559
|
-
|
|
19683
|
+
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 });
|
|
18560
19684
|
}
|
|
19685
|
+
this.renderMappingTable(this._SfOnboardingCompliancesListContainer, 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);
|
|
18561
19686
|
}
|
|
18562
|
-
});
|
|
18563
|
-
//console.log('compliances searchstring', searchString);
|
|
18564
|
-
if (searchString != "") {
|
|
18565
|
-
this._SfInputSearch.value = searchString;
|
|
18566
|
-
this._SfButtonSearch.click();
|
|
18567
19687
|
}
|
|
18568
19688
|
};
|
|
18569
|
-
this.renderOnboardingEntities = (
|
|
18570
|
-
|
|
18571
|
-
html += '<div id="entities-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
18572
|
-
html += '</div>';
|
|
18573
|
-
this._SfOnboardingEntitiesContainer.innerHTML = html;
|
|
18574
|
-
this.renderTaggingTable(this._SfOnboardingEntitiesListContainer, 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", "");
|
|
19689
|
+
this.renderOnboardingEntities = (selectedStatutes, mappedCompliances, mappedCountries, mappedEntities) => {
|
|
19690
|
+
this.renderTaggingTableNew(this._SfOnboardingEntitiesListContainer, 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", "");
|
|
18575
19691
|
};
|
|
18576
|
-
this.renderOnboardingCountries = (
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
html += '</div>';
|
|
18580
|
-
this._SfOnboardingCountriesContainer.innerHTML = html;
|
|
18581
|
-
const arr1 = [];
|
|
18582
|
-
for (var i = 0; i < mappedCompliances.data.mappings.mappings.length; i++) {
|
|
18583
|
-
if (mappedCompliances.data.mappings.mappings[i].selected) {
|
|
18584
|
-
arr1.push(mappedCompliances.data.mappings.mappings[i]);
|
|
18585
|
-
}
|
|
18586
|
-
}
|
|
18587
|
-
mappedCompliances.data.mappings.mappings = arr1;
|
|
18588
|
-
// const arr2 = [];
|
|
18589
|
-
// for(var i = 0; i < mappedCountries.data.mappings.mappings.length; i++) {
|
|
18590
|
-
// if(mappedCountries.data.mappings.mappings[i].selected) {
|
|
18591
|
-
// arr2.push(mappedCountries.data.mappings.mappings[i]);
|
|
18592
|
-
// }
|
|
18593
|
-
// }
|
|
18594
|
-
// mappedCountries.data.mappings.mappings = arr2;
|
|
18595
|
-
this.renderTaggingTable(this._SfOnboardingCountriesListContainer, 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, "", "");
|
|
19692
|
+
this.renderOnboardingCountries = (selectedStatutes, mappedCompliances, sourceMapping, mappedCountries) => {
|
|
19693
|
+
sourceMapping = {};
|
|
19694
|
+
this.renderTaggingTableNew(this._SfOnboardingCountriesListContainer, 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, "", "");
|
|
18596
19695
|
};
|
|
18597
19696
|
this.renderOnboardingStatutes = (mappedStatutes) => {
|
|
18598
19697
|
var initCursor = "";
|
|
@@ -18629,9 +19728,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18629
19728
|
for (var j = 0; j < mappedStatutes.data.mappings.mappings.length; j++) {
|
|
18630
19729
|
if (mappedStatutes.data.mappings.mappings[j].id == resultStatutes.values[i].id) {
|
|
18631
19730
|
//console.log('comparing',mappedStatutes.data.mappings.mappings[j].id,resultStatutes.values[i].id);
|
|
18632
|
-
if (mappedStatutes.data.mappings.mappings[j].selected) {
|
|
18633
|
-
|
|
18634
|
-
}
|
|
19731
|
+
// if (mappedStatutes.data.mappings.mappings[j].selected) {
|
|
19732
|
+
mapped = true;
|
|
19733
|
+
// }
|
|
18635
19734
|
extraFields = mappedStatutes.data.mappings.mappings[j].extraFields;
|
|
18636
19735
|
}
|
|
18637
19736
|
}
|
|
@@ -18866,112 +19965,112 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18866
19965
|
this._SfOnboardingTabContainer.innerHTML = html;
|
|
18867
19966
|
(_a = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-statutes')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', async () => {
|
|
18868
19967
|
this.myOnboardingTab = this.TAB_STATUTES;
|
|
18869
|
-
this.renderOnboardingTabs();
|
|
19968
|
+
await this.renderOnboardingTabs();
|
|
18870
19969
|
await this.loadOnboardingStatutes();
|
|
18871
19970
|
});
|
|
18872
19971
|
(_b = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-compliances')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', async () => {
|
|
18873
19972
|
this.myOnboardingTab = this.TAB_COMPLIANCES;
|
|
18874
|
-
this.renderOnboardingTabs();
|
|
19973
|
+
await this.renderOnboardingTabs();
|
|
18875
19974
|
this.loadOnboardingCompliances();
|
|
18876
19975
|
});
|
|
18877
19976
|
(_c = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-countries')) === null || _c === void 0 ? void 0 : _c.addEventListener('click', async () => {
|
|
18878
19977
|
this.myOnboardingTab = this.TAB_COUNTRIES;
|
|
18879
|
-
this.renderOnboardingTabs();
|
|
19978
|
+
await this.renderOnboardingTabs();
|
|
18880
19979
|
this.loadOnboardingCountries();
|
|
18881
19980
|
});
|
|
18882
19981
|
(_f = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-entities')) === null || _f === void 0 ? void 0 : _f.addEventListener('click', async () => {
|
|
18883
19982
|
this.myOnboardingTab = this.TAB_ENTITIES;
|
|
18884
|
-
this.renderOnboardingTabs();
|
|
19983
|
+
await this.renderOnboardingTabs();
|
|
18885
19984
|
this.loadOnboardingEntities();
|
|
18886
19985
|
});
|
|
18887
19986
|
(_g = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-locations')) === null || _g === void 0 ? void 0 : _g.addEventListener('click', async () => {
|
|
18888
19987
|
this.myOnboardingTab = this.TAB_LOCATIONS;
|
|
18889
|
-
this.renderOnboardingTabs();
|
|
19988
|
+
await this.renderOnboardingTabs();
|
|
18890
19989
|
this.loadOnboardingLocations();
|
|
18891
19990
|
});
|
|
18892
19991
|
(_h = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-functions')) === null || _h === void 0 ? void 0 : _h.addEventListener('click', async () => {
|
|
18893
19992
|
this.myOnboardingTab = this.TAB_FUNCTIONS;
|
|
18894
|
-
this.renderOnboardingTabs();
|
|
19993
|
+
await this.renderOnboardingTabs();
|
|
18895
19994
|
this.loadOnboardingFunctions();
|
|
18896
19995
|
});
|
|
18897
19996
|
(_j = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-tags')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', async () => {
|
|
18898
19997
|
this.myOnboardingTab = this.TAB_TAGS;
|
|
18899
|
-
this.renderOnboardingTabs();
|
|
19998
|
+
await this.renderOnboardingTabs();
|
|
18900
19999
|
this.loadOnboardingTags();
|
|
18901
20000
|
});
|
|
18902
20001
|
(_k = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-reporters')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', async () => {
|
|
18903
20002
|
this.myOnboardingTab = this.TAB_REPORTERS;
|
|
18904
|
-
this.renderOnboardingTabs();
|
|
20003
|
+
await this.renderOnboardingTabs();
|
|
18905
20004
|
this.loadOnboardingReporters();
|
|
18906
20005
|
});
|
|
18907
20006
|
(_l = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-approvers')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', async () => {
|
|
18908
20007
|
this.myOnboardingTab = this.TAB_APPROVERS;
|
|
18909
|
-
this.renderOnboardingTabs();
|
|
20008
|
+
await this.renderOnboardingTabs();
|
|
18910
20009
|
this.loadOnboardingApprovers();
|
|
18911
20010
|
});
|
|
18912
20011
|
(_m = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-functionheads')) === null || _m === void 0 ? void 0 : _m.addEventListener('click', async () => {
|
|
18913
20012
|
this.myOnboardingTab = this.TAB_FUNCTION_HEADS;
|
|
18914
|
-
this.renderOnboardingTabs();
|
|
20013
|
+
await this.renderOnboardingTabs();
|
|
18915
20014
|
this.loadOnboardingFunctionHeads();
|
|
18916
20015
|
});
|
|
18917
20016
|
(_o = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-auditors')) === null || _o === void 0 ? void 0 : _o.addEventListener('click', async () => {
|
|
18918
20017
|
this.myOnboardingTab = this.TAB_AUDITORS;
|
|
18919
|
-
this.renderOnboardingTabs();
|
|
20018
|
+
await this.renderOnboardingTabs();
|
|
18920
20019
|
this.loadOnboardingAuditors();
|
|
18921
20020
|
});
|
|
18922
20021
|
(_p = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-viewers')) === null || _p === void 0 ? void 0 : _p.addEventListener('click', async () => {
|
|
18923
20022
|
this.myOnboardingTab = this.TAB_VIEWERS;
|
|
18924
|
-
this.renderOnboardingTabs();
|
|
20023
|
+
await this.renderOnboardingTabs();
|
|
18925
20024
|
this.loadOnboardingViewers();
|
|
18926
20025
|
});
|
|
18927
20026
|
(_q = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-makercheckers')) === null || _q === void 0 ? void 0 : _q.addEventListener('click', async () => {
|
|
18928
20027
|
this.myOnboardingTab = this.TAB_MAKER_CHECKERS;
|
|
18929
|
-
this.renderOnboardingTabs();
|
|
20028
|
+
await this.renderOnboardingTabs();
|
|
18930
20029
|
this.loadOnboardingMakerCheckers();
|
|
18931
20030
|
});
|
|
18932
20031
|
(_r = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-docs')) === null || _r === void 0 ? void 0 : _r.addEventListener('click', async () => {
|
|
18933
20032
|
this.myOnboardingTab = this.TAB_DOCS;
|
|
18934
|
-
this.renderOnboardingTabs();
|
|
20033
|
+
await this.renderOnboardingTabs();
|
|
18935
20034
|
this.loadOnboardingDocs();
|
|
18936
20035
|
});
|
|
18937
20036
|
(_s = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-duedates')) === null || _s === void 0 ? void 0 : _s.addEventListener('click', async () => {
|
|
18938
20037
|
this.myOnboardingTab = this.TAB_DUEDATES;
|
|
18939
|
-
this.renderOnboardingTabs();
|
|
20038
|
+
await this.renderOnboardingTabs();
|
|
18940
20039
|
this.loadOnboardingDuedates();
|
|
18941
20040
|
});
|
|
18942
20041
|
(_t = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-alertschedules')) === null || _t === void 0 ? void 0 : _t.addEventListener('click', async () => {
|
|
18943
20042
|
this.myOnboardingTab = this.TAB_ALERTSCHEDULES;
|
|
18944
|
-
this.renderOnboardingTabs();
|
|
20043
|
+
await this.renderOnboardingTabs();
|
|
18945
20044
|
this.loadOnboardingAlertSchedules();
|
|
18946
20045
|
});
|
|
18947
20046
|
(_u = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-activations')) === null || _u === void 0 ? void 0 : _u.addEventListener('click', async () => {
|
|
18948
20047
|
this.myOnboardingTab = this.TAB_ACTIVATIONS;
|
|
18949
|
-
this.renderOnboardingTabs();
|
|
20048
|
+
await this.renderOnboardingTabs();
|
|
18950
20049
|
this.loadOnboardingActivations();
|
|
18951
20050
|
});
|
|
18952
20051
|
(_v = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-invalidations')) === null || _v === void 0 ? void 0 : _v.addEventListener('click', async () => {
|
|
18953
20052
|
this.myOnboardingTab = this.TAB_INVALIDATION;
|
|
18954
|
-
this.renderOnboardingTabs();
|
|
20053
|
+
await this.renderOnboardingTabs();
|
|
18955
20054
|
this.loadOnboardingInvalidations();
|
|
18956
20055
|
});
|
|
18957
20056
|
(_w = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-triggers')) === null || _w === void 0 ? void 0 : _w.addEventListener('click', async () => {
|
|
18958
20057
|
this.myOnboardingTab = this.TAB_TRIGGERS;
|
|
18959
|
-
this.renderOnboardingTabs();
|
|
20058
|
+
await this.renderOnboardingTabs();
|
|
18960
20059
|
this.loadOnboardingTriggers();
|
|
18961
20060
|
});
|
|
18962
20061
|
(_x = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-extensions')) === null || _x === void 0 ? void 0 : _x.addEventListener('click', async () => {
|
|
18963
20062
|
this.myOnboardingTab = this.TAB_EXTENSIONS;
|
|
18964
|
-
this.renderOnboardingTabs();
|
|
20063
|
+
await this.renderOnboardingTabs();
|
|
18965
20064
|
this.loadOnboardingExtensions();
|
|
18966
20065
|
});
|
|
18967
20066
|
(_y = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-internalcontrols')) === null || _y === void 0 ? void 0 : _y.addEventListener('click', async () => {
|
|
18968
20067
|
this.myOnboardingTab = this.TAB_INTERNALCONTROLS;
|
|
18969
|
-
this.renderOnboardingTabs();
|
|
20068
|
+
await this.renderOnboardingTabs();
|
|
18970
20069
|
this.loadOnboardingInternalControls();
|
|
18971
20070
|
});
|
|
18972
20071
|
(_z = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-reportedlocations')) === null || _z === void 0 ? void 0 : _z.addEventListener('click', async () => {
|
|
18973
20072
|
this.myOnboardingTab = this.TAB_REPORTEDLOCATIONS;
|
|
18974
|
-
this.renderOnboardingTabs();
|
|
20073
|
+
await this.renderOnboardingTabs();
|
|
18975
20074
|
this.loadOnboardingReportedLocations();
|
|
18976
20075
|
});
|
|
18977
20076
|
(_0 = this._SfOnboardingTabContainer.querySelector('#onboarding-tab-signoff')) === null || _0 === void 0 ? void 0 : _0.addEventListener('click', async () => {
|
|
@@ -22344,65 +23443,65 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22344
23443
|
users: transformedUsers
|
|
22345
23444
|
};
|
|
22346
23445
|
};
|
|
22347
|
-
this.uploadTriggersMapping = async (data) => {
|
|
22348
|
-
await this.uploadOnboardingMapping(data, 'triggers');
|
|
23446
|
+
this.uploadTriggersMapping = async (data, statuteids) => {
|
|
23447
|
+
await this.uploadOnboardingMapping(data, 'triggers', statuteids);
|
|
22349
23448
|
};
|
|
22350
|
-
this.uploadInternalControlsMapping = async (data) => {
|
|
22351
|
-
await this.uploadOnboardingMapping(data, 'internalcontrols');
|
|
23449
|
+
this.uploadInternalControlsMapping = async (data, statuteids) => {
|
|
23450
|
+
await this.uploadOnboardingMapping(data, 'internalcontrols', statuteids);
|
|
22352
23451
|
};
|
|
22353
|
-
this.uploadReportedLocationsMapping = async (data) => {
|
|
22354
|
-
await this.uploadOnboardingMapping(data, 'reportedlocations');
|
|
23452
|
+
this.uploadReportedLocationsMapping = async (data, statuteids) => {
|
|
23453
|
+
await this.uploadOnboardingMapping(data, 'reportedlocations', statuteids);
|
|
22355
23454
|
};
|
|
22356
|
-
this.uploadAlertSchedulesMapping = async (data) => {
|
|
22357
|
-
await this.uploadOnboardingMapping(data, 'alertschedules');
|
|
23455
|
+
this.uploadAlertSchedulesMapping = async (data, statuteids) => {
|
|
23456
|
+
await this.uploadOnboardingMapping(data, 'alertschedules', statuteids);
|
|
22358
23457
|
};
|
|
22359
|
-
this.uploadActivationsMapping = async (data) => {
|
|
22360
|
-
await this.uploadOnboardingMapping(data, 'activations');
|
|
23458
|
+
this.uploadActivationsMapping = async (data, statuteids) => {
|
|
23459
|
+
await this.uploadOnboardingMapping(data, 'activations', statuteids);
|
|
22361
23460
|
};
|
|
22362
|
-
this.uploadInvalidationsMapping = async (data) => {
|
|
22363
|
-
await this.uploadOnboardingMapping(data, 'invalidations');
|
|
23461
|
+
this.uploadInvalidationsMapping = async (data, statuteids) => {
|
|
23462
|
+
await this.uploadOnboardingMapping(data, 'invalidations', statuteids);
|
|
22364
23463
|
};
|
|
22365
|
-
this.uploadDuedatesMapping = async (data) => {
|
|
22366
|
-
await this.uploadOnboardingMapping(data, 'duedates');
|
|
23464
|
+
this.uploadDuedatesMapping = async (data, statuteids) => {
|
|
23465
|
+
await this.uploadOnboardingMapping(data, 'duedates', statuteids);
|
|
22367
23466
|
};
|
|
22368
|
-
this.uploadExtensionsMapping = async (data) => {
|
|
22369
|
-
await this.uploadOnboardingMapping(data, 'extensions');
|
|
23467
|
+
this.uploadExtensionsMapping = async (data, statuteids) => {
|
|
23468
|
+
await this.uploadOnboardingMapping(data, 'extensions', statuteids);
|
|
22370
23469
|
};
|
|
22371
|
-
this.uploadApproversMapping = async (data) => {
|
|
22372
|
-
await this.uploadOnboardingMapping(data, 'approvers');
|
|
23470
|
+
this.uploadApproversMapping = async (data, statuteids) => {
|
|
23471
|
+
await this.uploadOnboardingMapping(data, 'approvers', statuteids);
|
|
22373
23472
|
};
|
|
22374
|
-
this.uploadFunctionHeadsMapping = async (data) => {
|
|
22375
|
-
await this.uploadOnboardingMapping(data, 'functionheads');
|
|
23473
|
+
this.uploadFunctionHeadsMapping = async (data, statuteids) => {
|
|
23474
|
+
await this.uploadOnboardingMapping(data, 'functionheads', statuteids);
|
|
22376
23475
|
};
|
|
22377
|
-
this.uploadMakerCheckersMapping = async (data) => {
|
|
22378
|
-
await this.uploadOnboardingMapping(data, 'makercheckers');
|
|
23476
|
+
this.uploadMakerCheckersMapping = async (data, statuteids) => {
|
|
23477
|
+
await this.uploadOnboardingMapping(data, 'makercheckers', statuteids);
|
|
22379
23478
|
};
|
|
22380
|
-
this.uploadDocsMapping = async (data) => {
|
|
22381
|
-
await this.uploadOnboardingMapping(data, 'docs');
|
|
23479
|
+
this.uploadDocsMapping = async (data, statuteids) => {
|
|
23480
|
+
await this.uploadOnboardingMapping(data, 'docs', statuteids);
|
|
22382
23481
|
};
|
|
22383
|
-
this.uploadAuditorsMapping = async (data) => {
|
|
22384
|
-
await this.uploadOnboardingMapping(data, 'auditors');
|
|
23482
|
+
this.uploadAuditorsMapping = async (data, statuteids) => {
|
|
23483
|
+
await this.uploadOnboardingMapping(data, 'auditors', statuteids);
|
|
22385
23484
|
};
|
|
22386
|
-
this.uploadViewersMapping = async (data) => {
|
|
22387
|
-
await this.uploadOnboardingMapping(data, 'viewers');
|
|
23485
|
+
this.uploadViewersMapping = async (data, statuteids) => {
|
|
23486
|
+
await this.uploadOnboardingMapping(data, 'viewers', statuteids);
|
|
22388
23487
|
};
|
|
22389
|
-
this.uploadReportersMapping = async (data) => {
|
|
22390
|
-
await this.uploadOnboardingMapping(data, 'reporters');
|
|
23488
|
+
this.uploadReportersMapping = async (data, statuteids) => {
|
|
23489
|
+
await this.uploadOnboardingMapping(data, 'reporters', statuteids);
|
|
22391
23490
|
};
|
|
22392
|
-
this.uploadTagsMapping = async (data) => {
|
|
22393
|
-
await this.uploadOnboardingMapping(data, 'tags');
|
|
23491
|
+
this.uploadTagsMapping = async (data, statuteids) => {
|
|
23492
|
+
await this.uploadOnboardingMapping(data, 'tags', statuteids);
|
|
22394
23493
|
};
|
|
22395
|
-
this.uploadFunctionsMapping = async (data) => {
|
|
22396
|
-
await this.uploadOnboardingMapping(data, 'functions');
|
|
23494
|
+
this.uploadFunctionsMapping = async (data, statuteids) => {
|
|
23495
|
+
await this.uploadOnboardingMapping(data, 'functions', statuteids);
|
|
22397
23496
|
};
|
|
22398
|
-
this.uploadLocationsMapping = async (data) => {
|
|
22399
|
-
await this.uploadOnboardingMapping(data, 'locations');
|
|
23497
|
+
this.uploadLocationsMapping = async (data, statuteids) => {
|
|
23498
|
+
await this.uploadOnboardingMapping(data, 'locations', statuteids);
|
|
22400
23499
|
};
|
|
22401
|
-
this.uploadEntitiesMapping = async (data) => {
|
|
22402
|
-
await this.uploadOnboardingMapping(data, 'entities');
|
|
23500
|
+
this.uploadEntitiesMapping = async (data, statuteids) => {
|
|
23501
|
+
await this.uploadOnboardingMapping(data, 'entities', statuteids);
|
|
22403
23502
|
};
|
|
22404
|
-
this.uploadCountriesMapping = async (data) => {
|
|
22405
|
-
await this.uploadOnboardingMapping(data, 'countries');
|
|
23503
|
+
this.uploadCountriesMapping = async (data, statuteids) => {
|
|
23504
|
+
await this.uploadOnboardingMapping(data, 'countries', statuteids);
|
|
22406
23505
|
};
|
|
22407
23506
|
this.uploadMappedSuspense = async (data, year) => {
|
|
22408
23507
|
//console.log('uploading..', data);
|
|
@@ -22432,9 +23531,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22432
23531
|
}, 2000);
|
|
22433
23532
|
}
|
|
22434
23533
|
};
|
|
22435
|
-
this.uploadOnboardingMapping = async (data, onboardingstep) => {
|
|
23534
|
+
this.uploadOnboardingMapping = async (data, onboardingstep, statuteids) => {
|
|
22436
23535
|
//console.log('uploading..', data);
|
|
22437
|
-
let url = "https://" + this.apiId + "/
|
|
23536
|
+
let url = "https://" + this.apiId + "/updatemappedonboarding1";
|
|
22438
23537
|
// const body = {
|
|
22439
23538
|
// "projectid": this.projectId,
|
|
22440
23539
|
// "data": JSON.stringify(data),
|
|
@@ -22443,7 +23542,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22443
23542
|
let body = {
|
|
22444
23543
|
"projectid": this.projectId,
|
|
22445
23544
|
"presigned": true,
|
|
22446
|
-
"onboardingstep": onboardingstep
|
|
23545
|
+
"onboardingstep": onboardingstep,
|
|
23546
|
+
"statuteids": statuteids
|
|
22447
23547
|
};
|
|
22448
23548
|
let authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22449
23549
|
let xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
@@ -22455,7 +23555,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22455
23555
|
body = {
|
|
22456
23556
|
"projectid": this.projectId,
|
|
22457
23557
|
"key": jsonRespose.key,
|
|
22458
|
-
"onboardingstep": onboardingstep
|
|
23558
|
+
"onboardingstep": onboardingstep,
|
|
23559
|
+
"statuteids": statuteids
|
|
22459
23560
|
};
|
|
22460
23561
|
authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22461
23562
|
xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
@@ -22479,9 +23580,13 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22479
23580
|
if (xhr.status == 200) {
|
|
22480
23581
|
}
|
|
22481
23582
|
};
|
|
22482
|
-
this.uploadCompliancesMapping = async (data) => {
|
|
22483
|
-
|
|
22484
|
-
let url = "https://" + this.apiId + "/
|
|
23583
|
+
this.uploadCompliancesMapping = async (data, mappedstatutes) => {
|
|
23584
|
+
console.log('uploading..', data, mappedstatutes);
|
|
23585
|
+
let url = "https://" + this.apiId + "/updatemappedcompliances1";
|
|
23586
|
+
let statuteids = [];
|
|
23587
|
+
for (let statuteObj of mappedstatutes) {
|
|
23588
|
+
statuteids.push(statuteObj.id);
|
|
23589
|
+
}
|
|
22485
23590
|
let body = {
|
|
22486
23591
|
"projectid": this.projectId,
|
|
22487
23592
|
"presigned": true,
|
|
@@ -22495,6 +23600,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22495
23600
|
await this.uploadToPresignedUrl(data, jsonRespose.signedUrl);
|
|
22496
23601
|
body = {
|
|
22497
23602
|
"projectid": this.projectId,
|
|
23603
|
+
"statuteids": statuteids,
|
|
22498
23604
|
"key": jsonRespose.key
|
|
22499
23605
|
};
|
|
22500
23606
|
authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
@@ -22514,22 +23620,30 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22514
23620
|
}
|
|
22515
23621
|
};
|
|
22516
23622
|
this.uploadStatutesMapping = async (data) => {
|
|
22517
|
-
//console.log('uploading..', data);
|
|
22518
|
-
let url = "https://" + this.apiId + "/
|
|
22519
|
-
var searchstring = '';
|
|
22520
|
-
for (var i = 0; i < data.mappings.length; i++) {
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
//
|
|
23623
|
+
// console.log('uploading..', data);
|
|
23624
|
+
let url = "https://" + this.apiId + "/updatemappedstatutes1";
|
|
23625
|
+
// var searchstring = '';
|
|
23626
|
+
// for (var i = 0; i < data.mappings.length; i++) {
|
|
23627
|
+
// // const dataItem = JSON.parse(data.mappings[i].data);
|
|
23628
|
+
// const dataId = data.mappings[i].id;
|
|
23629
|
+
// // console.log(dataItem[3])
|
|
23630
|
+
// if (data.mappings[i].selected == true) {
|
|
23631
|
+
// searchstring += dataId;
|
|
23632
|
+
// // if (i < (data.mappings.length - 1)) {
|
|
23633
|
+
// searchstring += '|';
|
|
23634
|
+
// // }
|
|
23635
|
+
// }
|
|
23636
|
+
// }
|
|
23637
|
+
// if(searchstring.length > 0){
|
|
23638
|
+
// searchstring = searchstring.slice(0, -1);
|
|
23639
|
+
// }
|
|
23640
|
+
// const bodyUpload = {
|
|
22529
23641
|
// "projectid": this.projectId,
|
|
22530
|
-
// "data": JSON.stringify(data),
|
|
23642
|
+
// // "data": JSON.stringify(data),
|
|
22531
23643
|
// "compliancessearchstring": searchstring
|
|
22532
23644
|
// }
|
|
23645
|
+
// console.log("upload body", bodyUpload)
|
|
23646
|
+
// return;
|
|
22533
23647
|
let body = {
|
|
22534
23648
|
"projectid": this.projectId,
|
|
22535
23649
|
"presigned": true,
|
|
@@ -22543,7 +23657,6 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22543
23657
|
body = {
|
|
22544
23658
|
"projectid": this.projectId,
|
|
22545
23659
|
"key": jsonRespose.key,
|
|
22546
|
-
"compliancessearchstring": searchstring
|
|
22547
23660
|
};
|
|
22548
23661
|
authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22549
23662
|
xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
@@ -23590,10 +24703,10 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23590
24703
|
this.setError(jsonRespose.error);
|
|
23591
24704
|
}
|
|
23592
24705
|
};
|
|
23593
|
-
this.fetchMappedCompliances = async () => {
|
|
23594
|
-
let url = "https://" + this.apiId + "/
|
|
24706
|
+
this.fetchMappedCompliances = async (statuteids = []) => {
|
|
24707
|
+
let url = "https://" + this.apiId + "/getmappedcompliances1";
|
|
23595
24708
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23596
|
-
const xhr = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization));
|
|
24709
|
+
const xhr = (await this.prepareXhr({ "projectid": this.projectId, "statuteids": statuteids }, url, this._SfLoader, authorization));
|
|
23597
24710
|
this._SfLoader.innerHTML = '';
|
|
23598
24711
|
if (xhr.status == 200) {
|
|
23599
24712
|
var jsRespose = JSON.parse(xhr.responseText);
|
|
@@ -23708,7 +24821,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23708
24821
|
}
|
|
23709
24822
|
};
|
|
23710
24823
|
this.fetchSerializedMapping = async (onboardingstep) => {
|
|
23711
|
-
const url = "https://" + this.apiId + "/
|
|
24824
|
+
const url = "https://" + this.apiId + "/getmappedserializedonboarding1";
|
|
23712
24825
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23713
24826
|
const xhr = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization));
|
|
23714
24827
|
this._SfLoader.innerHTML = '';
|
|
@@ -23787,70 +24900,71 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23787
24900
|
// return (await this.fetchSerializedPartByPart("https://"+this.apiId+"/getmappedserializedcountries"));
|
|
23788
24901
|
return (await this.fetchSerializedMapping("countries"));
|
|
23789
24902
|
};
|
|
23790
|
-
this.fetchMappedTriggers = async () => {
|
|
23791
|
-
return (await this.fetchMappedOnboarding('triggers'));
|
|
24903
|
+
this.fetchMappedTriggers = async (statuteids = []) => {
|
|
24904
|
+
return (await this.fetchMappedOnboarding('triggers', statuteids));
|
|
23792
24905
|
};
|
|
23793
|
-
this.fetchMappedInternalControls = async () => {
|
|
23794
|
-
return (await this.fetchMappedOnboarding('internalcontrols'));
|
|
24906
|
+
this.fetchMappedInternalControls = async (statuteids = []) => {
|
|
24907
|
+
return (await this.fetchMappedOnboarding('internalcontrols', statuteids));
|
|
23795
24908
|
};
|
|
23796
|
-
this.fetchMappedReportedLocations = async () => {
|
|
23797
|
-
return (await this.fetchMappedOnboarding('reportedlocations'));
|
|
24909
|
+
this.fetchMappedReportedLocations = async (statuteids = []) => {
|
|
24910
|
+
return (await this.fetchMappedOnboarding('reportedlocations', statuteids));
|
|
23798
24911
|
};
|
|
23799
|
-
this.fetchMappedAlertSchedules = async () => {
|
|
23800
|
-
return (await this.fetchMappedOnboarding('alertschedules'));
|
|
24912
|
+
this.fetchMappedAlertSchedules = async (statuteids = []) => {
|
|
24913
|
+
return (await this.fetchMappedOnboarding('alertschedules', statuteids));
|
|
23801
24914
|
};
|
|
23802
|
-
this.fetchMappedActivations = async () => {
|
|
23803
|
-
return (await this.fetchMappedOnboarding('activations'));
|
|
24915
|
+
this.fetchMappedActivations = async (statuteids = []) => {
|
|
24916
|
+
return (await this.fetchMappedOnboarding('activations', statuteids));
|
|
23804
24917
|
};
|
|
23805
|
-
this.fetchMappedInvalidations = async () => {
|
|
23806
|
-
return (await this.fetchMappedOnboarding('invalidations'));
|
|
24918
|
+
this.fetchMappedInvalidations = async (statuteids = []) => {
|
|
24919
|
+
return (await this.fetchMappedOnboarding('invalidations', statuteids));
|
|
23807
24920
|
};
|
|
23808
|
-
this.fetchMappedExtensions = async () => {
|
|
23809
|
-
return (await this.fetchMappedOnboarding('extensions'));
|
|
24921
|
+
this.fetchMappedExtensions = async (statuteids = []) => {
|
|
24922
|
+
return (await this.fetchMappedOnboarding('extensions', statuteids));
|
|
23810
24923
|
};
|
|
23811
|
-
this.fetchMappedDuedates = async () => {
|
|
23812
|
-
return (await this.fetchMappedOnboarding('duedates'));
|
|
24924
|
+
this.fetchMappedDuedates = async (statuteids = []) => {
|
|
24925
|
+
return (await this.fetchMappedOnboarding('duedates', statuteids));
|
|
23813
24926
|
};
|
|
23814
|
-
this.fetchMappedReporters = async () => {
|
|
23815
|
-
return (await this.fetchMappedOnboarding('reporters'));
|
|
24927
|
+
this.fetchMappedReporters = async (statuteids = []) => {
|
|
24928
|
+
return (await this.fetchMappedOnboarding('reporters', statuteids));
|
|
23816
24929
|
};
|
|
23817
|
-
this.fetchMappedApprovers = async () => {
|
|
23818
|
-
return (await this.fetchMappedOnboarding('approvers'));
|
|
24930
|
+
this.fetchMappedApprovers = async (statuteids = []) => {
|
|
24931
|
+
return (await this.fetchMappedOnboarding('approvers', statuteids));
|
|
23819
24932
|
};
|
|
23820
|
-
this.fetchMappedFunctionHeads = async () => {
|
|
23821
|
-
return (await this.fetchMappedOnboarding('functionheads'));
|
|
24933
|
+
this.fetchMappedFunctionHeads = async (statuteids = []) => {
|
|
24934
|
+
return (await this.fetchMappedOnboarding('functionheads', statuteids));
|
|
23822
24935
|
};
|
|
23823
|
-
this.fetchMappedMakerCheckers = async () => {
|
|
23824
|
-
return (await this.fetchMappedOnboarding('makercheckers'));
|
|
24936
|
+
this.fetchMappedMakerCheckers = async (statuteids = []) => {
|
|
24937
|
+
return (await this.fetchMappedOnboarding('makercheckers', statuteids));
|
|
23825
24938
|
};
|
|
23826
|
-
this.fetchMappedDocs = async () => {
|
|
23827
|
-
return (await this.fetchMappedOnboarding('docs'));
|
|
24939
|
+
this.fetchMappedDocs = async (statuteids = []) => {
|
|
24940
|
+
return (await this.fetchMappedOnboarding('docs', statuteids));
|
|
23828
24941
|
};
|
|
23829
|
-
this.fetchMappedAuditors = async () => {
|
|
23830
|
-
return (await this.fetchMappedOnboarding('auditors'));
|
|
24942
|
+
this.fetchMappedAuditors = async (statuteids = []) => {
|
|
24943
|
+
return (await this.fetchMappedOnboarding('auditors', statuteids));
|
|
23831
24944
|
};
|
|
23832
|
-
this.fetchMappedViewers = async () => {
|
|
23833
|
-
return (await this.fetchMappedOnboarding('viewers'));
|
|
24945
|
+
this.fetchMappedViewers = async (statuteids = []) => {
|
|
24946
|
+
return (await this.fetchMappedOnboarding('viewers', statuteids));
|
|
23834
24947
|
};
|
|
23835
|
-
this.fetchMappedTags = async () => {
|
|
23836
|
-
return (await this.fetchMappedOnboarding('tags'));
|
|
24948
|
+
this.fetchMappedTags = async (statuteids = []) => {
|
|
24949
|
+
return (await this.fetchMappedOnboarding('tags', statuteids));
|
|
23837
24950
|
};
|
|
23838
|
-
this.fetchMappedLocations = async () => {
|
|
23839
|
-
return (await this.fetchMappedOnboarding('locations'));
|
|
24951
|
+
this.fetchMappedLocations = async (statuteids = []) => {
|
|
24952
|
+
return (await this.fetchMappedOnboarding('locations', statuteids));
|
|
23840
24953
|
};
|
|
23841
|
-
this.fetchMappedFunctions = async () => {
|
|
23842
|
-
return (await this.fetchMappedOnboarding('functions'));
|
|
24954
|
+
this.fetchMappedFunctions = async (statuteids = []) => {
|
|
24955
|
+
return (await this.fetchMappedOnboarding('functions', statuteids));
|
|
23843
24956
|
};
|
|
23844
|
-
this.fetchMappedEntities = async () => {
|
|
23845
|
-
return (await this.fetchMappedOnboarding('entities'));
|
|
24957
|
+
this.fetchMappedEntities = async (statuteids = []) => {
|
|
24958
|
+
return (await this.fetchMappedOnboarding('entities', statuteids));
|
|
23846
24959
|
};
|
|
23847
|
-
this.fetchMappedCountries = async () => {
|
|
23848
|
-
return (await this.fetchMappedOnboarding('countries'));
|
|
24960
|
+
this.fetchMappedCountries = async (statuteids = []) => {
|
|
24961
|
+
return (await this.fetchMappedOnboarding('countries', statuteids));
|
|
23849
24962
|
};
|
|
23850
|
-
this.fetchMappedOnboarding = async (onboardingstep) => {
|
|
23851
|
-
|
|
24963
|
+
this.fetchMappedOnboarding = async (onboardingstep, statuteids) => {
|
|
24964
|
+
var _a;
|
|
24965
|
+
const url = "https://" + this.apiId + "/getmappedonboarding1";
|
|
23852
24966
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23853
|
-
const xhr = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep }, url, this._SfLoader, authorization));
|
|
24967
|
+
const xhr = (await this.prepareXhr({ "projectid": this.projectId, "onboardingstep": onboardingstep, "statuteids": statuteids }, url, this._SfLoader, authorization));
|
|
23854
24968
|
this._SfLoader.innerHTML = '';
|
|
23855
24969
|
if (xhr.status == 200) {
|
|
23856
24970
|
var jsRespose = JSON.parse(xhr.responseText);
|
|
@@ -23858,7 +24972,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23858
24972
|
resultPresigned = {};
|
|
23859
24973
|
resultPresigned.data = {};
|
|
23860
24974
|
let tempObj = await this.fetchPresignedUrl(jsRespose.signedUrlGet);
|
|
23861
|
-
|
|
24975
|
+
let tempArr = [];
|
|
24976
|
+
for (let statuteid of statuteids) {
|
|
24977
|
+
for (let foundObjId of Object.keys((_a = tempObj[statuteid]) !== null && _a !== void 0 ? _a : [])) {
|
|
24978
|
+
let tempPushObj = tempObj[statuteid][foundObjId];
|
|
24979
|
+
tempPushObj.id = foundObjId.split(';')[foundObjId.split(';').length - 1];
|
|
24980
|
+
tempPushObj.statuteid = statuteid;
|
|
24981
|
+
tempArr.push(tempPushObj);
|
|
24982
|
+
}
|
|
24983
|
+
}
|
|
24984
|
+
// resultPresigned.data.mappings = (tempObj.mappings != null) ? tempObj : { mappings: [] };
|
|
24985
|
+
resultPresigned.data.mappings = tempArr;
|
|
23862
24986
|
console.log('resultPresigned onboarding1', tempObj);
|
|
23863
24987
|
console.log('resultPresigned onboarding', resultPresigned);
|
|
23864
24988
|
// await this.fetchPresignedUrlDelete(jsRespose.signedUrlDelete)
|
|
@@ -23893,7 +25017,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23893
25017
|
}
|
|
23894
25018
|
};
|
|
23895
25019
|
this.fetchMappedStatutes = async () => {
|
|
23896
|
-
let url = "https://" + this.apiId + "/
|
|
25020
|
+
let url = "https://" + this.apiId + "/getmappedstatutes1";
|
|
23897
25021
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23898
25022
|
const xhr = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization));
|
|
23899
25023
|
this._SfLoader.innerHTML = '';
|
|
@@ -23911,6 +25035,25 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
23911
25035
|
this.setError(jsonRespose.error);
|
|
23912
25036
|
}
|
|
23913
25037
|
};
|
|
25038
|
+
this.fetchMappedStatutesList = async () => {
|
|
25039
|
+
let url = "https://" + this.apiId + "/getmappedstatuteslist";
|
|
25040
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
25041
|
+
const xhr = (await this.prepareXhr({ "projectid": this.projectId }, url, this._SfLoader, authorization));
|
|
25042
|
+
this._SfLoader.innerHTML = '';
|
|
25043
|
+
if (xhr.status == 200) {
|
|
25044
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
25045
|
+
//console.log(jsonRespose);
|
|
25046
|
+
return jsonRespose.data;
|
|
25047
|
+
}
|
|
25048
|
+
else {
|
|
25049
|
+
if (xhr.status == 401) {
|
|
25050
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
25051
|
+
this.dispatchEvent(changeEvent);
|
|
25052
|
+
}
|
|
25053
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
25054
|
+
this.setError(jsonRespose.error);
|
|
25055
|
+
}
|
|
25056
|
+
};
|
|
23914
25057
|
this.fetchCreateRcmJob = async (complianceid, data, triggerDate, triggerMessage, projects) => {
|
|
23915
25058
|
data.trigger = {};
|
|
23916
25059
|
data.trigger.date = triggerDate;
|
|
@@ -28653,6 +29796,9 @@ __decorate([
|
|
|
28653
29796
|
__decorate([
|
|
28654
29797
|
query('#internalcontrols-container')
|
|
28655
29798
|
], SfIEvents.prototype, "_SfOnboardingInternalControlsContainer", void 0);
|
|
29799
|
+
__decorate([
|
|
29800
|
+
query('#reportedlocations-list-container')
|
|
29801
|
+
], SfIEvents.prototype, "_SfOnboardingReportedLocationsListContainer", void 0);
|
|
28656
29802
|
__decorate([
|
|
28657
29803
|
query('#reportedlocations-container')
|
|
28658
29804
|
], SfIEvents.prototype, "_SfOnboardingReportedLocationsContainer", void 0);
|