sf-i-events 1.0.941 → 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/dev/index.html +4 -4
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -0
- package/sf-i-events.js +65 -12
- package/src/sf-i-events.ts +68 -12
- package/src/util.ts +15 -9
- package/util.d.ts +2 -0
- package/util.js +7 -1
package/dev/index.html
CHANGED
|
@@ -941,7 +941,7 @@
|
|
|
941
941
|
</div>
|
|
942
942
|
|
|
943
943
|
</sf-i-events> -->
|
|
944
|
-
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
944
|
+
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
945
945
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
946
946
|
apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
|
|
947
947
|
apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
970
970
|
</div>
|
|
971
971
|
|
|
972
|
-
</sf-i-events>
|
|
972
|
+
</sf-i-events> -->
|
|
973
973
|
<!-- <sf-i-events id="sf-i-events-next" name="Next Compliances" apiid="dwqyez2puoxmu.cloudfront.net/event"
|
|
974
974
|
apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance"
|
|
975
975
|
apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
disablesignoff="yes" disableclientresponse="yes">
|
|
1085
1085
|
|
|
1086
1086
|
</sf-i-events> -->
|
|
1087
|
-
|
|
1087
|
+
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
1088
1088
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
1089
1089
|
apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
|
|
1090
1090
|
apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
|
|
@@ -1112,7 +1112,7 @@
|
|
|
1112
1112
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
1113
1113
|
</div>
|
|
1114
1114
|
|
|
1115
|
-
</sf-i-events>
|
|
1115
|
+
</sf-i-events>
|
|
1116
1116
|
<script>
|
|
1117
1117
|
|
|
1118
1118
|
function setCookie(name, value, days) {
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -769,6 +769,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
769
769
|
uploadReviewsBulk: (bulkBody: any) => Promise<void>;
|
|
770
770
|
uploadReport: (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string | undefined, reportformatschema: string | undefined, module: string | undefined, percentage: string | undefined, makercheckers: any, reportedlocations?: string) => Promise<boolean>;
|
|
771
771
|
uploadReportsBulk: (bulkBody: any, showSuccess?: boolean) => Promise<void>;
|
|
772
|
+
sendSuggestions: (eventid: string, eventdelta: any) => Promise<boolean>;
|
|
772
773
|
uploadMapping: () => Promise<void>;
|
|
773
774
|
uploadEvents: () => Promise<void>;
|
|
774
775
|
uploadReprogramTrigger: (eventid: string, timestamp: string) => Promise<void>;
|
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
|
};
|
|
@@ -13178,7 +13181,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13178
13181
|
reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true";
|
|
13179
13182
|
// reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
|
|
13180
13183
|
// reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
13181
|
-
|
|
13184
|
+
reportingReporting.flow = "reporting";
|
|
13182
13185
|
setTimeout(() => {
|
|
13183
13186
|
reportingReporting.loadMode();
|
|
13184
13187
|
console.log('list-customreporting', reportingSchemaJson);
|
|
@@ -13264,6 +13267,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13264
13267
|
}
|
|
13265
13268
|
let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues));
|
|
13266
13269
|
console.log('reportformatvalues', reportformatvalues, comparedObj);
|
|
13270
|
+
// await this.sendSuggestions(listEvent.id, comparedObj);
|
|
13267
13271
|
// return;
|
|
13268
13272
|
var clickEvent = new MouseEvent("click", {
|
|
13269
13273
|
"view": window,
|
|
@@ -13878,6 +13882,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13878
13882
|
var _a, _b, _c, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
13879
13883
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
13880
13884
|
console.log('previousid', previousId, 'nextid', nextId);
|
|
13885
|
+
console.log('confighome', Util.getProjectConfigHome());
|
|
13881
13886
|
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers, docsOptional, documentType;
|
|
13882
13887
|
let entityId = "";
|
|
13883
13888
|
let locationId = "";
|
|
@@ -13922,20 +13927,27 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13922
13927
|
var html = `
|
|
13923
13928
|
|
|
13924
13929
|
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
13930
|
+
${(previousId != "" || nextId != "") ? `
|
|
13931
|
+
<div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
|
|
13932
|
+
<button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
|
|
13933
|
+
<button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
|
|
13934
|
+
</div>
|
|
13935
|
+
` : `
|
|
13925
13936
|
<button part="button-icon" class="material-icons invisible">close</button>
|
|
13937
|
+
`}
|
|
13926
13938
|
<h3 part="results-title" class="m-0">Compliance Details</h3>
|
|
13927
13939
|
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
13928
13940
|
</div>
|
|
13929
13941
|
|
|
13930
13942
|
`;
|
|
13931
|
-
if (previousId != "" || nextId != "") {
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
}
|
|
13943
|
+
// if (previousId != "" || nextId != "") {
|
|
13944
|
+
// html += `
|
|
13945
|
+
// <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
|
|
13946
|
+
// <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
|
|
13947
|
+
// <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
|
|
13948
|
+
// </div>
|
|
13949
|
+
// `
|
|
13950
|
+
// }
|
|
13939
13951
|
if (this.selectedItemIds.length > 1) {
|
|
13940
13952
|
html += `
|
|
13941
13953
|
|
|
@@ -22014,6 +22026,47 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22014
22026
|
}, 3000);
|
|
22015
22027
|
}
|
|
22016
22028
|
};
|
|
22029
|
+
this.sendSuggestions = async (eventid, eventdelta) => {
|
|
22030
|
+
let url = "https://" + this.apiId + "/sendsuggestions";
|
|
22031
|
+
const body = {
|
|
22032
|
+
"projectid": this.projectId,
|
|
22033
|
+
"objectid": eventid,
|
|
22034
|
+
"objectdelta": JSON.stringify(eventdelta),
|
|
22035
|
+
};
|
|
22036
|
+
let retValue = true;
|
|
22037
|
+
console.log('uploading suggestion', body);
|
|
22038
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22039
|
+
const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
22040
|
+
this._SfLoader.innerHTML = '';
|
|
22041
|
+
if (xhr.status == 200) {
|
|
22042
|
+
// const jsonRespose = JSON.parse(xhr.responseText);
|
|
22043
|
+
//console.log('jsonResponse sync', jsonRespose);
|
|
22044
|
+
this.setSuccess("Report uploaded successfully!");
|
|
22045
|
+
setTimeout(() => {
|
|
22046
|
+
this.clearMessages();
|
|
22047
|
+
// this.showChosenMapping();
|
|
22048
|
+
// this.fetchEventMap();
|
|
22049
|
+
// if(this.myRole == this.TAB_REPORTER) {
|
|
22050
|
+
// this.renderMappingTabs(this.TAB_REPORTER);
|
|
22051
|
+
// } else {
|
|
22052
|
+
// this.renderMappingTabs(this.TAB_APPROVER);
|
|
22053
|
+
// }
|
|
22054
|
+
}, 2000);
|
|
22055
|
+
}
|
|
22056
|
+
else {
|
|
22057
|
+
if (xhr.status == 401) {
|
|
22058
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
22059
|
+
this.dispatchEvent(changeEvent);
|
|
22060
|
+
}
|
|
22061
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
22062
|
+
this.setError(jsonRespose.error);
|
|
22063
|
+
setTimeout(() => {
|
|
22064
|
+
this.clearMessages();
|
|
22065
|
+
}, 3000);
|
|
22066
|
+
retValue = false;
|
|
22067
|
+
}
|
|
22068
|
+
return retValue;
|
|
22069
|
+
};
|
|
22017
22070
|
this.uploadMapping = async () => {
|
|
22018
22071
|
let url = "https://" + this.apiId + "/mapevents";
|
|
22019
22072
|
const mapping = this.transformMappingsForUpload({
|
|
@@ -22334,7 +22387,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22334
22387
|
this._SfDetailContainer.querySelector('#button-show-definition').addEventListener('click', (_e) => {
|
|
22335
22388
|
this._SfDetailContainer.querySelector('#container-definition').innerHTML = '<div class="m-20"><div part="detail-head" class="mb-10"><strong>Definitions</strong></div><sf-i-uploader class="gone" id="sf-i-definitions" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf"]" extract="no" mandatory="" mode="view" maximize="yes"></sf-i-uploader></div>';
|
|
22336
22389
|
this._SfDetailContainer.querySelector('#sf-i-definitions').classList.remove('gone');
|
|
22337
|
-
this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify(
|
|
22390
|
+
this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify([attachmentKey]);
|
|
22338
22391
|
this._SfDetailContainer.querySelector('#sf-i-definitions').loadMode();
|
|
22339
22392
|
});
|
|
22340
22393
|
}
|
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;
|
|
@@ -17019,7 +17022,7 @@ export class SfIEvents extends LitElement {
|
|
|
17019
17022
|
reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
17020
17023
|
// reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
|
|
17021
17024
|
// reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
17022
|
-
|
|
17025
|
+
reportingReporting.flow = "reporting"
|
|
17023
17026
|
setTimeout(() => {
|
|
17024
17027
|
reportingReporting.loadMode();
|
|
17025
17028
|
console.log('list-customreporting', reportingSchemaJson);
|
|
@@ -17114,6 +17117,7 @@ export class SfIEvents extends LitElement {
|
|
|
17114
17117
|
}
|
|
17115
17118
|
let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues))
|
|
17116
17119
|
console.log('reportformatvalues', reportformatvalues, comparedObj)
|
|
17120
|
+
// await this.sendSuggestions(listEvent.id, comparedObj);
|
|
17117
17121
|
// return;
|
|
17118
17122
|
var clickEvent = new MouseEvent("click", {
|
|
17119
17123
|
"view": window,
|
|
@@ -17809,6 +17813,7 @@ export class SfIEvents extends LitElement {
|
|
|
17809
17813
|
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, previousId: string, nextId: string) => {
|
|
17810
17814
|
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
17811
17815
|
console.log('previousid', previousId, 'nextid', nextId);
|
|
17816
|
+
console.log('confighome', Util.getProjectConfigHome())
|
|
17812
17817
|
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional: boolean | any, documentType: string | any;
|
|
17813
17818
|
let entityId: string = "";
|
|
17814
17819
|
let locationId: string = "";
|
|
@@ -17856,21 +17861,28 @@ export class SfIEvents extends LitElement {
|
|
|
17856
17861
|
var html = `
|
|
17857
17862
|
|
|
17858
17863
|
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
17864
|
+
${(previousId != "" || nextId != "") ? `
|
|
17865
|
+
<div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
|
|
17866
|
+
<button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
|
|
17867
|
+
<button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
|
|
17868
|
+
</div>
|
|
17869
|
+
` : `
|
|
17859
17870
|
<button part="button-icon" class="material-icons invisible">close</button>
|
|
17871
|
+
`}
|
|
17860
17872
|
<h3 part="results-title" class="m-0">Compliance Details</h3>
|
|
17861
17873
|
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
17862
17874
|
</div>
|
|
17863
17875
|
|
|
17864
17876
|
`;
|
|
17865
17877
|
|
|
17866
|
-
if (previousId != "" || nextId != "") {
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
}
|
|
17878
|
+
// if (previousId != "" || nextId != "") {
|
|
17879
|
+
// html += `
|
|
17880
|
+
// <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
|
|
17881
|
+
// <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
|
|
17882
|
+
// <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
|
|
17883
|
+
// </div>
|
|
17884
|
+
// `
|
|
17885
|
+
// }
|
|
17874
17886
|
|
|
17875
17887
|
if (this.selectedItemIds.length > 1) {
|
|
17876
17888
|
|
|
@@ -27845,6 +27857,50 @@ export class SfIEvents extends LitElement {
|
|
|
27845
27857
|
}
|
|
27846
27858
|
}
|
|
27847
27859
|
|
|
27860
|
+
sendSuggestions = async (eventid: string, eventdelta:any) => {
|
|
27861
|
+
let url = "https://" + this.apiId + "/sendsuggestions";
|
|
27862
|
+
|
|
27863
|
+
const body = {
|
|
27864
|
+
"projectid": this.projectId,
|
|
27865
|
+
"objectid": eventid,
|
|
27866
|
+
"objectdelta": JSON.stringify(eventdelta),
|
|
27867
|
+
}
|
|
27868
|
+
let retValue = true;
|
|
27869
|
+
console.log('uploading suggestion', body);
|
|
27870
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
27871
|
+
const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
27872
|
+
this._SfLoader.innerHTML = '';
|
|
27873
|
+
if (xhr.status == 200) {
|
|
27874
|
+
|
|
27875
|
+
// const jsonRespose = JSON.parse(xhr.responseText);
|
|
27876
|
+
//console.log('jsonResponse sync', jsonRespose);
|
|
27877
|
+
this.setSuccess("Report uploaded successfully!");
|
|
27878
|
+
setTimeout(() => {
|
|
27879
|
+
this.clearMessages()
|
|
27880
|
+
// this.showChosenMapping();
|
|
27881
|
+
// this.fetchEventMap();
|
|
27882
|
+
// if(this.myRole == this.TAB_REPORTER) {
|
|
27883
|
+
// this.renderMappingTabs(this.TAB_REPORTER);
|
|
27884
|
+
// } else {
|
|
27885
|
+
// this.renderMappingTabs(this.TAB_APPROVER);
|
|
27886
|
+
// }
|
|
27887
|
+
}, 2000);
|
|
27888
|
+
|
|
27889
|
+
} else {
|
|
27890
|
+
if (xhr.status == 401) {
|
|
27891
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
27892
|
+
this.dispatchEvent(changeEvent);
|
|
27893
|
+
}
|
|
27894
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
27895
|
+
this.setError(jsonRespose.error);
|
|
27896
|
+
setTimeout(() => {
|
|
27897
|
+
this.clearMessages();
|
|
27898
|
+
}, 3000);
|
|
27899
|
+
retValue = false;
|
|
27900
|
+
}
|
|
27901
|
+
return retValue;
|
|
27902
|
+
}
|
|
27903
|
+
|
|
27848
27904
|
uploadMapping = async () => {
|
|
27849
27905
|
|
|
27850
27906
|
let url = "https://" + this.apiId + "/mapevents";
|
|
@@ -28265,7 +28321,7 @@ export class SfIEvents extends LitElement {
|
|
|
28265
28321
|
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-show-definition') as HTMLButtonElement)!.addEventListener('click', (_e: any) => {
|
|
28266
28322
|
(this._SfDetailContainer as HTMLDivElement).querySelector('#container-definition')!.innerHTML = '<div class="m-20"><div part="detail-head" class="mb-10"><strong>Definitions</strong></div><sf-i-uploader class="gone" id="sf-i-definitions" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf"]" extract="no" mandatory="" mode="view" maximize="yes"></sf-i-uploader></div>';
|
|
28267
28323
|
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).classList.remove('gone');
|
|
28268
|
-
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).prepopulatedInputArr = JSON.stringify(
|
|
28324
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).prepopulatedInputArr = JSON.stringify([attachmentKey]);
|
|
28269
28325
|
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).loadMode();
|
|
28270
28326
|
});
|
|
28271
28327
|
|
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
|