+ *ngFor="let item of NotificationHolderService.notificationList; let i = index">
diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts
index fa0438db4..eeb885948 100644
--- a/src/app/modals/profile/profile.page.ts
+++ b/src/app/modals/profile/profile.page.ts
@@ -12,6 +12,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { environment } from 'src/environments/environment';
import { ProcessesService } from 'src/app/services/processes.service';
import { EventsService } from 'src/app/services/events.service';
+import { NotificationHolderService } from 'src/app/store/notification-holder.service';
@Component({
selector: 'app-profile',
@@ -21,7 +22,6 @@ import { EventsService } from 'src/app/services/events.service';
export class ProfilePage implements OnInit {
userLoginPreference = ''
- notificationdata: any[] = [];
DataArray: Array
-
0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
- {{notificationLength}}
+
0" class="icon-badge" style="right: -6px;top: 38px;top: -6px;">
+ {{NotificationHolderService.notificationList.length}}
diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts
index aa3bd7e41..9b8190e38 100644
--- a/src/app/shared/header/header.page.ts
+++ b/src/app/shared/header/header.page.ts
@@ -14,6 +14,7 @@ import { PermissionService } from 'src/app/services/permission.service';
import { EventTrigger } from 'src/app/services/eventTrigger.service'
import { ActiveTabService } from 'src/app/services/active-tab.service';
import { NotificationsService } from 'src/app/services/notifications.service';
+import { NotificationHolderService } from 'src/app/store/notification-holder.service';
@Component({
selector: 'app-header',
@@ -55,6 +56,7 @@ export class HeaderPage implements OnInit {
private notificationService: NotificationsService,
private cdRef: ChangeDetectorRef,
private storageService: StorageService,
+ public NotificationHolderService: NotificationHolderService
) {
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
diff --git a/src/app/store/notification-holder.service.spec.ts b/src/app/store/notification-holder.service.spec.ts
new file mode 100644
index 000000000..191e1e1a4
--- /dev/null
+++ b/src/app/store/notification-holder.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { NotificationHolderService } from './notification-holder.service';
+
+describe('NotificationHolderService', () => {
+ let service: NotificationHolderService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(NotificationHolderService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/store/notification-holder.service.ts b/src/app/store/notification-holder.service.ts
new file mode 100644
index 000000000..de7b9e922
--- /dev/null
+++ b/src/app/store/notification-holder.service.ts
@@ -0,0 +1,118 @@
+import { Injectable } from '@angular/core';
+import { StorageService } from '../services/storage.service';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class NotificationHolderService {
+
+ notificationList = []
+
+ constructor(
+ private storageService: StorageService,
+ ) {
+
+ try {
+ this.restore()
+ } catch(error) {}
+
+ }
+
+ restore() {
+ this.storageService.get("Notifications").then((store) => {
+ if(Array.isArray(store)) {
+ this.notificationList = store
+ }
+ }).catch((error) => {})
+ }
+
+ save() {
+ this.storageService.store("Notifications", this.notificationList)
+ }
+
+ addNotification(notification) {
+
+ const element = notification
+ const i = this.notificationList.length + 1
+
+ let notificationObject;
+ if (element.notification) {
+
+ notificationObject = {
+ index: i,
+ title: element.notification.title,
+ Service: element.data.Service,
+ Object: element.data.Object,
+ IdObject: element.data.IdObject,
+ FolderId: element.data.FolderId,
+ body: element.notification.body,
+ dateInit: this.getFormatedTime(element.data.dateInit),
+ dateEnd: this.getFormatedTime(element.data.dateEnd),
+ Location: element.data.Location,
+ TypeAgenda: element.data.TypeAgenda,
+ Role: element.data.Role,
+ Status: element.data.Status,
+ read: false,
+ }
+
+ } else if (element.data) {
+ notificationObject = {
+ index: i,
+ title: element.title,
+ Service: element.data.Service,
+ Object: element.data.Object,
+ IdObject: element.data.IdObject,
+ FolderId: element.data.FolderId,
+ body: element.body,
+ dateInit: this.getFormatedTime(element.data.dateInit),
+ dateEnd: this.getFormatedTime(element.data.dateEnd),
+ Location: element.data.Location,
+ TypeAgenda: element.data.TypeAgenda,
+ Role: element.data.Role,
+ Status: element.data.Status,
+ read: false,
+ }
+
+ } else {
+ {
+ notificationObject = {
+ FolderId: element.FolderId,
+ IdObject: element.IdObject,
+ Location: element.Location,
+ Object: element.Object,
+ Role: element.Role,
+ Service: element.Service,
+ Status: element.Status,
+ TypeAgenda: element.TypeAgenda,
+ body: element.body,
+ dateEnd: element.dateEnd,
+ dateInit: element.dateInit,
+ index: element.index,
+ title: element.title,
+ read: false,
+ }
+ }
+ }
+
+ this.notificationList.push(notificationObject)
+ this.save()
+ }
+
+
+ getFormatedTime(dateString) {
+ var date = new Date(dateString);
+ var hours = date.getHours() /* > 12 ? date.getHours() - 12 : date.getHours() */;
+ var am_pm = date.getHours() >= 12 ? "pm" : "am";
+ var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
+ let time = hours + ":" + minutes /* + " " + am_pm */;
+ return time;
+ }
+
+ removeNotification(notification) {
+ this.notificationList = this.notificationList.filter( (e) => {
+ return e.index != notification.index
+ })
+ this.save()
+ }
+
+}
diff --git a/version/git-version.ts b/version/git-version.ts
index 887eda290..fc6b657ca 100644
--- a/version/git-version.ts
+++ b/version/git-version.ts
@@ -1,12 +1,12 @@
export let versionData = {
- "shortSHA": "081fe8692",
- "SHA": "081fe8692c8575cc102a91c6357d193d52cb9c0f",
- "branch": "developer-prod",
- "lastCommitAuthor": "'Eudes Inácio'",
- "lastCommitTime": "'Wed Aug 30 20:56:46 2023 +0100'",
- "lastCommitMessage": "pull made",
- "lastCommitNumber": "5252",
- "change": "",
- "changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged