sf-i-events 1.0.873 → 1.0.874
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/.eslintrc.json +5 -5
- package/dev/index.html +902 -902
- package/package.json +100 -100
- package/sf-i-events.d.ts +861 -856
- package/sf-i-events.js +22010 -21117
- package/src/sf-i-events.ts +1189 -192
- package/src/util.ts +519 -519
- package/test/sf-i-form_test.d.ts +6 -6
- package/test/sf-i-form_test.js +17 -17
- package/util.d.ts +49 -49
- package/util.js +438 -438
package/src/sf-i-events.ts
CHANGED
|
@@ -859,7 +859,7 @@ export class SfIEvents extends LitElement {
|
|
|
859
859
|
|
|
860
860
|
EXCLUDE_COLS_FROM_REGS: Array<string> = ["updatetype", "question", "invalidations", "activations", "alertschedule", "clientquestion", "countryname", "countryid", "entityname", "entityid", "locationname", "locationid", "reporters", "approvers", "timeframe", "responsedays", "execmodule", "functions", "shortid", "shortnumid", "countries", "entities", "locations", "tagsmap", "reportersmap", "approversmap", "functionheadsmap", "auditorsmap", "viewersmap", "approved", "documents", "comments", "lastupdated", "dateofcompletion", "mmdd", "completeness", "timeliness", "compliance", "delta", "triggers"]
|
|
861
861
|
|
|
862
|
-
CHARTS_LIST_BY_MODULES: { [key: string]: Array<string> } = { "compliances": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "notices": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "contracts": ["compliance", "timeliness", "completeness", "location"] };
|
|
862
|
+
CHARTS_LIST_BY_MODULES: { [key: string]: Array<string> } = { "compliances": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "notices": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"], "contracts": ["compliance", "timeliness", "completeness", "location"], "licenses": ["compliance", "timeliness", "completeness", "riskSeverity", "riskArea", "location", "function", "obligationType", "jurisdiction", "frequency", "subCategory"] };
|
|
863
863
|
|
|
864
864
|
chartSelectedLegend: Array<number> = [];
|
|
865
865
|
|
|
@@ -1246,6 +1246,9 @@ export class SfIEvents extends LitElement {
|
|
|
1246
1246
|
@property()
|
|
1247
1247
|
apiIdAgreements!: string;
|
|
1248
1248
|
|
|
1249
|
+
@property()
|
|
1250
|
+
apiIdLicenses!: string;
|
|
1251
|
+
|
|
1249
1252
|
@property()
|
|
1250
1253
|
apiMethodList!: string;
|
|
1251
1254
|
|
|
@@ -4263,7 +4266,7 @@ export class SfIEvents extends LitElement {
|
|
|
4263
4266
|
|
|
4264
4267
|
getComplianceStatus = (completeness: string, timeliness: string, percentage?: string, event: any = {}) => {
|
|
4265
4268
|
if (event.module == "contract") {
|
|
4266
|
-
console.log('compliance status', event.terminated)
|
|
4269
|
+
console.log('compliance status', event.terminated, completeness, timeliness)
|
|
4267
4270
|
if(event.terminated){
|
|
4268
4271
|
return "terminated"
|
|
4269
4272
|
}
|
|
@@ -6794,7 +6797,9 @@ export class SfIEvents extends LitElement {
|
|
|
6794
6797
|
if (module === "notice") {
|
|
6795
6798
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6796
6799
|
} else if (module === "contract") {
|
|
6797
|
-
this.
|
|
6800
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6801
|
+
} else if (module === "license") {
|
|
6802
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6798
6803
|
} else {
|
|
6799
6804
|
let found = false;
|
|
6800
6805
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -6833,7 +6838,9 @@ export class SfIEvents extends LitElement {
|
|
|
6833
6838
|
if (module === "notice") {
|
|
6834
6839
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6835
6840
|
} else if (module === "contract") {
|
|
6836
|
-
this.
|
|
6841
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6842
|
+
} else if (module === "license") {
|
|
6843
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6837
6844
|
} else {
|
|
6838
6845
|
let found = false;
|
|
6839
6846
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -10959,7 +10966,9 @@ export class SfIEvents extends LitElement {
|
|
|
10959
10966
|
if (module === "notice") {
|
|
10960
10967
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10961
10968
|
} else if (module === "contract") {
|
|
10962
|
-
this.
|
|
10969
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10970
|
+
} else if (module === "license") {
|
|
10971
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10963
10972
|
} else {
|
|
10964
10973
|
let found = false;
|
|
10965
10974
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -10998,7 +11007,9 @@ export class SfIEvents extends LitElement {
|
|
|
10998
11007
|
if (module === "notice") {
|
|
10999
11008
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11000
11009
|
} else if (module === "contract") {
|
|
11001
|
-
this.
|
|
11010
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11011
|
+
} else if (module === "license") {
|
|
11012
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11002
11013
|
} else {
|
|
11003
11014
|
let found = false;
|
|
11004
11015
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -11567,7 +11578,9 @@ export class SfIEvents extends LitElement {
|
|
|
11567
11578
|
if (module === "notice") {
|
|
11568
11579
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11569
11580
|
} else if (module === "contract") {
|
|
11570
|
-
this.
|
|
11581
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11582
|
+
} else if (module === "license") {
|
|
11583
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11571
11584
|
} else {
|
|
11572
11585
|
let found = false;
|
|
11573
11586
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -11588,7 +11601,7 @@ export class SfIEvents extends LitElement {
|
|
|
11588
11601
|
|
|
11589
11602
|
|
|
11590
11603
|
// this.renderEventDetail(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-'+this.currentColumnIndex) as HTMLButtonElement);
|
|
11591
|
-
console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
|
|
11604
|
+
// console.log('errorFetchEvent', mmdd, j, buttonArr[i].outerHTML, idArr);
|
|
11592
11605
|
this.fetchEventDetails(this.events[mmdd][j], mmdd + "/" + yyyy, (this._SfStreamContainer as HTMLDivElement).querySelector('#stream-month-' + this.currentColumnIndex) as HTMLButtonElement, this._SfStreamContainer as HTMLDivElement);
|
|
11593
11606
|
}
|
|
11594
11607
|
|
|
@@ -11611,7 +11624,9 @@ export class SfIEvents extends LitElement {
|
|
|
11611
11624
|
if (module === "notice") {
|
|
11612
11625
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11613
11626
|
} else if (module === "contract") {
|
|
11614
|
-
this.
|
|
11627
|
+
this.fetchContractDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11628
|
+
} else if (module === "license") {
|
|
11629
|
+
this.fetchLicenseDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11615
11630
|
} else {
|
|
11616
11631
|
let found = false;
|
|
11617
11632
|
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
@@ -13678,7 +13693,7 @@ export class SfIEvents extends LitElement {
|
|
|
13678
13693
|
|
|
13679
13694
|
}
|
|
13680
13695
|
}
|
|
13681
|
-
|
|
13696
|
+
fetchContractDetails = async (listEvent: any, mmddyyyy: string) => {
|
|
13682
13697
|
let entityId = listEvent.entityid;
|
|
13683
13698
|
let locationId = listEvent.locationid;
|
|
13684
13699
|
let url = "https://" + this.apiIdAgreements + "/getallobjectdetails";
|
|
@@ -13695,7 +13710,7 @@ export class SfIEvents extends LitElement {
|
|
|
13695
13710
|
|
|
13696
13711
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
13697
13712
|
console.log('jsonRespose agreement details', jsonRespose);
|
|
13698
|
-
this.
|
|
13713
|
+
this.renderContractDetails(jsonRespose.object, mmddyyyy)
|
|
13699
13714
|
} else {
|
|
13700
13715
|
if (xhr.status == 401) {
|
|
13701
13716
|
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
@@ -13709,7 +13724,7 @@ export class SfIEvents extends LitElement {
|
|
|
13709
13724
|
|
|
13710
13725
|
}
|
|
13711
13726
|
|
|
13712
|
-
|
|
13727
|
+
renewContract = async (listEvent: any, reportformatvalues: any) => {
|
|
13713
13728
|
|
|
13714
13729
|
let url = "https://" + this.apiIdAgreements + "/reopen";
|
|
13715
13730
|
|
|
@@ -13735,7 +13750,7 @@ export class SfIEvents extends LitElement {
|
|
|
13735
13750
|
|
|
13736
13751
|
}
|
|
13737
13752
|
}
|
|
13738
|
-
|
|
13753
|
+
renderContractDetails = async (listEvent: any, mmddyyyy: string) => {
|
|
13739
13754
|
// await this.fetchAgreementDetails(listEvent, mmddyyyy);
|
|
13740
13755
|
// return;
|
|
13741
13756
|
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
@@ -13959,7 +13974,7 @@ export class SfIEvents extends LitElement {
|
|
|
13959
13974
|
console.log('mmddyyyy', mmddyyyy)
|
|
13960
13975
|
if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
|
|
13961
13976
|
if (approved) {
|
|
13962
|
-
await this.
|
|
13977
|
+
await this.renewContract(listEvent, reportformatvalues);
|
|
13963
13978
|
} else {
|
|
13964
13979
|
console.log('renew reporting', reportformatvalues)
|
|
13965
13980
|
}
|
|
@@ -14331,7 +14346,7 @@ export class SfIEvents extends LitElement {
|
|
|
14331
14346
|
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14332
14347
|
}
|
|
14333
14348
|
}
|
|
14334
|
-
await this.
|
|
14349
|
+
await this.renewContract(listEvent, reportformatvalues);
|
|
14335
14350
|
console.log('upload report auto approve single')
|
|
14336
14351
|
}
|
|
14337
14352
|
if (this.recentlyReported[mmdd] == null) {
|
|
@@ -14570,13 +14585,13 @@ export class SfIEvents extends LitElement {
|
|
|
14570
14585
|
|
|
14571
14586
|
}
|
|
14572
14587
|
}
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
let url = "https://" + this.
|
|
14588
|
+
fetchLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
|
|
14589
|
+
let entityId = listEvent.entityid;
|
|
14590
|
+
let locationId = listEvent.locationid;
|
|
14591
|
+
let url = "https://" + this.apiIdLicenses + "/getallobjectdetails";
|
|
14577
14592
|
|
|
14578
14593
|
//console.log('fetch calendar url', url);
|
|
14579
|
-
let urlBody: any = {
|
|
14594
|
+
let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, entityid: entityId, locationid: locationId, userprofileid: this.userProfileId, role: this.myRole, year: this.calendarStartYYYY, mmddyyyy: mmddyyyy };
|
|
14580
14595
|
|
|
14581
14596
|
//console.log('urlbody', urlBody);
|
|
14582
14597
|
|
|
@@ -14586,197 +14601,1089 @@ export class SfIEvents extends LitElement {
|
|
|
14586
14601
|
if (xhr.status == 200) {
|
|
14587
14602
|
|
|
14588
14603
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
14589
|
-
console.log('jsonRespose', jsonRespose);
|
|
14590
|
-
|
|
14591
|
-
if (listEventContainer != null) {
|
|
14592
|
-
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14593
|
-
if (this.events[mmdd] != null) {
|
|
14594
|
-
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14595
|
-
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
|
|
14596
|
-
this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
|
|
14597
|
-
}
|
|
14598
|
-
}
|
|
14599
|
-
}
|
|
14600
|
-
this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
|
|
14601
|
-
}
|
|
14602
|
-
} else {
|
|
14603
|
-
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
|
|
14604
|
-
}
|
|
14605
|
-
|
|
14604
|
+
console.log('jsonRespose agreement details', jsonRespose);
|
|
14605
|
+
this.renderLicenseDetails(jsonRespose.object, mmddyyyy)
|
|
14606
14606
|
} else {
|
|
14607
14607
|
if (xhr.status == 401) {
|
|
14608
14608
|
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
14609
14609
|
this.dispatchEvent(changeEvent);
|
|
14610
|
-
}
|
|
14611
|
-
if (xhr.status === 404) {
|
|
14612
|
-
|
|
14613
|
-
this.showChosenProject();
|
|
14614
|
-
(this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
|
|
14615
|
-
this.renderChosenProject();
|
|
14616
|
-
|
|
14617
14610
|
} else {
|
|
14618
14611
|
const jsonRespose = JSON.parse(xhr.responseText);
|
|
14619
14612
|
this.setError(jsonRespose.error);
|
|
14620
14613
|
}
|
|
14621
14614
|
|
|
14622
14615
|
}
|
|
14616
|
+
|
|
14623
14617
|
}
|
|
14624
14618
|
|
|
14625
|
-
|
|
14626
|
-
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
14619
|
+
renewLicense = async (listEvent: any, reportformatvalues: any) => {
|
|
14627
14620
|
|
|
14628
|
-
let
|
|
14629
|
-
let entityId: string = "";
|
|
14630
|
-
let locationId: string = "";
|
|
14631
|
-
let statuteName: string = "";
|
|
14632
|
-
let reportformatName: string = "";
|
|
14633
|
-
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14634
|
-
entityId = event.entityid;
|
|
14635
|
-
locationId = event.locationid;
|
|
14636
|
-
// let completeness = this.getCompletenessStatus(event);
|
|
14637
|
-
comments = event['comments'] == null ? [] : (event['comments']);
|
|
14638
|
-
docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
|
|
14639
|
-
approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
|
|
14640
|
-
// dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
14641
|
-
makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
|
|
14642
|
-
docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
|
|
14643
|
-
documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
|
|
14621
|
+
let url = "https://" + this.apiIdLicenses + "/reopen";
|
|
14644
14622
|
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14623
|
+
console.log('renewing', reportformatvalues)
|
|
14624
|
+
//console.log('fetch calendar url', url);
|
|
14625
|
+
let urlBody: any = { projectid: this.projectId, objectid: listEvent.id, newvalues: reportformatvalues == "" ? null : JSON.parse(reportformatvalues), published: true, terminated: (JSON.parse(reportformatvalues).terminated ?? false) };
|
|
14626
|
+
// console.log('reopen body', url, urlBody)
|
|
14627
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
14628
|
+
const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
|
|
14629
|
+
this._SfLoader.innerHTML = '';
|
|
14630
|
+
if (xhr.status == 200) {
|
|
14649
14631
|
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14632
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
14633
|
+
console.log('jsonRespose agreement reopen', jsonRespose);
|
|
14634
|
+
} else {
|
|
14635
|
+
if (xhr.status == 401) {
|
|
14636
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
14637
|
+
this.dispatchEvent(changeEvent);
|
|
14638
|
+
} else {
|
|
14639
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
14640
|
+
this.setError(jsonRespose.error);
|
|
14641
|
+
}
|
|
14658
14642
|
|
|
14659
|
-
let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
|
|
14660
|
-
for (let tempReportingContainer of listReportingContainers) {
|
|
14661
|
-
tempReportingContainer.style.display = 'none';
|
|
14662
|
-
tempReportingContainer.innerHTML = '';
|
|
14663
|
-
}
|
|
14664
|
-
let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
|
|
14665
|
-
for (let buttonListReporting of buttonListReportings) {
|
|
14666
|
-
buttonListReporting.setAttribute('part', 'button-list-reporting')
|
|
14667
|
-
}
|
|
14668
|
-
let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
|
|
14669
|
-
for (let streamEventTitle of streamEventTitles) {
|
|
14670
|
-
streamEventTitle.removeAttribute('part')
|
|
14671
14643
|
}
|
|
14672
|
-
|
|
14673
|
-
|
|
14674
|
-
|
|
14675
|
-
|
|
14676
|
-
|
|
14677
|
-
|
|
14678
|
-
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
14684
|
-
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
|
|
14644
|
+
}
|
|
14645
|
+
renderLicenseDetails = async (listEvent: any, mmddyyyy: string) => {
|
|
14646
|
+
// await this.fetchAgreementDetails(listEvent, mmddyyyy);
|
|
14647
|
+
// return;
|
|
14648
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14649
|
+
let entityId = listEvent.entityid;
|
|
14650
|
+
let locationId = listEvent.locationid;
|
|
14651
|
+
let comments = listEvent['comments'];
|
|
14652
|
+
let docs = listEvent['documents'] == null ? [] : listEvent['documents'] == null ? [] : (listEvent['documents']);
|
|
14653
|
+
let approved = listEvent['approved'] == null ? false : listEvent['approved'] == null ? false : listEvent['approved'];
|
|
14654
|
+
let makercheckers = listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'] == null ? [] : listEvent['makercheckers'];
|
|
14655
|
+
// let docsOptional = listEvent['docs'] == null ? [] : listEvent['docs'] == null ? [] : listEvent['docs'];
|
|
14656
|
+
let html: string = '';
|
|
14657
|
+
let documentType = listEvent['documenttype'] == null ? null : listEvent['documenttype'][0] == null ? null : listEvent['documenttype'][0].split(" ")[0];
|
|
14658
|
+
html += `
|
|
14659
|
+
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
14660
|
+
<button part="button-icon" class="material-icons invisible">close</button>
|
|
14661
|
+
<h3 part="results-title" class="m-0">License Details</h3>
|
|
14662
|
+
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
14688
14663
|
</div>
|
|
14689
|
-
|
|
14690
|
-
|
|
14664
|
+
`
|
|
14665
|
+
html += `
|
|
14666
|
+
<div class="box-large" id="shimmer-container-agreements" part="shimmer-container-agreements">
|
|
14667
|
+
</div>
|
|
14668
|
+
`
|
|
14669
|
+
html += '<sf-i-reporting id="detail-reporting" class="hide" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" name="Contract Details" apiiduploader="1peg5170d3" apiid="' + this.apiIdAgreements + '" mode="admin" flow="details" projectid="' + this.projectId + '" projectname="' + this.projectName + '" editdisable="true" formviewclass="flex-wrap"></sf-i-reporting>';
|
|
14691
14670
|
|
|
14692
|
-
|
|
14671
|
+
html += '<div part="reporting-view-container">'
|
|
14693
14672
|
|
|
14694
|
-
html +=
|
|
14673
|
+
html += this.renderReporting(listEvent, mmddyyyy);
|
|
14674
|
+
html += "</div>"
|
|
14695
14675
|
|
|
14696
|
-
html += '<div
|
|
14697
|
-
html +=
|
|
14698
|
-
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
|
|
14699
|
-
html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
|
|
14676
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
14677
|
+
html += '<h3 part="results-title" class="m-0"><br />Comments</h3>';
|
|
14700
14678
|
html += '</div>';
|
|
14701
14679
|
|
|
14702
|
-
html += '<
|
|
14680
|
+
html += '<div class="m-20">';
|
|
14703
14681
|
|
|
14704
|
-
html += '<div class="
|
|
14705
|
-
html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
|
|
14706
|
-
html += '<h3>Basic Information</h3>'
|
|
14707
|
-
html += '<h3 class="head-indicator-basic">-</h3>'
|
|
14708
|
-
html += '</div>';
|
|
14709
|
-
html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
|
|
14682
|
+
html += '<div class="d-flex flex-col">';
|
|
14710
14683
|
|
|
14711
|
-
for (var i = 0; i <
|
|
14684
|
+
for (var i = 0; i < comments.length; i++) {
|
|
14685
|
+
html += '<div part="commentbox" class="d-flex commentbox ' + (comments[i].author + "").toLowerCase() + 'box">';
|
|
14686
|
+
html += '<div class="mr-20 d-flex flex-col align-end"><span part="comment-username">' + (comments[i].username != null ? comments[i].username : '') + '</span><span part="td-head">' + comments[i].author + '</span>' + ((i === (comments.length - 1) && this.enableDeleteLatestReport) ? '<br /><button class="mt-5 button-delete" part="button">Delete</button>' : '') + '</div>';
|
|
14712
14687
|
|
|
14713
|
-
|
|
14688
|
+
const onlyCommentText = (comments[i].comment + "").replace(/ *\([^)]*\) */g, "").trim();
|
|
14689
|
+
try {
|
|
14714
14690
|
|
|
14715
|
-
|
|
14691
|
+
const jsonComments = JSON.parse(onlyCommentText);
|
|
14716
14692
|
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
html += '</div>';
|
|
14693
|
+
if (Util.isInteger(jsonComments)) {
|
|
14694
|
+
html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
|
|
14695
|
+
} else {
|
|
14696
|
+
//console.log('json comments', jsonComments);
|
|
14697
|
+
var htmlTable = '';
|
|
14698
|
+
for (var j = 0; j < Object.keys(jsonComments).length; j++) {
|
|
14699
|
+
htmlTable += '<div class="mb-20">';
|
|
14700
|
+
htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
|
|
14701
|
+
htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
|
|
14702
|
+
htmlTable += '</div>';
|
|
14728
14703
|
}
|
|
14729
|
-
|
|
14704
|
+
html += '<div class="">' + htmlTable + '<small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
|
|
14730
14705
|
}
|
|
14731
|
-
}
|
|
14732
|
-
|
|
14733
|
-
}
|
|
14734
14706
|
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
html += '<div class="
|
|
14738
|
-
html += '<div part="detail-head"><strong>Approved</strong></div>'
|
|
14739
|
-
html += '<span class="material-icons color-done">check_circle</span>'
|
|
14740
|
-
html += '</div>';
|
|
14707
|
+
} catch (e: any) {
|
|
14708
|
+
//console.log('json comments exception', comments[i]);
|
|
14709
|
+
html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + Util.getDateTimeStrings(new Date(comments[i].timestamp).getTime()) + '</span></small></div>';
|
|
14741
14710
|
}
|
|
14742
|
-
}
|
|
14743
14711
|
|
|
14744
|
-
if (docs != null) {
|
|
14745
|
-
html += '<div class="m-20">';
|
|
14746
|
-
html += '<div part="detail-head"><strong>Documents</strong></div>'
|
|
14747
|
-
html += '<span class="material-icons muted">description</span>'
|
|
14748
|
-
html += docs.length
|
|
14749
14712
|
html += '</div>';
|
|
14750
14713
|
}
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
html += '<div class="m-20">';
|
|
14754
|
-
html += '<div part="detail-head"><strong>Comments</strong></div>'
|
|
14755
|
-
html += '<span class="material-icons muted">forum</span>'
|
|
14756
|
-
html += comments.length
|
|
14757
|
-
html += '</div>';
|
|
14714
|
+
if (comments.length === 0) {
|
|
14715
|
+
html += '<div><strong>No comments yet!</strong></div>';
|
|
14758
14716
|
}
|
|
14759
14717
|
|
|
14760
|
-
html += '<div class="m-20">';
|
|
14761
|
-
html += '<div part="detail-head"><strong>Reporters</strong></div>'
|
|
14762
|
-
html += this.getReporterDetailStringFromEvent(event);
|
|
14763
14718
|
html += '</div>';
|
|
14764
14719
|
|
|
14765
|
-
html += '<div class="m-20">';
|
|
14766
|
-
html += '<div part="detail-head"><strong>Approvers</strong></div>'
|
|
14767
|
-
html += this.getApproverDetailStringFromEvent(event);
|
|
14768
14720
|
html += '</div>';
|
|
14721
|
+
console.log('selected event', JSON.stringify(listEvent));
|
|
14722
|
+
(this._SfDetailContainer as HTMLDivElement).innerHTML = html;
|
|
14723
|
+
(this._SfDetailContainer as HTMLDivElement).style.display = 'block';
|
|
14769
14724
|
|
|
14770
|
-
|
|
14771
|
-
html += '</div>';
|
|
14725
|
+
let usermap = Util.getUsermap();
|
|
14772
14726
|
|
|
14727
|
+
let sfireporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#detail-reporting') as SfIReporting
|
|
14728
|
+
sfireporting.usermap = JSON.stringify(usermap);
|
|
14729
|
+
sfireporting.selectedItem = listEvent;
|
|
14730
|
+
sfireporting.editdisable = "true"
|
|
14731
|
+
setTimeout(() => {
|
|
14732
|
+
console.log('sfireporting', sfireporting._SfReportingContainer);
|
|
14733
|
+
sfireporting.loadMode();
|
|
14734
|
+
}, 500);
|
|
14773
14735
|
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
|
|
14778
|
-
|
|
14779
|
-
|
|
14736
|
+
sfireporting.addEventListener('valueChanged', () => {
|
|
14737
|
+
sfireporting.classList.remove('hide');
|
|
14738
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#shimmer-container-agreements') as HTMLDivElement).classList.add('hide');
|
|
14739
|
+
});
|
|
14740
|
+
let reportingSchemaJson = "";
|
|
14741
|
+
let reportingSchemaValues = ""
|
|
14742
|
+
if (listEvent.reportformatschema != null) {
|
|
14743
|
+
reportingSchemaJson = listEvent.reportformatschema
|
|
14744
|
+
reportingSchemaValues = listEvent.reportformatvalues
|
|
14745
|
+
} else if (listEvent.customreporting != null) {
|
|
14746
|
+
reportingSchemaJson = listEvent.customreporting
|
|
14747
|
+
}
|
|
14748
|
+
if (listEvent.customreporting != null || listEvent.reportformatschema != null) {
|
|
14749
|
+
let reportingHtml = '<sf-i-reporting id="reporting-reporting" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-textarea-disabled:reporting-input-textarea-disabled, input-date:reporting-input-date, input-date-disabled:reporting-input-date-disabled, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head, reporting-uploader-extracted-text:reporting-reporting-uploader-extracted-text, reporting-uploader-sf-upload-message:reporting-reporting-uploader-sf-upload-message, reporting-uploader-sf-upload-submessage:reporting-reporting-uploader-sf-upload-submessage, reporting-uploader-extracted-text-chip:reporting-reporting-uploader-extracted-text-chip, reporting-uploader-extracted-text-chip-failed:reporting-reporting-uploader-extracted-text-chip-failed, reporting-uploader-doctype-verify-badge:reporting-reporting-uploader-doctype-verify-badge, reporting-span-submit-published:reporting-reporting-span-submit-published, reporting-span-submit-unpublished:reporting-reporting-span-submit-unpublished, reporting-reporting-container:reporting-reporting-reporting-container, reporting-button-icon:reporting-reporting-button-icon, reporting-uploader-button-icon:reporting-reporting-uploader-button-icon, reporting-sf-i-form-modal-container:reporting-reporting-sf-i-form-modal-container, reporting-next-calendar-date:reporting-reporting-next-calendar-date, reporting-last-calendar-date:reporting-reporting-last-calendar-date, reporting-input-publish-checkbox:reporting-reporting-input-publish-checkbox, reporting-button-icon-light:reporting-reporting-button-icon-light, reporting-button-icon-small:reporting-reporting-button-icon-small, reporting-uploader-input-label:reporting-reporting-uploader-input-label, reporting-input-radio:reporting-reporting-input-radio, reporting-radio-label:reporting-reporting-radio-label, reporting-input-textarea:reporting-reporting-input-textarea, reporting-input-textarea-disabled:reporting-reporting-input-textarea-disabled, reporting-input-date:reporting-reporting-input-date, reporting-input-date-disabled:reporting-reporting-input-date-disabled, reporting-input-select-single:reporting-reporting-input-select-single, reporting-textarea-container:reporting-reporting-textarea-container, reporting-section-body:reporting-reporting-section-body, reporting-section-container:reporting-reporting-section-container, reporting-date-container:reporting-reporting-date-container, reporting-input-sf-i-uploader:reporting-reporting-input-sf-i-uploader, reporting-published-container:reporting-reporting-published-container, reporting-selected-option:reporting-reporting-selected-option, reporting-input-select-multi-option:reporting-reporting-input-select-multi-option, reporting-select-option-label:reporting-reporting-select-option-label, reporting-input-sf-i-form:reporting-reporting-input-sf-i-form, reporting-input-sf-i-bricks:reporting-reporting-input-sf-i-bricks, reporting-uploader-input:reporting-reporting-uploader-input, reporting-form-container:reporting-reporting-form-container, reporting-published-container:reporting-reporting-published-container, reporting-form-container-published:reporting-reporting-form-container-published, reporting-subsection:reporting-reporting-subsection, reporting-results-title:reporting-reporting-results-title, reporting-td-head:reporting-reporting-td-head, reporting-td-action:reporting-reporting-td-action, reporting-td-body:reporting-reporting-td-body, reporting-td-body-2:reporting-reporting-td-body-2, reporting-add-button:reporting-reporting-add-button, reporting-uploader-button:reporting-reporting-uploader-button, reporting-section-head-collapsed:reporting-reporting-section-head-collapsed, reporting-section-title-expanded:reporting-reporting-section-title-expanded, reporting-section-title-collapsed:reporting-reporting-section-title-collapsed, reporting-section-head-expanded:reporting-reporting-section-head-expanded, reporting-progress-bar-finished:reporting-reporting-progress-bar-finished, reporting-progress-bar-complete:reporting-reporting-progress-bar-complete, reporting-progress-bar-incomplete:reporting-reporting-progress-bar-incomplete, reporting-section-success-icon:reporting-reporting-section-success-icon, reporting-section-body:reporting-reporting-section-body, reporting-title-section:reporting-reporting-title-section, reporting-button-lg:reporting-reporting-button-lg, reporting-uploader-detail-container:reporting-reporting-uploader-detail-container, reporting-textarea-label:reporting-reporting-textarea-label, reporting-date-label:reporting-reporting-date-label, reporting-commentbox:reporting-reporting-commentbox, reporting-comment-username:reporting-reporting-comment-username, reporting-detail-head:reporting-reporting-detail-head, input-sf-i-select:reporting-input-sf-i-select,reporting-input-sf-i-select:reporting-reporting-input-sf-i-select, select-input-select:reporting-select-input-select, checklist-container:reporting-checklist-container, checklist-title:reporting-checklist-title, checklist-list:reporting-checklist-list, checklist-item:reporting-checklist-item, checklist-checkbox:reporting-checklist-checkbox, checklist-checkbox-label:reporting-checklist-checkbox-label, reporting-checklist-container:reporting-reporting-checklist-container, reporting-checklist-title:reporting-reporting-checklist-title, reporting-checklist-list:reporting-reporting-checklist-list, reporting-checklist-item:reporting-reporting-checklist-item, reporting-checklist-checkbox:reporting-reporting-checklist-checkbox, reporting-checklist-checkbox-label:reporting-reporting-checklist-checkbox-label, checklist-add-input:reporting-checklist-add-input, checklist-add-button:reporting-checklist-add-button, terminate-container:reporting-terminate-container, terminate-container-terminated:reporting-terminate-container-terminated, terminate-container-active:reporting-terminate-container-active, input-terminate-checkbox: reporting-input-terminate-checkbox, reporting-terminate-container:reporting-reporting-terminate-container, reporting-terminate-container-terminated:reporting-reporting-terminate-container-terminated, reporting-terminate-container-active:reporting-reporting-terminate-container-active, reporting-input-terminate-checkbox: reporting-reporting-input-terminate-checkbox, uploader-container:reporting-uploader-container, reporting-uploader-container:reporting-reporting-uploader-container, not-selected:reporting-not-selected, reporting-not-selected:reportinig-reporting-not-selected" mode="edit" flow="reporting" name="Contract Reporting" formviewclass="flex-wrap" showterminate="true" projectid="' + this.projectId + '"></sf-i-reporting>'
|
|
14750
|
+
|
|
14751
|
+
let reportFormatContainer = (this._SfDetailContainer as HTMLDivElement).querySelector('#report-format-container') as HTMLDivElement;
|
|
14752
|
+
if (reportFormatContainer != null) {
|
|
14753
|
+
reportFormatContainer.innerHTML = reportingHtml;
|
|
14754
|
+
}
|
|
14755
|
+
|
|
14756
|
+
}
|
|
14757
|
+
let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
|
|
14758
|
+
|
|
14759
|
+
if (reportingSchemaJson != "" && reportingReporting != null) {
|
|
14760
|
+
reportingReporting.configjson = reportingSchemaJson;
|
|
14761
|
+
if (reportingSchemaValues != "") reportingReporting.prepopulateValJson = reportingSchemaValues
|
|
14762
|
+
reportingReporting.mode = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "edit" : "view"
|
|
14763
|
+
reportingReporting.editdisable = (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) ? "false" : "true"
|
|
14764
|
+
reportingReporting.flow = "reporting"
|
|
14765
|
+
setTimeout(() => {
|
|
14766
|
+
reportingReporting.loadMode();
|
|
14767
|
+
console.log('list-customreporting', reportingSchemaJson);
|
|
14768
|
+
console.log('list-customreporting1', reportingSchemaValues);
|
|
14769
|
+
console.log('list-customreporting2', reportingReporting.mode);
|
|
14770
|
+
}, 500)
|
|
14771
|
+
}
|
|
14772
|
+
|
|
14773
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close')?.addEventListener('click', () => {
|
|
14774
|
+
|
|
14775
|
+
(this._SfDetailContainer as HTMLDivElement).innerHTML = '';
|
|
14776
|
+
(this._SfDetailContainer as HTMLDivElement).style.display = 'none';
|
|
14777
|
+
|
|
14778
|
+
});
|
|
14779
|
+
|
|
14780
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('.button-delete')?.addEventListener('click', async () => {
|
|
14781
|
+
|
|
14782
|
+
// await this.fetchDeleteReview(listEvent["id"], mmddyyyy, entityId, locationId);
|
|
14783
|
+
// this.setSuccess('Deleted successfully!')
|
|
14784
|
+
// setTimeout(() => {
|
|
14785
|
+
// this.clearMessages()
|
|
14786
|
+
// }, 3000);
|
|
14787
|
+
// //console.log('deleted', resultDelete);
|
|
14788
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
14789
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
14790
|
+
// } else {
|
|
14791
|
+
// if(currentColumnButton != null) {
|
|
14792
|
+
// currentColumnButton.click();
|
|
14793
|
+
// }
|
|
14794
|
+
// }
|
|
14795
|
+
|
|
14796
|
+
console.log('delete review clicked')
|
|
14797
|
+
|
|
14798
|
+
var clickEvent = new MouseEvent("click", {
|
|
14799
|
+
"view": window,
|
|
14800
|
+
"bubbles": true,
|
|
14801
|
+
"cancelable": false
|
|
14802
|
+
});
|
|
14803
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
14804
|
+
|
|
14805
|
+
});
|
|
14806
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-auto-approve')?.addEventListener('click', async () => {
|
|
14807
|
+
if (this.selectedItemIds.length === 0) {
|
|
14808
|
+
console.log('audto approve single')
|
|
14809
|
+
} else {
|
|
14810
|
+
console.log('auto approve bulk')
|
|
14811
|
+
}
|
|
14812
|
+
//console.log('deleted', resultDelete);
|
|
14813
|
+
if (this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
14814
|
+
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
14815
|
+
} else {
|
|
14816
|
+
// if(currentColumnButton != null) {
|
|
14817
|
+
// currentColumnButton.click();
|
|
14818
|
+
// }
|
|
14819
|
+
}
|
|
14820
|
+
|
|
14821
|
+
var clickEvent = new MouseEvent("click", {
|
|
14822
|
+
"view": window,
|
|
14823
|
+
"bubbles": true,
|
|
14824
|
+
"cancelable": false
|
|
14825
|
+
});
|
|
14826
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
14827
|
+
|
|
14828
|
+
});
|
|
14829
|
+
|
|
14830
|
+
if (this.mode == "consumer" || this.mode == "next") {
|
|
14831
|
+
|
|
14832
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-approve')?.addEventListener('click', async (ev: any) => {
|
|
14833
|
+
let buttonClick = ev.target as HTMLButtonElement
|
|
14834
|
+
buttonClick.innerHTML = "Saving..."
|
|
14835
|
+
const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approver-comments') as HTMLInputElement).value;
|
|
14836
|
+
const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
|
|
14837
|
+
let currStatus = this.getCompletenessStatus(listEvent);
|
|
14838
|
+
let newEvent = { ...listEvent };
|
|
14839
|
+
newEvent.comments = comments;
|
|
14840
|
+
newEvent.approved = approved;
|
|
14841
|
+
let newStatus = this.getCompletenessStatus(newEvent);
|
|
14842
|
+
if (currStatus == newStatus) {
|
|
14843
|
+
buttonClick.innerHTML = "Save"
|
|
14844
|
+
this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
|
|
14845
|
+
setTimeout(() => {
|
|
14846
|
+
this.clearMessages();
|
|
14847
|
+
}, 3000);
|
|
14848
|
+
return;
|
|
14849
|
+
}
|
|
14850
|
+
let reportformatvalues = ""
|
|
14851
|
+
let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
|
|
14852
|
+
console.log('renew reporting', reportingReporting)
|
|
14853
|
+
if (reportingReporting != null) {
|
|
14854
|
+
reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
|
|
14855
|
+
}
|
|
14856
|
+
var clickEvent = new MouseEvent("click", {
|
|
14857
|
+
"view": window,
|
|
14858
|
+
"bubbles": true,
|
|
14859
|
+
"cancelable": false
|
|
14860
|
+
});
|
|
14861
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
14862
|
+
|
|
14863
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, event["id"], comments, approved)
|
|
14864
|
+
let flagBulk = false;
|
|
14865
|
+
if (this.selectedItemIds.length <= 1) {
|
|
14866
|
+
console.log('mmddyyyy', mmddyyyy)
|
|
14867
|
+
if (await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
|
|
14868
|
+
if (approved) {
|
|
14869
|
+
await this.renewContract(listEvent, reportformatvalues);
|
|
14870
|
+
} else {
|
|
14871
|
+
console.log('renew reporting', reportformatvalues)
|
|
14872
|
+
}
|
|
14873
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14874
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14875
|
+
this.events[mmdd][p].approved = approved
|
|
14876
|
+
this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
|
|
14877
|
+
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
|
|
14878
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
14879
|
+
}
|
|
14880
|
+
}
|
|
14881
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
14882
|
+
this.recentlyReported[mmdd] = []
|
|
14883
|
+
}
|
|
14884
|
+
this.recentlyReported[mmdd].push(listEvent)
|
|
14885
|
+
console.log('review single')
|
|
14886
|
+
}
|
|
14887
|
+
} else {
|
|
14888
|
+
let bulkBodyReview = []
|
|
14889
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14890
|
+
|
|
14891
|
+
const selectedId = this.selectedItemIds[k];
|
|
14892
|
+
//console.log('selectedid', selectedId);
|
|
14893
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14894
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14895
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14896
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14897
|
+
|
|
14898
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
14899
|
+
bulkBodyReview.push({
|
|
14900
|
+
"mmddyyyy": mmddyyyy,
|
|
14901
|
+
"projectid": this.projectId,
|
|
14902
|
+
"type": "review",
|
|
14903
|
+
"eventid": eventId,
|
|
14904
|
+
"comments": comments,
|
|
14905
|
+
"approved": approved,
|
|
14906
|
+
"entityid": entityId,
|
|
14907
|
+
"locationid": locationId,
|
|
14908
|
+
"username": this.userName,
|
|
14909
|
+
"userid": this.userProfileId,
|
|
14910
|
+
"userrole": this.myRole,
|
|
14911
|
+
"year": this.calendarStartYYYY,
|
|
14912
|
+
"module": listEvent.module ?? "events"
|
|
14913
|
+
})
|
|
14914
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, comments, approved)
|
|
14915
|
+
|
|
14916
|
+
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
14917
|
+
// await this.sleep(2000);
|
|
14918
|
+
// this.clearMessages();
|
|
14919
|
+
|
|
14920
|
+
}
|
|
14921
|
+
await this.uploadReviewsBulk(bulkBodyReview);
|
|
14922
|
+
|
|
14923
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
14924
|
+
|
|
14925
|
+
const selectedId = this.selectedItemIds[k];
|
|
14926
|
+
//console.log('selectedid', selectedId);
|
|
14927
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
14928
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
14929
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
14930
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
14931
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
14932
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
14933
|
+
if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
14934
|
+
|
|
14935
|
+
this.events[mmdd][p].isbulk = true
|
|
14936
|
+
flagBulk = true;
|
|
14937
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
14938
|
+
this.recentlyReported[mmdd] = []
|
|
14939
|
+
}
|
|
14940
|
+
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
14941
|
+
}
|
|
14942
|
+
}
|
|
14943
|
+
}
|
|
14944
|
+
console.log('review bulk')
|
|
14945
|
+
}
|
|
14946
|
+
|
|
14947
|
+
if (this.mode == "next") {
|
|
14948
|
+
// this.fetchNext(this.nextPage)
|
|
14949
|
+
this.renderRoleTabsNext(this.nextPage)
|
|
14950
|
+
} else {
|
|
14951
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
14952
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
14953
|
+
// } else
|
|
14954
|
+
if (this.getCurrentTab() == this.TAB_FIND) {
|
|
14955
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
14956
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
14957
|
+
} else {
|
|
14958
|
+
if (this.selectedItemIds.length > 0) {
|
|
14959
|
+
await this.fetchBulkReportingData();
|
|
14960
|
+
}
|
|
14961
|
+
this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
|
|
14962
|
+
var clickEvent = new MouseEvent("click", {
|
|
14963
|
+
"view": window,
|
|
14964
|
+
"bubbles": true,
|
|
14965
|
+
"cancelable": false
|
|
14966
|
+
});
|
|
14967
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)?.dispatchEvent(clickEvent);
|
|
14968
|
+
|
|
14969
|
+
// if(currentColumnButton != null) {
|
|
14970
|
+
// currentColumnButton.click();
|
|
14971
|
+
// }
|
|
14972
|
+
}
|
|
14973
|
+
}
|
|
14974
|
+
|
|
14975
|
+
});
|
|
14976
|
+
|
|
14977
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-audit')?.addEventListener('click', async (ev: any) => {
|
|
14978
|
+
let buttonClick = ev.target as HTMLButtonElement
|
|
14979
|
+
buttonClick.innerHTML = "Saving..."
|
|
14980
|
+
const comments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-auditor-comments') as HTMLInputElement).value;
|
|
14981
|
+
const approved = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked;
|
|
14982
|
+
let currStatus = this.getCompletenessStatus(listEvent);
|
|
14983
|
+
let newEvent = { ...listEvent };
|
|
14984
|
+
newEvent.comments = comments;
|
|
14985
|
+
newEvent.approved = approved;
|
|
14986
|
+
let newStatus = this.getCompletenessStatus(newEvent);
|
|
14987
|
+
if (currStatus == newStatus) {
|
|
14988
|
+
buttonClick.innerHTML = "Save"
|
|
14989
|
+
this.setError(approved ? 'Already Approved!' : 'Already Rejected!');
|
|
14990
|
+
setTimeout(() => {
|
|
14991
|
+
this.clearMessages();
|
|
14992
|
+
}, 3000);
|
|
14993
|
+
return;
|
|
14994
|
+
}
|
|
14995
|
+
if (comments.trim().length === 0) {
|
|
14996
|
+
buttonClick.innerHTML = "Save"
|
|
14997
|
+
this.setError('Comments cannot be blank!');
|
|
14998
|
+
setTimeout(() => {
|
|
14999
|
+
this.clearMessages();
|
|
15000
|
+
}, 3000);
|
|
15001
|
+
|
|
15002
|
+
} else {
|
|
15003
|
+
let flagBulk = false;
|
|
15004
|
+
if (this.selectedItemIds.length <= 1) {
|
|
15005
|
+
|
|
15006
|
+
if (await this.uploadAudit(entityId, locationId, mmddyyyy, listEvent["id"], comments, approved, listEvent.module ?? "events")) {
|
|
15007
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15008
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
15009
|
+
this.events[mmdd][p].approved = approved
|
|
15010
|
+
this.events[mmdd][p].comments.push({ 'author': 'Auditor', 'comment': comments + ` (Approved: ${approved ? 'Yes' : 'No'})`, 'timestamp': new Date().toString() })
|
|
15011
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
15012
|
+
}
|
|
15013
|
+
}
|
|
15014
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
15015
|
+
this.recentlyReported[mmdd] = []
|
|
15016
|
+
}
|
|
15017
|
+
this.recentlyReported[mmdd].push(listEvent)
|
|
15018
|
+
}
|
|
15019
|
+
console.log('uploadaudit single')
|
|
15020
|
+
} else {
|
|
15021
|
+
let bulkBodyAudit = []
|
|
15022
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
15023
|
+
|
|
15024
|
+
const selectedId = this.selectedItemIds[k];
|
|
15025
|
+
//console.log('selectedid', selectedId);
|
|
15026
|
+
|
|
15027
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
15028
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
15029
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
15030
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
15031
|
+
|
|
15032
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
15033
|
+
bulkBodyAudit.push({
|
|
15034
|
+
"mmddyyyy": mmddyyyy,
|
|
15035
|
+
"projectid": this.projectId,
|
|
15036
|
+
"type": "audit",
|
|
15037
|
+
"eventid": eventId,
|
|
15038
|
+
"comments": comments,
|
|
15039
|
+
"approved": approved,
|
|
15040
|
+
"entityid": entityId,
|
|
15041
|
+
"locationid": locationId,
|
|
15042
|
+
"username": this.userName,
|
|
15043
|
+
"userid": this.userProfileId,
|
|
15044
|
+
"userrole": this.myRole,
|
|
15045
|
+
"year": this.calendarStartYYYY,
|
|
15046
|
+
"module": listEvent.module ?? "events"
|
|
15047
|
+
})
|
|
15048
|
+
// await this.uploadAudit(entityId, locationId, mmddyyyy, eventId, comments, approved);
|
|
15049
|
+
|
|
15050
|
+
}
|
|
15051
|
+
|
|
15052
|
+
await this.uploadAuditsBulk(bulkBodyAudit);
|
|
15053
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
15054
|
+
|
|
15055
|
+
const selectedId = this.selectedItemIds[k];
|
|
15056
|
+
//console.log('selectedid', selectedId);
|
|
15057
|
+
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
15058
|
+
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
15059
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
15060
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
15061
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
15062
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15063
|
+
if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
15064
|
+
|
|
15065
|
+
this.events[mmdd][p].isbulk = true
|
|
15066
|
+
flagBulk = true;
|
|
15067
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
15068
|
+
this.recentlyReported[mmdd] = []
|
|
15069
|
+
}
|
|
15070
|
+
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
15071
|
+
}
|
|
15072
|
+
}
|
|
15073
|
+
}
|
|
15074
|
+
|
|
15075
|
+
console.log('uploadAudit bulk')
|
|
15076
|
+
|
|
15077
|
+
}
|
|
15078
|
+
|
|
15079
|
+
var clickEvent = new MouseEvent("click", {
|
|
15080
|
+
"view": window,
|
|
15081
|
+
"bubbles": true,
|
|
15082
|
+
"cancelable": false
|
|
15083
|
+
});
|
|
15084
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
15085
|
+
if (this.mode == "next") {
|
|
15086
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
15087
|
+
} else {
|
|
15088
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
15089
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
15090
|
+
// } else
|
|
15091
|
+
if (this.getCurrentTab() == this.TAB_FIND) {
|
|
15092
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
15093
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
15094
|
+
} else {
|
|
15095
|
+
if (this.selectedItemIds.length > 0) {
|
|
15096
|
+
await this.fetchBulkReportingData();
|
|
15097
|
+
}
|
|
15098
|
+
this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk);
|
|
15099
|
+
// if(currentColumnButton != null) {
|
|
15100
|
+
// currentColumnButton.click();
|
|
15101
|
+
// }
|
|
15102
|
+
}
|
|
15103
|
+
}
|
|
15104
|
+
|
|
15105
|
+
}
|
|
15106
|
+
|
|
15107
|
+
|
|
15108
|
+
|
|
15109
|
+
});
|
|
15110
|
+
|
|
15111
|
+
if (this.myRole == this.TAB_REPORTER || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
15112
|
+
|
|
15113
|
+
if (approved) {
|
|
15114
|
+
|
|
15115
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
|
|
15116
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'hidden';
|
|
15117
|
+
}
|
|
15118
|
+
|
|
15119
|
+
|
|
15120
|
+
} else {
|
|
15121
|
+
|
|
15122
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement) != null) {
|
|
15123
|
+
|
|
15124
|
+
|
|
15125
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report') as HTMLElement).style.visibility = 'visible';
|
|
15126
|
+
|
|
15127
|
+
(this._SfDetailContainer as HTMLDivElement).querySelector('#button-uploader-submit-report')?.addEventListener('click', async (ev: any) => {
|
|
15128
|
+
let buttonClick = ev.target as HTMLButtonElement
|
|
15129
|
+
buttonClick.innerHTML = "Saving..."
|
|
15130
|
+
const reportercomments = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-comments') as HTMLInputElement).value;
|
|
15131
|
+
|
|
15132
|
+
//console.log('reporter comments 1', reportercomments);
|
|
15133
|
+
|
|
15134
|
+
// const reporterdoc = ((((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement) != null) && ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value.length > 0) ? (new Date(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-doc') as HTMLInputElement).value).getTime() + "") : "";
|
|
15135
|
+
const reporterdoc = new Date().getTime() + "";
|
|
15136
|
+
let docs: any[] = [];
|
|
15137
|
+
|
|
15138
|
+
//console.log('reporter comments 2', reportercomments);
|
|
15139
|
+
|
|
15140
|
+
// if(docsOptional.length === 0) {
|
|
15141
|
+
// docs = (this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.selectedValues();
|
|
15142
|
+
// }
|
|
15143
|
+
|
|
15144
|
+
//console.log('docs', docs);
|
|
15145
|
+
let reportformatvalues: string = "";
|
|
15146
|
+
let reportformatschema: string = "";
|
|
15147
|
+
if (listEvent.customreporting != null) {
|
|
15148
|
+
let reportingReporting = (this._SfDetailContainer as HTMLDivElement).querySelector('#reporting-reporting') as SfIReporting
|
|
15149
|
+
console.log('reportformatvalues', JSON.stringify(reportingReporting.selectedValues()))
|
|
15150
|
+
reportformatvalues = JSON.stringify(reportingReporting!.selectedValues()) ?? "";
|
|
15151
|
+
reportformatschema = reportingReporting!.configjson ?? "";
|
|
15152
|
+
}
|
|
15153
|
+
|
|
15154
|
+
let percentage: string = "100";
|
|
15155
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null) {
|
|
15156
|
+
percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
|
|
15157
|
+
}
|
|
15158
|
+
// if (Number.isNaN(parseInt(percentage)) || parseInt(percentage) < 0 || parseInt(percentage) > 100) {
|
|
15159
|
+
|
|
15160
|
+
// //console.log('reporter comments 3', reportercomments);
|
|
15161
|
+
// buttonClick.innerHTML = "Save"
|
|
15162
|
+
// this.setError('Invalid Percentage!');
|
|
15163
|
+
// setTimeout(() => {
|
|
15164
|
+
// this.clearMessages();
|
|
15165
|
+
// }, 3000);
|
|
15166
|
+
|
|
15167
|
+
// } else {
|
|
15168
|
+
// if (docs.length === 0 && docsOptional.length === 0) {
|
|
15169
|
+
|
|
15170
|
+
// //console.log('reporter comments 3', reportercomments);
|
|
15171
|
+
// buttonClick.innerHTML = "Save"
|
|
15172
|
+
// this.setError('No documents uploaded!');
|
|
15173
|
+
// setTimeout(() => {
|
|
15174
|
+
// this.clearMessages();
|
|
15175
|
+
// }, 3000);
|
|
15176
|
+
|
|
15177
|
+
// } else {
|
|
15178
|
+
|
|
15179
|
+
// //console.log('reporterdoc', reporterdoc);
|
|
15180
|
+
|
|
15181
|
+
// if (reporterdoc.length === 0) {
|
|
15182
|
+
// buttonClick.innerHTML = "Save"
|
|
15183
|
+
// this.setError('Date of completion not selected!');
|
|
15184
|
+
// setTimeout(() => {
|
|
15185
|
+
// this.clearMessages();
|
|
15186
|
+
// }, 3000);
|
|
15187
|
+
|
|
15188
|
+
// } else if (parseInt(reporterdoc) > new Date().getTime()) {
|
|
15189
|
+
// buttonClick.innerHTML = "Save"
|
|
15190
|
+
// this.setError('Date of completion cannot be in future!');
|
|
15191
|
+
// setTimeout(() => {
|
|
15192
|
+
// this.clearMessages();
|
|
15193
|
+
// }, 3000);
|
|
15194
|
+
|
|
15195
|
+
// } else {
|
|
15196
|
+
|
|
15197
|
+
//console.log('makerscheckers 1', reportercomments);
|
|
15198
|
+
|
|
15199
|
+
if (reportercomments.trim().length === 0) {
|
|
15200
|
+
buttonClick.innerHTML = "Save"
|
|
15201
|
+
this.setError('Comments cannot be blank!');
|
|
15202
|
+
setTimeout(() => {
|
|
15203
|
+
this.clearMessages();
|
|
15204
|
+
}, 3000);
|
|
15205
|
+
|
|
15206
|
+
} else {
|
|
15207
|
+
|
|
15208
|
+
|
|
15209
|
+
var clickEvent = new MouseEvent("click", {
|
|
15210
|
+
"view": window,
|
|
15211
|
+
"bubbles": true,
|
|
15212
|
+
"cancelable": false
|
|
15213
|
+
});
|
|
15214
|
+
|
|
15215
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#button-detail-close') as HTMLButtonElement)!.dispatchEvent(clickEvent);
|
|
15216
|
+
let flagBulk = false;
|
|
15217
|
+
if (this.selectedItemIds.length <= 1) {
|
|
15218
|
+
|
|
15219
|
+
if (await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, listEvent.module, percentage, makercheckers)) {
|
|
15220
|
+
console.log('this.events', this.events);
|
|
15221
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15222
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
15223
|
+
this.events[mmdd][p].documents = docs
|
|
15224
|
+
this.events[mmdd][p].comments.push({ 'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString() })
|
|
15225
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
15226
|
+
}
|
|
15227
|
+
}
|
|
15228
|
+
console.log('uploadReport single')
|
|
15229
|
+
if (makercheckers.length > 0) {
|
|
15230
|
+
|
|
15231
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, listEvent["id"], "Auto approved", true, "notices");
|
|
15232
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15233
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
15234
|
+
this.events[mmdd][p].approved = true
|
|
15235
|
+
this.events[mmdd][p].terminated = (JSON.parse(reportformatvalues).terminated) ?? false
|
|
15236
|
+
// this.events[mmdd][p].documents = docs
|
|
15237
|
+
this.events[mmdd][p].comments.push({ 'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString() })
|
|
15238
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
15239
|
+
}
|
|
15240
|
+
}
|
|
15241
|
+
await this.renewContract(listEvent, reportformatvalues);
|
|
15242
|
+
console.log('upload report auto approve single')
|
|
15243
|
+
}
|
|
15244
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
15245
|
+
this.recentlyReported[mmdd] = []
|
|
15246
|
+
}
|
|
15247
|
+
this.recentlyReported[mmdd].push(listEvent)
|
|
15248
|
+
}
|
|
15249
|
+
} else {
|
|
15250
|
+
let bulkBody = []
|
|
15251
|
+
let bulkBodyReview = []
|
|
15252
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
15253
|
+
|
|
15254
|
+
const selectedId = this.selectedItemIds[k];
|
|
15255
|
+
//console.log('selectedid', selectedId);
|
|
15256
|
+
|
|
15257
|
+
const makercheckersL = selectedId.split('-')[5];
|
|
15258
|
+
entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
15259
|
+
locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
15260
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
15261
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
15262
|
+
|
|
15263
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
15264
|
+
|
|
15265
|
+
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
15266
|
+
// if(parseInt(makercheckersL) > 0) {
|
|
15267
|
+
// bulkBodyReview.push({
|
|
15268
|
+
// "mmddyyyy": mmddyyyy,
|
|
15269
|
+
// "projectid": this.projectId,
|
|
15270
|
+
// "type": "report",
|
|
15271
|
+
// "eventid": eventId,
|
|
15272
|
+
// "comments": reportercomments,
|
|
15273
|
+
// "dateofcompletion": reporterdoc,
|
|
15274
|
+
// "percentage": percentage,
|
|
15275
|
+
// "entityid": entityId,
|
|
15276
|
+
// "locationid": locationId,
|
|
15277
|
+
// "event": null,
|
|
15278
|
+
// "docs": JSON.stringify(docs),
|
|
15279
|
+
// "approved": true,
|
|
15280
|
+
// "username": this.userName,
|
|
15281
|
+
// "reportformatvalues": reportformatvalues,
|
|
15282
|
+
// "reportformatschema": reportformatschema,
|
|
15283
|
+
// "userid": this.userProfileId,
|
|
15284
|
+
// "userrole": this.myRole,
|
|
15285
|
+
// "year": this.calendarStartYYYY,
|
|
15286
|
+
// "module": listEvent.module ?? "events"
|
|
15287
|
+
// } )
|
|
15288
|
+
// // await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
15289
|
+
|
|
15290
|
+
// }else{
|
|
15291
|
+
bulkBody.push({
|
|
15292
|
+
"mmddyyyy": mmddyyyy,
|
|
15293
|
+
"projectid": this.projectId,
|
|
15294
|
+
"type": "report",
|
|
15295
|
+
"eventid": eventId,
|
|
15296
|
+
"comments": reportercomments,
|
|
15297
|
+
"dateofcompletion": reporterdoc,
|
|
15298
|
+
"percentage": percentage,
|
|
15299
|
+
"entityid": entityId,
|
|
15300
|
+
"locationid": locationId,
|
|
15301
|
+
"event": null,
|
|
15302
|
+
"docs": JSON.stringify(docs),
|
|
15303
|
+
"username": this.userName,
|
|
15304
|
+
"reportformatvalues": reportformatvalues,
|
|
15305
|
+
"reportformatschema": reportformatschema,
|
|
15306
|
+
"userid": this.userProfileId,
|
|
15307
|
+
"userrole": this.myRole,
|
|
15308
|
+
"year": this.calendarStartYYYY,
|
|
15309
|
+
"module": listEvent.module ?? "events",
|
|
15310
|
+
"makercheckers": (parseInt(makercheckersL) > 0) ? ["makercheckers"] : null
|
|
15311
|
+
})
|
|
15312
|
+
// }
|
|
15313
|
+
|
|
15314
|
+
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
15315
|
+
// await this.sleep(2000);
|
|
15316
|
+
// this.clearMessages();
|
|
15317
|
+
|
|
15318
|
+
}
|
|
15319
|
+
|
|
15320
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
15321
|
+
// await this.fetchBulkReportingData();
|
|
15322
|
+
if (bulkBody.length > 0) {
|
|
15323
|
+
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
15324
|
+
}
|
|
15325
|
+
|
|
15326
|
+
// if(bulkBodyReview.length > 0){
|
|
15327
|
+
// await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
15328
|
+
// }
|
|
15329
|
+
await this.fetchBulkReportingData();
|
|
15330
|
+
console.log('uploadReport bulk')
|
|
15331
|
+
for (var k = 0; k < this.selectedItemIds.length; k++) {
|
|
15332
|
+
|
|
15333
|
+
const selectedId = this.selectedItemIds[k];
|
|
15334
|
+
//console.log('selectedid', selectedId);
|
|
15335
|
+
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
15336
|
+
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
15337
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
15338
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
15339
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
15340
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15341
|
+
if (this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId) {
|
|
15342
|
+
|
|
15343
|
+
this.events[mmdd][p].isbulk = true
|
|
15344
|
+
flagBulk = true;
|
|
15345
|
+
if (this.recentlyReported[mmdd] == null) {
|
|
15346
|
+
this.recentlyReported[mmdd] = []
|
|
15347
|
+
}
|
|
15348
|
+
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
15349
|
+
}
|
|
15350
|
+
}
|
|
15351
|
+
}
|
|
15352
|
+
|
|
15353
|
+
}
|
|
15354
|
+
|
|
15355
|
+
if (this.mode == "next") {
|
|
15356
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
15357
|
+
} else {
|
|
15358
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
15359
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
15360
|
+
// } else
|
|
15361
|
+
if (this.getCurrentTab() == this.TAB_FIND) {
|
|
15362
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
15363
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
15364
|
+
} else {
|
|
15365
|
+
if (this.selectedItemIds.length > 0) {
|
|
15366
|
+
await this.fetchBulkReportingData();
|
|
15367
|
+
}
|
|
15368
|
+
this.renderAppropriateStream(this.sdate, this.edate, true, flagBulk)
|
|
15369
|
+
// if(currentColumnButton != null) {
|
|
15370
|
+
// currentColumnButton.click();
|
|
15371
|
+
// }
|
|
15372
|
+
}
|
|
15373
|
+
}
|
|
15374
|
+
|
|
15375
|
+
}
|
|
15376
|
+
|
|
15377
|
+
|
|
15378
|
+
// }
|
|
15379
|
+
// }
|
|
15380
|
+
// }
|
|
15381
|
+
});
|
|
15382
|
+
|
|
15383
|
+
}
|
|
15384
|
+
|
|
15385
|
+
}
|
|
15386
|
+
|
|
15387
|
+
}
|
|
15388
|
+
|
|
15389
|
+
if (this._SfUploader[0] != null) {
|
|
15390
|
+
(this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
|
|
15391
|
+
this._SfUploader[0].querySelector('#uploader').addEventListener('analysisInProgress', (_ev: any) => {
|
|
15392
|
+
console.log('uploader analysisInProgress', _ev);
|
|
15393
|
+
(this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "block"
|
|
15394
|
+
});
|
|
15395
|
+
this._SfUploader[0].querySelector('#uploader').addEventListener('analysisCompleted', (_ev: any) => {
|
|
15396
|
+
console.log('uploader analysisInProgress', _ev);
|
|
15397
|
+
(this._SfDetailContainer.querySelector('.uploader-analysis-message') as HTMLDivElement).style.display = "none"
|
|
15398
|
+
});
|
|
15399
|
+
|
|
15400
|
+
|
|
15401
|
+
//console.log('documentType checking', documentType);
|
|
15402
|
+
|
|
15403
|
+
if (documentType != null) {
|
|
15404
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.docType = documentType;
|
|
15405
|
+
}
|
|
15406
|
+
|
|
15407
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify([]);
|
|
15408
|
+
console.log('uploader', (this._SfUploader[0].querySelector('#uploader') as SfIUploader));
|
|
15409
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
15410
|
+
|
|
15411
|
+
if (docs.length > 0) {
|
|
15412
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.prepopulatedInputArr = JSON.stringify(docs);
|
|
15413
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
15414
|
+
}
|
|
15415
|
+
|
|
15416
|
+
if (this.myRole == this.TAB_APPROVER || approved) {
|
|
15417
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = true;
|
|
15418
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
15419
|
+
} else {
|
|
15420
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.readOnly = false;
|
|
15421
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
15422
|
+
}
|
|
15423
|
+
|
|
15424
|
+
const dataPassthrough = {
|
|
15425
|
+
projectId: this.projectId,
|
|
15426
|
+
countryId: this.countryId,
|
|
15427
|
+
entityId: listEvent.entityid,
|
|
15428
|
+
locationId: listEvent.locationid,
|
|
15429
|
+
mmddyyyy: mmddyyyy,
|
|
15430
|
+
complianceId: listEvent['id'],
|
|
15431
|
+
path: "uploadextract"
|
|
15432
|
+
};
|
|
15433
|
+
|
|
15434
|
+
const callbackUrlHost = "8icpy39ru0.execute-api.us-east-1.amazonaws.com";
|
|
15435
|
+
const callbackUrlPath = "test/uploadextract";
|
|
15436
|
+
|
|
15437
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.projectId = this.projectId;
|
|
15438
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.dataPassthrough = JSON.stringify(dataPassthrough);
|
|
15439
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlHost = callbackUrlHost;
|
|
15440
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.callbackUrlPath = callbackUrlPath;
|
|
15441
|
+
(this._SfUploader[0].querySelector('#uploader') as SfIUploader)!.loadMode();
|
|
15442
|
+
|
|
15443
|
+
}
|
|
15444
|
+
|
|
15445
|
+
|
|
15446
|
+
|
|
15447
|
+
//console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
15448
|
+
if (this.myRole == this.TAB_APPROVER || this.myRole == this.TAB_VIEWER || this.myRole == this.TAB_AUDITOR || this.myRole == this.TAB_FUNCTION_HEAD) {
|
|
15449
|
+
//console.log('approved 1', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
15450
|
+
if (listEvent["approved"] != null) {
|
|
15451
|
+
if (listEvent["approved"] === true) {
|
|
15452
|
+
//console.log('approved 2', event["approved"], this.myRole, this.TAB_APPROVER);
|
|
15453
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
|
|
15454
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = true;
|
|
15455
|
+
}
|
|
15456
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
15457
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = false;
|
|
15458
|
+
}
|
|
15459
|
+
} else {
|
|
15460
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement) != null) {
|
|
15461
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement)!.checked = false;
|
|
15462
|
+
}
|
|
15463
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
15464
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement)!.checked = true;
|
|
15465
|
+
}
|
|
15466
|
+
}
|
|
15467
|
+
} else {
|
|
15468
|
+
if ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement != null) {
|
|
15469
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-yes') as HTMLInputElement).checked = false;
|
|
15470
|
+
}
|
|
15471
|
+
if (((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement) != null) {
|
|
15472
|
+
((this._SfDetailContainer as HTMLDivElement).querySelector('#input-approve-no') as HTMLInputElement).checked = true;
|
|
15473
|
+
}
|
|
15474
|
+
|
|
15475
|
+
}
|
|
15476
|
+
}
|
|
15477
|
+
|
|
15478
|
+
}
|
|
15479
|
+
}
|
|
15480
|
+
|
|
15481
|
+
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement, flagUploadGuidance: boolean = false, listEventContainer: HTMLDivElement | null = null) => {
|
|
15482
|
+
console.log('listEvent', listEvent, listEvent.id)
|
|
15483
|
+
let url = "https://" + this.apiId + "/getalleventdetails";
|
|
15484
|
+
|
|
15485
|
+
//console.log('fetch calendar url', url);
|
|
15486
|
+
let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
|
|
15487
|
+
|
|
15488
|
+
//console.log('urlbody', urlBody);
|
|
15489
|
+
|
|
15490
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
15491
|
+
const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
|
|
15492
|
+
this._SfLoader.innerHTML = '';
|
|
15493
|
+
if (xhr.status == 200) {
|
|
15494
|
+
|
|
15495
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
15496
|
+
console.log('jsonRespose', jsonRespose);
|
|
15497
|
+
if (flagUploadGuidance) {
|
|
15498
|
+
if (listEventContainer != null) {
|
|
15499
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
15500
|
+
if (this.events[mmdd] != null) {
|
|
15501
|
+
for (var p = 0; p < this.events[mmdd].length; p++) {
|
|
15502
|
+
if (this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == listEvent.locationid && this.events[mmdd][p].entityid == listEvent.entityid) {
|
|
15503
|
+
this.events[mmdd][p].uploadguidance = jsonRespose.data.uploadguidance
|
|
15504
|
+
}
|
|
15505
|
+
}
|
|
15506
|
+
}
|
|
15507
|
+
this.renderListReporting(listEventContainer, jsonRespose.data, mmddyyyy, eventsContainer)
|
|
15508
|
+
}
|
|
15509
|
+
} else {
|
|
15510
|
+
this.renderEventDetail(jsonRespose.data, mmddyyyy, currentColumnButton, eventsContainer);
|
|
15511
|
+
}
|
|
15512
|
+
|
|
15513
|
+
} else {
|
|
15514
|
+
if (xhr.status == 401) {
|
|
15515
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
15516
|
+
this.dispatchEvent(changeEvent);
|
|
15517
|
+
}
|
|
15518
|
+
if (xhr.status === 404) {
|
|
15519
|
+
|
|
15520
|
+
this.showChosenProject();
|
|
15521
|
+
(this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
|
|
15522
|
+
this.renderChosenProject();
|
|
15523
|
+
|
|
15524
|
+
} else {
|
|
15525
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
15526
|
+
this.setError(jsonRespose.error);
|
|
15527
|
+
}
|
|
15528
|
+
|
|
15529
|
+
}
|
|
15530
|
+
}
|
|
15531
|
+
|
|
15532
|
+
renderEventDetail = (event: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
|
|
15533
|
+
console.log('event details', event, mmddyyyy, currentColumnButton == null ? "null currentColumnButton" : currentColumnButton.id);
|
|
15534
|
+
|
|
15535
|
+
let comments, docs, approved, /*dateOfCompletion,*/ makercheckers: Array<string>, docsOptional, documentType;
|
|
15536
|
+
let entityId: string = "";
|
|
15537
|
+
let locationId: string = "";
|
|
15538
|
+
let statuteName: string = "";
|
|
15539
|
+
let reportformatName: string = "";
|
|
15540
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
15541
|
+
entityId = event.entityid;
|
|
15542
|
+
locationId = event.locationid;
|
|
15543
|
+
// let completeness = this.getCompletenessStatus(event);
|
|
15544
|
+
comments = event['comments'] == null ? [] : (event['comments']);
|
|
15545
|
+
docs = event['documents'] == null ? [] : event['documents'] == null ? [] : (event['documents']);
|
|
15546
|
+
approved = event['approved'] == null ? false : event['approved'] == null ? false : event['approved'];
|
|
15547
|
+
// dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
15548
|
+
makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'] == null ? [] : event['makercheckers'];
|
|
15549
|
+
docsOptional = event['docs'] == null ? [] : event['docs'] == null ? [] : event['docs'];
|
|
15550
|
+
documentType = event['documenttype'] == null ? null : event['documenttype'][0] == null ? null : event['documenttype'][0].split(" ")[0];
|
|
15551
|
+
|
|
15552
|
+
statuteName = event['statute'][0].trim();
|
|
15553
|
+
if (event['reportformat'] != null) {
|
|
15554
|
+
reportformatName = (event['reportformat'][0] ?? "").trim().replace('&', '&');
|
|
15555
|
+
}
|
|
15556
|
+
|
|
15557
|
+
console.log('event detail', event, statuteName);
|
|
15558
|
+
//console.log('event detail comments', comments);
|
|
15559
|
+
//console.log('event dateofcompletion', dateOfCompletion);
|
|
15560
|
+
//console.log('event detail documenttype', documentType);
|
|
15561
|
+
const basicFields = ['id', 'shortid', 'entityname', 'locationname', 'functions'];
|
|
15562
|
+
const statuteFields = ['jurisdiction', 'country', 'state', 'category', 'subcategory', 'statute'];
|
|
15563
|
+
const complianceFields = ['specificity', 'reference', 'obligation', 'penalty', 'authority', 'frequency', 'subfrequency', 'obligationtype', 'duedate', 'applicability', 'form', 'additionalurls', 'adhocquestion', 'adhocquestionschedule', 'adhocinstances', 'uploadguidance', 'attachment'];
|
|
15564
|
+
const grcFields = ['internalcontrols', 'firstlineofdefence', 'secondlineofdefence', 'thirdlineofdefence', 'risk', 'riskarea'];
|
|
15565
|
+
|
|
15566
|
+
let listReportingContainers = eventsContainer.querySelectorAll('.list-reporting-container') as NodeListOf<HTMLDivElement>
|
|
15567
|
+
for (let tempReportingContainer of listReportingContainers) {
|
|
15568
|
+
tempReportingContainer.style.display = 'none';
|
|
15569
|
+
tempReportingContainer.innerHTML = '';
|
|
15570
|
+
}
|
|
15571
|
+
let buttonListReportings = eventsContainer.querySelectorAll('.button-list-reporting') as NodeListOf<HTMLButtonElement>
|
|
15572
|
+
for (let buttonListReporting of buttonListReportings) {
|
|
15573
|
+
buttonListReporting.setAttribute('part', 'button-list-reporting')
|
|
15574
|
+
}
|
|
15575
|
+
let streamEventTitles = eventsContainer.querySelectorAll('.stream-event-title') as NodeListOf<SfIElasticText>
|
|
15576
|
+
for (let streamEventTitle of streamEventTitles) {
|
|
15577
|
+
streamEventTitle.removeAttribute('part')
|
|
15578
|
+
}
|
|
15579
|
+
var html = `
|
|
15580
|
+
|
|
15581
|
+
<div part="compliance-detail-title" class="d-flex justify-between">
|
|
15582
|
+
<button part="button-icon" class="material-icons invisible">close</button>
|
|
15583
|
+
<h3 part="results-title" class="m-0">Compliance Details</h3>
|
|
15584
|
+
<button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
15585
|
+
</div>
|
|
15586
|
+
|
|
15587
|
+
`;
|
|
15588
|
+
|
|
15589
|
+
if (this.selectedItemIds.length > 1) {
|
|
15590
|
+
|
|
15591
|
+
html += `
|
|
15592
|
+
|
|
15593
|
+
<div class="d-flex justify-between m-20">
|
|
15594
|
+
<h4 class="m-0">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
|
|
15595
|
+
</div>
|
|
15596
|
+
|
|
15597
|
+
`;
|
|
15598
|
+
|
|
15599
|
+
}
|
|
15600
|
+
|
|
15601
|
+
html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
|
|
15602
|
+
|
|
15603
|
+
html += '<div part="detail-summary">';
|
|
15604
|
+
html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
|
|
15605
|
+
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
|
|
15606
|
+
html += ('<div part="detail-summary-content" class="pl-20 pr-20">' + ('<sf-i-elastic-text text="' + (event['internalcontrols'] + "").replace(/"/g, "").replace(/\n/g, '<br />') + '" minLength="80"></sf-i-elastic-text>') + '</div>');
|
|
15607
|
+
html += '</div>';
|
|
15608
|
+
|
|
15609
|
+
html += '<br />';
|
|
15610
|
+
|
|
15611
|
+
html += '<div class="accordian-section section-basic pl-20 pr-20" part="accordian-section">';
|
|
15612
|
+
html += '<div class="d-flex justify-between accordian-head head-basic cursor" part="accordian-head">';
|
|
15613
|
+
html += '<h3>Basic Information</h3>'
|
|
15614
|
+
html += '<h3 class="head-indicator-basic">-</h3>'
|
|
15615
|
+
html += '</div>';
|
|
15616
|
+
html += '<div class="d-flex flex-wrap accordian-body body-basic" part="accordian-body">';
|
|
15617
|
+
|
|
15618
|
+
for (var i = 0; i < basicFields.length; i++) {
|
|
15619
|
+
|
|
15620
|
+
if (!this.getEventPreviewFields().includes(basicFields[i])) {
|
|
15621
|
+
|
|
15622
|
+
if (!this.getEventHideFields().includes(basicFields[i])) {
|
|
15623
|
+
|
|
15624
|
+
console.log('basicFields', event[basicFields[i]] + "");
|
|
15625
|
+
if ((event[basicFields[i]] + "").indexOf("[") >= 0) {
|
|
15626
|
+
html += '<div class="m-20">';
|
|
15627
|
+
html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
|
|
15628
|
+
html += this.getEventTexts(basicFields[i], JSON.parse(event[basicFields[i]]), event).replace(/ *\([^)]*\) */g, "").trim();
|
|
15629
|
+
html += '</div>';
|
|
15630
|
+
} else {
|
|
15631
|
+
html += '<div class="m-20">';
|
|
15632
|
+
html += '<div part="detail-head"><strong>' + basicFields[i] + '</strong></div>'
|
|
15633
|
+
html += '<sf-i-elastic-text text="' + (event[basicFields[i]] + "").replace(/"/g, "").replace(/ *\([^)]*\) */g, "").trim().split(';')[0] + '" minLength="80"></sf-i-elastic-text>';
|
|
15634
|
+
html += '</div>';
|
|
15635
|
+
}
|
|
15636
|
+
|
|
15637
|
+
}
|
|
15638
|
+
}
|
|
15639
|
+
|
|
15640
|
+
}
|
|
15641
|
+
|
|
15642
|
+
if (this.mode == "consumer") {
|
|
15643
|
+
if (approved) {
|
|
15644
|
+
html += '<div class="m-20">';
|
|
15645
|
+
html += '<div part="detail-head"><strong>Approved</strong></div>'
|
|
15646
|
+
html += '<span class="material-icons color-done">check_circle</span>'
|
|
15647
|
+
html += '</div>';
|
|
15648
|
+
}
|
|
15649
|
+
}
|
|
15650
|
+
|
|
15651
|
+
if (docs != null) {
|
|
15652
|
+
html += '<div class="m-20">';
|
|
15653
|
+
html += '<div part="detail-head"><strong>Documents</strong></div>'
|
|
15654
|
+
html += '<span class="material-icons muted">description</span>'
|
|
15655
|
+
html += docs.length
|
|
15656
|
+
html += '</div>';
|
|
15657
|
+
}
|
|
15658
|
+
|
|
15659
|
+
if (comments != null) {
|
|
15660
|
+
html += '<div class="m-20">';
|
|
15661
|
+
html += '<div part="detail-head"><strong>Comments</strong></div>'
|
|
15662
|
+
html += '<span class="material-icons muted">forum</span>'
|
|
15663
|
+
html += comments.length
|
|
15664
|
+
html += '</div>';
|
|
15665
|
+
}
|
|
15666
|
+
|
|
15667
|
+
html += '<div class="m-20">';
|
|
15668
|
+
html += '<div part="detail-head"><strong>Reporters</strong></div>'
|
|
15669
|
+
html += this.getReporterDetailStringFromEvent(event);
|
|
15670
|
+
html += '</div>';
|
|
15671
|
+
|
|
15672
|
+
html += '<div class="m-20">';
|
|
15673
|
+
html += '<div part="detail-head"><strong>Approvers</strong></div>'
|
|
15674
|
+
html += this.getApproverDetailStringFromEvent(event);
|
|
15675
|
+
html += '</div>';
|
|
15676
|
+
|
|
15677
|
+
html += '</div>';
|
|
15678
|
+
html += '</div>';
|
|
15679
|
+
|
|
15680
|
+
|
|
15681
|
+
html += '<div class="accordian-section section-statute pl-20 pr-20" part="accordian-section">';
|
|
15682
|
+
html += '<div class="d-flex justify-between accordian-head head-statute cursor" part="accordian-head">';
|
|
15683
|
+
html += '<h3>Statute Information</h3>'
|
|
15684
|
+
html += '<h3 class="head-indicator-statute">-</h3>'
|
|
15685
|
+
html += '</div>';
|
|
15686
|
+
html += '<div class="d-flex flex-wrap accordian-body body-statute" part="accordian-body">';
|
|
14780
15687
|
|
|
14781
15688
|
for (var i = 0; i < statuteFields.length; i++) {
|
|
14782
15689
|
|
|
@@ -15249,13 +16156,21 @@ export class SfIEvents extends LitElement {
|
|
|
15249
16156
|
} else {
|
|
15250
16157
|
feedbackMessage.setAttribute('style', 'border:');
|
|
15251
16158
|
this.uploadTriggerMyEvent(
|
|
15252
|
-
event.id + "
|
|
16159
|
+
event.id + " - " + event.shortid,
|
|
15253
16160
|
feedbackMessage.value,
|
|
15254
|
-
event.
|
|
15255
|
-
event.
|
|
15256
|
-
event.
|
|
16161
|
+
(event.country[0] ?? "").replace(/ *\([^)]*\) */g, ""),
|
|
16162
|
+
(event.entityname ?? "").replace(/ *\([^)]*\) */g, ""),
|
|
16163
|
+
(event.locationname ?? "").replace(/ *\([^)]*\) */g, ""),
|
|
15257
16164
|
event.statute[0],
|
|
15258
16165
|
event.subcategory[0]);
|
|
16166
|
+
// this.uploadTriggerMyEvent(
|
|
16167
|
+
// event.id + ";" + event.shortid,
|
|
16168
|
+
// feedbackMessage.value,
|
|
16169
|
+
// event.countries.join(",").replace(/ *\([^)]*\) */g, ""),
|
|
16170
|
+
// event.entities.join(',').replace(/ *\([^)]*\) */g, ""),
|
|
16171
|
+
// event.locations.join(',').replace(/ *\([^)]*\) */g, ""),
|
|
16172
|
+
// event.statute[0],
|
|
16173
|
+
// event.subcategory[0]);
|
|
15259
16174
|
buttonCancel.click();
|
|
15260
16175
|
buttonClose.click();
|
|
15261
16176
|
}
|
|
@@ -16080,15 +16995,15 @@ export class SfIEvents extends LitElement {
|
|
|
16080
16995
|
// taggingArray.data.mappings.mappings = [];
|
|
16081
16996
|
|
|
16082
16997
|
const tempArray = [];
|
|
16083
|
-
|
|
16998
|
+
console.log('selectedindexchecking 1', this.selectedCbs)
|
|
16084
16999
|
for (var count = 0; count < sourceArray.data.mappings.mappings.length; count++) {
|
|
16085
17000
|
|
|
16086
|
-
|
|
17001
|
+
console.log('selectedindexchecking', selectedIndex, count, this.selectedCbs.includes(selectedIndex + ""), this.selectedCbs.includes(count + ""));
|
|
16087
17002
|
//taggingArray.data.mappings.mappings[count] = sourceArray.data.mappings.mappings[count];
|
|
16088
17003
|
//taggingArray.data.mappings.mappings.push(sourceArray.data.mappings.mappings[count]);
|
|
16089
17004
|
tempArray.push(sourceArray.data.mappings.mappings[count]);
|
|
16090
17005
|
// //console.log('selectedindexchecking', this.selectedCbs, count, this.selectedCbs.includes(selectedIndex), this.selectedCbs.includes(count));
|
|
16091
|
-
if (this.selectedCbs.includes(selectedIndex) && this.selectedCbs.includes(count + '')) {
|
|
17006
|
+
if (this.selectedCbs.includes(selectedIndex + '') && this.selectedCbs.includes(count + '')) {
|
|
16092
17007
|
if (((divElement as HTMLDivElement).querySelector('#tags-' + selectedIndex) as SfIForm).selectedValues != null) {
|
|
16093
17008
|
|
|
16094
17009
|
if (tempArray[count] == null) tempArray[count] = {};
|
|
@@ -16730,16 +17645,16 @@ export class SfIEvents extends LitElement {
|
|
|
16730
17645
|
var k = 0;
|
|
16731
17646
|
for (k = 0; k < taggingArray.data.mappings.mappings.length; k++) {
|
|
16732
17647
|
|
|
16733
|
-
if (taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
|
|
16734
|
-
|
|
17648
|
+
// if (taggingArray.data.mappings.mappings[k].id == sourceArray.data.mappings.mappings[i].id) {
|
|
17649
|
+
// if (taggingArray.data.mappings.mappings[k].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
|
|
16735
17650
|
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
17651
|
+
// console.log('found', taggingArray.data.mappings.mappings[k]);
|
|
17652
|
+
// //console.log('before before filtermatch',sourceCols[l],JSON.parse(sourceArray.data.mappings.mappings[0].cols)[j], colCountry, (sourceArray.data.mappings.mappings[i]), (sourceArray.data.mappings.mappings[i].data), colState);
|
|
17653
|
+
// //console.log('before filtermatch', colCountry, JSON.parse(sourceArray.data.mappings.mappings[i].data)[colCountry], colState, JSON.parse(sourceArray.data.mappings.mappings[i].data)[colState], JSON.parse(sourceArray.data.mappings.mappings[i].data)[colSubcategory]);
|
|
16739
17654
|
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
}
|
|
17655
|
+
// }
|
|
17656
|
+
// break;
|
|
17657
|
+
// }
|
|
16743
17658
|
|
|
16744
17659
|
}
|
|
16745
17660
|
|
|
@@ -17056,12 +17971,12 @@ export class SfIEvents extends LitElement {
|
|
|
17056
17971
|
}
|
|
17057
17972
|
|
|
17058
17973
|
// if(taggingArray.data.mappings.mappings[j].id == "62330e24-298d-4ef2-9449-c0e400e37cac" && equal) {
|
|
17059
|
-
if (taggingArray.data.mappings.mappings[j].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
|
|
17974
|
+
// if (taggingArray.data.mappings.mappings[j].id == "62330e24-298d-4ef2-9449-c0e400e37cac") {
|
|
17060
17975
|
|
|
17061
|
-
|
|
17062
|
-
|
|
17976
|
+
// // console.log('rendertagging', taggingArray.data.mappings.mappings[j], sourceArray.data.mappings.mappings[i]);
|
|
17977
|
+
// console.log('rendertagging', taggingArray.data.mappings.mappings[j]);
|
|
17063
17978
|
|
|
17064
|
-
}
|
|
17979
|
+
// }
|
|
17065
17980
|
|
|
17066
17981
|
|
|
17067
17982
|
if (equal) {
|
|
@@ -22713,7 +23628,7 @@ export class SfIEvents extends LitElement {
|
|
|
22713
23628
|
|
|
22714
23629
|
html += '<button class="tab-button mb-10" id="calendar-tab-month" part="' + (selectedTab == this.TAB_STREAM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Month</button>';
|
|
22715
23630
|
html += '<button class="tab-button mb-10" id="calendar-tab-custom" part="' + (selectedTab == this.TAB_CUSTOM ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">' + (this.myRole == this.TAB_VIEWER ? "Statistics" : "Range") + '</button>';
|
|
22716
|
-
if (this.selectedFeatures.indexOf('contracts') < 0) {
|
|
23631
|
+
if (this.selectedFeatures.indexOf('contracts') < 0 && this.selectedFeatures.indexOf('licenses') < 0) {
|
|
22717
23632
|
html += '<button class="tab-button mb-10" id="calendar-tab-register" part="' + (selectedTab == this.TAB_REGISTERS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Registers</button>';
|
|
22718
23633
|
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_FIND ? '' : 'hide') + '" id="calendar-tab-find" part="' + (selectedTab == this.TAB_FIND ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Search</button>';
|
|
22719
23634
|
html += '<button class="tab-button tab-button-secondary mb-10 ' + (selectedTab == this.TAB_THIS ? '' : 'hide') + '" id="calendar-tab-this" part="' + (selectedTab == this.TAB_THIS ? 'calendar-tab-button-selected' : 'calendar-tab-button-not-selected') + '">Current</button>';
|
|
@@ -23945,7 +24860,7 @@ export class SfIEvents extends LitElement {
|
|
|
23945
24860
|
"module": module
|
|
23946
24861
|
}
|
|
23947
24862
|
let retValue = true;
|
|
23948
|
-
|
|
24863
|
+
console.log('uploading review', body);
|
|
23949
24864
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
23950
24865
|
const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
23951
24866
|
this._SfLoader.innerHTML = '';
|
|
@@ -24053,7 +24968,7 @@ export class SfIEvents extends LitElement {
|
|
|
24053
24968
|
"makercheckers": makercheckers
|
|
24054
24969
|
}
|
|
24055
24970
|
|
|
24056
|
-
console.log(body);
|
|
24971
|
+
console.log('reportingbody',body);
|
|
24057
24972
|
let retValue = true;
|
|
24058
24973
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
24059
24974
|
const xhr: any = (await this.prepareXhr(body, url, this._SfLoader, authorization)) as any;
|
|
@@ -25621,7 +26536,9 @@ export class SfIEvents extends LitElement {
|
|
|
25621
26536
|
} else if (this.selectedFeatures.indexOf('notices') >= 0) {
|
|
25622
26537
|
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month, year);
|
|
25623
26538
|
} else if (this.selectedFeatures.indexOf('contracts') >= 0) {
|
|
25624
|
-
this.
|
|
26539
|
+
this.fetchAndRenderContracts(startDate, endDate, searchString, list, month, year);
|
|
26540
|
+
} else if (this.selectedFeatures.indexOf('licenses') >= 0) {
|
|
26541
|
+
this.fetchAndRenderLicenses(startDate, endDate, searchString, list, month, year);
|
|
25625
26542
|
}
|
|
25626
26543
|
}
|
|
25627
26544
|
fetchAndYearlyRenderUserCalendar_2 = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
@@ -25843,7 +26760,7 @@ export class SfIEvents extends LitElement {
|
|
|
25843
26760
|
|
|
25844
26761
|
}
|
|
25845
26762
|
|
|
25846
|
-
|
|
26763
|
+
fetchAndRenderContracts = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
25847
26764
|
|
|
25848
26765
|
let path = "", view = "";
|
|
25849
26766
|
this.sdate = startDate;
|
|
@@ -25920,6 +26837,84 @@ export class SfIEvents extends LitElement {
|
|
|
25920
26837
|
|
|
25921
26838
|
}
|
|
25922
26839
|
|
|
26840
|
+
}
|
|
26841
|
+
fetchAndRenderLicenses = async (startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
26842
|
+
|
|
26843
|
+
let path = "", view = "";
|
|
26844
|
+
this.sdate = startDate;
|
|
26845
|
+
this.edate = endDate;
|
|
26846
|
+
if (this.tagId != null && this.tagId != "") {
|
|
26847
|
+
view = "tag";
|
|
26848
|
+
} else if (this.countryId != null && this.countryId != "") {
|
|
26849
|
+
view = "country";
|
|
26850
|
+
} else if (this.locationId != null && this.locationId != "") {
|
|
26851
|
+
view = "location";
|
|
26852
|
+
} else {
|
|
26853
|
+
view = "entity";
|
|
26854
|
+
}
|
|
26855
|
+
|
|
26856
|
+
path = "getallcountryobjects";
|
|
26857
|
+
|
|
26858
|
+
let sDate = "";
|
|
26859
|
+
let eDate = "";
|
|
26860
|
+
|
|
26861
|
+
//console.log('currenttab', this.getCurrentTab());
|
|
26862
|
+
|
|
26863
|
+
if (this.getCurrentTab() == this.TAB_YEAR) {
|
|
26864
|
+
sDate = "03/31/" + this.calendarStartYYYY;
|
|
26865
|
+
eDate = "04/01/" + (parseInt(this.calendarStartYYYY) + 1);
|
|
26866
|
+
} else {
|
|
26867
|
+
sDate = startDate;
|
|
26868
|
+
eDate = endDate;
|
|
26869
|
+
}
|
|
26870
|
+
|
|
26871
|
+
|
|
26872
|
+
let url = "https://" + this.apiIdLicenses + "/" + path;
|
|
26873
|
+
|
|
26874
|
+
//console.log('fetch calendar url', url);
|
|
26875
|
+
let urlBody: any = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "entityid": this.entityId, "countryid": this.countryId, "functionid": this.functionId, "locationid": this.locationId, "tagid": this.tagId, "adhoc": "false", "exclusivestartkey": 0, "sdate": sDate, "edate": eDate, "view": view, "year": year, "list": list, "month": month };
|
|
26876
|
+
|
|
26877
|
+
if (searchString.length > 0) {
|
|
26878
|
+
urlBody["searchstring"] = searchString;
|
|
26879
|
+
}
|
|
26880
|
+
|
|
26881
|
+
//console.log('urlbody', urlBody);
|
|
26882
|
+
|
|
26883
|
+
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
26884
|
+
const xhr: any = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing')) as any;
|
|
26885
|
+
this._SfLoader.innerHTML = '';
|
|
26886
|
+
if (xhr.status == 200) {
|
|
26887
|
+
|
|
26888
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
26889
|
+
console.log('jsonRespose', jsonRespose);
|
|
26890
|
+
let licenses = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
26891
|
+
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
|
|
26892
|
+
this.lastupdated = Util.getDateTimeStrings(new Date().getTime())
|
|
26893
|
+
let tempEvents = this.events
|
|
26894
|
+
for (let mmddyyyy of Object.keys(licenses)) {
|
|
26895
|
+
tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []), ...licenses[mmddyyyy]]
|
|
26896
|
+
}
|
|
26897
|
+
this.events = tempEvents;
|
|
26898
|
+
this.renderAppropriateStream(this.sdate, this.edate, true);
|
|
26899
|
+
console.log('licenses', licenses, tempEvents);
|
|
26900
|
+
} else {
|
|
26901
|
+
if (xhr.status == 401) {
|
|
26902
|
+
let changeEvent = new CustomEvent('tokenExpired', { bubbles: true });
|
|
26903
|
+
this.dispatchEvent(changeEvent);
|
|
26904
|
+
}
|
|
26905
|
+
if (xhr.status === 404) {
|
|
26906
|
+
|
|
26907
|
+
this.showChosenProject();
|
|
26908
|
+
(this._SfTitleChosenProject as HTMLElement).innerHTML = (this._SfProject[0].querySelector('#sf-i-project') as SfIForm).selectedTexts()[0];
|
|
26909
|
+
this.renderChosenProject();
|
|
26910
|
+
|
|
26911
|
+
} else {
|
|
26912
|
+
const jsonRespose = JSON.parse(xhr.responseText);
|
|
26913
|
+
this.setError(jsonRespose.error);
|
|
26914
|
+
}
|
|
26915
|
+
|
|
26916
|
+
}
|
|
26917
|
+
|
|
25923
26918
|
}
|
|
25924
26919
|
|
|
25925
26920
|
fetchStatistics = async (startDate: string = "", endDate: string = "", filtercriteria: string, filterid: string, subfiltercriteria: string, subfilterid: string) => {
|
|
@@ -25951,6 +26946,8 @@ export class SfIEvents extends LitElement {
|
|
|
25951
26946
|
url = "https://" + this.apiIdNotices + "/" + path;
|
|
25952
26947
|
} else if (this.selectedFeatures.indexOf('contracts') >= 0) {
|
|
25953
26948
|
url = "https://" + this.apiIdAgreements + "/" + path;
|
|
26949
|
+
} else if (this.selectedFeatures.indexOf('licenses') >= 0) {
|
|
26950
|
+
url = "https://" + this.apiIdLicenses + "/" + path;
|
|
25954
26951
|
}
|
|
25955
26952
|
|
|
25956
26953
|
//console.log('fetch calendar url', url);
|