mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
add either pattern
This commit is contained in:
@@ -118,25 +118,23 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
this.agendaDataRepository.approveEvent(serialNumber).subscribe((value) => {
|
||||
console.log(value)
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
}, ((error) => {
|
||||
console.log('aprove event error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}))
|
||||
/* await this.processes.PostTaskAction(body).toPromise() */
|
||||
const result = await this.agendaDataRepository.approveEvent(serialNumber)// .subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
this.close()
|
||||
loader.remove()
|
||||
console.log(result.value)
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.httpErroHandle.httpsSucessMessagge('Aprovar')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
} else {
|
||||
|
||||
console.log('aprove event error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
this.close()
|
||||
loader.remove()
|
||||
|
||||
|
||||
}
|
||||
|
||||
async rejectTask(serialNumber: string) {
|
||||
@@ -145,24 +143,20 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "")//.subscribe((value) => {
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise() */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Declined', "").subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rejeitar');
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
}, ((error) => {
|
||||
console.log('reject event error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}))
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.close()
|
||||
} else {
|
||||
|
||||
console.log('reject event error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
@@ -235,23 +229,20 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
try {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note).subscribe((value) => {
|
||||
/* await this.processes.PostTaskAction(body).toPromise(); */
|
||||
const result = await this.agendaDataRepository.eventToaprovalStatus(serialNumber, 'Revision', res.data.note)// .subscribe((value) => {
|
||||
if(result.isOk()) {
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
this.TaskService.loadEventosParaAprovacao();
|
||||
this.close();
|
||||
},((error) => {
|
||||
console.log('send event to revision error: ', error)
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}));
|
||||
} else {
|
||||
|
||||
console.log('send event to revision error: ', result.error)
|
||||
this.httpErroHandle.httpStatusHandle(result.error)
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -400,19 +400,20 @@ export class EditEventToApprovePage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
/* await this.eventsService.postEventToApproveEdit(event).toPromise() */
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
|
||||
if(calendar.isOk()) {
|
||||
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => {
|
||||
const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing)
|
||||
|
||||
if(value.isOk()) {
|
||||
console.log(value)
|
||||
this.close()
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
} else {
|
||||
console.log('edit event error: ', value.error)
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
}));
|
||||
}
|
||||
|
||||
console.log({serverCurrentList, list: this.eventProcess.workflowInstanceDataFields.ParticipantsList, e: this.eventProcess})
|
||||
|
||||
@@ -421,7 +422,7 @@ export class EditEventToApprovePage implements OnInit {
|
||||
console.log({insert, remove})
|
||||
|
||||
if(insert.length >= 1) {
|
||||
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert).subscribe((value) => {
|
||||
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
console.log('add Attendee error: ', error)
|
||||
|
||||
@@ -416,34 +416,33 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
|
||||
console.log('this.selectedUserCalendar', this.selectedUserCalendar)
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.showLoader = true;
|
||||
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
const value = await this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, this.editAllEvent, calendar.value, tracing)
|
||||
|
||||
if(value.isOk()) {
|
||||
console.log(value.value)
|
||||
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
this.clearPostEvent.emit();
|
||||
this.deleteTemporaryData();
|
||||
this.showLoader = false;
|
||||
this.close();
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
|
||||
}, ((error) => {
|
||||
console.log('edit event error: ', error)
|
||||
tracing
|
||||
} else {
|
||||
console.log('edit event error: ', value.error)
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
}));
|
||||
}
|
||||
|
||||
console.log({serverCurrentList, Attendees: this._postEvent.Attendees})
|
||||
|
||||
const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this._postEvent.Attendees as any)
|
||||
|
||||
console.log({ insert, remove });
|
||||
|
||||
if(insert.length >= 1) {
|
||||
this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert).subscribe((value) => {
|
||||
this.agendaDataRepository.addEventAttendee(this._postEvent.EventId, insert, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
tracing.setAttribute('failed.attendees', 'true')
|
||||
|
||||
@@ -33,6 +33,8 @@ import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda
|
||||
import { RoleIdService } from 'src/app/services/role-id.service'
|
||||
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||
import { UserList } from 'src/app/models/entiry/agenda/contact';
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -85,7 +87,7 @@ export class NewEventPage implements OnInit {
|
||||
@Input() selectedSegment: string;
|
||||
@Input() selectedDate: Date;
|
||||
@Input() CalendarDate: Date;
|
||||
@Input() taskParticipants: EventPerson[] = [];
|
||||
@Input() taskParticipants: UserList = [];
|
||||
@Input() taskParticipantsCc: any = [];
|
||||
|
||||
@Output() setIntervenient = new EventEmitter<any>();
|
||||
@@ -131,8 +133,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[] = [];
|
||||
eventPersons: UserList;
|
||||
contacts: UserList = [];
|
||||
allDayCheck: boolean = false;
|
||||
|
||||
|
||||
@@ -153,6 +155,7 @@ export class NewEventPage implements OnInit {
|
||||
private changeProfileService: ChangeProfileService,
|
||||
private agendaDataRepository: AgendaDataRepositoryService,
|
||||
public RoleIdService: RoleIdService,
|
||||
private ContactRepositoryService: ContactRepositoryService
|
||||
) {
|
||||
this.dateAdapter.setLocale('pt');
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -208,7 +211,7 @@ export class NewEventPage implements OnInit {
|
||||
if (this.postEvent.Attendees != null) {
|
||||
this.postEvent.Attendees.forEach(e => {
|
||||
if (e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
this.taskParticipants.push(e as any);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
}
|
||||
@@ -553,29 +556,30 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
let loader = this.toastService.loading();
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) as any
|
||||
this.postEvent.IsAllDayEvent = this.allDayCheck;
|
||||
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
|
||||
if(calendar.isOk()) {
|
||||
|
||||
try {
|
||||
const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing).toPromise()
|
||||
const value = await this.agendaDataRepository.createEvent(this.postEvent, this.documents, calendar.value, tracing)
|
||||
|
||||
if(value.isOk()) {
|
||||
|
||||
console.log(value)
|
||||
this.afterSave();
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||
loader.remove();
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
} catch (error) {
|
||||
console.log('create event error: ', error)
|
||||
} else {
|
||||
console.log('create event error: ', value.error)
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
loader.remove();
|
||||
this.hhtpErrorHandle.httpStatusHandle(error.status)
|
||||
this.hhtpErrorHandle.httpStatusHandle(value.error.status)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {}
|
||||
|
||||
|
||||
}
|
||||
@@ -672,7 +676,11 @@ export class NewEventPage implements OnInit {
|
||||
async fetchContacts(filter: string) {
|
||||
console.log(this.loggeduser.Profile)
|
||||
if (this.loggeduser.Profile == 'PR') {
|
||||
this.contactsService.getContacts(filter).subscribe(result => {
|
||||
|
||||
const RequestResult = await this.ContactRepositoryService.getUsersMap();
|
||||
if(RequestResult.isOk()) {
|
||||
const result = RequestResult.value
|
||||
|
||||
if (this.eventPersons != null) {
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
@@ -685,7 +693,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
this.contacts = result;
|
||||
console.log('Attendes Email', this.loggeduser.Email)
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleId == this.RoleIdService.MD)
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
|
||||
this.contacts = filterLoggedUserEmail;
|
||||
@@ -693,8 +701,11 @@ export class NewEventPage implements OnInit {
|
||||
this.taskParticipants.push(this.contacts[0]);
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
console.log('Attendes Email', this.taskParticipants)
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import { SearchList_v2 } from 'src/app/models/search-document';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { isHttpError } from 'src/app/services/http.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { DeleteEventRecurrencePage, EventDeleteRecurrenceComponentReturn } from 'src/app/modals/delete-event-recurrence/delete-event-recurrence.page';
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
templateUrl: './view-event.page.html',
|
||||
@@ -209,29 +210,41 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
deleteYesOrNo() {
|
||||
async deleteYesOrNo() {
|
||||
|
||||
if (this.loadedEvent.IsRecurring) {
|
||||
const modal = await this.modalController.create({
|
||||
component: DeleteEventRecurrencePage,
|
||||
componentProps: {},
|
||||
cssClass: 'event-recurrence-modal',
|
||||
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
const data: EventDeleteRecurrenceComponentReturn = res.data
|
||||
if(data =='DeleteAll') {
|
||||
this.deleteEvent_v2(true);
|
||||
|
||||
} else if (data == 'DeleteOne') {
|
||||
this.deleteEvent_v2(false);
|
||||
} else if(data == 'Cancel') {
|
||||
this.close()
|
||||
} else {
|
||||
this.close()
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
} else {
|
||||
this.alertController.create({
|
||||
header: 'Eliminar evento?',
|
||||
message: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?',
|
||||
inputs: [
|
||||
{
|
||||
name: 'confirm',
|
||||
type: 'checkbox',
|
||||
label: '',
|
||||
value: 'confirm',
|
||||
checked: false,
|
||||
}
|
||||
],
|
||||
message: '',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sim',
|
||||
handler: (data) => {
|
||||
if (data.includes('confirm')) {
|
||||
this.deleteEvent_v2(true);
|
||||
} else {
|
||||
this.deleteEvent_v2(false);
|
||||
}
|
||||
handler: () => {
|
||||
this.deleteEvent_v2(false);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -242,44 +255,29 @@ export class ViewEventPage implements OnInit {
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
});
|
||||
} else {
|
||||
this.alertController.create({
|
||||
header: 'Eliminar evento?',
|
||||
message: '',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.deleteEvent_v2(false);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Não',
|
||||
handler: () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteEvent_v2(deleteAll) {
|
||||
async deleteEvent_v2(deleteAll) {
|
||||
console.log(this.loadedEvent.EventId)
|
||||
const loader = this.toastService.loading()
|
||||
this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll).subscribe(() => {
|
||||
console.log()
|
||||
const value = await this.agendaDataRepository.deleteEvent(this.loadedEvent.EventId,deleteAll)//.subscribe(() => {
|
||||
|
||||
if(value.isOk()) {
|
||||
|
||||
console.log(value.value)
|
||||
this.httpErrorHandle.httpsSucessMessagge('delete event')
|
||||
this.close();
|
||||
},(error) => {
|
||||
console.log('delete event error: ',error)
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
},()=>{
|
||||
loader.remove();
|
||||
});
|
||||
} else {
|
||||
|
||||
console.log('delete event error: ', value.error)
|
||||
this.httpErrorHandle.httpStatusHandle(value.error)
|
||||
}
|
||||
|
||||
loader.remove();
|
||||
|
||||
}
|
||||
|
||||
// async deleteEvent() {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -9,6 +7,7 @@ import { Searchbar } from 'ionic-angular';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendee-modal',
|
||||
@@ -52,10 +51,9 @@ export class AttendeePage implements OnInit {
|
||||
listOfNotAllowdRoute = ['/home/gabinete-digital/despachos/', ]
|
||||
|
||||
constructor(
|
||||
private modalCtrl: ModalController,
|
||||
private contactsService: ContactsService,
|
||||
public ThemeService: ThemeService,
|
||||
private router: Router,) {
|
||||
private router: Router,
|
||||
private ContactRepositoryService: ContactRepositoryService) {
|
||||
|
||||
|
||||
|
||||
@@ -234,7 +232,13 @@ export class AttendeePage implements OnInit {
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(_result => {
|
||||
const RequestResult = await this.ContactRepositoryService.getUsersMap();
|
||||
|
||||
if(RequestResult.isOk()) {
|
||||
const _result = RequestResult.value
|
||||
|
||||
|
||||
console.log({_result})
|
||||
|
||||
let result
|
||||
if(this.hideExternalDomain) {
|
||||
@@ -270,8 +274,10 @@ export class AttendeePage implements OnInit {
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
checkStringNull(value: string) {
|
||||
|
||||
@@ -327,17 +327,19 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId((this.eventProcess as any).owner.wxUserId)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing).subscribe((value) => {
|
||||
const value = await this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, true, calendar.value, tracing)//.subscribe((value) => {
|
||||
|
||||
if(value.isOk()) {
|
||||
console.log(value)
|
||||
this.httpErroHalde.httpsSucessMessagge('Editar evento')
|
||||
window['approve-event-getTask']()
|
||||
this.close();
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
}, ((error) => {
|
||||
this.httpErroHalde.httpStatusHandle(error)
|
||||
console.log('edit event error: ', error)
|
||||
} else {
|
||||
this.httpErroHalde.httpStatusHandle(value.error)
|
||||
console.log('edit event error: ', value.error)
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
}));
|
||||
}
|
||||
|
||||
console.log({serverCurrentList, ParticipantsList:this.eventProcess.workflowInstanceDataFields.ParticipantsList})
|
||||
const { insert, remove } = AttendeesLIstChangeDetector(serverCurrentList as any, this.eventProcess.workflowInstanceDataFields.ParticipantsList as any)
|
||||
@@ -346,7 +348,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
if(insert.length >= 1) {
|
||||
|
||||
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert).subscribe((value) => {
|
||||
this.agendaDataRepository.addEventAttendee(this.eventProcess.serialNumber, insert, tracing).subscribe((value) => {
|
||||
|
||||
}, ((error) => {
|
||||
console.log('add Attendee error: ', error)
|
||||
|
||||
@@ -11,9 +11,7 @@ import { ThemeService } from '../../services/theme.service';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
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 { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
|
||||
import { HeaderSettingsService } from "src/app/services/header-settings.service"
|
||||
@@ -64,15 +62,11 @@ export class HeaderPage implements OnInit {
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private animationController: AnimationController,
|
||||
private storageservice: StorageService,
|
||||
public platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
public RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
private eventTriger: EventTrigger,
|
||||
public ActiveTabService: ActiveTabService,
|
||||
private notificationService: NotificationsService,
|
||||
private cdRef: ChangeDetectorRef,
|
||||
private storageService: StorageService,
|
||||
private zone: NgZone,
|
||||
private attachmentService: AttachmentsService,
|
||||
@@ -84,10 +78,6 @@ export class HeaderPage implements OnInit {
|
||||
|
||||
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
|
||||
|
||||
this.notificationCount$.subscribe(count => {
|
||||
console.log('Notification Count:', count);
|
||||
});
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
router.events.subscribe((val) => {
|
||||
this.hideSearch();
|
||||
@@ -162,50 +152,15 @@ export class HeaderPage implements OnInit {
|
||||
}
|
||||
|
||||
updateReciveNotification() {
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
if (event.notification == "recive") {
|
||||
console.log('header', event.notification)
|
||||
this.notificationLengthData()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
updateDeleteNotification() {
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
if (event.notification == "deleted") {
|
||||
console.log('header', event.notification)
|
||||
this.notificationLengthData()
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
async notificationLengthData() {
|
||||
console.log('Call notification data')
|
||||
await this.storageservice.get("Notifications").then((value) => {
|
||||
|
||||
console.log('Get notification data',)
|
||||
|
||||
this.zone.run(() => {
|
||||
this.notificationLength = value.length;
|
||||
console.log('Call notification data', this.notificationLength)
|
||||
});
|
||||
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
if (!error) {
|
||||
this.zone.run(() => {
|
||||
console.error('header storage get notification', error)
|
||||
this.notificationLength = 0;
|
||||
});
|
||||
} else {
|
||||
console.error('header storage get notification', error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
hideSearch() {
|
||||
if (this.router.url.startsWith('/home/events') || this.router.url.startsWith('/home/chat')) {
|
||||
this.hideSearchBtn = true;
|
||||
@@ -301,8 +256,6 @@ export class HeaderPage implements OnInit {
|
||||
|
||||
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.notificationLengthData()
|
||||
this.getProfilePictureSorage()
|
||||
this.showProfileModal = false
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user