mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment
This commit is contained in:
@@ -32,6 +32,8 @@ import { EventTrigger } from 'src/app/services/eventTrigger.service';
|
|||||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { Plugins } from '@capacitor/core';
|
import { Plugins } from '@capacitor/core';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
const { App } = Plugins;
|
const { App } = Plugins;
|
||||||
|
|
||||||
@@ -128,6 +130,7 @@ export class ChatPage implements OnInit {
|
|||||||
private RochetChatConnectorService: RochetChatConnectorService,
|
private RochetChatConnectorService: RochetChatConnectorService,
|
||||||
private zone: NgZone,
|
private zone: NgZone,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.headers = new HttpHeaders();;
|
this.headers = new HttpHeaders();;
|
||||||
@@ -175,8 +178,18 @@ export class ChatPage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.ChatSystemService.setMainChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
// this.setStatus('offline');
|
// this.setStatus('offline');
|
||||||
this.routerSubscription?.unsubscribe();
|
this.routerSubscription?.unsubscribe();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<ion-toolbar class="header-toolbar">
|
<ion-toolbar class="header-toolbar">
|
||||||
<div class="main-header">
|
<div class="main-header" *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
<div class="header-top">
|
<div class="header-top">
|
||||||
<!-- <app-btn-modal-dismiss></app-btn-modal-dismiss> -->
|
<!-- <app-btn-modal-dismiss></app-btn-modal-dismiss> -->
|
||||||
<div class="left">
|
<div class="left">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
<ion-content>
|
<ion-content *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
|
|
||||||
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
|
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
|
||||||
<div class="welcome-text">
|
<div class="welcome-text">
|
||||||
@@ -277,7 +277,7 @@
|
|||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer *ngIf="ChatSystemService.getGroupRoom(roomId)">
|
||||||
|
|
||||||
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
|
||||||
<ngx-letters-avatar *ngIf="showAvatar" [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30"
|
<ngx-letters-avatar *ngIf="showAvatar" [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30"
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { sanitize } from "sanitize-filename-ts";
|
import { sanitize } from "sanitize-filename-ts";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
templateUrl: './group-messages.page.html',
|
templateUrl: './group-messages.page.html',
|
||||||
@@ -108,7 +107,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private file: File,
|
private file: File,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public RouteService: RouteService,
|
public RouteService: RouteService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
this.ChatSystemService.getUser()
|
this.ChatSystemService.getUser()
|
||||||
|
|
||||||
@@ -137,6 +137,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
open() {
|
open() {
|
||||||
try {
|
try {
|
||||||
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
|
||||||
@@ -144,6 +146,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||||
|
|
||||||
|
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.open()
|
this.open()
|
||||||
@@ -151,6 +156,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection page')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.loggedUser = this.loggedUserChat;
|
this.loggedUser = this.loggedUserChat;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import { NotificationsService } from 'src/app/services/notifications.service';
|
|||||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
|
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { sanitize } from "sanitize-filename-ts";
|
import { sanitize } from "sanitize-filename-ts";
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +122,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public RochetChatConnectorService: RochetChatConnectorService,
|
public RochetChatConnectorService: RochetChatConnectorService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -140,6 +142,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
||||||
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollToBottomClicked()
|
this.scrollToBottomClicked()
|
||||||
@@ -147,8 +153,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
//alert(error)
|
//alert(error)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection page')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export class ChatSystemService {
|
|||||||
loadingUsers = false
|
loadingUsers = false
|
||||||
|
|
||||||
onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true })
|
onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true })
|
||||||
|
private mainChangeDetector: Function = () => {}
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -66,7 +67,7 @@ export class ChatSystemService {
|
|||||||
private AttachmentsService: AttachmentsService,
|
private AttachmentsService: AttachmentsService,
|
||||||
private NetworkServiceService: NetworkServiceService,
|
private NetworkServiceService: NetworkServiceService,
|
||||||
private ViewedMessageService: ViewedMessageService,
|
private ViewedMessageService: ViewedMessageService,
|
||||||
private notificationService: NotificationsService
|
private notificationService: NotificationsService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
@@ -148,9 +149,15 @@ export class ChatSystemService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch(error) {}
|
} catch(error) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
setMainChangeDetector(x:Function) {
|
||||||
|
this.mainChangeDetector = x
|
||||||
|
}
|
||||||
|
|
||||||
|
runMainChangeDetector() {
|
||||||
|
console.log("change")
|
||||||
|
this.mainChangeDetector()
|
||||||
}
|
}
|
||||||
|
|
||||||
loadChat() {
|
loadChat() {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { ChatSystemService } from './chat-system.service';
|
|||||||
import { ViewedMessageService } from './viewed-message.service'
|
import { ViewedMessageService } from './viewed-message.service'
|
||||||
import * as FIFOProcessQueue from 'fifo-process-queue';
|
import * as FIFOProcessQueue from 'fifo-process-queue';
|
||||||
import { NotificationsService } from '../notifications.service';
|
import { NotificationsService } from '../notifications.service';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -84,6 +85,7 @@ export class RoomService {
|
|||||||
|
|
||||||
sortRoomList = () => { }
|
sortRoomList = () => { }
|
||||||
chatServiceDeleteRoom = (roomId) => { }
|
chatServiceDeleteRoom = (roomId) => { }
|
||||||
|
private changeDetector: Function = () => {}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public RochetChatConnectorService: RochetChatConnectorService,
|
public RochetChatConnectorService: RochetChatConnectorService,
|
||||||
@@ -190,6 +192,11 @@ export class RoomService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setChangeDetector(x:Function) {
|
||||||
|
console.log("set change detector")
|
||||||
|
this.changeDetector = x
|
||||||
|
}
|
||||||
|
|
||||||
get online() {
|
get online() {
|
||||||
|
|
||||||
if (!this.isGroup) {
|
if (!this.isGroup) {
|
||||||
@@ -372,8 +379,6 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.messageUnread = true
|
this.messageUnread = true
|
||||||
|
|
||||||
// this.sortRoomList()
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollDown()
|
this.scrollDown()
|
||||||
}, 50)
|
}, 50)
|
||||||
@@ -386,6 +391,7 @@ export class RoomService {
|
|||||||
this.name = ChatMessage.msg
|
this.name = ChatMessage.msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.changeDetector()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
done()
|
done()
|
||||||
}, 5)
|
}, 5)
|
||||||
|
|||||||
@@ -14,9 +14,10 @@ import { notificationObject } from '../models/notifications';
|
|||||||
import { Capacitor } from '@capacitor/core';
|
import { Capacitor } from '@capacitor/core';
|
||||||
import { AngularFireMessaging } from '@angular/fire/messaging';
|
import { AngularFireMessaging } from '@angular/fire/messaging';
|
||||||
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
||||||
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
import { FCM } from '@capacitor-community/fcm';
|
import { FCM } from '@capacitor-community/fcm';
|
||||||
|
import { ChatSystemService } from './chat/chat-system.service';
|
||||||
|
import {ChatController} from 'src/app/controller/chat'
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -42,6 +43,8 @@ export class NotificationsService {
|
|||||||
notificationReceived: EventEmitter<void> = new EventEmitter<void>();
|
notificationReceived: EventEmitter<void> = new EventEmitter<void>();
|
||||||
token = ''
|
token = ''
|
||||||
|
|
||||||
|
ChatController = ChatController
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private storageService: StorageService,
|
private storageService: StorageService,
|
||||||
@@ -199,6 +202,7 @@ export class NotificationsService {
|
|||||||
this.active = true
|
this.active = true
|
||||||
console.log('NOtification Listener', notification)
|
console.log('NOtification Listener', notification)
|
||||||
this.storenotification(notification)
|
this.storenotification(notification)
|
||||||
|
this.chatNotification(notification)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -206,11 +210,13 @@ export class NotificationsService {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.afMessaging.messages.subscribe((notification) => {
|
this.afMessaging.messages.subscribe((notification) => {
|
||||||
|
console.log(notification)
|
||||||
this.storenotification(notification)
|
this.storenotification(notification)
|
||||||
this.notificationReceived.emit();
|
this.notificationReceived.emit();
|
||||||
this.eventtrigger.publishSomeData({
|
this.eventtrigger.publishSomeData({
|
||||||
notification: "recive"
|
notification: "recive"
|
||||||
})
|
})
|
||||||
|
this.chatNotification(notification)
|
||||||
// Handle the received message, e.g., show a notification
|
// Handle the received message, e.g., show a notification
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -393,4 +399,13 @@ export class NotificationsService {
|
|||||||
// })()
|
// })()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
chatNotification(_notification) {
|
||||||
|
const notification = this.NotificationHolderService.stractureNotificationObject(_notification)
|
||||||
|
|
||||||
|
if (notification?.notification?.data?.Service === "chat" || notification?.Service === "chat") {
|
||||||
|
this.ChatController.ChatSystemService.runMainChangeDetector()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
templateUrl: './group-messages.page.html',
|
templateUrl: './group-messages.page.html',
|
||||||
@@ -103,7 +103,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.ChatSystemService.getUser()
|
this.ChatSystemService.getUser()
|
||||||
@@ -119,7 +120,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||||
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
|
||||||
|
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
this.showAvatar = false
|
this.showAvatar = false
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -131,6 +134,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection shared')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loggedUser = this.loggedUserChat;
|
this.loggedUser = this.loggedUserChat;
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
|||||||
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
||||||
import { PermissionService } from 'src/app/services/permission.service';
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@@ -123,7 +124,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private FileValidatorService: FileValidatorService
|
private FileValidatorService: FileValidatorService,
|
||||||
|
private ChangeDetectorRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
// update
|
// update
|
||||||
this.checkAudioPermission()
|
this.checkAudioPermission()
|
||||||
@@ -138,6 +140,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
|
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId)
|
||||||
|
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
|
||||||
|
this.changeDetector()
|
||||||
|
})
|
||||||
|
|
||||||
this.showAvatar = false
|
this.showAvatar = false
|
||||||
|
|
||||||
|
|
||||||
@@ -154,6 +161,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeDetector = () => {
|
||||||
|
console.log('run detection shared')
|
||||||
|
this.ChangeDetectorRef.detectChanges()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async ChatMessageDebuggingPage() {
|
async ChatMessageDebuggingPage() {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
|
|||||||
@@ -114,6 +114,74 @@ export class NotificationHolderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
stractureNotificationObject(notification) {
|
||||||
|
const element = notification
|
||||||
|
let notificationObject;
|
||||||
|
|
||||||
|
if (element.notification) {
|
||||||
|
|
||||||
|
notificationObject = {
|
||||||
|
id: notification?.id || uuidv4(),
|
||||||
|
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 = {
|
||||||
|
id: notification?.id || uuidv4(),
|
||||||
|
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 = {
|
||||||
|
id: notification?.id || uuidv4(),
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
notificationObject.hashCode = (SHA1(notification)).toString()
|
||||||
|
|
||||||
|
return notificationObject
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
addNotification(notification) {
|
addNotification(notification) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user