sf-i-events 1.0.941 → 1.0.942
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 +59 -10
- package/src/sf-i-events.ts +62 -10
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
|
@@ -13178,7 +13178,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13178
13178
|
reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true";
|
|
13179
13179
|
// reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
|
|
13180
13180
|
// reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
13181
|
-
|
|
13181
|
+
reportingReporting.flow = "reporting";
|
|
13182
13182
|
setTimeout(() => {
|
|
13183
13183
|
reportingReporting.loadMode();
|
|
13184
13184
|
console.log('list-customreporting', reportingSchemaJson);
|
|
@@ -13264,6 +13264,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13264
13264
|
}
|
|
13265
13265
|
let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues));
|
|
13266
13266
|
console.log('reportformatvalues', reportformatvalues, comparedObj);
|
|
13267
|
+
// await this.sendSuggestions(listEvent.id, comparedObj);
|
|
13267
13268
|
// return;
|
|
13268
13269
|
var clickEvent = new MouseEvent("click", {
|
|
13269
13270
|
"view": window,
|
|
@@ -13922,20 +13923,27 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
13922
13923
|
var html = `
|
|
13923
13924
|
|
|
13924
13925
|
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
13926
|
+
${(previousId != "" || nextId != "") ? `
|
|
13927
|
+
<div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
|
|
13928
|
+
<button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
|
|
13929
|
+
<button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
|
|
13930
|
+
</div>
|
|
13931
|
+
` : `
|
|
13925
13932
|
<button part="button-icon" class="material-icons invisible">close</button>
|
|
13933
|
+
`}
|
|
13926
13934
|
<h3 part="results-title" class="m-0">Compliance Details</h3>
|
|
13927
13935
|
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
13928
13936
|
</div>
|
|
13929
13937
|
|
|
13930
13938
|
`;
|
|
13931
|
-
if (previousId != "" || nextId != "") {
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
}
|
|
13939
|
+
// if (previousId != "" || nextId != "") {
|
|
13940
|
+
// html += `
|
|
13941
|
+
// <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
|
|
13942
|
+
// <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
|
|
13943
|
+
// <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
|
|
13944
|
+
// </div>
|
|
13945
|
+
// `
|
|
13946
|
+
// }
|
|
13939
13947
|
if (this.selectedItemIds.length > 1) {
|
|
13940
13948
|
html += `
|
|
13941
13949
|
|
|
@@ -22014,6 +22022,47 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22014
22022
|
}, 3000);
|
|
22015
22023
|
}
|
|
22016
22024
|
};
|
|
22025
|
+
this.sendSuggestions = async (eventid, eventdelta) => {
|
|
22026
|
+
let url = "https://" + this.apiId + "/sendsuggestions";
|
|
22027
|
+
const body = {
|
|
22028
|
+
"projectid": this.projectId,
|
|
22029
|
+
"objectid": eventid,
|
|
22030
|
+
"objectdelta": JSON.stringify(eventdelta),
|
|
22031
|
+
};
|
|
22032
|
+
let retValue = true;
|
|
22033
|
+
console.log('uploading suggestion', body);
|
|
22034
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22035
|
+
const xhr = (await this.prepareXhr(body, url, this._SfLoader, authorization));
|
|
22036
|
+
this._SfLoader.innerHTML = '';
|
|
22037
|
+
if (xhr.status == 200) {
|
|
22038
|
+
// const jsonRespose = JSON.parse(xhr.responseText);
|
|
22039
|
+
//console.log('jsonResponse sync', jsonRespose);
|
|
22040
|
+
this.setSuccess("Report uploaded successfully!");
|
|
22041
|
+
setTimeout(() => {
|
|
22042
|
+
this.clearMessages();
|
|
22043
|
+
// this.showChosenMapping();
|
|
22044
|
+
// this.fetchEventMap();
|
|
22045
|
+
// if(this.myRole == this.TAB_REPORTER) {
|
|
22046
|
+
// this.renderMappingTabs(this.TAB_REPORTER);
|
|
22047
|
+
// } else {
|
|
22048
|
+
// this.renderMappingTabs(this.TAB_APPROVER);
|
|
22049
|
+
// }
|
|
22050
|
+
}, 2000);
|
|
22051
|
+
}
|
|
22052
|
+
else {
|
|
22053
|
+
if (xhr.status == 401) {
|
|
22054
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
22055
|
+
this.dispatchEvent(changeEvent);
|
|
22056
|
+
}
|
|
22057
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
22058
|
+
this.setError(jsonRespose.error);
|
|
22059
|
+
setTimeout(() => {
|
|
22060
|
+
this.clearMessages();
|
|
22061
|
+
}, 3000);
|
|
22062
|
+
retValue = false;
|
|
22063
|
+
}
|
|
22064
|
+
return retValue;
|
|
22065
|
+
};
|
|
22017
22066
|
this.uploadMapping = async () => {
|
|
22018
22067
|
let url = "https://" + this.apiId + "/mapevents";
|
|
22019
22068
|
const mapping = this.transformMappingsForUpload({
|
|
@@ -22334,7 +22383,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
22334
22383
|
this._SfDetailContainer.querySelector('#button-show-definition').addEventListener('click', (_e) => {
|
|
22335
22384
|
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
22385
|
this._SfDetailContainer.querySelector('#sf-i-definitions').classList.remove('gone');
|
|
22337
|
-
this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify(
|
|
22386
|
+
this._SfDetailContainer.querySelector('#sf-i-definitions').prepopulatedInputArr = JSON.stringify([attachmentKey]);
|
|
22338
22387
|
this._SfDetailContainer.querySelector('#sf-i-definitions').loadMode();
|
|
22339
22388
|
});
|
|
22340
22389
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -17019,7 +17019,7 @@ export class SfIEvents extends LitElement {
|
|
|
17019
17019
|
reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
17020
17020
|
// reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
|
|
17021
17021
|
// reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
17022
|
-
|
|
17022
|
+
reportingReporting.flow = "reporting"
|
|
17023
17023
|
setTimeout(() => {
|
|
17024
17024
|
reportingReporting.loadMode();
|
|
17025
17025
|
console.log('list-customreporting', reportingSchemaJson);
|
|
@@ -17114,6 +17114,7 @@ export class SfIEvents extends LitElement {
|
|
|
17114
17114
|
}
|
|
17115
17115
|
let comparedObj = Util.compareObjects(reportformatvalues, JSON.parse(listEvent.reportformatvalues))
|
|
17116
17116
|
console.log('reportformatvalues', reportformatvalues, comparedObj)
|
|
17117
|
+
// await this.sendSuggestions(listEvent.id, comparedObj);
|
|
17117
17118
|
// return;
|
|
17118
17119
|
var clickEvent = new MouseEvent("click", {
|
|
17119
17120
|
"view": window,
|
|
@@ -17856,21 +17857,28 @@ export class SfIEvents extends LitElement {
|
|
|
17856
17857
|
var html = `
|
|
17857
17858
|
|
|
17858
17859
|
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
17860
|
+
${(previousId != "" || nextId != "") ? `
|
|
17861
|
+
<div part="compliance-detail-prev-next" class="d-flex justify-center align-center">
|
|
17862
|
+
<button id="button-detail-previous" part="button-icon" class="mr-10 material-icons${previousId != "" ? "" : " gone"}">chevron_left</button>
|
|
17863
|
+
<button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " gone"}">chevron_right</button>
|
|
17864
|
+
</div>
|
|
17865
|
+
` : `
|
|
17859
17866
|
<button part="button-icon" class="material-icons invisible">close</button>
|
|
17867
|
+
`}
|
|
17860
17868
|
<h3 part="results-title" class="m-0">Compliance Details</h3>
|
|
17861
17869
|
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
17862
17870
|
</div>
|
|
17863
17871
|
|
|
17864
17872
|
`;
|
|
17865
17873
|
|
|
17866
|
-
if (previousId != "" || nextId != "") {
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
}
|
|
17874
|
+
// if (previousId != "" || nextId != "") {
|
|
17875
|
+
// html += `
|
|
17876
|
+
// <div part="compliance-detail-prev-next" class="d-flex justify-between m-20">
|
|
17877
|
+
// <button id="button-detail-previous" part="button-icon" class="material-icons${previousId != "" ? "" : " invisible"}">chevron_left</button>
|
|
17878
|
+
// <button id="button-detail-next" part="button-icon" class="material-icons${nextId != "" ? "" : " invisible"}">chevron_right</button>
|
|
17879
|
+
// </div>
|
|
17880
|
+
// `
|
|
17881
|
+
// }
|
|
17874
17882
|
|
|
17875
17883
|
if (this.selectedItemIds.length > 1) {
|
|
17876
17884
|
|
|
@@ -27845,6 +27853,50 @@ export class SfIEvents extends LitElement {
|
|
|
27845
27853
|
}
|
|
27846
27854
|
}
|
|
27847
27855
|
|
|
27856
|
+
sendSuggestions = async (eventid: string, eventdelta:any) => {
|
|
27857
|
+
let url = "https://" + this.apiId + "/sendsuggestions";
|
|
27858
|
+
|
|
27859
|
+
const body = {
|
|
27860
|
+
"projectid": this.projectId,
|
|
27861
|
+
"objectid": eventid,
|
|
27862
|
+
"objectdelta": JSON.stringify(eventdelta),
|
|
27863
|
+
}
|
|
27864
|
+
let retValue = true;
|
|
27865
|
+
console.log('uploading suggestion', body);
|
|
27866
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
27867
|
+
const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
27868
|
+
this._SfLoader.innerHTML = '';
|
|
27869
|
+
if (xhr.status == 200) {
|
|
27870
|
+
|
|
27871
|
+
// const jsonRespose = JSON.parse(xhr.responseText);
|
|
27872
|
+
//console.log('jsonResponse sync', jsonRespose);
|
|
27873
|
+
this.setSuccess("Report uploaded successfully!");
|
|
27874
|
+
setTimeout(() => {
|
|
27875
|
+
this.clearMessages()
|
|
27876
|
+
// this.showChosenMapping();
|
|
27877
|
+
// this.fetchEventMap();
|
|
27878
|
+
// if(this.myRole == this.TAB_REPORTER) {
|
|
27879
|
+
// this.renderMappingTabs(this.TAB_REPORTER);
|
|
27880
|
+
// } else {
|
|
27881
|
+
// this.renderMappingTabs(this.TAB_APPROVER);
|
|
27882
|
+
// }
|
|
27883
|
+
}, 2000);
|
|
27884
|
+
|
|
27885
|
+
} else {
|
|
27886
|
+
if (xhr.status == 401) {
|
|
27887
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
27888
|
+
this.dispatchEvent(changeEvent);
|
|
27889
|
+
}
|
|
27890
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
27891
|
+
this.setError(jsonRespose.error);
|
|
27892
|
+
setTimeout(() => {
|
|
27893
|
+
this.clearMessages();
|
|
27894
|
+
}, 3000);
|
|
27895
|
+
retValue = false;
|
|
27896
|
+
}
|
|
27897
|
+
return retValue;
|
|
27898
|
+
}
|
|
27899
|
+
|
|
27848
27900
|
uploadMapping = async () => {
|
|
27849
27901
|
|
|
27850
27902
|
let url = "https://" + this.apiId + "/mapevents";
|
|
@@ -28265,7 +28317,7 @@ export class SfIEvents extends LitElement {
|
|
|
28265
28317
|
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-show-definition') as HTMLButtonElement)!.addEventListener('click', (_e: any) => {
|
|
28266
28318
|
(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
28319
|
((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(
|
|
28320
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).prepopulatedInputArr = JSON.stringify([attachmentKey]);
|
|
28269
28321
|
((this._SfDetailContainer as HTMLDivElement).querySelector('#sf-i-definitions') as SfIUploader).loadMode();
|
|
28270
28322
|
});
|
|
28271
28323
|
|