sf-i-events 1.0.978 → 1.0.979
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/index.html +7 -7
- package/package.json +1 -1
- package/sf-i-events.js +46 -76
- package/src/sf-i-events.ts +45 -87
package/dev/index.html
CHANGED
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
import { SfNewFeature } from 'https://esm.run/sf-new-feature@1.0.2/sf-new-feature.js';
|
|
35
35
|
import { SfChecklist } from 'https://esm.run/sf-checklist@1.0.24/dist/sf-checklist.js';
|
|
36
36
|
// import { SfChecklist } from '../../sf-checklist/dist/sf-checklist.js';
|
|
37
|
-
|
|
38
|
-
import { SfMultiselectSearch } from '../../sf-multiselect-search/dist/sf-multiselect-search.js';
|
|
37
|
+
import { SfMultiselectSearch } from 'https://esm.run/sf-multiselect-search@1.0.5/dist/sf-multiselect-search.js';
|
|
38
|
+
// import { SfMultiselectSearch } from '../../sf-multiselect-search/dist/sf-multiselect-search.js';
|
|
39
39
|
|
|
40
40
|
// import {LitElement, html, css} from 'https://unpkg.com/lit-element@3.3.3/lit-element.js?module';
|
|
41
41
|
// import {SfNav} from 'https://unpkg.com/sf-nav@1.0.73/sf-nav.js?module';
|
|
@@ -988,13 +988,13 @@
|
|
|
988
988
|
apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
|
|
989
989
|
|
|
990
990
|
</sf-i-events> -->
|
|
991
|
-
<sf-i-events projectid="63d20443-b9cc-4a86-b39d-bf81c1c93ba5" projectname="PrecisionMed ABC" mode="onboarding"
|
|
991
|
+
<!-- <sf-i-events projectid="63d20443-b9cc-4a86-b39d-bf81c1c93ba5" projectname="PrecisionMed ABC" mode="onboarding"
|
|
992
992
|
locations="{}" contractstartdate="01/01/2024" apiid="api2.flagggrc.tech/event-api"
|
|
993
993
|
username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
994
994
|
apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging"
|
|
995
995
|
apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
|
|
996
996
|
|
|
997
|
-
</sf-i-events>
|
|
997
|
+
</sf-i-events> -->
|
|
998
998
|
<!-- <sf-i-events name="Calendar" apiid="api2.flagggrc.tech/event-api"
|
|
999
999
|
apiid2="3mefupehxkw4pwsq3oyk7lf2pq0pisdx.lambda-url.us-east-1.on.aws" mode="consumer"
|
|
1000
1000
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
@@ -1198,14 +1198,14 @@
|
|
|
1198
1198
|
</div>
|
|
1199
1199
|
|
|
1200
1200
|
</sf-i-events> -->
|
|
1201
|
-
|
|
1201
|
+
<sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding"
|
|
1202
1202
|
locations="{"India":{"Maharashtra":["Pune","Mumbai"],"Telangana":["Telangana"]},"Canada":{"CanadaSO":["CanadaLO"]},"Singapore":{"SingaporeSO":["Orchard","Raffles","Robinson","Tanjong","Tras"]},"United Kingdom":{"UnitedSO":["UnitedLO"]},"United States of America":{"AmericaSO":["AmericaLO"]}}"
|
|
1203
|
-
contractstartdate="1/4/2024" apiid="
|
|
1203
|
+
contractstartdate="1/4/2024" apiid="api2.flagggrc.tech/event-api" username="ninad.t@flagggrc.tech"
|
|
1204
1204
|
apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance"
|
|
1205
1205
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile"
|
|
1206
1206
|
disablesignoff="yes" disableclientresponse="yes">
|
|
1207
1207
|
|
|
1208
|
-
</sf-i-events>
|
|
1208
|
+
</sf-i-events>
|
|
1209
1209
|
<!-- <sf-i-events projectid="a81b6ae1-98de-4b72-8cf0-9aaee5b61891" projectname="Khaitan" mode="onboarding" locations="{}"
|
|
1210
1210
|
contractstartdate="01/01/2025" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech"
|
|
1211
1211
|
apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance"
|
package/package.json
CHANGED
package/sf-i-events.js
CHANGED
|
@@ -17219,40 +17219,6 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17219
17219
|
console.log('taggingarray', JSON.stringify(taggingArray));
|
|
17220
17220
|
console.log('selectedStatutes', selectedStatutes);
|
|
17221
17221
|
this.selectedCbs = [];
|
|
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
|
-
// }
|
|
17247
|
-
// }
|
|
17248
|
-
// } else {
|
|
17249
|
-
// console.log('taggingArray1', taggingArray.data.mappings, taggingArray.data.mappings.mappings)
|
|
17250
|
-
// }
|
|
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
17222
|
for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
17257
17223
|
if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] == null) {
|
|
17258
17224
|
taggingArray.data.mappings.mappings.splice(i, 1);
|
|
@@ -17278,18 +17244,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17278
17244
|
}
|
|
17279
17245
|
}
|
|
17280
17246
|
}
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
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
|
-
// }
|
|
17247
|
+
if (sourceMapping.data == null) {
|
|
17248
|
+
sourceMapping = { data: { mappings: Object.values(sourceArray.data.mappings.mappings) } };
|
|
17249
|
+
}
|
|
17293
17250
|
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
17251
|
let flagMatch = false;
|
|
17295
17252
|
if (sourceArray.data.mappings.mappings[sourceMapping.data.mappings[i].id] == null) {
|
|
@@ -17359,6 +17316,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17359
17316
|
}
|
|
17360
17317
|
tagged++;
|
|
17361
17318
|
}
|
|
17319
|
+
else {
|
|
17320
|
+
console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject);
|
|
17321
|
+
}
|
|
17362
17322
|
}
|
|
17363
17323
|
else {
|
|
17364
17324
|
let flagFound = false;
|
|
@@ -17410,7 +17370,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17410
17370
|
tagged++;
|
|
17411
17371
|
}
|
|
17412
17372
|
else {
|
|
17413
|
-
console.log('tagged not found', taggingArray.data.mappings.mappings[j]);
|
|
17373
|
+
console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject);
|
|
17414
17374
|
}
|
|
17415
17375
|
}
|
|
17416
17376
|
}
|
|
@@ -17697,7 +17657,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17697
17657
|
}
|
|
17698
17658
|
}
|
|
17699
17659
|
}
|
|
17700
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
17660
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17701
17661
|
}
|
|
17702
17662
|
// this.saveTagging(taggingArray.data.mappings, uploadFunction, refreshFunction, true);
|
|
17703
17663
|
});
|
|
@@ -17719,7 +17679,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17719
17679
|
}
|
|
17720
17680
|
}
|
|
17721
17681
|
}
|
|
17722
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
17682
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17723
17683
|
});
|
|
17724
17684
|
}
|
|
17725
17685
|
}
|
|
@@ -17900,9 +17860,11 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17900
17860
|
let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings));
|
|
17901
17861
|
for (let [i, obj] of csvArray.entries()) {
|
|
17902
17862
|
let tempCsvObj = obj;
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
|
|
17863
|
+
let tempId = obj.id;
|
|
17864
|
+
let tempCompliance = sourceArray.data.mappings.mappings[tempId];
|
|
17865
|
+
if (tempCompliance['cols'] != null && tempCompliance['data'] != null) {
|
|
17866
|
+
let dataArr = JSON.parse(tempCompliance['data']);
|
|
17867
|
+
let colsArr = JSON.parse(tempCompliance['cols']);
|
|
17906
17868
|
for (let [j, colKey] of colsArr.entries()) {
|
|
17907
17869
|
tempCsvObj['cols_' + colKey] = dataArr[j];
|
|
17908
17870
|
}
|
|
@@ -17931,7 +17893,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17931
17893
|
fileInputNew.addEventListener('change', (e) => {
|
|
17932
17894
|
var fr = new FileReader();
|
|
17933
17895
|
fr.onload = () => {
|
|
17934
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
17896
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17935
17897
|
};
|
|
17936
17898
|
var frCsv = new FileReader();
|
|
17937
17899
|
frCsv.onload = () => {
|
|
@@ -17942,18 +17904,26 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17942
17904
|
let changeCount = 0;
|
|
17943
17905
|
for (let [i, obj] of tempArr.entries()) {
|
|
17944
17906
|
let tempObj = taggingArray.data.mappings.mappings[i];
|
|
17907
|
+
for (let key of Object.keys(tempObj)) {
|
|
17908
|
+
if (key.indexOf('cols_') >= 0) {
|
|
17909
|
+
delete tempObj[key];
|
|
17910
|
+
}
|
|
17911
|
+
}
|
|
17945
17912
|
delete tempObj['delta'];
|
|
17946
17913
|
delete tempObj['lastupdated'];
|
|
17947
17914
|
let tempNewObj = obj;
|
|
17915
|
+
for (let key of Object.keys(tempNewObj)) {
|
|
17916
|
+
if (key.indexOf('cols_') >= 0) {
|
|
17917
|
+
delete tempNewObj[key];
|
|
17918
|
+
}
|
|
17919
|
+
}
|
|
17948
17920
|
delete tempNewObj['delta'];
|
|
17949
17921
|
delete tempNewObj['lastupdated'];
|
|
17950
17922
|
if (JSON.stringify(tempObj) !== JSON.stringify(tempNewObj)) {
|
|
17951
17923
|
// console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
|
|
17952
17924
|
let changedId = "";
|
|
17953
17925
|
for (let [k, col] of uniqCols.entries()) {
|
|
17954
|
-
if (col != "id") {
|
|
17955
|
-
continue;
|
|
17956
|
-
}
|
|
17926
|
+
// if (col != "id") { continue; }
|
|
17957
17927
|
changedId += tempObj[col];
|
|
17958
17928
|
if (k < (uniqCols.length - 1)) {
|
|
17959
17929
|
changedId += ";";
|
|
@@ -17976,8 +17946,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
17976
17946
|
tempObj["data"]["mappings"] = {};
|
|
17977
17947
|
tempObj["data"]["mappings"]["mappings"] = tempArr;
|
|
17978
17948
|
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,
|
|
17949
|
+
console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]), sourceMapping);
|
|
17950
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
17981
17951
|
}
|
|
17982
17952
|
]);
|
|
17983
17953
|
};
|
|
@@ -18089,7 +18059,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18089
18059
|
html += '</div>';
|
|
18090
18060
|
html += '</div>';
|
|
18091
18061
|
html += '<div class="d-flex align-center">';
|
|
18092
|
-
html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
18062
|
+
// html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
18093
18063
|
html += '<div class="mr-10">';
|
|
18094
18064
|
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
18065
|
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>';
|
|
@@ -18520,21 +18490,21 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18520
18490
|
// });
|
|
18521
18491
|
}
|
|
18522
18492
|
}
|
|
18523
|
-
// Filter field handlers
|
|
18524
|
-
const inputFilter = divElement.querySelector('.input-filter');
|
|
18525
|
-
inputFilter.addEventListener('keyup', (e) => {
|
|
18526
|
-
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
});
|
|
18493
|
+
// // Filter field handlers
|
|
18494
|
+
// const inputFilter = (divElement as HTMLDivElement).querySelector('.input-filter') as HTMLInputElement;
|
|
18495
|
+
// inputFilter.addEventListener('keyup', (e: any) => {
|
|
18496
|
+
// if (e.key == 'Enter') {
|
|
18497
|
+
// //console.log(inputFilter.value);
|
|
18498
|
+
// if (this._SfLoader != null) {
|
|
18499
|
+
// this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
|
|
18500
|
+
// this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
|
|
18501
|
+
// }
|
|
18502
|
+
// setTimeout(() => {
|
|
18503
|
+
// this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
|
|
18504
|
+
// this._SfLoader.innerHTML = '';
|
|
18505
|
+
// }, 1000);
|
|
18506
|
+
// }
|
|
18507
|
+
// });
|
|
18538
18508
|
// More button handlers
|
|
18539
18509
|
const buttonToggleMoreBack = divElement.querySelector('.button-toggle-more-back');
|
|
18540
18510
|
const buttonToggleMore = divElement.querySelector('.button-toggle-more');
|
|
@@ -19408,7 +19378,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
19408
19378
|
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
19409
19379
|
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
19410
19380
|
html += '<label part="input-label">Select Statute</label>';
|
|
19411
|
-
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
19381
|
+
html += '<sf-multiselect-search mode="edit" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
|
|
19412
19382
|
html += '</div>';
|
|
19413
19383
|
html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
19414
19384
|
html += '</div>';
|
|
@@ -19444,7 +19414,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
19444
19414
|
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
19445
19415
|
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
19446
19416
|
html += '<label part="input-label">Select Statute</label>';
|
|
19447
|
-
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
19417
|
+
html += '<sf-multiselect-search mode="edit" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
|
|
19448
19418
|
html += '</div>';
|
|
19449
19419
|
html += '<div id="' + listcontainerid + '" class="d-flex flex-col w-100 scroll-x">';
|
|
19450
19420
|
html += '</div>';
|
package/src/sf-i-events.ts
CHANGED
|
@@ -21745,51 +21745,6 @@ export class SfIEvents extends LitElement {
|
|
|
21745
21745
|
|
|
21746
21746
|
this.selectedCbs = [];
|
|
21747
21747
|
|
|
21748
|
-
// const foundArr = [];
|
|
21749
|
-
|
|
21750
|
-
// if (taggingArray.data.mappings != null && taggingArray.data.mappings.mappings.length > 0) {
|
|
21751
|
-
// console.log('scanning taggingarray', taggingArray.data.mappings.mappings.length + "");
|
|
21752
|
-
// for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
21753
|
-
|
|
21754
|
-
// var found = false;
|
|
21755
|
-
|
|
21756
|
-
// // console.log('source array search', sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id], taggingArray.data.mappings.mappings[i].id)
|
|
21757
|
-
// if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null) {
|
|
21758
|
-
|
|
21759
|
-
// var equal = true;
|
|
21760
|
-
|
|
21761
|
-
// for (var k = 0; k < uniqCols.length; k++) {
|
|
21762
|
-
// console.log('checking uniqCols', uniqCols[k]);
|
|
21763
|
-
// if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] != null && taggingArray.data.mappings.mappings[i] != null) {
|
|
21764
|
-
// if (sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
|
|
21765
|
-
// equal = false;
|
|
21766
|
-
// }
|
|
21767
|
-
// }
|
|
21768
|
-
|
|
21769
|
-
// }
|
|
21770
|
-
|
|
21771
|
-
// if (equal) {
|
|
21772
|
-
// found = true;
|
|
21773
|
-
// }
|
|
21774
|
-
// }
|
|
21775
|
-
|
|
21776
|
-
// if (found) {
|
|
21777
|
-
// foundArr.push(taggingArray.data.mappings.mappings[i]);
|
|
21778
|
-
// } else {
|
|
21779
|
-
// console.log('taggingarray not found', taggingArray.data.mappings.mappings[i], i)
|
|
21780
|
-
// }
|
|
21781
|
-
|
|
21782
|
-
// }
|
|
21783
|
-
// } else {
|
|
21784
|
-
// console.log('taggingArray1', taggingArray.data.mappings, taggingArray.data.mappings.mappings)
|
|
21785
|
-
// }
|
|
21786
|
-
// console.log('taggingarray2', taggingArray.data.mappings.mappings.length + "");
|
|
21787
|
-
// if (taggingArray.data.mappings == null) {
|
|
21788
|
-
// taggingArray.data.mappings = {};
|
|
21789
|
-
// }
|
|
21790
|
-
|
|
21791
|
-
// taggingArray.data.mappings.mappings = foundArr;
|
|
21792
|
-
|
|
21793
21748
|
for (var i = 0; i < taggingArray.data.mappings.mappings.length; i++) {
|
|
21794
21749
|
|
|
21795
21750
|
if (taggingArray.data.mappings.mappings[i].id != null && sourceArray.data.mappings.mappings[taggingArray.data.mappings.mappings[i].id] == null) {
|
|
@@ -21822,20 +21777,9 @@ export class SfIEvents extends LitElement {
|
|
|
21822
21777
|
}
|
|
21823
21778
|
}
|
|
21824
21779
|
}
|
|
21825
|
-
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
// if (taggedIds.indexOf(sourceid) >= 0) {
|
|
21829
|
-
// continue;
|
|
21830
|
-
// }
|
|
21831
|
-
// let objToPush: any = { id: sourceid }
|
|
21832
|
-
// for (i = 0; i < (mandatoryFields as Array<string>).length; i++) {
|
|
21833
|
-
// objToPush[mandatoryFields[i]] = ""
|
|
21834
|
-
// }
|
|
21835
|
-
// taggingArray.data.mappings.mappings.push(objToPush);
|
|
21836
|
-
// }
|
|
21837
|
-
// }
|
|
21838
|
-
|
|
21780
|
+
if(sourceMapping.data == null){
|
|
21781
|
+
sourceMapping = {data:{mappings:Object.values(sourceArray.data.mappings.mappings)}}
|
|
21782
|
+
}
|
|
21839
21783
|
for (var i = 0; i < (sourceMapping.data?.mappings ?? []).length; i++) {
|
|
21840
21784
|
let flagMatch = false;
|
|
21841
21785
|
if (sourceArray.data.mappings.mappings[sourceMapping.data.mappings[i].id] == null) {
|
|
@@ -21905,6 +21849,8 @@ export class SfIEvents extends LitElement {
|
|
|
21905
21849
|
}
|
|
21906
21850
|
}
|
|
21907
21851
|
tagged++;
|
|
21852
|
+
}else{
|
|
21853
|
+
console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject)
|
|
21908
21854
|
}
|
|
21909
21855
|
} else {
|
|
21910
21856
|
let flagFound = false;
|
|
@@ -21954,7 +21900,7 @@ export class SfIEvents extends LitElement {
|
|
|
21954
21900
|
}
|
|
21955
21901
|
tagged++;
|
|
21956
21902
|
} else {
|
|
21957
|
-
console.log('tagged not found', taggingArray.data.mappings.mappings[j])
|
|
21903
|
+
console.log('tagged not found', taggingArray.data.mappings.mappings[j], sourceObject)
|
|
21958
21904
|
}
|
|
21959
21905
|
}
|
|
21960
21906
|
}
|
|
@@ -22308,7 +22254,7 @@ export class SfIEvents extends LitElement {
|
|
|
22308
22254
|
|
|
22309
22255
|
}
|
|
22310
22256
|
|
|
22311
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
22257
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
|
|
22312
22258
|
|
|
22313
22259
|
}
|
|
22314
22260
|
|
|
@@ -22344,7 +22290,7 @@ export class SfIEvents extends LitElement {
|
|
|
22344
22290
|
|
|
22345
22291
|
}
|
|
22346
22292
|
|
|
22347
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
22293
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, taggingArray, sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter)
|
|
22348
22294
|
|
|
22349
22295
|
});
|
|
22350
22296
|
}
|
|
@@ -22581,9 +22527,11 @@ export class SfIEvents extends LitElement {
|
|
|
22581
22527
|
let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings))
|
|
22582
22528
|
for (let [i, obj] of csvArray.entries()) {
|
|
22583
22529
|
let tempCsvObj = obj
|
|
22584
|
-
|
|
22585
|
-
|
|
22586
|
-
|
|
22530
|
+
let tempId = obj.id;
|
|
22531
|
+
let tempCompliance = sourceArray.data.mappings.mappings[tempId]
|
|
22532
|
+
if (tempCompliance['cols'] != null && tempCompliance['data'] != null) {
|
|
22533
|
+
let dataArr = JSON.parse(tempCompliance['data'])
|
|
22534
|
+
let colsArr = JSON.parse(tempCompliance['cols'])
|
|
22587
22535
|
for (let [j, colKey] of colsArr.entries()) {
|
|
22588
22536
|
tempCsvObj['cols_' + colKey] = dataArr[j]
|
|
22589
22537
|
}
|
|
@@ -22614,7 +22562,7 @@ export class SfIEvents extends LitElement {
|
|
|
22614
22562
|
fileInputNew.addEventListener('change', (e: any) => {
|
|
22615
22563
|
var fr = new FileReader();
|
|
22616
22564
|
fr.onload = () => {
|
|
22617
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
22565
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
22618
22566
|
};
|
|
22619
22567
|
var frCsv = new FileReader();
|
|
22620
22568
|
frCsv.onload = () => {
|
|
@@ -22625,16 +22573,26 @@ export class SfIEvents extends LitElement {
|
|
|
22625
22573
|
let changeCount = 0;
|
|
22626
22574
|
for (let [i, obj] of tempArr.entries()) {
|
|
22627
22575
|
let tempObj = taggingArray.data.mappings.mappings[i]
|
|
22576
|
+
for(let key of Object.keys(tempObj)){
|
|
22577
|
+
if(key.indexOf('cols_') >= 0){
|
|
22578
|
+
delete tempObj[key]
|
|
22579
|
+
}
|
|
22580
|
+
}
|
|
22628
22581
|
delete tempObj['delta'];
|
|
22629
22582
|
delete tempObj['lastupdated'];
|
|
22630
22583
|
let tempNewObj = obj
|
|
22584
|
+
for(let key of Object.keys(tempNewObj)){
|
|
22585
|
+
if(key.indexOf('cols_') >= 0){
|
|
22586
|
+
delete tempNewObj[key]
|
|
22587
|
+
}
|
|
22588
|
+
}
|
|
22631
22589
|
delete tempNewObj['delta'];
|
|
22632
22590
|
delete tempNewObj['lastupdated'];
|
|
22633
22591
|
if (JSON.stringify(tempObj) !== JSON.stringify(tempNewObj)) {
|
|
22634
22592
|
// console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
|
|
22635
22593
|
let changedId = ""
|
|
22636
22594
|
for (let [k, col] of uniqCols.entries()) {
|
|
22637
|
-
if (col != "id") { continue; }
|
|
22595
|
+
// if (col != "id") { continue; }
|
|
22638
22596
|
changedId += tempObj[col];
|
|
22639
22597
|
if (k < (uniqCols.length - 1)) {
|
|
22640
22598
|
changedId += ";"
|
|
@@ -22659,9 +22617,9 @@ export class SfIEvents extends LitElement {
|
|
|
22659
22617
|
tempObj["data"]["mappings"]["mappings"] = tempArr
|
|
22660
22618
|
let tempObjStr = JSON.stringify(tempObj)
|
|
22661
22619
|
|
|
22662
|
-
console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]))
|
|
22620
|
+
console.log('csv taggingarray cols', uniqCols, JSON.parse(tempObjStr)["data"]["mappings"]["mappings"].length, Object.keys(tempObj.data.mappings.mappings[0]), sourceMapping)
|
|
22663
22621
|
|
|
22664
|
-
this.renderTaggingTableNew(divElement, selectedStatutes,
|
|
22622
|
+
this.renderTaggingTableNew(divElement, selectedStatutes, sourceObject, sourceMapping, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, compareFields, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
|
|
22665
22623
|
}
|
|
22666
22624
|
])
|
|
22667
22625
|
}
|
|
@@ -22792,7 +22750,7 @@ export class SfIEvents extends LitElement {
|
|
|
22792
22750
|
html += '</div>';
|
|
22793
22751
|
|
|
22794
22752
|
html += '<div class="d-flex align-center">';
|
|
22795
|
-
html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
22753
|
+
// html += '<input part="input" type="text" placeholder="Filter" class="input-filter mr-10" value="' + subfilter + '" />';
|
|
22796
22754
|
html += '<div class="mr-10">';
|
|
22797
22755
|
html += '<div class="d-flex justify-end"><button part="calendar-tab-icon-not-selected" class="material-icons button-toggle-more">expand_more</button><button part="calendar-tab-icon-selected" class="material-icons button-toggle-more-back hide">expand_less</button></div>'
|
|
22798
22756
|
html += '<div style="position: absolute; margin-top: 5px;"><button part="button" class="hide d-flex align-center button-download-backups" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">file_save</span><span>Download Backups</span></button><button part="button" class="mt-10 hide d-flex align-center button-export-mapping" style="margin-left: -80px"><span class="material-symbols-outlined mr-10">export_notes</span><span>Export Mapping</span></button></div>'
|
|
@@ -23339,25 +23297,25 @@ export class SfIEvents extends LitElement {
|
|
|
23339
23297
|
|
|
23340
23298
|
}
|
|
23341
23299
|
|
|
23342
|
-
// Filter field handlers
|
|
23300
|
+
// // Filter field handlers
|
|
23343
23301
|
|
|
23344
|
-
const inputFilter = (divElement as HTMLDivElement).querySelector('.input-filter') as HTMLInputElement;
|
|
23345
|
-
inputFilter.addEventListener('keyup', (e: any) => {
|
|
23302
|
+
// const inputFilter = (divElement as HTMLDivElement).querySelector('.input-filter') as HTMLInputElement;
|
|
23303
|
+
// inputFilter.addEventListener('keyup', (e: any) => {
|
|
23346
23304
|
|
|
23347
|
-
|
|
23348
|
-
|
|
23349
|
-
|
|
23350
|
-
|
|
23351
|
-
|
|
23352
|
-
|
|
23353
|
-
|
|
23354
|
-
|
|
23355
|
-
|
|
23356
|
-
|
|
23305
|
+
// if (e.key == 'Enter') {
|
|
23306
|
+
// //console.log(inputFilter.value);
|
|
23307
|
+
// if (this._SfLoader != null) {
|
|
23308
|
+
// this._SfLoader.innerHTML = '<div class="lds-dual-ring"></div>';
|
|
23309
|
+
// this._SfLoader.innerHTML += ('<div class="lds-text"><div class="lds-text-c"></div></div>');
|
|
23310
|
+
// }
|
|
23311
|
+
// setTimeout(() => {
|
|
23312
|
+
// this.renderMappingTable(divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, inputFilter.value, statuteColName, extraHintsArr)
|
|
23313
|
+
// this._SfLoader.innerHTML = '';
|
|
23314
|
+
// }, 1000);
|
|
23357
23315
|
|
|
23358
|
-
|
|
23316
|
+
// }
|
|
23359
23317
|
|
|
23360
|
-
});
|
|
23318
|
+
// });
|
|
23361
23319
|
|
|
23362
23320
|
// More button handlers
|
|
23363
23321
|
|
|
@@ -24476,7 +24434,7 @@ export class SfIEvents extends LitElement {
|
|
|
24476
24434
|
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
24477
24435
|
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
24478
24436
|
html += '<label part="input-label">Select Statute</label>';
|
|
24479
|
-
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
24437
|
+
html += '<sf-multiselect-search mode="edit" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
|
|
24480
24438
|
html += '</div>';
|
|
24481
24439
|
|
|
24482
24440
|
html += '<div id="compliances-list-container" class="d-flex flex-col w-100 scroll-x">';
|
|
@@ -24518,7 +24476,7 @@ export class SfIEvents extends LitElement {
|
|
|
24518
24476
|
html += '<div class="d-flex flex-col w-100" style="height: 75vh">';
|
|
24519
24477
|
html += '<div class="d-flex flex-col justify-center align-stretch w-100">';
|
|
24520
24478
|
html += '<label part="input-label">Select Statute</label>';
|
|
24521
|
-
html += '<sf-multiselect-search mode="edit" id="statute-select"></sf-multiselect-search>';
|
|
24479
|
+
html += '<sf-multiselect-search mode="edit" exportparts="input:multiselect-input, button-icon-multiselect-button-icon, multiselect-item:multiselect-item, multiselecct-checkbox:multiselect-checkbox, multiselecct-checkbox-label:multiselect-checkbox-label" id="statute-select"></sf-multiselect-search>';
|
|
24522
24480
|
html += '</div>';
|
|
24523
24481
|
|
|
24524
24482
|
html += '<div id="' + listcontainerid + '" class="d-flex flex-col w-100 scroll-x">';
|