sf-i-events 1.0.844 → 1.0.846
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 +49 -16
- package/src/sf-i-events.ts +58 -17
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
|
@@ -3970,7 +3970,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3970
3970
|
const id = ev.target.id;
|
|
3971
3971
|
const idArr = id.split("-");
|
|
3972
3972
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
3973
|
-
const yyyy = this.
|
|
3973
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
3974
3974
|
// const i = idArr[5];
|
|
3975
3975
|
const j = idArr[5];
|
|
3976
3976
|
let listReportingContainer = eventsContainer.querySelector('#list-reporting-container-' + mmdd.replace(/\//g, '-') + '-' + j);
|
|
@@ -4138,7 +4138,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4138
4138
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
4139
4139
|
const j = idArr[5];
|
|
4140
4140
|
const isnotice = idArr[6];
|
|
4141
|
-
var yyyy = this.
|
|
4141
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
4142
4142
|
if (isnotice === "isnotice") {
|
|
4143
4143
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
4144
4144
|
}
|
|
@@ -4168,7 +4168,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
4168
4168
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
4169
4169
|
const j = idArr[5];
|
|
4170
4170
|
const isnotice = idArr[6];
|
|
4171
|
-
var yyyy = this.
|
|
4171
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
4172
4172
|
if (isnotice === "isnotice") {
|
|
4173
4173
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
4174
4174
|
}
|
|
@@ -7567,7 +7567,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7567
7567
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
7568
7568
|
const j = idArr[5];
|
|
7569
7569
|
const isnotice = idArr[6];
|
|
7570
|
-
var yyyy = this.
|
|
7570
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
7571
7571
|
if (isnotice === "isnotice") {
|
|
7572
7572
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
7573
7573
|
}
|
|
@@ -7596,7 +7596,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7596
7596
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
7597
7597
|
const j = idArr[5];
|
|
7598
7598
|
const isnotice = idArr[6];
|
|
7599
|
-
var yyyy = this.
|
|
7599
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
7600
7600
|
if (isnotice === "isnotice") {
|
|
7601
7601
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
7602
7602
|
}
|
|
@@ -8048,7 +8048,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8048
8048
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
8049
8049
|
const j = idArr[5];
|
|
8050
8050
|
const isnotice = idArr[6];
|
|
8051
|
-
var yyyy = this.
|
|
8051
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
8052
8052
|
if (isnotice === "isnotice") {
|
|
8053
8053
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
8054
8054
|
}
|
|
@@ -8079,7 +8079,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8079
8079
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
8080
8080
|
const j = idArr[5];
|
|
8081
8081
|
const isnotice = idArr[6];
|
|
8082
|
-
var yyyy = this.
|
|
8082
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
8083
8083
|
if (isnotice === "isnotice") {
|
|
8084
8084
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy);
|
|
8085
8085
|
}
|
|
@@ -8256,6 +8256,39 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
8256
8256
|
});
|
|
8257
8257
|
});
|
|
8258
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
|
+
};
|
|
8259
8292
|
this.getCurrentYear = (mm) => {
|
|
8260
8293
|
// var currMonth = new Date().getMonth() + 1;
|
|
8261
8294
|
// // if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
@@ -9705,7 +9738,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9705
9738
|
console.log('listEvent', listEvent, listEvent.id);
|
|
9706
9739
|
let url = "https://" + this.apiId + "/getalleventdetails";
|
|
9707
9740
|
//console.log('fetch calendar url', url);
|
|
9708
|
-
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) };
|
|
9709
9742
|
//console.log('urlbody', urlBody);
|
|
9710
9743
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
9711
9744
|
const xhr = (await this.prepareXhr(urlBody, url, this._SfLoader, authorization, 'Preparing'));
|
|
@@ -9811,7 +9844,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
9811
9844
|
html += '<div class="accordian-container m-20 pb-20" part="accordian-container">';
|
|
9812
9845
|
html += '<div part="detail-summary">';
|
|
9813
9846
|
html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>' + event['obligationtitle'] + '</h1></div>');
|
|
9814
|
-
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'] + '</h3></div>');
|
|
9847
|
+
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>' + event['obligation'].replace(/\n/g, '<br />') + '</h3></div>');
|
|
9815
9848
|
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>');
|
|
9816
9849
|
html += '</div>';
|
|
9817
9850
|
html += '<br />';
|
|
@@ -18422,17 +18455,17 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18422
18455
|
this.dispatchEvent(changeEvent);
|
|
18423
18456
|
}
|
|
18424
18457
|
};
|
|
18425
|
-
this.renderWithFeatures = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
|
|
18458
|
+
this.renderWithFeatures = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
18426
18459
|
this.events = [];
|
|
18427
18460
|
console.log('rendering and fetching', startDate, endDate, searchString, list, month);
|
|
18428
18461
|
if (this.selectedFeatures.indexOf('compliances') >= 0) {
|
|
18429
|
-
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month);
|
|
18462
|
+
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month, year);
|
|
18430
18463
|
}
|
|
18431
18464
|
else if (this.selectedFeatures.indexOf('notices') >= 0) {
|
|
18432
|
-
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month);
|
|
18465
|
+
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month, year);
|
|
18433
18466
|
}
|
|
18434
18467
|
};
|
|
18435
|
-
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) => {
|
|
18436
18469
|
let path = "", view = "";
|
|
18437
18470
|
this.sdate = startDate;
|
|
18438
18471
|
this.edate = endDate;
|
|
@@ -18462,7 +18495,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18462
18495
|
}
|
|
18463
18496
|
let url = "https://" + this.apiId + "/" + path;
|
|
18464
18497
|
//console.log('fetch calendar url', url);
|
|
18465
|
-
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 };
|
|
18466
18499
|
if (searchString.length > 0) {
|
|
18467
18500
|
urlBody["searchstring"] = searchString;
|
|
18468
18501
|
}
|
|
@@ -18538,7 +18571,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18538
18571
|
}
|
|
18539
18572
|
}
|
|
18540
18573
|
};
|
|
18541
|
-
this.fetchAndRenderNotices = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00") => {
|
|
18574
|
+
this.fetchAndRenderNotices = async (startDate = "", endDate = "", searchString = "", list = "yes", month = "00", year = this.calendarStartYYYY) => {
|
|
18542
18575
|
var _a;
|
|
18543
18576
|
let path = "", view = "";
|
|
18544
18577
|
this.sdate = startDate;
|
|
@@ -18569,7 +18602,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
18569
18602
|
}
|
|
18570
18603
|
let url = "https://" + this.apiIdNotices + "/" + path;
|
|
18571
18604
|
//console.log('fetch calendar url', url);
|
|
18572
|
-
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 };
|
|
18573
18606
|
if (searchString.length > 0) {
|
|
18574
18607
|
urlBody["searchstring"] = searchString;
|
|
18575
18608
|
}
|
package/src/sf-i-events.ts
CHANGED
|
@@ -6368,7 +6368,7 @@ export class SfIEvents extends LitElement {
|
|
|
6368
6368
|
const id = ev.target.id;
|
|
6369
6369
|
const idArr = id.split("-")
|
|
6370
6370
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6371
|
-
const yyyy = this.
|
|
6371
|
+
const yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6372
6372
|
// const i = idArr[5];
|
|
6373
6373
|
const j = idArr[5];
|
|
6374
6374
|
let listReportingContainer = eventsContainer.querySelector('#list-reporting-container-'+mmdd.replace(/\//g,'-')+'-'+j) as HTMLDivElement
|
|
@@ -6564,7 +6564,7 @@ export class SfIEvents extends LitElement {
|
|
|
6564
6564
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6565
6565
|
const j = idArr[5];
|
|
6566
6566
|
const isnotice = idArr[6];
|
|
6567
|
-
var yyyy = this.
|
|
6567
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6568
6568
|
if(isnotice === "isnotice"){
|
|
6569
6569
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6570
6570
|
}else{
|
|
@@ -6601,7 +6601,7 @@ export class SfIEvents extends LitElement {
|
|
|
6601
6601
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
6602
6602
|
const j = idArr[5];
|
|
6603
6603
|
const isnotice = idArr[6];
|
|
6604
|
-
var yyyy = this.
|
|
6604
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
6605
6605
|
if(isnotice === "isnotice"){
|
|
6606
6606
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
6607
6607
|
}else{
|
|
@@ -10702,7 +10702,7 @@ export class SfIEvents extends LitElement {
|
|
|
10702
10702
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
10703
10703
|
const j = idArr[5];
|
|
10704
10704
|
const isnotice = idArr[6];
|
|
10705
|
-
var yyyy = this.
|
|
10705
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
10706
10706
|
if(isnotice === "isnotice"){
|
|
10707
10707
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10708
10708
|
}else{
|
|
@@ -10739,7 +10739,7 @@ export class SfIEvents extends LitElement {
|
|
|
10739
10739
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
10740
10740
|
const j = idArr[5];
|
|
10741
10741
|
const isnotice = idArr[6];
|
|
10742
|
-
var yyyy = this.
|
|
10742
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
10743
10743
|
if(isnotice === "isnotice"){
|
|
10744
10744
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
10745
10745
|
}else{
|
|
@@ -11288,7 +11288,7 @@ export class SfIEvents extends LitElement {
|
|
|
11288
11288
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
11289
11289
|
const j = idArr[5];
|
|
11290
11290
|
const isnotice = idArr[6];
|
|
11291
|
-
var yyyy = this.
|
|
11291
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
11292
11292
|
if(isnotice === "isnotice"){
|
|
11293
11293
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11294
11294
|
}else{
|
|
@@ -11329,7 +11329,7 @@ export class SfIEvents extends LitElement {
|
|
|
11329
11329
|
const mmdd = idArr[3] + "/" + idArr[4];
|
|
11330
11330
|
const j = idArr[5];
|
|
11331
11331
|
const isnotice = idArr[6];
|
|
11332
|
-
var yyyy = this.
|
|
11332
|
+
var yyyy = this.getYearFromMonthBetween(this.sdate, this.edate, idArr[3]);
|
|
11333
11333
|
if(isnotice === "isnotice"){
|
|
11334
11334
|
this.renderNoticeDetails(this.events[mmdd][j], mmdd + "/" + yyyy)
|
|
11335
11335
|
}else{
|
|
@@ -11540,8 +11540,49 @@ export class SfIEvents extends LitElement {
|
|
|
11540
11540
|
|
|
11541
11541
|
}
|
|
11542
11542
|
|
|
11543
|
-
|
|
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
|
+
}
|
|
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
|
+
|
|
11544
11583
|
|
|
11584
|
+
getCurrentYear = (mm: string) => {
|
|
11585
|
+
|
|
11545
11586
|
// var currMonth = new Date().getMonth() + 1;
|
|
11546
11587
|
|
|
11547
11588
|
// // if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
@@ -13317,7 +13358,7 @@ export class SfIEvents extends LitElement {
|
|
|
13317
13358
|
let url = "https://"+this.apiId+"/getalleventdetails";
|
|
13318
13359
|
|
|
13319
13360
|
//console.log('fetch calendar url', url);
|
|
13320
|
-
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)};
|
|
13321
13362
|
|
|
13322
13363
|
//console.log('urlbody', urlBody);
|
|
13323
13364
|
|
|
@@ -13436,7 +13477,7 @@ export class SfIEvents extends LitElement {
|
|
|
13436
13477
|
|
|
13437
13478
|
html += '<div part="detail-summary">';
|
|
13438
13479
|
html += ('<div part="detail-summary-title" class="pl-20 pr-20"><h1>'+event['obligationtitle']+'</h1></div>');
|
|
13439
|
-
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>'+event['obligation']+'</h3></div>');
|
|
13480
|
+
html += ('<div part="detail-summary-subtitle" class="pl-20 pr-20"><h3>'+event['obligation'].replace(/\n/g,'<br />')+'</h3></div>');
|
|
13440
13481
|
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>');
|
|
13441
13482
|
html += '</div>';
|
|
13442
13483
|
|
|
@@ -24313,16 +24354,16 @@ export class SfIEvents extends LitElement {
|
|
|
24313
24354
|
|
|
24314
24355
|
}
|
|
24315
24356
|
|
|
24316
|
-
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) => {
|
|
24317
24358
|
this.events = []
|
|
24318
24359
|
console.log('rendering and fetching', startDate, endDate, searchString, list, month)
|
|
24319
24360
|
if(this.selectedFeatures.indexOf('compliances') >= 0){
|
|
24320
|
-
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month)
|
|
24361
|
+
this.fetchAndYearlyRenderUserCalendar_2(startDate, endDate, searchString, list, month, year)
|
|
24321
24362
|
}else if(this.selectedFeatures.indexOf('notices') >= 0){
|
|
24322
|
-
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month);
|
|
24363
|
+
this.fetchAndRenderNotices(startDate, endDate, searchString, list, month, year);
|
|
24323
24364
|
}
|
|
24324
24365
|
}
|
|
24325
|
-
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) => {
|
|
24326
24367
|
|
|
24327
24368
|
let path = "", view = "";
|
|
24328
24369
|
this.sdate = startDate;
|
|
@@ -24356,7 +24397,7 @@ export class SfIEvents extends LitElement {
|
|
|
24356
24397
|
let url = "https://"+this.apiId+"/"+ path;
|
|
24357
24398
|
|
|
24358
24399
|
//console.log('fetch calendar url', url);
|
|
24359
|
-
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};
|
|
24360
24401
|
|
|
24361
24402
|
if(searchString.length > 0) {
|
|
24362
24403
|
urlBody["searchstring"] = searchString;
|
|
@@ -24462,7 +24503,7 @@ export class SfIEvents extends LitElement {
|
|
|
24462
24503
|
|
|
24463
24504
|
}
|
|
24464
24505
|
|
|
24465
|
-
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) => {
|
|
24466
24507
|
|
|
24467
24508
|
let path = "", view = "";
|
|
24468
24509
|
this.sdate = startDate;
|
|
@@ -24496,7 +24537,7 @@ export class SfIEvents extends LitElement {
|
|
|
24496
24537
|
let url = "https://"+this.apiIdNotices+"/"+ path;
|
|
24497
24538
|
|
|
24498
24539
|
//console.log('fetch calendar url', url);
|
|
24499
|
-
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};
|
|
24500
24541
|
|
|
24501
24542
|
if(searchString.length > 0) {
|
|
24502
24543
|
urlBody["searchstring"] = searchString;
|