sf-i-events 1.0.843 → 1.0.845
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/index.html +11 -1
- package/package.json +1 -1
- package/sf-i-events.d.ts +5 -3
- package/sf-i-events.js +69 -15
- package/src/sf-i-events.ts +78 -16
package/dev/index.html
CHANGED
|
@@ -779,7 +779,7 @@
|
|
|
779
779
|
</div>
|
|
780
780
|
|
|
781
781
|
</sf-i-events> -->
|
|
782
|
-
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="reporter" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
782
|
+
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Local Reporter 1" userprofileid="e9684b5d-ddbc-46d3-ae07-51706bf75410" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="reporter" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
783
783
|
|
|
784
784
|
<div slot="uploader">
|
|
785
785
|
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
@@ -788,6 +788,16 @@
|
|
|
788
788
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
789
789
|
</div>
|
|
790
790
|
|
|
791
|
+
</sf-i-events> -->
|
|
792
|
+
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="pattern" username="Humayu Shaikh" userprofileid="115e99a2-4b5b-4b76-846e-24133dac5ccd" projectid="5a05b884-d7ed-4f63-b623-4d305ea2cfd6" projectname="Standard Radiators Private Limited" countryid="17f9c73b-886d-40d7-b8f2-2ace42763d47" enabledeletelatestreport="true" features="[]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligationtitle"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
793
|
+
|
|
794
|
+
<div slot="uploader">
|
|
795
|
+
<sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="["jpg","png","pdf","xls","xlsx","doc","docx"]" extract="yes" projectid="5a05b884-d7ed-4f63-b623-4d305ea2cfd6" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
|
|
796
|
+
</div>
|
|
797
|
+
<div slot="reporting">
|
|
798
|
+
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
799
|
+
</div>
|
|
800
|
+
|
|
791
801
|
</sf-i-events>
|
|
792
802
|
<!-- <sf-i-events projectid="5a05b884-d7ed-4f63-b623-4d305ea2cfd6" projectname="Standard Radiators Private Limited" mode="onboarding" locations="{"India":{"Punjab":["Punjab Warehouse"],"Gujarat":["RO & Unit I","Unit II"]}}" contractstartdate="01/03/2025" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
|
|
793
803
|
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -573,6 +573,8 @@ export declare class SfIEvents extends LitElement {
|
|
|
573
573
|
renderButtonRefresh: (eventsContainer: HTMLDivElement) => void;
|
|
574
574
|
renderStream: (index: number | undefined, showGraph: boolean | undefined, showBackgroundButton: boolean) => void;
|
|
575
575
|
attachTimelineFilterHandlers: (divContainer: HTMLDivElement) => void;
|
|
576
|
+
getFinancialYear: (mmddyyyy: string) => string;
|
|
577
|
+
getYearFromMonthBetween: (startDateStr: string, endDateStr: string, monthStr: string) => string;
|
|
576
578
|
getCurrentYear: (mm: string) => string;
|
|
577
579
|
clearButtonSelection: () => void;
|
|
578
580
|
clearGraphData: () => void;
|
|
@@ -798,9 +800,9 @@ export declare class SfIEvents extends LitElement {
|
|
|
798
800
|
sleepFunction: (ms: number) => Promise<unknown>;
|
|
799
801
|
renderAppropriateStream: (startDate: string, endDate: string, showGraph?: boolean, showBackgroundButton?: boolean) => void;
|
|
800
802
|
fetchRegisters: (searchString?: string, meta?: string, selectedCountry?: string, selectedStatute?: string) => Promise<any>;
|
|
801
|
-
renderWithFeatures: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string) => Promise<void>;
|
|
802
|
-
fetchAndYearlyRenderUserCalendar_2: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string) => Promise<void>;
|
|
803
|
-
fetchAndRenderNotices: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string) => Promise<void>;
|
|
803
|
+
renderWithFeatures: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string, year?: string) => Promise<void>;
|
|
804
|
+
fetchAndYearlyRenderUserCalendar_2: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string, year?: string) => Promise<void>;
|
|
805
|
+
fetchAndRenderNotices: (startDate?: string, endDate?: string, searchString?: string, list?: string, month?: string, year?: string) => Promise<void>;
|
|
804
806
|
fetchStatistics: (startDate: string | undefined, endDate: string | undefined, filtercriteria: string, filterid: string, subfiltercriteria: string, subfilterid: string) => Promise<any>;
|
|
805
807
|
fetchBulkReportingData: () => Promise<void>;
|
|
806
808
|
fetchUserCalendar: () => Promise<void>;
|
package/sf-i-events.js
CHANGED
|
@@ -3705,6 +3705,13 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3705
3705
|
this.clearMessages();
|
|
3706
3706
|
}, 3000);
|
|
3707
3707
|
}
|
|
3708
|
+
else if (parseInt(reporterdoc) > new Date().getTime()) {
|
|
3709
|
+
buttonClick.innerHTML = "Save";
|
|
3710
|
+
this.setError('Date of completion cannot be in future!');
|
|
3711
|
+
setTimeout(() => {
|
|
3712
|
+
this.clearMessages();
|
|
3713
|
+
}, 3000);
|
|
3714
|
+
}
|
|
3708
3715
|
else {
|
|
3709
3716
|
//console.log('makerscheckers 1', reportercomments);
|
|
3710
3717
|
if (reportercomments.trim().length === 0) {
|
|
@@ -3963,7 +3970,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3963
3970
|
const id = ev.target.id;
|
|
3964
3971
|
const idArr = id.split("-");
|
|
3965
3972
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
3966
|
-
const yyyy = this.
|
|
3973
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
3967
3974
|
// const i = idArr[5];
|
|
3968
3975
|
const j = idArr[5];
|
|
3969
3976
|
let listReportingContainer = eventsContainer.querySelector('#list-reporting-container-' + mmdd.replace(/\//g, '-') + '-' + j);
|
|
@@ -4131,7 +4138,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4131
4138
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
4132
4139
|
const j = idArr[5];
|
|
4133
4140
|
const isnotice = idArr[6];
|
|
4134
|
-
var yyyy = this.
|
|
4141
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
4135
4142
|
if (isnotice === "isnotice") {
|
|
4136
4143
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
4137
4144
|
}
|
|
@@ -4161,7 +4168,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4161
4168
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
4162
4169
|
const j = idArr[5];
|
|
4163
4170
|
const isnotice = idArr[6];
|
|
4164
|
-
var yyyy = this.
|
|
4171
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
4165
4172
|
if (isnotice === "isnotice") {
|
|
4166
4173
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
4167
4174
|
}
|
|
@@ -7560,7 +7567,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7560
7567
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
7561
7568
|
const j = idArr[5];
|
|
7562
7569
|
const isnotice = idArr[6];
|
|
7563
|
-
var yyyy = this.
|
|
7570
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
7564
7571
|
if (isnotice === "isnotice") {
|
|
7565
7572
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
7566
7573
|
}
|
|
@@ -7589,7 +7596,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7589
7596
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
7590
7597
|
const j = idArr[5];
|
|
7591
7598
|
const isnotice = idArr[6];
|
|
7592
|
-
var yyyy = this.
|
|
7599
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
7593
7600
|
if (isnotice === "isnotice") {
|
|
7594
7601
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
7595
7602
|
}
|
|
@@ -8041,7 +8048,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8041
8048
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
8042
8049
|
const j = idArr[5];
|
|
8043
8050
|
const isnotice = idArr[6];
|
|
8044
|
-
var yyyy = this.
|
|
8051
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
8045
8052
|
if (isnotice === "isnotice") {
|
|
8046
8053
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
8047
8054
|
}
|
|
@@ -8072,7 +8079,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8072
8079
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
8073
8080
|
const j = idArr[5];
|
|
8074
8081
|
const isnotice = idArr[6];
|
|
8075
|
-
var yyyy = this.
|
|
8082
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
8076
8083
|
if (isnotice === "isnotice") {
|
|
8077
8084
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
8078
8085
|
}
|
|
@@ -8249,6 +8256,39 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8249
8256
|
});
|
|
8250
8257
|
});
|
|
8251
8258
|
};
|
|
8259
|
+
this.getFinancialYear = (mmddyyyy) => {
|
|
8260
|
+
const date = new Date(mmddyyyy);
|
|
8261
|
+
const year = date.getFullYear();
|
|
8262
|
+
const month = date.getMonth() + 1; // getMonth() is 0-indexed
|
|
8263
|
+
let finYear;
|
|
8264
|
+
if (month >= 4) {
|
|
8265
|
+
// April to December → Financial year starts in this year
|
|
8266
|
+
finYear = year;
|
|
8267
|
+
}
|
|
8268
|
+
else {
|
|
8269
|
+
// January to March → Financial year started in previous year
|
|
8270
|
+
finYear = year - 1;
|
|
8271
|
+
}
|
|
8272
|
+
return `${finYear}`;
|
|
8273
|
+
};
|
|
8274
|
+
this.getYearFromMonthBetween = (startDateStr, endDateStr, monthStr) => {
|
|
8275
|
+
const startDate = new Date(startDateStr);
|
|
8276
|
+
const endDate = new Date(endDateStr);
|
|
8277
|
+
const month = parseInt(monthStr, 10); // Ensure month is a number
|
|
8278
|
+
if (isNaN(month) || month < 1 || month > 12) {
|
|
8279
|
+
return this.calendarStartYYYY;
|
|
8280
|
+
}
|
|
8281
|
+
let current = new Date(startDate.getFullYear(), startDate.getMonth(), 1);
|
|
8282
|
+
while (current <= endDate) {
|
|
8283
|
+
if (current.getMonth() + 1 === month) { // getMonth() is 0-indexed
|
|
8284
|
+
return current.getFullYear() + "";
|
|
8285
|
+
}
|
|
8286
|
+
// Move to next month
|
|
8287
|
+
current.setMonth(current.getMonth() + 1);
|
|
8288
|
+
}
|
|
8289
|
+
// If no matching month found in the range
|
|
8290
|
+
return this.calendarStartYYYY;
|
|
8291
|
+
};
|
|
8252
8292
|
this.getCurrentYear = (mm) => {
|
|
8253
8293
|
// var currMonth = new Date().getMonth() + 1;
|
|
8254
8294
|
// // if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
@@ -9440,6 +9480,13 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9440
9480
|
this.clearMessages();
|
|
9441
9481
|
}, 3000);
|
|
9442
9482
|
}
|
|
9483
|
+
else if (parseInt(reporterdoc) > new Date().getTime()) {
|
|
9484
|
+
buttonClick.innerHTML = "Save";
|
|
9485
|
+
this.setError('Date of completion cannot be in future!');
|
|
9486
|
+
setTimeout(() => {
|
|
9487
|
+
this.clearMessages();
|
|
9488
|
+
}, 3000);
|
|
9489
|
+
}
|
|
9443
9490
|
else {
|
|
9444
9491
|
//console.log('makerscheckers 1', reportercomments);
|
|
9445
9492
|
if (reportercomments.trim().length === 0) {
|
|
@@ -9691,7 +9738,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9691
9738
|
console.log('listEvent', listEvent, listEvent.id);
|
|
9692
9739
|
let url = "https://" + this.apiId + "/getalleventdetails";
|
|
9693
9740
|
//console.log('fetch calendar url', url);
|
|
9694
|
-
let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.
|
|
9741
|
+
let urlBody = { "projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.getFinancialYear(mmddyyyy) };
|
|
9695
9742
|
//console.log('urlbody', urlBody);
|
|
9696
9743
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
9697
9744
|
const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
|
|
@@ -10562,6 +10609,13 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
10562
10609
|
this.clearMessages();
|
|
10563
10610
|
}, 3000);
|
|
10564
10611
|
}
|
|
10612
|
+
else if (parseInt(reporterdoc) > new Date().getTime()) {
|
|
10613
|
+
buttonClick.innerHTML = "Save";
|
|
10614
|
+
this.setError('Date of completion cannot be in future!');
|
|
10615
|
+
setTimeout(() => {
|
|
10616
|
+
this.clearMessages();
|
|
10617
|
+
}, 3000);
|
|
10618
|
+
}
|
|
10565
10619
|
else {
|
|
10566
10620
|
//console.log('makerscheckers 1', reportercomments);
|
|
10567
10621
|
if (reportercomments.trim().length === 0) {
|
|
@@ -18401,17 +18455,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18401
18455
|
this.dispatchEvent(changeEvent);
|
|
18402
18456
|
}
|
|
18403
18457
|
};
|
|
18404
|
-
this.renderWithFeatures = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
|
|
18458
|
+
this.renderWithFeatures = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
18405
18459
|
this.events = [];
|
|
18406
18460
|
console.log('rendering and fetching', startDate, endDate, searchString, list, month);
|
|
18407
18461
|
if (this.selectedFeatures.indexOf('compliances') >= 0) {
|
|
18408
|
-
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month);
|
|
18462
|
+
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month, year);
|
|
18409
18463
|
}
|
|
18410
18464
|
else if (this.selectedFeatures.indexOf('notices') >= 0) {
|
|
18411
|
-
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month);
|
|
18465
|
+
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month, year);
|
|
18412
18466
|
}
|
|
18413
18467
|
};
|
|
18414
|
-
this.fetchAndYearlyRenderUserCalendar_2 = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
|
|
18468
|
+
this.fetchAndYearlyRenderUserCalendar_2 = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
18415
18469
|
let path = "", view = "";
|
|
18416
18470
|
this.sdate = startDate;
|
|
18417
18471
|
this.edate = endDate;
|
|
@@ -18441,7 +18495,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18441
18495
|
}
|
|
18442
18496
|
let url = "https://" + this.apiId + "/" + path;
|
|
18443
18497
|
//console.log('fetch calendar url', url);
|
|
18444
|
-
let urlBody = { "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":
|
|
18498
|
+
let urlBody = { "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 };
|
|
18445
18499
|
if (searchString.length > 0) {
|
|
18446
18500
|
urlBody["searchstring"] = searchString;
|
|
18447
18501
|
}
|
|
@@ -18517,7 +18571,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18517
18571
|
}
|
|
18518
18572
|
}
|
|
18519
18573
|
};
|
|
18520
|
-
this.fetchAndRenderNotices = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
|
|
18574
|
+
this.fetchAndRenderNotices = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
18521
18575
|
var _a;
|
|
18522
18576
|
let path = "", view = "";
|
|
18523
18577
|
this.sdate = startDate;
|
|
@@ -18548,7 +18602,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18548
18602
|
}
|
|
18549
18603
|
let url = "https://" + this.apiIdNotices + "/" + path;
|
|
18550
18604
|
//console.log('fetch calendar url', url);
|
|
18551
|
-
let urlBody = { "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":
|
|
18605
|
+
let urlBody = { "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 };
|
|
18552
18606
|
if (searchString.length > 0) {
|
|
18553
18607
|
urlBody["searchstring"] = searchString;
|
|
18554
18608
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -6075,6 +6075,13 @@ export class SfIEvents extends LitElement {
|
|
|
6075
6075
|
this.clearMessages();
|
|
6076
6076
|
}, 3000);
|
|
6077
6077
|
|
|
6078
|
+
} else if(parseInt(reporterdoc) > new Date().getTime()) {
|
|
6079
|
+
buttonClick.innerHTML = "Save"
|
|
6080
|
+
this.setError('Date of completion cannot be in future!');
|
|
6081
|
+
setTimeout(() => {
|
|
6082
|
+
this.clearMessages();
|
|
6083
|
+
}, 3000);
|
|
6084
|
+
|
|
6078
6085
|
} else {
|
|
6079
6086
|
|
|
6080
6087
|
//console.log('makerscheckers 1', reportercomments);
|
|
@@ -6361,7 +6368,7 @@ export class SfIEvents extends LitElement {
|
|
|
6361
6368
|
const id = ev.target.id;
|
|
6362
6369
|
const idArr = id.split("-")
|
|
6363
6370
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6364
|
-
const yyyy = this.
|
|
6371
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6365
6372
|
// const i = idArr[5];
|
|
6366
6373
|
const j = idArr[5];
|
|
6367
6374
|
let listReportingContainer = eventsContainer.querySelector('#list-reporting-container-'+mmdd.replace(/\//g,'-')+'-'+j) as HTMLDivElement
|
|
@@ -6557,7 +6564,7 @@ export class SfIEvents extends LitElement {
|
|
|
6557
6564
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6558
6565
|
const j = idArr[5];
|
|
6559
6566
|
const isnotice = idArr[6];
|
|
6560
|
-
var yyyy = this.
|
|
6567
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6561
6568
|
if(isnotice === "isnotice"){
|
|
6562
6569
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6563
6570
|
}else{
|
|
@@ -6594,7 +6601,7 @@ export class SfIEvents extends LitElement {
|
|
|
6594
6601
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6595
6602
|
const j = idArr[5];
|
|
6596
6603
|
const isnotice = idArr[6];
|
|
6597
|
-
var yyyy = this.
|
|
6604
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6598
6605
|
if(isnotice === "isnotice"){
|
|
6599
6606
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6600
6607
|
}else{
|
|
@@ -10695,7 +10702,7 @@ export class SfIEvents extends LitElement {
|
|
|
10695
10702
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
10696
10703
|
const j = idArr[5];
|
|
10697
10704
|
const isnotice = idArr[6];
|
|
10698
|
-
var yyyy = this.
|
|
10705
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
10699
10706
|
if(isnotice === "isnotice"){
|
|
10700
10707
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10701
10708
|
}else{
|
|
@@ -10732,7 +10739,7 @@ export class SfIEvents extends LitElement {
|
|
|
10732
10739
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
10733
10740
|
const j = idArr[5];
|
|
10734
10741
|
const isnotice = idArr[6];
|
|
10735
|
-
var yyyy = this.
|
|
10742
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
10736
10743
|
if(isnotice === "isnotice"){
|
|
10737
10744
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10738
10745
|
}else{
|
|
@@ -11281,7 +11288,7 @@ export class SfIEvents extends LitElement {
|
|
|
11281
11288
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
11282
11289
|
const j = idArr[5];
|
|
11283
11290
|
const isnotice = idArr[6];
|
|
11284
|
-
var yyyy = this.
|
|
11291
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
11285
11292
|
if(isnotice === "isnotice"){
|
|
11286
11293
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11287
11294
|
}else{
|
|
@@ -11322,7 +11329,7 @@ export class SfIEvents extends LitElement {
|
|
|
11322
11329
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
11323
11330
|
const j = idArr[5];
|
|
11324
11331
|
const isnotice = idArr[6];
|
|
11325
|
-
var yyyy = this.
|
|
11332
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
11326
11333
|
if(isnotice === "isnotice"){
|
|
11327
11334
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11328
11335
|
}else{
|
|
@@ -11533,8 +11540,49 @@ export class SfIEvents extends LitElement {
|
|
|
11533
11540
|
|
|
11534
11541
|
}
|
|
11535
11542
|
|
|
11536
|
-
|
|
11543
|
+
getFinancialYear = (mmddyyyy: string): string => {
|
|
11544
|
+
const date = new Date(mmddyyyy);
|
|
11545
|
+
const year = date.getFullYear();
|
|
11546
|
+
const month = date.getMonth() + 1; // getMonth() is 0-indexed
|
|
11547
|
+
|
|
11548
|
+
let finYear: number;
|
|
11549
|
+
if (month >= 4) {
|
|
11550
|
+
// April to December → Financial year starts in this year
|
|
11551
|
+
finYear = year;
|
|
11552
|
+
} else {
|
|
11553
|
+
// January to March → Financial year started in previous year
|
|
11554
|
+
finYear = year - 1;
|
|
11555
|
+
}
|
|
11556
|
+
|
|
11557
|
+
return `${finYear}`;
|
|
11558
|
+
}
|
|
11537
11559
|
|
|
11560
|
+
getYearFromMonthBetween = (startDateStr: string, endDateStr: string, monthStr: string): string => {
|
|
11561
|
+
const startDate = new Date(startDateStr);
|
|
11562
|
+
const endDate = new Date(endDateStr);
|
|
11563
|
+
const month = parseInt(monthStr, 10); // Ensure month is a number
|
|
11564
|
+
|
|
11565
|
+
if (isNaN(month) || month < 1 || month > 12) {
|
|
11566
|
+
return this.calendarStartYYYY
|
|
11567
|
+
}
|
|
11568
|
+
|
|
11569
|
+
let current = new Date(startDate.getFullYear(), startDate.getMonth(), 1);
|
|
11570
|
+
|
|
11571
|
+
while (current <= endDate) {
|
|
11572
|
+
if (current.getMonth() + 1 === month) { // getMonth() is 0-indexed
|
|
11573
|
+
return current.getFullYear() + "";
|
|
11574
|
+
}
|
|
11575
|
+
// Move to next month
|
|
11576
|
+
current.setMonth(current.getMonth() + 1);
|
|
11577
|
+
}
|
|
11578
|
+
|
|
11579
|
+
// If no matching month found in the range
|
|
11580
|
+
return this.calendarStartYYYY;
|
|
11581
|
+
}
|
|
11582
|
+
|
|
11583
|
+
|
|
11584
|
+
getCurrentYear = (mm: string) => {
|
|
11585
|
+
|
|
11538
11586
|
// var currMonth = new Date().getMonth() + 1;
|
|
11539
11587
|
|
|
11540
11588
|
// // if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
@@ -13014,6 +13062,13 @@ export class SfIEvents extends LitElement {
|
|
|
13014
13062
|
this.clearMessages();
|
|
13015
13063
|
}, 3000);
|
|
13016
13064
|
|
|
13065
|
+
} else if(parseInt(reporterdoc) > new Date().getTime()) {
|
|
13066
|
+
buttonClick.innerHTML = "Save"
|
|
13067
|
+
this.setError('Date of completion cannot be in future!');
|
|
13068
|
+
setTimeout(() => {
|
|
13069
|
+
this.clearMessages();
|
|
13070
|
+
}, 3000);
|
|
13071
|
+
|
|
13017
13072
|
} else {
|
|
13018
13073
|
|
|
13019
13074
|
//console.log('makerscheckers 1', reportercomments);
|
|
@@ -13303,7 +13358,7 @@ export class SfIEvents extends LitElement {
|
|
|
13303
13358
|
let url = "https://"+this.apiId+"/getalleventdetails";
|
|
13304
13359
|
|
|
13305
13360
|
//console.log('fetch calendar url', url);
|
|
13306
|
-
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.
|
|
13361
|
+
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)};
|
|
13307
13362
|
|
|
13308
13363
|
//console.log('urlbody', urlBody);
|
|
13309
13364
|
|
|
@@ -14339,6 +14394,13 @@ export class SfIEvents extends LitElement {
|
|
|
14339
14394
|
this.clearMessages();
|
|
14340
14395
|
}, 3000);
|
|
14341
14396
|
|
|
14397
|
+
} else if(parseInt(reporterdoc) > new Date().getTime()) {
|
|
14398
|
+
buttonClick.innerHTML = "Save"
|
|
14399
|
+
this.setError('Date of completion cannot be in future!');
|
|
14400
|
+
setTimeout(() => {
|
|
14401
|
+
this.clearMessages();
|
|
14402
|
+
}, 3000);
|
|
14403
|
+
|
|
14342
14404
|
} else {
|
|
14343
14405
|
|
|
14344
14406
|
//console.log('makerscheckers 1', reportercomments);
|
|
@@ -24292,16 +24354,16 @@ export class SfIEvents extends LitElement {
|
|
|
24292
24354
|
|
|
24293
24355
|
}
|
|
24294
24356
|
|
|
24295
|
-
renderWithFeatures = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00") => {
|
|
24357
|
+
renderWithFeatures = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
24296
24358
|
this.events = []
|
|
24297
24359
|
console.log('rendering and fetching', startDate, endDate, searchString, list, month)
|
|
24298
24360
|
if(this.selectedFeatures.indexOf('compliances') >= 0){
|
|
24299
|
-
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month)
|
|
24361
|
+
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month, year)
|
|
24300
24362
|
}else if(this.selectedFeatures.indexOf('notices') >= 0){
|
|
24301
|
-
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month);
|
|
24363
|
+
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month, year);
|
|
24302
24364
|
}
|
|
24303
24365
|
}
|
|
24304
|
-
fetchAndYearlyRenderUserCalendar_2 = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00") => {
|
|
24366
|
+
fetchAndYearlyRenderUserCalendar_2 = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
24305
24367
|
|
|
24306
24368
|
let path = "", view = "";
|
|
24307
24369
|
this.sdate = startDate;
|
|
@@ -24335,7 +24397,7 @@ export class SfIEvents extends LitElement {
|
|
|
24335
24397
|
let url = "https://"+this.apiId+"/"+ path;
|
|
24336
24398
|
|
|
24337
24399
|
//console.log('fetch calendar url', url);
|
|
24338
|
-
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":
|
|
24400
|
+
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};
|
|
24339
24401
|
|
|
24340
24402
|
if(searchString.length > 0) {
|
|
24341
24403
|
urlBody["searchstring"] = searchString;
|
|
@@ -24441,7 +24503,7 @@ export class SfIEvents extends LitElement {
|
|
|
24441
24503
|
|
|
24442
24504
|
}
|
|
24443
24505
|
|
|
24444
|
-
fetchAndRenderNotices = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00") => {
|
|
24506
|
+
fetchAndRenderNotices = async(startDate: string = "", endDate: string = "", searchString: string = "", list: string = "yes", month: string = "00", year: string = this.calendarStartYYYY) => {
|
|
24445
24507
|
|
|
24446
24508
|
let path = "", view = "";
|
|
24447
24509
|
this.sdate = startDate;
|
|
@@ -24475,7 +24537,7 @@ export class SfIEvents extends LitElement {
|
|
|
24475
24537
|
let url = "https://"+this.apiIdNotices+"/"+ path;
|
|
24476
24538
|
|
|
24477
24539
|
//console.log('fetch calendar url', url);
|
|
24478
|
-
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":
|
|
24540
|
+
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};
|
|
24479
24541
|
|
|
24480
24542
|
if(searchString.length > 0) {
|
|
24481
24543
|
urlBody["searchstring"] = searchString;
|