sf-i-events 1.0.942 → 1.0.943
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/package.json +1 -1
- package/sf-i-events.js +6 -2
- package/src/sf-i-events.ts +6 -2
- package/src/util.ts +15 -9
- package/util.d.ts +2 -0
- package/util.js +7 -1
package/package.json
CHANGED
package/sf-i-events.js
CHANGED
|
@@ -2577,7 +2577,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2577
2577
|
// const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
|
|
2578
2578
|
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.concise != null && !isReportedLocation;
|
|
2579
2579
|
const showLocationRisk = event.concise != null;
|
|
2580
|
-
const
|
|
2580
|
+
const configHome = Util.getProjectConfigHome();
|
|
2581
|
+
const showReview = event.concise != null && configHome.features != null && configHome.features.indexOf("understood") >= 0;
|
|
2581
2582
|
const showLastUpdated = event.concise == null && lastUpdated.length > 0;
|
|
2582
2583
|
// console.log('showReportingButton', showReportingButton)
|
|
2583
2584
|
console.log('isReportedLocation', isReportedLocation, 'showCheckbox', showCheckbox, 'showReportingButton', showReportingButton, 'showLocationRisk', showLocationRisk, 'showLastUpdated', showLastUpdated);
|
|
@@ -2918,7 +2919,9 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2918
2919
|
let approverStr = event.concise == null ? this.getApproverStringFromEvent(event) : "";
|
|
2919
2920
|
let graphParam = this.getGraphParam(event);
|
|
2920
2921
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
2921
|
-
|
|
2922
|
+
const configHome = Util.getProjectConfigHome();
|
|
2923
|
+
const configFlag = configHome.features != null && configHome.features.indexOf("understood") >= 0;
|
|
2924
|
+
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span> Mark Understood</button>')) : '') + '</div>';
|
|
2922
2925
|
// }
|
|
2923
2926
|
return html;
|
|
2924
2927
|
};
|
|
@@ -13879,6 +13882,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13879
13882
|
var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
13880
13883
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
13881
13884
|
console.log('previousid', previousId, 'nextid', nextId);
|
|
13885
|
+
console.log('confighome', Util.getProjectConfigHome());
|
|
13882
13886
|
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers, docsOptional, documentType;
|
|
13883
13887
|
let entityId = "";
|
|
13884
13888
|
let locationId = "";
|
package/src/sf-i-events.ts
CHANGED
|
@@ -4808,7 +4808,8 @@ export class SfIEvents extends LitElement {
|
|
|
4808
4808
|
// const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
|
|
4809
4809
|
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.concise != null && !isReportedLocation;
|
|
4810
4810
|
const showLocationRisk = event.concise != null;
|
|
4811
|
-
const
|
|
4811
|
+
const configHome = Util.getProjectConfigHome();
|
|
4812
|
+
const showReview = event.concise != null && configHome.features != null && configHome.features.indexOf("understood") >= 0;
|
|
4812
4813
|
const showLastUpdated = event.concise == null && lastUpdated.length > 0;
|
|
4813
4814
|
// console.log('showReportingButton', showReportingButton)
|
|
4814
4815
|
console.log('isReportedLocation', isReportedLocation, 'showCheckbox', showCheckbox, 'showReportingButton', showReportingButton, 'showLocationRisk', showLocationRisk, 'showLastUpdated', showLastUpdated);
|
|
@@ -5191,7 +5192,9 @@ export class SfIEvents extends LitElement {
|
|
|
5191
5192
|
|
|
5192
5193
|
let graphParam = this.getGraphParam(event);
|
|
5193
5194
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
5194
|
-
|
|
5195
|
+
const configHome = Util.getProjectConfigHome();
|
|
5196
|
+
const configFlag = configHome.features != null && configHome.features.indexOf("understood") >= 0
|
|
5197
|
+
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null) && (event.reportedlocationsflag != true))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '-" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + (((event.module == "compliances" || event.module == null) && event.concise == null && configFlag) ? (event.review ? ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-reviewed" class="material-symbols-outlined d-flex align-center mb-20 ml-10 button-icon-review">flag_check</button>') : ('<button id="input-checkbox-review-' + mmdd.replace('/', '-') + '-' + j + '" part="button-icon-review" class="d-flex align-center mb-20 ml-10 button-icon-review"><span class="material-symbols-outlined" title="Mark as reviewed">flag</span> Mark Understood</button>')) : '') + '</div>';
|
|
5195
5198
|
// }
|
|
5196
5199
|
|
|
5197
5200
|
return html;
|
|
@@ -17810,6 +17813,7 @@ export class SfIEvents extends LitElement {
|
|
|
17810
17813
|
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string, nextId: string) => {
|
|
17811
17814
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
17812
17815
|
console.log('previousid', previousId, 'nextid', nextId);
|
|
17816
|
+
console.log('confighome', Util.getProjectConfigHome())
|
|
17813
17817
|
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional: boolean | any, documentType: string | any;
|
|
17814
17818
|
let entityId: string = "";
|
|
17815
17819
|
let locationId: string = "";
|
package/src/util.ts
CHANGED
|
@@ -506,6 +506,12 @@ function getUsermap() {
|
|
|
506
506
|
return userMapHome;
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
+
function getProjectConfigHome() {
|
|
510
|
+
let userinfo = JSON.parse(localStorage.getItem('userinfo') ?? "{}");
|
|
511
|
+
let projectConfigHome = JSON.parse(JSON.parse((userinfo.project.data.value.confighome)));
|
|
512
|
+
return projectConfigHome;
|
|
513
|
+
}
|
|
514
|
+
|
|
509
515
|
function getProjectUsermap() {
|
|
510
516
|
let projectUsermap = JSON.parse((localStorage.getItem('projectusermap') ?? "{}").replace(/_QUOTES_/g, "\\\""));
|
|
511
517
|
return projectUsermap;
|
|
@@ -581,15 +587,15 @@ function isVisible(el: HTMLElement): boolean {
|
|
|
581
587
|
|
|
582
588
|
return (
|
|
583
589
|
rect.height > 0 &&
|
|
584
|
-
rect.width >= 0
|
|
590
|
+
rect.width >= 0
|
|
585
591
|
) && (
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
592
|
+
style.display !== "none" &&
|
|
593
|
+
style.visibility !== "hidden" &&
|
|
594
|
+
style.opacity !== "0"
|
|
595
|
+
);
|
|
590
596
|
}
|
|
591
597
|
|
|
592
|
-
function compareObjects
|
|
598
|
+
function compareObjects(obj1: any, obj2: any): any {
|
|
593
599
|
if (obj1 === obj2) return {};
|
|
594
600
|
|
|
595
601
|
// If both are arrays
|
|
@@ -624,7 +630,7 @@ function compareObjects (obj1: any, obj2: any): any {
|
|
|
624
630
|
|
|
625
631
|
for (const key of keys) {
|
|
626
632
|
if (!(key in obj1)) {
|
|
627
|
-
diff[key] = [null,(obj2 as any)[key]];
|
|
633
|
+
diff[key] = [null, (obj2 as any)[key]];
|
|
628
634
|
} else if (!(key in obj2)) {
|
|
629
635
|
diff[key] = [(obj1 as any)[key], null];
|
|
630
636
|
} else {
|
|
@@ -646,10 +652,10 @@ function compareObjects (obj1: any, obj2: any): any {
|
|
|
646
652
|
}
|
|
647
653
|
|
|
648
654
|
// Primitive comparison
|
|
649
|
-
return obj1 !== obj2 ? [obj1,obj2] : [];
|
|
655
|
+
return obj1 !== obj2 ? [obj1, obj2] : [];
|
|
650
656
|
}
|
|
651
657
|
const exportFunctions = {
|
|
652
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
|
|
658
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, getProjectConfigHome, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
|
|
653
659
|
};
|
|
654
660
|
|
|
655
661
|
export default exportFunctions;
|
package/util.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare function percentageString(val: number, valTotal: number): string;
|
|
|
18
18
|
declare function getCurrentFiscal(): number;
|
|
19
19
|
declare function getDateTimeStrings(unixTimestamp: number): string;
|
|
20
20
|
declare function getUsermap(): any;
|
|
21
|
+
declare function getProjectConfigHome(): any;
|
|
21
22
|
declare function getProjectUsermap(): any;
|
|
22
23
|
declare function setFeatures(features: any): void;
|
|
23
24
|
declare function getFeatures(): any;
|
|
@@ -48,6 +49,7 @@ declare const exportFunctions: {
|
|
|
48
49
|
getCurrentFiscal: typeof getCurrentFiscal;
|
|
49
50
|
getDateTimeStrings: typeof getDateTimeStrings;
|
|
50
51
|
getUsermap: typeof getUsermap;
|
|
52
|
+
getProjectConfigHome: typeof getProjectConfigHome;
|
|
51
53
|
setFeatures: typeof setFeatures;
|
|
52
54
|
getFeatures: typeof getFeatures;
|
|
53
55
|
getProjectUsermap: typeof getProjectUsermap;
|
package/util.js
CHANGED
|
@@ -425,6 +425,12 @@ function getUsermap() {
|
|
|
425
425
|
let userMapHome = JSON.parse(JSON.parse((userinfo.user.usermap.S).replace(/_QUOTES_/g, "\\\"")));
|
|
426
426
|
return userMapHome;
|
|
427
427
|
}
|
|
428
|
+
function getProjectConfigHome() {
|
|
429
|
+
var _a;
|
|
430
|
+
let userinfo = JSON.parse((_a = localStorage.getItem('userinfo')) !== null && _a !== void 0 ? _a : "{}");
|
|
431
|
+
let projectConfigHome = JSON.parse(JSON.parse((userinfo.project.data.value.confighome)));
|
|
432
|
+
return projectConfigHome;
|
|
433
|
+
}
|
|
428
434
|
function getProjectUsermap() {
|
|
429
435
|
var _a;
|
|
430
436
|
let projectUsermap = JSON.parse(((_a = localStorage.getItem('projectusermap')) !== null && _a !== void 0 ? _a : "{}").replace(/_QUOTES_/g, "\\\""));
|
|
@@ -550,7 +556,7 @@ function compareObjects(obj1, obj2) {
|
|
|
550
556
|
return obj1 !== obj2 ? [obj1, obj2] : [];
|
|
551
557
|
}
|
|
552
558
|
const exportFunctions = {
|
|
553
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
|
|
559
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal, getDateTimeStrings, getUsermap, getProjectConfigHome, setFeatures, getFeatures, getProjectUsermap, downloadExcelFromCSV, isJSONParsable, isVisible, compareObjects
|
|
554
560
|
};
|
|
555
561
|
export default exportFunctions;
|
|
556
562
|
//# sourceMappingURL=util.js.map
|