mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
merge
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5">GABINETE DIGITAL</p>
|
||||
<div class="add-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text color-white">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text color-white">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
|
||||
<div class="add-line-white"></div>
|
||||
</div>
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5">GABINETE DIGITAL</p>
|
||||
<div class="add-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text color-white">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text color-white">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
|
||||
<div class="add-line-white"></div>
|
||||
</div>
|
||||
@@ -45,7 +45,8 @@
|
||||
</ion-buttons>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<ion-label (click)="asyncNotification()">{{notificationdata.length}} novas notificações</ion-label>
|
||||
<ion-label (click)="asyncNotification()" *ngIf="notificationdata">{{notificationdata.length}} novas notificações</ion-label>
|
||||
<ion-label (click)="asyncNotification()" *ngIf="!notificationdata">0 novas notificações</ion-label>
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<span class="date">{{loadedEvent.Location}}</span>
|
||||
|
||||
<div *ngIf="loadedEvent.Organizer">
|
||||
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
|
||||
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Calendário Partilhado' ">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
|
||||
</div>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { Event } from '../../models/event.model';
|
||||
import { EditEventPage } from 'src/app/pages/agenda/edit-event/edit-event.page';
|
||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -54,6 +55,8 @@ export class ViewEventPage implements OnInit {
|
||||
header = true
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
LoadedDocument: any = null;
|
||||
CalendarId
|
||||
sesseionStora = SessionStore
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -74,6 +77,7 @@ export class ViewEventPage implements OnInit {
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
this.eventId = this.navParams.get('eventId');
|
||||
this.CalendarId = this.navParams.get('CalendarId');
|
||||
this.isEventEdited = false;
|
||||
this.loadedEvent = new Event();
|
||||
this.eventBody = { BodyType: "1", Text: "" };
|
||||
@@ -127,24 +131,51 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
loadEvent() {
|
||||
const loader = this.toastService.loading();
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
/* this.today = new Date(res.StartDate);
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.RouteService.goBack();
|
||||
}, (error) => {
|
||||
|
||||
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
if(this.CalendarId) {
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
}
|
||||
loader.remove()
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteEvent() {
|
||||
|
||||
@@ -14,28 +14,32 @@
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-content fullscreen>
|
||||
<div class="media d-flex align-items-center justify-center">
|
||||
<div *ngIf="view" class="media d-flex align-items-center justify-center">
|
||||
<div class="media-content w-100 d-flex align-items-center justify-center">
|
||||
|
||||
<ion-slides style="width: 100%; height: 100%;" [options]="sliderOpts">
|
||||
<ion-slide>
|
||||
<div class="swiper-zoom-container">
|
||||
<div>
|
||||
<div class="swiper-zoom-container" >
|
||||
<div style="overflow: scroll; width: 100%; height:100%;">
|
||||
<img src="{{image}}">
|
||||
</div>
|
||||
<!-- <div *ngIf="type == 'application/pdf'">
|
||||
<iframe width="100%" height="100%" [src]="base64Sanitize" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document"></iframe> -->
|
||||
|
||||
<!-- <pdf-viewer [src]="image"
|
||||
[render-text]="true"
|
||||
[original-size]="false"
|
||||
style="width: 400px; height: 500px"
|
||||
></pdf-viewer> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<div *ngIf="!view" class="swiper-zoom-container" >
|
||||
<img src="{{image}}">
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-slides *ngIf="!view" style="width: 100%; height: 100%;" [options]="sliderOpts">
|
||||
<ion-slide>
|
||||
<div class="swiper-zoom-container" >
|
||||
<img src="{{image}}">
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
|
||||
|
||||
</ion-content>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ModalController, NavParams, Platform } from '@ionic/angular';
|
||||
import { DomSanitizer} from '@angular/platform-browser';
|
||||
import { pdfDefaultOptions } from 'ngx-extended-pdf-viewer';
|
||||
|
||||
@@ -14,10 +14,10 @@ export class ViewMediaPage implements OnInit {
|
||||
type: any;
|
||||
name: string
|
||||
_updatedAt: string
|
||||
view: boolean
|
||||
|
||||
sliderOpts = {
|
||||
zoom: true,
|
||||
maxRation: 2
|
||||
zoom: true
|
||||
};
|
||||
|
||||
base64Sanitize:any = "";
|
||||
@@ -26,6 +26,7 @@ export class ViewMediaPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
public sanitizer: DomSanitizer,
|
||||
private platform: Platform,
|
||||
|
||||
) {
|
||||
this.image = this.navParams.get('image')
|
||||
@@ -38,6 +39,12 @@ export class ViewMediaPage implements OnInit {
|
||||
ngOnInit() {
|
||||
console.log(this.image)
|
||||
this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.image);
|
||||
|
||||
if (this.platform.is('desktop')) {
|
||||
this.view = true;
|
||||
} else {
|
||||
this.view = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,10 +67,6 @@ export class ViewMediaPage implements OnInit {
|
||||
const blob = new Blob(byteArrays, { type: contentType });
|
||||
return blob;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss()
|
||||
|
||||
@@ -42,4 +42,11 @@ models.register({
|
||||
})
|
||||
|
||||
|
||||
// models.registerDynamic({
|
||||
// type: 'indexedDB',
|
||||
// version: 4,
|
||||
// models: [MessageModel, DeleteMessageModel]
|
||||
// })
|
||||
|
||||
|
||||
window['MessageModel'] = MessageModel
|
||||
|
||||
@@ -16,9 +16,6 @@ registerLocaleData(localeDe);
|
||||
|
||||
import { CalendarModule, DateAdapter } from 'angular-calendar';
|
||||
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
|
||||
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
|
||||
|
||||
|
||||
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
<button title="Visualizar a lista de Eventos para aprovação" class="btn-no-color cursor-pointer resize" (click)="viewEventsToApprove()" *ngIf="loggeduser.Profile != 'PR'">
|
||||
<button title="Visualizar a lista de Eventos para aprovação" class="btn-no-color cursor-pointer resize" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && !mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon>
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
<calendar
|
||||
class="calendar-component"
|
||||
[eventSource]="listToPresent"
|
||||
[eventSource]="CalendarStore.eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
@@ -229,11 +229,11 @@
|
||||
|
||||
<div class="calendar-title-container px-20 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||
<div class="calendar-title-description flex-grow-1 text-grey d-flex justify-center align-center">
|
||||
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do MDGPR</div>
|
||||
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Meu Calendário</div>
|
||||
</div>
|
||||
<div class="calendar-title-description text-black align-center">
|
||||
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
||||
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do Presidente da República</div>
|
||||
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário Partilhado</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -293,7 +293,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.OwnerCalendars.length">
|
||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.OwnerCalendars.length && loggeduser.Profile != 'PR' ">
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||
|
||||
<div class="EventListBox-container" >
|
||||
@@ -334,7 +334,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sd-timeline flex-grow-1 d-none d-md-block timeline-md text-black pl-20 pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.SharedCalendars.length != 0" >
|
||||
<div class="sd-timeline flex-grow-1 d-none d-md-block timeline-md text-black pl-20 pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.SharedCalendars.length != 0 || loggeduser.Profile == 'PR' " >
|
||||
<div *ngFor="let events of TimelinePRList | keyvalue;">
|
||||
|
||||
<div class="EventListBox-container" >
|
||||
|
||||
@@ -9,6 +9,7 @@ import { DomSanitizer } from "@angular/platform-browser";
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
// showTimeline
|
||||
import { setHours, setMinutes } from 'date-fns';
|
||||
@@ -33,6 +34,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -166,6 +168,7 @@ export class AgendaPage implements OnInit {
|
||||
array = []
|
||||
|
||||
sessionStore = SessionStore;
|
||||
environment
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
@@ -183,7 +186,8 @@ export class AgendaPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private storage:Storage
|
||||
private storage:Storage,
|
||||
public p: PermissionService
|
||||
) {
|
||||
|
||||
this.dateAdapter.setLocale('es');
|
||||
@@ -204,6 +208,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.CalendarStore.ResetList([])
|
||||
|
||||
this.listToPresent = []
|
||||
|
||||
})
|
||||
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
@@ -251,9 +257,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
//this.getFromDB();
|
||||
|
||||
setTimeout(() =>{
|
||||
setTimeout(() => {
|
||||
const pathname = window.location.pathname
|
||||
let realoadCounter = 0
|
||||
this.router.events.forEach((event) => {
|
||||
@@ -348,7 +352,7 @@ export class AgendaPage implements OnInit {
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
|
||||
this.updateEventListBox()
|
||||
this.updateEventListBox();
|
||||
|
||||
};
|
||||
|
||||
@@ -1478,7 +1482,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
|
||||
// THIS LINE
|
||||
this.updateEventListBox()
|
||||
this.updateEventListBox();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -117,9 +117,9 @@
|
||||
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<mat-form-field appearance="none" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data Inicio*"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
@@ -149,9 +149,9 @@
|
||||
-->
|
||||
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<mat-form-field appearance="none" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data de fim*"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
|
||||
@@ -104,21 +104,6 @@ export class NewEventPage implements OnInit {
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
this.taskParticipants = this.navParams.get('attendees');
|
||||
|
||||
let now = new Date();
|
||||
|
||||
if(now.getMinutes() <= 30){
|
||||
this.autoStartTime = new Date(now.setMinutes(30));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
else{
|
||||
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
|
||||
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -40,12 +40,13 @@
|
||||
<div class="content-location">
|
||||
<span class="date">{{loadedEvent.Location}}</span>
|
||||
<div *ngIf="loadedEvent.Organizer">
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == false">
|
||||
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == false || sesseionStora.user.Profile =='PR'">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == true">
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == true && sesseionStora.user.Profile !='PR'">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,9 @@ export class ViewEventPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
private ionicStorage: Storage,
|
||||
private CalendarService: CalendarService
|
||||
private CalendarService: CalendarService,
|
||||
) {
|
||||
|
||||
|
||||
this.isEventEdited = false;
|
||||
this.loadedEvent = new Event();
|
||||
|
||||
@@ -7,16 +7,8 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { ChatPageRoutingModule } from './chat-routing.module';
|
||||
|
||||
import { ChatPage } from './chat.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-messages.page';
|
||||
import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
|
||||
import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page';
|
||||
import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page';
|
||||
import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page';
|
||||
import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page';
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||
|
||||
import { ContactsPageModule } from 'src/app/shared/chat/messages/contacts/contacts.module';
|
||||
import { GroupMessagesPageModule } from 'src/app/shared/chat/group-messages/group-messages.module';
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
|
||||
<ion-toolbar [class.block-button]="showNewEvent || showNewGroup || showContacts">
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
|
||||
<ion-segment-button value="Contactos">
|
||||
Conversas
|
||||
@@ -37,6 +38,7 @@
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
<div class=" aside overflow-y-auto d-flex flex-wrap flex-grow-1">
|
||||
<div class="width-100" [ngSwitch]="segment">
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
@@ -57,7 +59,7 @@
|
||||
<ion-label >
|
||||
<span >
|
||||
<div >
|
||||
<div >
|
||||
<div [class.bold-message]="room.messageUnread == true">
|
||||
{{room.name}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -94,7 +96,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true">
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true && wsChatMethodsService._dm.length == 0">
|
||||
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
|
||||
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-chat-grey.svg"></ion-icon></div>
|
||||
<div class="item-content flex-grow-1 cursor-pointer">
|
||||
@@ -125,7 +127,7 @@
|
||||
<div (click)="openGroupMessagesPage(group.id)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title" [class.item-title-active]="group.id ==idSelected">
|
||||
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
|
||||
<ion-label [class.bold-message]="group.messageUnread == true">{{group.name.split('-').join(' ')}}</ion-label>
|
||||
</div>
|
||||
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.lastMessage && !group.customFields.countDownDate">{{group.duration}}</div>
|
||||
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{group.countDownTime}}</div>
|
||||
@@ -133,12 +135,13 @@
|
||||
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.id ==idSelected">
|
||||
<div class="item-message" *ngIf="group.otherUserType == false">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
|
||||
<div *ngIf="group.otherUserType == true">{{group.userThatIsTyping}} está escrever ...</div>
|
||||
|
||||
<div class="item-files add-ellipsis" *ngIf="group.lastMessage.file">
|
||||
<fa-icon *ngIf="group.lastMessage.file.type != 'application/meeting' && group.lastMessage.file.type != 'application/audio'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
|
||||
<fa-icon *ngIf="group.lastMessage.file.type == 'application/audio'" icon="file-audio" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
|
||||
<span *ngIf="group.lastMessage.file.type == 'application/audio'" class="item-files-title"> audio </span>
|
||||
<fa-icon *ngIf="group.lastMessage.file.type == 'application/meeting'" icon="calendar-alt" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
|
||||
<span *ngIf="group.lastMessage.file.type != 'application/audio'" class="item-files-title"> {{ group.lastMessage.attachments[0].title }}</span>
|
||||
<span *ngIf="group.lastMessage.file.type != 'application/audio' && group.lastMessage.attachments" class="item-files-title"> {{ group.lastMessage.attachments[0].title }}</span>
|
||||
</div>
|
||||
<div class="item-files" *ngIf="group.attachments">
|
||||
<div *ngIf="group.value.lastMessage.attachments[0].image_url">
|
||||
@@ -150,7 +153,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true">
|
||||
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true && wsChatMethodsService._group.length == 0">
|
||||
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
|
||||
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-group-chat-grey.svg"></ion-icon></div>
|
||||
<div class="item-content flex-grow-1 cursor-pointer">
|
||||
@@ -196,6 +199,7 @@
|
||||
|
||||
<app-contacts
|
||||
(openMessage)="openMessagesPage($event)"
|
||||
(emptyTextDescriptionOpen)="emptyTextDescriptionOpen()"
|
||||
*ngIf="showContacts"
|
||||
[style.display]="showContacts ? 'flex' : 'none'"
|
||||
class=" height-100 flex-column">
|
||||
@@ -203,6 +207,7 @@
|
||||
|
||||
<app-new-group
|
||||
(addGroupMessage)="openGroupContactsPage($event)"
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
[style.display]="showNewGroup ? 'flex' : 'none'"
|
||||
class=" height-100 flex-column">
|
||||
</app-new-group>
|
||||
@@ -238,6 +243,7 @@
|
||||
</app-group-messages>
|
||||
|
||||
<app-new-event
|
||||
*ngIf="showNewEvent"
|
||||
[profile]=""
|
||||
[roomId]="groupRoomId"
|
||||
[selectedSegment]=segment
|
||||
@@ -245,13 +251,11 @@
|
||||
[taskParticipantsCc]="taskParticipantsCc"
|
||||
[selectedDate]="eventSelectedDate"
|
||||
[eventAttendees]="contacts"
|
||||
(onAddEvent)="closeNewEventComponent()"
|
||||
(openAttendeesComponent)="openAttendeesComponent($event)"
|
||||
(cloneAllmobileComponent)="closeNewEventComponent()"
|
||||
(onAddEvent)="closeNewEventComponentAndOpenChat($event)"
|
||||
(openAttendeesComponent)="closeNewEventComponentAndOpenChat($event)"
|
||||
[style.display]="showNewEvent ? 'flex' : 'none'"
|
||||
class=" height-100 flex-column">
|
||||
</app-new-event>
|
||||
|
||||
<app-attendee-modal
|
||||
[adding]="adding"
|
||||
[taskParticipants]="taskParticipants"
|
||||
|
||||
@@ -178,3 +178,13 @@ ion-content{
|
||||
color: #fff !important;
|
||||
background-color: #42b9fe !important;
|
||||
}
|
||||
|
||||
|
||||
.bold-message {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.block-button {
|
||||
pointer-events: none;
|
||||
opacity: 0.2;
|
||||
}
|
||||
@@ -125,6 +125,8 @@ export class ChatPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
this.segment = 'Contactos'
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -227,6 +229,9 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
}
|
||||
openMessagesPage(rid) {
|
||||
|
||||
this.roomId = rid;
|
||||
|
||||
if (window.innerWidth < 701) {
|
||||
this.openMessagesModal(rid);
|
||||
}
|
||||
@@ -234,7 +239,6 @@ export class ChatPage implements OnInit {
|
||||
this.idSelected = rid;
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEmptyComponent = false;
|
||||
this.roomId = rid;
|
||||
this.showMessages = true;
|
||||
}
|
||||
}
|
||||
@@ -273,6 +277,8 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
|
||||
openGroupMessagesPage(rid) {
|
||||
|
||||
this.roomId = rid;
|
||||
if (window.innerWidth < 701) {
|
||||
this.openGroupMessagesModal(rid);
|
||||
}
|
||||
@@ -280,7 +286,7 @@ export class ChatPage implements OnInit {
|
||||
this.idSelected = rid;
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEmptyComponent = false;
|
||||
this.roomId = rid;
|
||||
|
||||
|
||||
this.showGroupMessages = true;
|
||||
}
|
||||
@@ -320,7 +326,6 @@ export class ChatPage implements OnInit {
|
||||
|
||||
async setIntervenient(data) {
|
||||
this.taskParticipants = removeDuplicate(data)
|
||||
|
||||
}
|
||||
|
||||
async setIntervenientCC(data) {
|
||||
@@ -338,13 +343,33 @@ export class ChatPage implements OnInit {
|
||||
this.idSelected = "";
|
||||
}
|
||||
|
||||
async closeNewEventComponentAndOpenChat({roomId}) {
|
||||
this.closeAllDesktopComponents();
|
||||
|
||||
console.log(roomId)
|
||||
|
||||
this.wsChatMethodsService._group.forEach((room)=>{
|
||||
if(room.id == roomId) {
|
||||
|
||||
|
||||
this.openGroupMessagesPage(roomId)
|
||||
}
|
||||
})
|
||||
|
||||
this.wsChatMethodsService._dm.forEach((room)=>{
|
||||
if(room.id == roomId) {
|
||||
this.openMessagesPage(roomId)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onSegmentChange() {
|
||||
//this.load();
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
setTimeout(() => {
|
||||
//this.load();
|
||||
event.target.complete();
|
||||
}, 1000);
|
||||
}
|
||||
@@ -357,7 +382,6 @@ export class ChatPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getDirectMessagesDB() {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storageservice.get("rooms").then((rooms) =>{
|
||||
@@ -560,6 +584,11 @@ export class ChatPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
roomDataFileType(roomData) {
|
||||
return roomData?.lastMessage?.file?.type || null
|
||||
}
|
||||
|
||||
async transformGroups(data) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
let groupsArray = [];
|
||||
@@ -600,6 +629,12 @@ export class ChatPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async emptyTextDescriptionOpen() {
|
||||
this.closeAllDesktopComponents()
|
||||
this.showEmptyComponent = true
|
||||
}
|
||||
|
||||
async getGroups(event?) {
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res: any) => {
|
||||
//
|
||||
@@ -644,7 +679,15 @@ export class ChatPage implements OnInit {
|
||||
cssClass: 'modal modal-desktop',
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then((Data) => {
|
||||
// console.log(Data,'daatatatat');
|
||||
|
||||
// let data = Data.data
|
||||
// let roomId = data.roomId
|
||||
// this.openMessagesPage(roomId);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async newGroup() {
|
||||
@@ -689,8 +732,6 @@ export class ChatPage implements OnInit {
|
||||
|
||||
async openGroupMessagesModal(roomId: any) {
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
cssClass: 'modal modal-desktop isGroupChatOpened',
|
||||
|
||||
@@ -13,8 +13,6 @@ import { ChatPopoverPageModule } from 'src/app/shared/popover/chat-popover/chat-
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { AngularCropperjsModule } from 'angular-cropperjs';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
|
||||
|
||||
@@ -90,8 +90,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="image" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Imagem"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
|
||||
@@ -108,10 +112,11 @@
|
||||
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
@@ -130,8 +135,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Mensagem de voz"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||
@@ -159,7 +168,7 @@
|
||||
</div>
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name ?? ""}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
||||
</div>
|
||||
@@ -196,15 +205,6 @@
|
||||
</div>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
<!-- <div *ngIf="msg.file">
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name ?? ""}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
||||
</div>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||
|
||||
@@ -150,7 +150,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
})
|
||||
|
||||
//this.loadFiles();
|
||||
}
|
||||
|
||||
setStatus(status: string) {
|
||||
@@ -171,7 +170,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
ngAfterViewInit() {
|
||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
|
||||
|
||||
if(this.room?.customFields?.countDownDate) {
|
||||
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
|
||||
}
|
||||
}
|
||||
|
||||
handlePress(id?: string) {
|
||||
@@ -326,7 +328,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.loadFiles();
|
||||
}
|
||||
|
||||
async goToEvent(eventId: any) {
|
||||
async goToEvent(event: any) {
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -337,7 +339,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
eventId: event.id,
|
||||
CalendarId: event.calendarId
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
@@ -1055,7 +1058,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
return blob;
|
||||
}
|
||||
|
||||
openFile(pdfString, filename) {
|
||||
openFile(pdfString, filename, type) {
|
||||
const blob = this.b64toBlob(pdfString, 'application/pdf')
|
||||
let pathFile = ''
|
||||
const fileName = filename
|
||||
@@ -1093,7 +1096,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
async openPreview(msg: MessageService) {
|
||||
|
||||
if(msg.file.type === "application/webtrix") {
|
||||
if(msg?.file?.type === "application/webtrix") {
|
||||
this.viewDocument(msg.file, msg.attachments.image_url)
|
||||
} else {
|
||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||
@@ -1106,8 +1109,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log(msg)
|
||||
if (msg.file.type == "application/img") {
|
||||
if (msg?.file?.type == "application/img") {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewMediaPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
@@ -1121,10 +1124,25 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
modal.present();
|
||||
} else {
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].name, str)
|
||||
}
|
||||
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name);
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewMediaPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
componentProps: {
|
||||
image: msg.attachments[0].image_url,
|
||||
type: msg.file.type,
|
||||
username: msg.u.name,
|
||||
_updatedAt: msg._updatedAt
|
||||
}
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,28 +88,26 @@ export class ContactsPage implements OnInit {
|
||||
doRefresh(event){
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
close() {
|
||||
this.modalController.dismiss({});
|
||||
}
|
||||
|
||||
clicked(){
|
||||
|
||||
}
|
||||
clicked() {}
|
||||
|
||||
createRoom(username:string){
|
||||
let body = {
|
||||
username: username,
|
||||
}
|
||||
this.chatService.createRoom(body).subscribe(res => {
|
||||
this.chatService.createRoom(body).subscribe(async(res) => {
|
||||
|
||||
this.room = res['room'];
|
||||
|
||||
|
||||
await this.WsChatMethodsService.getAllRooms();
|
||||
this.getDirectMessage(this.room._id);
|
||||
this.WsChatMethodsService.getAllRooms()
|
||||
});
|
||||
}
|
||||
getDirectMessage(roomId:any){
|
||||
|
||||
getDirectMessage(roomId:any) {
|
||||
|
||||
|
||||
this.chatService.getAllDirectMessages().subscribe(res=>{
|
||||
@@ -121,6 +119,7 @@ export class ContactsPage implements OnInit {
|
||||
this.openModal(this.dm._id);
|
||||
});
|
||||
}
|
||||
|
||||
async openModal(roomId:any){
|
||||
this.close();
|
||||
|
||||
@@ -137,26 +136,10 @@ export class ContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openMessages(username:string){
|
||||
/* this.close(); */
|
||||
|
||||
let dm:any;
|
||||
//Create new room
|
||||
this.createRoom(username);
|
||||
//Get direct messages (dm)
|
||||
/* this.getDirectMessage(this.room._id); */
|
||||
|
||||
this.createRoom(username);
|
||||
|
||||
|
||||
/* const modal = await this.modalController.create({
|
||||
component: MessagesPage,
|
||||
cssClass: 'group-messages',
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
dm: dm,
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss(); */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div class="message-attachments"> -->
|
||||
<div class="file">
|
||||
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
||||
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
||||
@@ -67,7 +66,6 @@
|
||||
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||
</ion-label>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,8 +85,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="image" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Imagem"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
||||
@@ -107,10 +109,11 @@
|
||||
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
@@ -135,8 +138,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Mensagem de voz"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="file audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||
@@ -167,7 +174,7 @@
|
||||
</div>
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal">
|
||||
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||
</button><br />
|
||||
<ion-label class="info-meeting-medium">
|
||||
@@ -185,7 +192,7 @@
|
||||
<div *ngIf="msg.file && msg.delate == false">
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal">
|
||||
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||
</button><br />
|
||||
<ion-label class="info-meeting-medium">
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { VoiceRecorder, RecordingData, GenericResponse} from 'capacitor-voice-recorder';
|
||||
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
@@ -38,7 +38,9 @@ import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
|
||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@@ -101,7 +103,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
downloadProgess: number;
|
||||
downloadLoader: boolean;
|
||||
|
||||
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||
audioPermissionStatus: 'granted' | 'denied' | 'prompt' | null = null
|
||||
sessionStore = SessionStore
|
||||
|
||||
constructor(
|
||||
@@ -123,7 +125,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private sqlservice: SqliteService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
|
||||
private CameraService: CameraService,
|
||||
private processesService: ProcessesService,
|
||||
private storage: Storage,
|
||||
@@ -133,10 +134,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private sanitiser: DomSanitizer,
|
||||
private alertController: AlertController,
|
||||
// private document: DocumentViewer
|
||||
private file: File,
|
||||
private fileOpener: FileOpener,
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
if (window.innerWidth > 701) {
|
||||
@@ -144,7 +147,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
@@ -158,12 +160,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.createDirectoryImage()
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.chatService.refreshtoken();
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
this.getChatMembers();
|
||||
}
|
||||
|
||||
@@ -213,11 +216,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
try {
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
|
||||
|
||||
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
|
||||
}
|
||||
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
|
||||
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
|
||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
|
||||
}
|
||||
});
|
||||
@@ -228,22 +231,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
async startRecording() {
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
|
||||
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
|
||||
if (await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) => { return result.value })) {
|
||||
if (await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => { return result.value })) {
|
||||
//if(await this.hasAudioRecordingPermission()){
|
||||
if (this.recording) {
|
||||
return;
|
||||
}
|
||||
this.recording = true;
|
||||
VoiceRecorder.startRecording();
|
||||
this.calculateDuration();
|
||||
if (this.recording) {
|
||||
return;
|
||||
}
|
||||
this.recording = true;
|
||||
VoiceRecorder.startRecording();
|
||||
this.calculateDuration();
|
||||
//}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.');
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!');
|
||||
}
|
||||
}
|
||||
@@ -251,13 +254,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
stopRecording() {
|
||||
this.deleteRecording();
|
||||
this.allowTyping = false;
|
||||
|
||||
|
||||
if (!this.recording) {
|
||||
return;
|
||||
}
|
||||
this.recording = false;
|
||||
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
|
||||
|
||||
|
||||
this.recording = false;
|
||||
if (result.value && result.value.recordDataBase64) {
|
||||
const recordData = result.value.recordDataBase64;
|
||||
@@ -266,7 +269,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//Save file
|
||||
this.storage.set('fileName', fileName);
|
||||
this.storage.set('recordData', result).then(() => {
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -335,7 +338,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} catch (err) { }
|
||||
}
|
||||
|
||||
async goToEvent(eventId: any) {
|
||||
async goToEvent(event: any) {
|
||||
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -345,13 +349,14 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
eventId: event.id,
|
||||
CalendarId: event.calendarId
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -415,16 +420,16 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
|
||||
this.audioRecorded = recordData?.value?.recordDataBase64;
|
||||
}
|
||||
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
|
||||
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
|
||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
@@ -447,7 +452,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
viewDocument(file: any, url?: string) {
|
||||
|
||||
|
||||
if (file.type == "application/webtrix") {
|
||||
this.openViewDocumentModal(file);
|
||||
}
|
||||
@@ -598,7 +603,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
IsRequired: "true",
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.popoverController.dismiss();
|
||||
if (window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
@@ -632,7 +637,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const blob = await base64.blob();
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
@@ -712,7 +717,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Photos
|
||||
});
|
||||
|
||||
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//
|
||||
|
||||
@@ -749,17 +754,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
|
||||
|
||||
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
|
||||
const blob = this.base64toBlob(encodedData, file.type)
|
||||
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
@@ -775,7 +780,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
temporaryData: formData
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -790,7 +795,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
resolve(reader.result)
|
||||
};
|
||||
reader.onerror = function (error) {
|
||||
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
@@ -798,7 +803,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
async openChatOptions(ev?: any) {
|
||||
const roomId = this.roomId
|
||||
|
||||
|
||||
|
||||
const popover = await this.popoverController.create({
|
||||
component: ChatOptionsPopoverPage,
|
||||
@@ -813,7 +818,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
await popover.present();
|
||||
popover.onDidDismiss().then(async (res) => {
|
||||
|
||||
|
||||
if (res['data'] == 'meeting') {
|
||||
this.bookMeeting();
|
||||
}
|
||||
@@ -840,11 +845,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
|
||||
|
||||
|
||||
let chatmsgArray = [];
|
||||
let array = []
|
||||
msg.forEach(element => {
|
||||
|
||||
|
||||
|
||||
let msgChat = {
|
||||
_id: element.Id,
|
||||
@@ -864,7 +869,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -946,27 +951,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
openFile(pdfString, filename, type) {
|
||||
// const blob = this.b64toBlob(pdfString, type)
|
||||
// let pathFile = ''
|
||||
// const fileName = filename
|
||||
// const contentFile = blob
|
||||
// if (this.platform.is('ios')) {
|
||||
// pathFile = this.file.documentsDirectory
|
||||
// } else {
|
||||
// pathFile = this.file.externalRootDirectory
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// this.file
|
||||
// .writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
// .then(success => {
|
||||
// this.fileOpener
|
||||
// .open(pathFile + fileName, type)
|
||||
// .then(() =>
|
||||
// .catch(e =>
|
||||
// })
|
||||
// .catch(e =>
|
||||
const blob = this.b64toBlob(pdfString, type)
|
||||
let pathFile = ''
|
||||
const fileName = filename
|
||||
const contentFile = blob
|
||||
if (this.platform.is('ios')) {
|
||||
pathFile = this.file.documentsDirectory
|
||||
} else {
|
||||
pathFile = this.file.externalRootDirectory
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.file
|
||||
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
.then(success => {
|
||||
this.fileOpener
|
||||
.open(pathFile + fileName, type)
|
||||
.then(() => console.log())
|
||||
.catch(e => console.error(e))
|
||||
})
|
||||
.catch(e => console.error(e))
|
||||
}
|
||||
|
||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||
@@ -979,9 +984,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
|
||||
async openPreview(msg) {
|
||||
|
||||
|
||||
if(msg.file.type === "application/webtrix") {
|
||||
|
||||
if (msg.file.type === "application/webtrix") {
|
||||
this.viewDocument(msg.file, msg.attachments.image_url)
|
||||
} else {
|
||||
|
||||
@@ -996,6 +1001,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log(msg)
|
||||
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewMediaPage,
|
||||
@@ -1009,11 +1015,28 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
|
||||
this.downloadFileFromBrowser("file", str)
|
||||
this.downloadFileFromBrowser(msg.attachments[0].name, str)
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewMediaPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
componentProps: {
|
||||
image: msg.attachments[0].image_url,
|
||||
type: msg.file.type,
|
||||
username: msg.u.name,
|
||||
_updatedAt: msg._updatedAt
|
||||
}
|
||||
});
|
||||
modal.present();
|
||||
} else {
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1022,7 +1045,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async audioPreview(msg) {
|
||||
|
||||
|
||||
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
|
||||
this.downloadFileMsg(msg)
|
||||
} else { }
|
||||
@@ -1059,6 +1082,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// });
|
||||
// }
|
||||
|
||||
async createDirectoryImage() {
|
||||
await Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border init-event-header">
|
||||
<!-- <ion-header class="ion-no-border init-event-header"> -->
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
@@ -17,132 +18,125 @@
|
||||
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="main " ng-controller="AppController">
|
||||
<!-- <ion-content class="main " ng-controller="AppController"> -->
|
||||
<ion-content ng-controller="AppController">
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<button title="Ir para a sua Agenda" class="btn-no-color" [routerLink]="['/home/agenda']">
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'default' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'tribunal' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
</button>
|
||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<button title="Ir para a sua Agenda" class="btn-no-color" [routerLink]="['/home/agenda']">
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'default' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
|
||||
(click)="goToEvent(event.EventId)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<div class="schedule-time">
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'tribunal' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
<div class="description">
|
||||
<p>{{event.Subject}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
<!--
|
||||
<div class="resume">
|
||||
<div class="title">
|
||||
Resumo para Amnahã
|
||||
</div>
|
||||
<div class="event-num">4 eventos ageandados para amanhã</div>
|
||||
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
|
||||
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
<div class="text">Correspondência por ler</div>
|
||||
</div>
|
||||
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'default' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
|
||||
(click)="goToEvent(event.EventId)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
<div class="schedule-time">
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'tribunal' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
|
||||
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Subject }}</div>
|
||||
<div class="location">{{ task.Senders }}</div>
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
<div class="description">
|
||||
<p>{{event.Subject}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</div>
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <iframe id="home-iframe" style="width: 100%;" src="/assets/www/pdfjs/web/viewer.html?file=/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf"></iframe> -->
|
||||
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
<div class="text">Correspondência por ler</div>
|
||||
</div>
|
||||
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'default' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
|
||||
<ion-icon
|
||||
*ngIf="ThemeService.currentTheme == 'tribunal' "
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
|
||||
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Subject }}</div>
|
||||
<div class="location">{{ task.Senders }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <iframe id="home-iframe" style="width: 100%;" src="/assets/www/pdfjs/web/viewer.html?file=/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf"></iframe> -->
|
||||
</ion-content>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit, LOCALE_ID, EventEmitter, Output, Renderer2, ElementRef } from '@angular/core';
|
||||
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
|
||||
|
||||
import { Event } from '../../models/event.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -25,13 +25,13 @@ import { Storage } from '@ionic/storage';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
styleUrls: ['./events.page.scss'],
|
||||
})
|
||||
export class EventsPage implements OnInit {
|
||||
/* Get current system date */
|
||||
today = new Date();
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
@@ -39,25 +39,16 @@ export class EventsPage implements OnInit {
|
||||
|
||||
customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
/* Setting appropriate greeting according to the time */
|
||||
grettings = ["Bom dia", "Boa tarde", "Boa noite"];
|
||||
greetting = '';
|
||||
|
||||
timeDate = this.today.getHours() + ":" + this.today.getMinutes();
|
||||
/* Set segment variable */
|
||||
|
||||
segment: string;
|
||||
public profile: string;
|
||||
currentEvent: any;
|
||||
|
||||
eventsList: Event[];
|
||||
maxSubjectLength = 30;
|
||||
officialeventsList: Event[];
|
||||
personaleventsList: Event[];
|
||||
|
||||
prEventList: Event[];
|
||||
mdEventList: Event[];
|
||||
|
||||
combinedEvents: Event[];
|
||||
|
||||
customText = false;
|
||||
totalEvent = 0;
|
||||
@@ -65,7 +56,6 @@ export class EventsPage implements OnInit {
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
taskslist: DailyWorkTask[] = [];
|
||||
expedientList: any;
|
||||
hideSearchBtn: boolean = false;
|
||||
|
||||
@@ -82,8 +72,6 @@ export class EventsPage implements OnInit {
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
/* existingScreenOrientation: string; */
|
||||
|
||||
permissionList = new PermissionList();
|
||||
|
||||
constructor(
|
||||
@@ -94,7 +82,6 @@ export class EventsPage implements OnInit {
|
||||
private alertController: AlertService,
|
||||
private authService: AuthService,
|
||||
private processes: ProcessesService,
|
||||
/* private gabineteService: GabineteDigitalPage, */
|
||||
private modalController: ModalController,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
public platform: Platform,
|
||||
@@ -104,12 +91,11 @@ export class EventsPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
) {
|
||||
/* this.existingScreenOrientation = this.screenOrientation.type; */
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.prEventList = null;
|
||||
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//
|
||||
@@ -124,6 +110,13 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
|
||||
this.listToPresent = [];
|
||||
this.listToPresentexpediente = []
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -150,10 +143,6 @@ export class EventsPage implements OnInit {
|
||||
this.hideSearch();
|
||||
});
|
||||
|
||||
//this.getEventsFromLocalDb();
|
||||
|
||||
//this.checkScreenOrientation();
|
||||
|
||||
}
|
||||
|
||||
hideSearch() {
|
||||
@@ -172,32 +161,6 @@ export class EventsPage implements OnInit {
|
||||
this.RefreshEvents();
|
||||
}
|
||||
|
||||
// Lock to portrait
|
||||
/* lockToPortrait() {
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
|
||||
|
||||
} */
|
||||
|
||||
// Lock to landscape
|
||||
/* lockToLandscape() {
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
|
||||
} */
|
||||
|
||||
// Unlock screen orientation
|
||||
/* unlockScreenOrientation() {
|
||||
this.screenOrientation.unlock();
|
||||
} */
|
||||
|
||||
/* checkScreenOrientation() {
|
||||
if (window.innerWidth < 701) {
|
||||
this.lockToPortrait();
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
this.unlockScreenOrientation();
|
||||
}
|
||||
} */
|
||||
|
||||
async RefreshEvents() {
|
||||
this.currentEvent = "";
|
||||
@@ -493,7 +456,7 @@ export class EventsPage implements OnInit {
|
||||
//
|
||||
this.addProcessToDb(result);
|
||||
|
||||
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||
let ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class DespachoPrPage implements OnInit {
|
||||
serialNumber: string;
|
||||
caller: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
intervenientes: any =[]
|
||||
cc: any = [];
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -45,7 +45,7 @@ export class DespachoPage implements OnInit {
|
||||
serialnumber: string;
|
||||
caller: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
profile: string;
|
||||
task: any
|
||||
fulltask: any
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
attachments:any;
|
||||
customDate: any;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class DiplomasGerarPage implements OnInit {
|
||||
profile: string;
|
||||
task: any
|
||||
fulltask: any
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
attachments:any;
|
||||
customDate: any;
|
||||
@@ -184,11 +184,14 @@ export class DiplomasGerarPage implements OnInit {
|
||||
|
||||
async sendExpedienteToPending() {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
|
||||
this.goBack();
|
||||
this.toastService.successMessage()
|
||||
loader.remove()
|
||||
},
|
||||
error => {
|
||||
loader.remove()
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export class DiplomaPage implements OnInit {
|
||||
profile: string;
|
||||
task: any
|
||||
fulltask: any
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
attachments: any;
|
||||
customDate: any
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="validar" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">
|
||||
Por validar ...
|
||||
Por validar
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="assinados">
|
||||
Assinados PR ...
|
||||
Assinados PR
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -59,9 +59,14 @@
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) == toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}} </p>
|
||||
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} </p>
|
||||
<p>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 0">Diário</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 1">Semanal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 2">Mensal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 3">Anual</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == -1">(Não se repete)</span>
|
||||
</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
Calendário MDGPR
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
Calendário Partilhado
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
+4
-1
@@ -53,7 +53,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
serialNumber: string;
|
||||
caller: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
documents: SearchList[] = [];
|
||||
attachments: any;
|
||||
@@ -324,12 +324,15 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
loader.remove()
|
||||
},
|
||||
(error) => {
|
||||
loader.remove()
|
||||
this.toastService._badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class ExpedientePrPage implements OnInit {
|
||||
serialnumber: string;
|
||||
caller:string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
intervenientes: any = [];
|
||||
cc: any = [];
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
@@ -133,12 +133,15 @@ export class ExpedientePrPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
loader.remove()
|
||||
},
|
||||
(error)=>{
|
||||
loader.remove()
|
||||
this.toastService._badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
||||
<!-- <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
|
||||
<div class="center-div">
|
||||
<div class="exp-card-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
|
||||
@@ -226,14 +226,14 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'showDespachosPr'" src="assets/images/theme/gov/icons-despachos-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="exp-card-text">
|
||||
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p>
|
||||
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Calendário Partilhado</p>
|
||||
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Despachos criados por mim</p>
|
||||
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<!-- <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDiplomasPage('validar'); selectedElement='DiplomasPorValidar'" [class.active]="selectedElement == 'DiplomasPorValidar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasPorValidar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
|
||||
@@ -243,7 +243,7 @@
|
||||
<p class="text-center exp-card-title " *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Validar</p>
|
||||
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Diplomas por Assinar</p>
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="SessionStore.user.Profile == 'Consultant'" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
@@ -257,7 +257,7 @@
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||
@@ -269,7 +269,7 @@
|
||||
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" >Diplomas</p>
|
||||
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
-->
|
||||
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||
<div class="d-flex justify-center">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
|
||||
|
||||
@@ -46,7 +46,7 @@ export class PedidoPage implements OnInit {
|
||||
eventsList: Event[];
|
||||
serialnumber: string;
|
||||
caller: string;
|
||||
intervenientes: any;
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
</form>
|
||||
<div class="msg-bottom d-flex">
|
||||
<p class="msg-bottom-p">Uma iniciativa do Gabinete do Presidente da República</p>
|
||||
<p class="msg-bottom-p">Uma iniciativa do Gabinete do Calendário Partilhado</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -13,7 +13,11 @@ import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { PermissionList } from 'src/app/models/permission/permissionList';
|
||||
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'
|
||||
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.page.html',
|
||||
@@ -46,6 +50,10 @@ export class LoginPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private storageservice: StorageService,
|
||||
public p: PermissionService,
|
||||
private WsChatService: WsChatService,
|
||||
private storage: Storage,
|
||||
public WsChatMethodsService: WsChatMethodsService,
|
||||
private ChatService: ChatService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -124,6 +132,7 @@ export class LoginPage implements OnInit {
|
||||
await this.authService.loginChat(attempt.ChatData.data);
|
||||
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader()
|
||||
|
||||
}
|
||||
|
||||
@@ -134,7 +143,9 @@ export class LoginPage implements OnInit {
|
||||
|
||||
} else {
|
||||
|
||||
this.WsChatService.logout();
|
||||
this.clearStoreService.clear();
|
||||
this.WsChatMethodsService.clearChat();
|
||||
SessionStore.delete();
|
||||
window.localStorage.clear();
|
||||
await MessageModel.deleteAll()
|
||||
@@ -148,6 +159,7 @@ export class LoginPage implements OnInit {
|
||||
if(attempt.ChatData) {
|
||||
await this.authService.loginChat(attempt.ChatData.data);
|
||||
await this.authService.loginToChatWs();
|
||||
this.ChatService.setheader()
|
||||
}
|
||||
|
||||
this.getToken();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<ion-datetime
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
class="d-block d-md-none"
|
||||
placeholder="Início"
|
||||
placeholder="Data início*"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data inicio*"
|
||||
[formControl]="dateControlStart"
|
||||
[min]="minDate"
|
||||
[disabled]="disabled"
|
||||
@@ -70,7 +70,7 @@
|
||||
<ion-datetime
|
||||
class="d-block d-md-none"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
placeholder="Fim"
|
||||
placeholder="Data de fim*"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
@@ -78,9 +78,9 @@
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
|
||||
<mat-form-field class="date-hour-picker d-none d-md-block">
|
||||
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data de fim*"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="endMinDate"
|
||||
[disabled]="disabled"
|
||||
|
||||
@@ -75,14 +75,14 @@ export class NewActionPage implements OnInit {
|
||||
this.dateControlStart = new FormControl(moment(new Date()));
|
||||
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
||||
|
||||
this.folder.DateBegin = new Date().toISOString()
|
||||
this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
|
||||
// this.folder.DateBegin = new Date().toISOString()
|
||||
// this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.segment = "Evento";
|
||||
this.setDefaultTime()
|
||||
// this.setDefaultTime()
|
||||
}
|
||||
|
||||
setDefaultTime() {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<ion-progress-bar type="indeterminate" class="loader" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
|
||||
<div class="top-box d-flex ion-justify-content-between">
|
||||
<div class="top-box d-flex ion-justify-content-between pb-10">
|
||||
<!-- search -->
|
||||
<div *ngIf="!showAdvanceSearch" class="icon-z icon-most-searched-word-open cursor-pointer" (click)="showHideAdvanceSearch(true)">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Search drop down -->
|
||||
<div class="advance-search pa-0 pt-10 flex-md-grow-1" >
|
||||
<div class="advance-search pa-0 pt-10 pr-10 flex-md-grow-1" >
|
||||
|
||||
<ion-form [class.d-none]="!showSearchInput">
|
||||
<div class="d-flex search-input-container ion-justify-content-between" >
|
||||
|
||||
@@ -20,7 +20,7 @@ import { RoomService } from './chat/room.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { InitialsService } from './functions/initials.service';
|
||||
import { PermissionService } from './permission.service';
|
||||
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -48,7 +48,8 @@ export class AuthService {
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private storage: Storage,
|
||||
private initialsService: InitialsService,
|
||||
public p: PermissionService, ) {
|
||||
public p: PermissionService,
|
||||
public WsChatMethodsService: WsChatMethodsService, ) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
@@ -201,6 +202,11 @@ export class AuthService {
|
||||
|
||||
|
||||
this.WsChatService.setStatus('online')
|
||||
|
||||
setTimeout(() => {
|
||||
this.WsChatMethodsService.getAllRooms();
|
||||
}, 200);
|
||||
|
||||
// alert('wsLogin')
|
||||
|
||||
}).catch((message) => {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AuthService } from './auth.service';
|
||||
import { HttpService } from './http.service';
|
||||
import { StorageService } from './storage.service';
|
||||
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from './permission.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -24,19 +23,21 @@ export class ChatService {
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private httpService: HttpService,
|
||||
private authService: AuthService,
|
||||
private storage: Storage,
|
||||
private storageService: StorageService,
|
||||
public p: PermissionService) {
|
||||
public p: PermissionService,
|
||||
private changeProfileService: ChangeProfileService,) {
|
||||
|
||||
this.setheader()
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
this.setheader();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getDocumentDetails(url: string) {
|
||||
let headersc = new HttpHeaders();
|
||||
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||
headersc = headersc.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||
headersc = headersc.set('X-User-Id', SessionStore.user.ChatData.data.userId);
|
||||
headersc = headersc.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken);
|
||||
headersc = headersc.set('Sec-Fetch-Dest', 'attachment');
|
||||
headersc = headersc.set('Sec-Fetch-Mode', 'navigate');
|
||||
headersc = headersc.set('Cookie', 'rc_uid=fsMwcNdufWvdnChj7');
|
||||
@@ -342,7 +343,6 @@ export class ChatService {
|
||||
setheader() {
|
||||
try {
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
this.loggedUserChat = this.authService.ValidatedUserChat;
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
@@ -359,25 +359,31 @@ export class ChatService {
|
||||
}
|
||||
}
|
||||
|
||||
refreshtoken() {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
|
||||
let data = {
|
||||
status: res['status'],
|
||||
data: {
|
||||
userId: res['data'].userId,
|
||||
authToken: res['data'].authToken
|
||||
async refreshtoken() {
|
||||
|
||||
if(this.headers) {
|
||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
let options = {
|
||||
headers: this.headers
|
||||
};
|
||||
return await this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
|
||||
let data = {
|
||||
status: res['status'],
|
||||
data: {
|
||||
userId: res['data'].userId,
|
||||
authToken: res['data'].authToken
|
||||
}
|
||||
}
|
||||
}
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save()
|
||||
SessionStore.user.ChatData = data
|
||||
SessionStore.save()
|
||||
this.setheader()
|
||||
// console.log(res)
|
||||
// console.log(SessionStore.user.ChatData)
|
||||
});
|
||||
} else {
|
||||
this.setheader()
|
||||
// console.log(res)
|
||||
// console.log(SessionStore.user.ChatData)
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,7 +56,9 @@ export class MessageService {
|
||||
messageSend = false
|
||||
delate = false
|
||||
delateRequest = false
|
||||
downloadLoader: boolean;
|
||||
downloadLoader: boolean = false
|
||||
downloadAttachments = false;
|
||||
downloadAttachmentsTemp = 0;
|
||||
|
||||
constructor(private storage: Storage,
|
||||
private NfService: NfService,
|
||||
@@ -77,7 +79,7 @@ export class MessageService {
|
||||
this.ts = ts
|
||||
this.u = u || { name: this.usernameToDisplayName(SessionStore.user.UserName), username: SessionStore.user.UserName, _id: ""}
|
||||
this.t = t
|
||||
this._id = _id
|
||||
this._id = _id || ""
|
||||
this._updatedAt = _updatedAt || new Date().getTime()
|
||||
this.file = file
|
||||
this.temporaryData = temporaryData
|
||||
@@ -254,7 +256,14 @@ export class MessageService {
|
||||
// save the changes to the storage
|
||||
this.save()
|
||||
this.downloadLoader = false;
|
||||
this.downloadAttachments = true
|
||||
this.downloadAttachmentsTemp++;
|
||||
}
|
||||
}, ()=>{
|
||||
// error
|
||||
this.downloadLoader = false;
|
||||
this.downloadAttachments = false
|
||||
this.downloadAttachmentsTemp++;
|
||||
});
|
||||
|
||||
}
|
||||
@@ -310,7 +319,7 @@ export class MessageService {
|
||||
|
||||
async addMessageDB() {
|
||||
if(!this.addToDb) {
|
||||
this.addToDb= true
|
||||
this.addToDb = true
|
||||
const message = this.getChatObj()
|
||||
|
||||
delete message.id
|
||||
|
||||
@@ -39,6 +39,7 @@ export class RoomService {
|
||||
name = ''
|
||||
_updatedAt = {}
|
||||
hasLoadHistory = false
|
||||
hasLoadHistoryMessageRF = []
|
||||
restoreFromOffline = false
|
||||
duration = ''
|
||||
isTyping = false
|
||||
@@ -53,6 +54,8 @@ export class RoomService {
|
||||
u
|
||||
sessionStore = SessionStore
|
||||
countDownTime = ''
|
||||
chatOpen = false
|
||||
messageUnread = false
|
||||
|
||||
scrollDown = () => { }
|
||||
|
||||
@@ -177,7 +180,7 @@ export class RoomService {
|
||||
|
||||
if(difference < 0) {
|
||||
|
||||
this.deleteRoom()
|
||||
this.deleteRoom();
|
||||
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
@@ -234,18 +237,20 @@ export class RoomService {
|
||||
let IncomingChatMessageArgs = IncomingChatMessage.fields.args[0]
|
||||
let ChatMessage : ChatMessageInterface = this.fix_updatedAt(IncomingChatMessageArgs)
|
||||
|
||||
if(!this.messagesLocalReference.includes(ChatMessage.localReference)) {
|
||||
const allMessageIds = this.messages.map((e)=> e._id);
|
||||
|
||||
if(!this.messagesLocalReference.includes(ChatMessage.localReference) && !allMessageIds.includes(ChatMessage?._id)) {
|
||||
|
||||
this.messagesLocalReference.push(ChatMessage.localReference);
|
||||
|
||||
const message = await this.prepareCreate({message: ChatMessage, save: true})
|
||||
const message = await this.prepareCreate({message: ChatMessage, save: true});
|
||||
message.messageSend = true
|
||||
|
||||
this.lastMessage = message
|
||||
this.calDateDuration(ChatMessage._updatedAt)
|
||||
this.lastMessage = message;
|
||||
this.calDateDuration(ChatMessage._updatedAt);
|
||||
|
||||
if (message.t == 'r') {
|
||||
this.name = message.msg
|
||||
this.name = message.msg;
|
||||
}
|
||||
|
||||
if(this.isSenderIsNotMe(ChatMessage)) {
|
||||
@@ -256,7 +261,12 @@ export class RoomService {
|
||||
}
|
||||
|
||||
message.addMessageDB()
|
||||
|
||||
|
||||
|
||||
if(this.chatOpen == false) {
|
||||
this.messageUnread = true
|
||||
}
|
||||
|
||||
setTimeout(()=>{
|
||||
this.scrollDown()
|
||||
}, 50)
|
||||
@@ -305,19 +315,17 @@ export class RoomService {
|
||||
this.otherUserType = args[1]
|
||||
this.readAllMessage()
|
||||
|
||||
//
|
||||
// alert(JSON.stringify(args))
|
||||
|
||||
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
|
||||
|
||||
this.readAllMessage()
|
||||
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
|
||||
|
||||
// alert('delete')
|
||||
//
|
||||
|
||||
this.deleteMessage(args[1]?.method?._id)
|
||||
|
||||
} else {
|
||||
// alert('miss')
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +469,7 @@ export class RoomService {
|
||||
|
||||
|
||||
deleteAll() {
|
||||
this.messages.forEach((message)=>{
|
||||
this.messages.forEach((message) => {
|
||||
if(message?._id) {
|
||||
this.sendDeleteRequest(message._id)
|
||||
}
|
||||
@@ -470,7 +478,7 @@ export class RoomService {
|
||||
|
||||
async delateMessageToSendToOthers(userId) {
|
||||
|
||||
const deleteMessage = await DeleteMessageModel.all()
|
||||
const deleteMessage = await DeleteMessageModel.all();
|
||||
|
||||
const toSend = deleteMessage.filter((DeleteMessage:string[])=> ! DeleteMessage.includes(userId))
|
||||
|
||||
@@ -486,8 +494,8 @@ export class RoomService {
|
||||
|
||||
this.WsChatService.deleteMessage(msgId).then(async() => {
|
||||
message.delateRequest = true
|
||||
await message.save()
|
||||
this.deleteMessage(msgId)
|
||||
await message.save();
|
||||
this.deleteMessage(msgId);
|
||||
})
|
||||
|
||||
} else {
|
||||
@@ -509,7 +517,7 @@ export class RoomService {
|
||||
*/
|
||||
async send({file = null, attachments = null, temporaryData = {}}) {
|
||||
|
||||
const localReference = uuidv4()
|
||||
const localReference = uuidv4();
|
||||
|
||||
let offlineChatMessage = {
|
||||
rid: this.id,
|
||||
@@ -522,9 +530,9 @@ export class RoomService {
|
||||
|
||||
this.message= ''
|
||||
|
||||
this.messagesLocalReference.push(localReference)
|
||||
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
||||
|
||||
this.messagesLocalReference.push(localReference)
|
||||
await message.addMessageDB()
|
||||
message.send()
|
||||
|
||||
@@ -540,7 +548,9 @@ export class RoomService {
|
||||
this.sortRoomList()
|
||||
}
|
||||
|
||||
|
||||
if(this.hasLoadHistory == false) {
|
||||
this.hasLoadHistoryMessageRF.push(localReference)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -594,10 +604,13 @@ export class RoomService {
|
||||
|
||||
roomLeave() {
|
||||
this.setTypingOff()
|
||||
this.chatOpen = false
|
||||
}
|
||||
|
||||
open() {
|
||||
// this.typing(this.message)
|
||||
this.chatOpen = true
|
||||
this.messageUnread = false
|
||||
}
|
||||
|
||||
|
||||
@@ -669,17 +682,17 @@ export class RoomService {
|
||||
}
|
||||
|
||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
|
||||
// console.log('load history', chatHistory)
|
||||
//
|
||||
|
||||
const messagesId = this.messages.map((message)=> message._id)
|
||||
|
||||
chatHistory.result.messages.reverse().forEach(async(message: any) => {
|
||||
await chatHistory.result.messages.reverse().forEach(async(message: any) => {
|
||||
|
||||
if (!messagesId.includes(message._id)) {
|
||||
const messagesToSave = await this.prepareMessageCreateIfNotExist_iD({message: message});
|
||||
if(messagesToSave) {
|
||||
await messagesToSave.addMessageDB()
|
||||
messagesToSave.addMessageDB()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,6 +706,28 @@ export class RoomService {
|
||||
}, 50)
|
||||
|
||||
this.hasLoadHistory = true
|
||||
this.messageReorder();
|
||||
}
|
||||
|
||||
async messageReorder() {
|
||||
const reorderMessage: MessageService[] = this.messages.filter((message) =>
|
||||
this.hasLoadHistoryMessageRF.includes(message?.localReference)
|
||||
);
|
||||
|
||||
await this.messages.forEach( async (message, i) => {
|
||||
|
||||
if(this.hasLoadHistoryMessageRF.includes(message?.localReference)) {
|
||||
this.messages.splice(i, 1)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
this.hasLoadHistoryMessageRF = [];
|
||||
|
||||
reorderMessage.forEach((message) => {
|
||||
this.messages.push(message)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -704,10 +739,10 @@ export class RoomService {
|
||||
|
||||
|
||||
await this.messages.forEach( async (message, index) => {
|
||||
if(message._id) {
|
||||
if(message._id) {
|
||||
if(message.viewed.length == 0) {
|
||||
this.messages[index].viewed = membersIds
|
||||
this.messages[index].received = membersIds
|
||||
this.messages[index].viewed = membersIds;
|
||||
this.messages[index].received = membersIds;
|
||||
|
||||
await this.messages[index].save()
|
||||
}
|
||||
@@ -787,7 +822,33 @@ export class RoomService {
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
this.messages.push(wewMessage)
|
||||
|
||||
let found;
|
||||
|
||||
if(wewMessage.localReference != null) {
|
||||
found = this.messages.find((MessageService, index) => {
|
||||
if ( MessageService.localReference == wewMessage.localReference ) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
found = this.messages.find((MessageService, index) => {
|
||||
if ( MessageService._id == wewMessage._id) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (!found) {
|
||||
this.messages.push(wewMessage)
|
||||
return wewMessage
|
||||
}
|
||||
|
||||
return wewMessage
|
||||
|
||||
}
|
||||
@@ -830,7 +891,7 @@ export class RoomService {
|
||||
message = this.fix_updatedAt(message)
|
||||
|
||||
const found = this.messages.find((MessageService, index) => {
|
||||
if (MessageService._id == message._id ) {
|
||||
if (MessageService._id == message._id) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@@ -872,6 +933,7 @@ export class RoomService {
|
||||
sendReadMessage() {
|
||||
this.WsChatService.readMessage(this.id)
|
||||
this.sendFalseTypingReadMessage('viewMessage', {})
|
||||
this.messageUnread = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import { SortService } from '../functions/sort.service';
|
||||
import { chatUser } from 'src/app/models/chatMethod';
|
||||
import { NfService } from 'src/app/services/chat/nf.service'
|
||||
import { ChangeProfileService } from '../change-profile.service';
|
||||
import { AuthService } from '../auth.service';
|
||||
import { ChatStorageService } from './chat-storage.service';
|
||||
import { ChatMethodsService } from './chat-methods.service';
|
||||
import { AESEncrypt } from '../aesencrypt.service'
|
||||
@@ -41,7 +40,7 @@ export class WsChatMethodsService {
|
||||
users: chatUser[] = []
|
||||
sessionStore = SessionStore
|
||||
|
||||
loggedUser: any;
|
||||
|
||||
|
||||
delete = []
|
||||
|
||||
@@ -56,7 +55,6 @@ export class WsChatMethodsService {
|
||||
private NfService: NfService,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
private chatService: ChatService,
|
||||
private authService: AuthService,
|
||||
private ChatStorageService: ChatStorageService,
|
||||
private ChatMethodsService:ChatMethodsService,
|
||||
private AESEncrypt: AESEncrypt,
|
||||
@@ -64,7 +62,7 @@ export class WsChatMethodsService {
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
) {
|
||||
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
|
||||
|
||||
this.loadChat()
|
||||
|
||||
@@ -93,13 +91,6 @@ export class WsChatMethodsService {
|
||||
})
|
||||
|
||||
|
||||
// on change profile remove a rooms
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
this.clearChat()
|
||||
this.ReLoadChat()
|
||||
this.storage.remove('Rooms');
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
private loadChat() {
|
||||
@@ -173,8 +164,10 @@ export class WsChatMethodsService {
|
||||
async getAllRooms () {
|
||||
this.loadingWholeList = true
|
||||
const rooms = await this.WsChatService.getRooms();
|
||||
try {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
|
||||
await this.storage.remove('Rooms');
|
||||
|
||||
await rooms.result.update.forEach( async (roomData: room, index) => {
|
||||
const roomId = this.getRoomId(roomData);
|
||||
@@ -215,12 +208,12 @@ export class WsChatMethodsService {
|
||||
await this.storage.set('Rooms', rooms);
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.sortRoomList()
|
||||
}, 1000)
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.sortRoomList()
|
||||
}, 10000)
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ export class WsChatService {
|
||||
//
|
||||
if(message.result) {
|
||||
if(message.result.token) {
|
||||
|
||||
this.isLogin = true
|
||||
this.loginResponse = message
|
||||
|
||||
@@ -106,6 +105,7 @@ export class WsChatService {
|
||||
|
||||
getRooms(roomOlder = 1480377601) {
|
||||
|
||||
|
||||
//const requestId = uuidv4()
|
||||
const requestId = uuidv4()
|
||||
const message = {
|
||||
@@ -121,7 +121,6 @@ export class WsChatService {
|
||||
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||
if(message.id == requestId) { // same request send
|
||||
resolve(message)
|
||||
//
|
||||
return true
|
||||
}
|
||||
}})
|
||||
@@ -186,6 +185,7 @@ export class WsChatService {
|
||||
logout() {
|
||||
this.isLogin = false
|
||||
this.ws.connected = false
|
||||
this.ws.disconnect()
|
||||
}
|
||||
|
||||
// send message to room
|
||||
@@ -749,6 +749,7 @@ export class WsChatService {
|
||||
const data = JSON.parse(event.data)
|
||||
|
||||
//
|
||||
// console.log(data)
|
||||
|
||||
for (const [key, value] of Object.entries(this.wsCallbacks)) {
|
||||
if(value.type== 'Onmessage') {
|
||||
@@ -777,6 +778,15 @@ export class WsChatService {
|
||||
|
||||
onerror: (event: any) => {
|
||||
|
||||
},
|
||||
disconnect:() => {
|
||||
if(this.socket) {
|
||||
this.socket.onopen = (event: any) => {}
|
||||
this.socket.onmessage = (event: any) => {}
|
||||
this.socket.onclose = (event: any) => {}
|
||||
this.socket.onerror = (event: any) => {}
|
||||
this.socket.close()
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -254,6 +254,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="eventProcess.workflowInstanceDataFields.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
[min]="eventProcess.workflowInstanceDataFields.EndDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #occurrrence
|
||||
|
||||
@@ -109,16 +109,17 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
const result = this.participantsPipe.transform(this.postEvent.Attendees)
|
||||
this.taskParticipants = result.taskParticipants
|
||||
this.taskParticipantsCc = result.taskParticipantsCc
|
||||
if (this.postEvent.Attendees != null) {
|
||||
const result = this.participantsPipe.transform(this.postEvent.Attendees)
|
||||
this.taskParticipants = result.taskParticipants
|
||||
this.taskParticipantsCc = result.taskParticipantsCc
|
||||
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
||||
}
|
||||
}
|
||||
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
@@ -127,14 +128,10 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
|
||||
// this.postEvent.EventRecurrence.LastOccurrence = this.currentDate;
|
||||
|
||||
setTimeout(() => {
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
|
||||
}, 1000);
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Calendário do MDGPR
|
||||
Meu Calendário
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
Calendário Partilhado
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -123,9 +123,9 @@
|
||||
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<mat-form-field appearance="none" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data Inicio*"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
@@ -155,9 +155,9 @@
|
||||
-->
|
||||
<div (click)="openFim()" class="ion-input-class flex-grow-1 justify-center align-center materia-top" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<mat-form-field appearance="none" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
placeholder="Data de fim*"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
|
||||
@@ -133,22 +133,6 @@ export class NewEventPage implements OnInit {
|
||||
this.loggeduser = userService.ValidatedUser;
|
||||
this.postEvent = new Event();
|
||||
|
||||
let now = new Date();
|
||||
|
||||
if(now.getMinutes() <= 30) {
|
||||
this.autoStartTime = new Date(now.setMinutes(30));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
else {
|
||||
this.autoStartTime = new Date(now.setHours(now.getHours()+1));
|
||||
this.autoStartTime = new Date(this.autoStartTime.setMinutes(0));
|
||||
this.postEvent.StartDate = this.autoStartTime;
|
||||
this.autoEndTime = new Date(this.autoStartTime.getTime() + 30 * 60000);
|
||||
this.postEvent.EndDate = this.autoEndTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -347,10 +331,10 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
close(){
|
||||
close() {
|
||||
|
||||
this.deleteTemporaryData();
|
||||
this.cloneAllmobileComponent.emit();
|
||||
this.cloneAllmobileComponent.emit({roomId:this.roomId});
|
||||
this.clearContact.emit();
|
||||
this.setIntervenient.emit([]);
|
||||
this.setIntervenientCC.emit([]);
|
||||
@@ -475,8 +459,13 @@ export class NewEventPage implements OnInit {
|
||||
"end": this.postEvent.EndDate,
|
||||
"venue": this.postEvent.Location,
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
}
|
||||
|
||||
},
|
||||
error => {
|
||||
loader.remove()
|
||||
@@ -488,10 +477,12 @@ export class NewEventPage implements OnInit {
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
(id) => {
|
||||
|
||||
loader.remove()
|
||||
|
||||
const eventId: any = id;
|
||||
|
||||
@@ -519,7 +510,24 @@ export class NewEventPage implements OnInit {
|
||||
if(DocumentToSave.length == 0){
|
||||
this.afterSave();
|
||||
}
|
||||
this.toastService._successMessage('Evento criado');
|
||||
let data = {
|
||||
"subject": this.postEvent.Subject,
|
||||
"start": this.postEvent.StartDate,
|
||||
"end": this.postEvent.EndDate,
|
||||
"venue": this.postEvent.Location,
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
}
|
||||
|
||||
this.toastService._successMessage('Evento criado')
|
||||
},()=>{
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -527,10 +535,12 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
(id) => {
|
||||
|
||||
loader.remove();
|
||||
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
@@ -557,7 +567,24 @@ export class NewEventPage implements OnInit {
|
||||
if(DocumentToSave.length == 0){
|
||||
this.afterSave();
|
||||
}
|
||||
|
||||
this.toastService._successMessage('Evento criado');
|
||||
let data = {
|
||||
"subject": this.postEvent.Subject,
|
||||
"start": this.postEvent.StartDate,
|
||||
"end": this.postEvent.EndDate,
|
||||
"venue": this.postEvent.Location,
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
}
|
||||
this.toastService._successMessage('Evento criado')
|
||||
},()=>{
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.toastService._badRequest('Evento não criado')
|
||||
});
|
||||
|
||||
}
|
||||
@@ -580,7 +607,10 @@ export class NewEventPage implements OnInit {
|
||||
afterSave() {
|
||||
this.deleteTemporaryData();
|
||||
|
||||
this.onAddEvent.emit(this.postEvent);
|
||||
this.onAddEvent.emit(Object.assign(this.postEvent, {
|
||||
roomId: this.roomId
|
||||
}));
|
||||
|
||||
this.GoBackEditOrAdd.emit();
|
||||
|
||||
this.setIntervenient.emit([]);
|
||||
@@ -643,7 +673,7 @@ export class NewEventPage implements OnInit {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,12 +36,13 @@
|
||||
<span class="date">{{loadedEvent.Location}}</span>
|
||||
|
||||
<div *ngIf="loadedEvent.Organizer">
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == false">
|
||||
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == false || sesseionStora.user.Profile =='PR'">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == true">
|
||||
<div *ngIf="eventsService.isMyEvent(loadedEvent) == true && sesseionStora.user.Profile !='PR'">
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
|
||||
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
|
||||
</div>
|
||||
|
||||
@@ -89,8 +89,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="image" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Imagem"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,10 +116,11 @@
|
||||
<div (click)="openPreview(msg)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
<ion-label>{{file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
@@ -134,8 +139,12 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Mensagem de voz"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||
@@ -164,7 +173,7 @@
|
||||
</div>
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
||||
</div>
|
||||
@@ -202,7 +211,7 @@
|
||||
<!-- <div *ngIf="msg.file" >
|
||||
<div *ngIf="msg.file.type == 'application/meeting'" class="info-meeting">
|
||||
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<button (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
|
||||
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
|
||||
</div>
|
||||
@@ -230,10 +239,8 @@
|
||||
</ion-content>
|
||||
|
||||
<ion-footer>
|
||||
<!-- <div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true" >A escrever...</div> -->
|
||||
|
||||
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
|
||||
{{ wsChatMethodsService.getGroupRoom(roomId).otherUserType }}
|
||||
|
||||
<ngx-letters-avatar *ngIf="showAvatar"
|
||||
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
|
||||
|
||||
@@ -213,7 +213,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
} catch (err) { }
|
||||
}
|
||||
|
||||
async goToEvent(eventId: any) {
|
||||
async goToEvent(event: any) {
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -224,7 +224,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
eventId: event.id,
|
||||
CalendarId: event.calendarId
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
@@ -1103,19 +1104,21 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
async openPreview(msg) {
|
||||
|
||||
|
||||
if (msg.file.type === "application/webtrix") {
|
||||
this.viewDocument(msg.file, msg.attachments.image_url)
|
||||
} else {
|
||||
|
||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||
this.downloadFileMsg(msg)
|
||||
//this.testDownlod(msg)
|
||||
|
||||
} else {
|
||||
|
||||
var str = msg.attachments[0].image_url;
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log(msg)
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
@@ -1136,17 +1139,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
this.openFile(str, msg.attachments[0].name, msg.file.type);
|
||||
}
|
||||
|
||||
/* const modal = await this.modalController.create({
|
||||
component: ViewMediaPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
componentProps: {
|
||||
image: str,
|
||||
type: msg.file.type,
|
||||
username: msg.u.name,
|
||||
_updatedAt: msg._updatedAt
|
||||
}
|
||||
});
|
||||
modal.present(); */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="back-icon cursor-pointer">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " (click)="close()" slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
<div class="back-icon cursor-pointer" (click)="close()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Nova Conversa</ion-label>
|
||||
@@ -22,10 +22,10 @@
|
||||
<ion-content>
|
||||
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<div class="main-content">
|
||||
|
||||
@@ -36,11 +36,10 @@
|
||||
</div>
|
||||
|
||||
<div (click)="openMessagesPage(user.username)" *virtualItem="let user" class="item-user cursor-pointer">
|
||||
<p>{{user.name}}</p>
|
||||
<span class="icon">
|
||||
<ion-icon class="{{user.status}}" slot="end" name="ellipse"></ion-icon>
|
||||
</span>
|
||||
|
||||
<p>{{user.name}}</p>
|
||||
<span class="icon">
|
||||
<ion-icon class="{{user.status}}" slot="end" name="ellipse"></ion-icon>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</ion-virtual-scroll>
|
||||
|
||||
@@ -27,6 +27,7 @@ export class ContactsPage implements OnInit {
|
||||
sessionStore = SessionStore
|
||||
|
||||
@Output() openMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() emptyTextDescriptionOpen:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -41,10 +42,12 @@ export class ContactsPage implements OnInit {
|
||||
this.room=null;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
async ngOnInit() {
|
||||
|
||||
this.loadUsers();
|
||||
this.chatService.refreshtoken();
|
||||
await this.chatService.refreshtoken();
|
||||
this.loadUsers();
|
||||
|
||||
}
|
||||
|
||||
onChange(event){
|
||||
@@ -67,11 +70,11 @@ export class ContactsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
loadUsers(){
|
||||
loadUsers() {
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
this.chatService.getAllUsers().subscribe((res:any)=>{
|
||||
this.chatService.getAllUsers().subscribe((res:any)=> {
|
||||
|
||||
//this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
@@ -96,20 +99,20 @@ export class ContactsPage implements OnInit {
|
||||
let first_prev = records[recordIndex - 1].name[0];
|
||||
let first_current = record.name[0];
|
||||
|
||||
if(first_prev != first_current){
|
||||
if(first_prev != first_current) {
|
||||
return first_current;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
doRefresh(event){
|
||||
doRefresh(event) {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
close() {
|
||||
this.emptyTextDescriptionOpen.emit();
|
||||
}
|
||||
|
||||
clicked(){
|
||||
clicked() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
<div class="messages-list-item-wrapper container-width-100"
|
||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; index as i; let last = last">
|
||||
|
||||
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''">
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
|
||||
@@ -89,8 +90,13 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="image" class="file-icon"></ion-icon>
|
||||
<ion-label>{{"Imagem"}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
<img *ngIf="msg.attachments[0].image_url" src={{msg.attachments[0].image_url}} alt="image">
|
||||
@@ -108,14 +114,18 @@
|
||||
|
||||
<div *ngIf="!msg.attachments[0].image_url">
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="document" class="file-icon"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="msg.attachments[0].type != 'webtrix'" name="document" class="file-icon"></ion-icon>
|
||||
<ion-icon *ngIf="msg.attachments[0].type == 'webtrix'" src="assets/icon/webtrix.svg" class="file-icon"></ion-icon>
|
||||
|
||||
<ion-label>{{ file.title}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.attachments[0].type != 'webtrix' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<div *ngIf="msg.attachments[0].image_url">
|
||||
|
||||
<span *ngIf="msg.file.type">
|
||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon">
|
||||
@@ -137,8 +147,13 @@
|
||||
<ion-item class="add-attachment-bg-color" shape="round" lines="none" type="button">
|
||||
<ion-icon name="mic-outline" class="file-icon"></ion-icon>
|
||||
<ion-label>{{'Mensagem de voz'}}</ion-label>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0 " class="icon-download" src="assets/icon/theme/default/icons-download.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == false && msg.downloadAttachmentsTemp == 0" class="icon-download" src="assets/icon/theme/gov/icons-download.svg" slot="end"></ion-icon>
|
||||
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' && msg.downloadLoader == true " class="icon-download" src="assets/gif/theme/default/Blocks-loader.svg" slot="end"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && msg.downloadLoader == true" class="icon-download" src="assets/gif/theme/gov/Blocks-loader.svg" slot="end"></ion-icon>s
|
||||
<ion-icon *ngIf="msg.downloadAttachments == false && msg.downloadAttachmentsTemp >= 1 && msg.downloadLoader == false" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
|
||||
@@ -164,13 +179,14 @@
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-meeting" *ngIf="msg.file.type == 'application/meeting'">
|
||||
|
||||
<ion-label *ngIf="msg.delate == true" class="info-meeting-small">Apagou a mensagem</ion-label><br />
|
||||
|
||||
|
||||
<ion-label *ngIf="msg.delate == false" class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
|
||||
<button *ngIf="msg.delate == false" (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal">
|
||||
<button *ngIf="msg.delate == false" (click)="goToEvent(msg.file)" class="btn-no-color info-meeting-normal">
|
||||
<ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label>
|
||||
</button><br />
|
||||
<ion-label *ngIf="msg.delate == false" class="info-meeting-medium">
|
||||
@@ -214,14 +230,10 @@
|
||||
<div class="width-100 pl-20 pr-20">
|
||||
<span *ngIf="!lastAudioRecorded">{{durationDisplay}}</span>
|
||||
<div class=" audioDiv d-flex width-100 mt-10 mb-10" *ngIf="lastAudioRecorded">
|
||||
<!-- <button class="audioButtonPlay" fill="clear" (click)="start(audioRecorded)" *ngIf="!isPlaying"> <ion-icon slot="icon-only" name="play"></ion-icon> </button>
|
||||
<button class="audioButtonPlay" fill="clear" (click)="togglePlayer(true)" *ngIf="isPlaying"> <ion-icon slot="icon-only" name="pause"></ion-icon> </button> -->
|
||||
<div (click)="start(audioRecorded)" *ngIf="!isPlaying" > <ion-icon slot="icon-only" name="play"></ion-icon> </div>
|
||||
<div (click)="togglePlayer(isPlaying)" *ngIf="isPlaying"> <ion-icon slot="icon-only" name="pause"></ion-icon> </div>
|
||||
<!-- <label>{{audioDuration}}</label> -->
|
||||
<ion-range #range [(ngModel)]="audioProgress" max="100" (mouseup)="seek()"></ion-range>
|
||||
</div>
|
||||
<!-- <audio [src]="audioRecorded" class="d-flex width-100 mt-10 mb-10" *ngIf="lastAudioRecorded" controls controlsList="nodownload noplaybackrate"></audio> -->
|
||||
</div>
|
||||
|
||||
<div class="container width-100 d-flex">
|
||||
|
||||
@@ -27,11 +27,10 @@ import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-vi
|
||||
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Howl } from 'howler';
|
||||
import { runInThisContext } from 'vm';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
@@ -49,8 +48,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
@ViewChild('message-item') messageContainer: ElementRef;
|
||||
|
||||
loggedUser: any;
|
||||
|
||||
messages: any;
|
||||
dm: any;
|
||||
userPresence = '';
|
||||
@@ -100,6 +97,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
audioTimer: any;
|
||||
@ViewChild('range', { static: false }) range: IonRange;
|
||||
userName = "";
|
||||
room: any = new Array();
|
||||
roomName: any;
|
||||
isAdmin = false;
|
||||
roomCountDownDate: string;
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
@@ -123,12 +124,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
private platform: Platform,
|
||||
private fileOpener: FileOpener,
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
|
||||
this.checkAudioPermission()
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||
@@ -165,11 +166,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
alert(this.wsChatMethodsService.getDmRoom(this.roomId).name)
|
||||
|
||||
this.chatService.refreshtoken();
|
||||
this.scrollToBottom();
|
||||
|
||||
this.getChatMembers();
|
||||
|
||||
this.deleteRecording();
|
||||
@@ -375,7 +376,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
return this.timeService.showDateDuration(start);
|
||||
}
|
||||
|
||||
async goToEvent(eventId: any) {
|
||||
async goToEvent(event: any) {
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
@@ -385,7 +386,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps: {
|
||||
eventId: eventId,
|
||||
eventId: event.id,
|
||||
CalendarId: event.calendarId
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
@@ -441,22 +443,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
deleteMessage(msgId: string, msg: MessageService) {
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
|
||||
if (msg.file.type == "application/webtrix") {
|
||||
// this.openViewDocumentModal(msg.file);
|
||||
}
|
||||
else {
|
||||
|
||||
var str = msg.attachments[0].image_url;
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
const encodedData = btoa(str);
|
||||
|
||||
let file = this.base64toBlob(encodedData, 'application/pdf')
|
||||
let fileURL = URL.createObjectURL(file)
|
||||
|
||||
window.open(fileURL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
base64toBlob(base64Data, contentType) {
|
||||
@@ -667,7 +653,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
const roomId = this.roomId
|
||||
|
||||
const image = await this.CameraService.takePicture();
|
||||
await this.fileService.saveImage(image)
|
||||
await this.fileService.saveImage(image);
|
||||
const lastphoto: any = await this.fileService.loadFiles();
|
||||
const { capturedImage, capturedImageTitle } = await this.fileService.loadFileData(lastphoto);
|
||||
const base64 = await fetch(capturedImage);
|
||||
@@ -1028,33 +1014,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
|
||||
this.downloadFileMsg(msg)
|
||||
|
||||
|
||||
/* } else if (msg.file.type === "application/pdf") {
|
||||
|
||||
|
||||
|
||||
const win = window.open("", "_blank");
|
||||
let html = '';
|
||||
|
||||
html += '<html>';
|
||||
html += '<body style="margin:0!important">';
|
||||
html += '<iframe width="100%" height="100%" src="' + str + '" type="application/pdf" />';
|
||||
html += '</body>';
|
||||
html += '</html>';
|
||||
|
||||
setTimeout(() => {
|
||||
win.document.write(html);
|
||||
}, 0); */
|
||||
|
||||
|
||||
|
||||
//this.viewDocument(msg, msg.attachments.image_url)
|
||||
} else {
|
||||
|
||||
var str = msg.attachments[0].image_url;
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log(msg)
|
||||
if (msg.file.type == "application/img") {
|
||||
const modal = await this.modalController.create({
|
||||
@@ -1079,19 +1044,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
testEditMessage(msg: MessageService) {
|
||||
// msg.receptorReceive()
|
||||
// alert('cool!')
|
||||
}
|
||||
|
||||
start(track) {
|
||||
if (this.audioPlay) {
|
||||
this.audioPlay.stop();
|
||||
@@ -1138,6 +1095,27 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
async getRoomInfo() {
|
||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||
// console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
if (this.room.name) {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
}
|
||||
|
||||
|
||||
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
|
||||
this.isAdmin = true
|
||||
} else {
|
||||
this.isAdmin = false
|
||||
}
|
||||
|
||||
if (this.room.customFields.countDownDate) {
|
||||
this.roomCountDownDate = this.room.customFields.countDownDate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ export class NewGroupPage implements OnInit{
|
||||
|
||||
@Input() groupName:string;
|
||||
@Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
|
||||
constructor(
|
||||
private pickerController: PickerController,
|
||||
@@ -59,10 +61,8 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
_ionChange(event){
|
||||
|
||||
|
||||
@@ -76,9 +76,8 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
}
|
||||
|
||||
close(){
|
||||
//this.modalController.dismiss();
|
||||
|
||||
close() {
|
||||
|
||||
this.addGroupMessage.emit();
|
||||
}
|
||||
|
||||
@@ -91,6 +90,9 @@ export class NewGroupPage implements OnInit{
|
||||
let customFields = {}
|
||||
let res:any;
|
||||
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
if(this.thedate) {
|
||||
let customFields = {
|
||||
"countDownDate":this.thedate
|
||||
@@ -102,6 +104,8 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
|
||||
|
||||
loader.remove();
|
||||
|
||||
// FsId
|
||||
// DocId
|
||||
|
||||
@@ -109,36 +113,17 @@ export class NewGroupPage implements OnInit{
|
||||
this.addGroupMessage.emit(res.result.rid);
|
||||
await this.wsChatMethodsService.getAllRooms();
|
||||
|
||||
setTimeout(()=> {
|
||||
this.documents.forEach(element => {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
|
||||
file: {
|
||||
"name": element.Assunto,
|
||||
"type": "application/webtrix",
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"DocId": element.DocId,
|
||||
"Assunto": element.Assunto,
|
||||
},
|
||||
temporaryData: {
|
||||
data: {
|
||||
selected: {
|
||||
Id: element.DocId,
|
||||
ApplicationType: element.ApplicationId
|
||||
}
|
||||
}
|
||||
},
|
||||
attachments: [{
|
||||
"title": element.Assunto,
|
||||
"description": element.Assunto,
|
||||
"title_link_download": true,
|
||||
"type": "webtrix",
|
||||
"text": element.Assunto,
|
||||
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||
}],
|
||||
})
|
||||
});
|
||||
|
||||
}, 500)
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
|
||||
this.createGroupWithAttachments(res)
|
||||
|
||||
}, 500)
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
@@ -148,6 +133,52 @@ export class NewGroupPage implements OnInit{
|
||||
|
||||
}
|
||||
|
||||
createGroupWithAttachmentsCath(res: any) {
|
||||
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
|
||||
setTimeout(()=>{
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
}, 1500)
|
||||
} else {
|
||||
this.createGroupWithAttachments(res)
|
||||
}
|
||||
}
|
||||
|
||||
createGroupWithAttachments(res: any) {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).hasLoadHistory = true;
|
||||
|
||||
this.documents.forEach(element => {
|
||||
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
|
||||
file: {
|
||||
"name": element.Assunto,
|
||||
"type": "application/webtrix",
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"DocId": element.DocId,
|
||||
"Assunto": element.Assunto,
|
||||
},
|
||||
temporaryData: {
|
||||
data: {
|
||||
selected: {
|
||||
Id: element.DocId,
|
||||
ApplicationType: element.ApplicationId
|
||||
}
|
||||
}
|
||||
},
|
||||
attachments: [{
|
||||
"title": element.Assunto,
|
||||
"description": element.Assunto,
|
||||
"title_link_download": true,
|
||||
"type": "webtrix",
|
||||
"text": element.Assunto,
|
||||
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||
}],
|
||||
})
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
this.groupName = ""
|
||||
}, 150);
|
||||
}
|
||||
|
||||
async addContacts(){
|
||||
this.close();
|
||||
|
||||
|
||||
@@ -84,13 +84,13 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && allProcessesList.length == 0"
|
||||
*ngIf="!skeletonLoader && getAllProcessCount == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && allProcessesList.length == 0">
|
||||
<div *ngIf="skeletonLoader && getAllProcessCount == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -80,6 +80,9 @@ export class AllProcessesPage implements OnInit {
|
||||
|
||||
|
||||
get AllProcess() {
|
||||
setTimeout(() => {
|
||||
this.skeletonLoader = false;
|
||||
}, 5000);
|
||||
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
||||
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr)
|
||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
|
||||
|
||||
@@ -111,6 +111,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="startDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
@@ -138,6 +139,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="endDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
@@ -196,6 +198,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="eventProcess.workflowInstanceDataFields.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
[min]="endDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #occurrrence
|
||||
|
||||
@@ -51,6 +51,7 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
public stepSecond = 5;
|
||||
recurringTypes: any;
|
||||
selectedRecurringType: any;
|
||||
currentDate = new Date()
|
||||
|
||||
showLoader = false
|
||||
|
||||
@@ -181,14 +182,54 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSelectedRecurringChanged(ev:any){
|
||||
/*
|
||||
|
||||
this.calculetedLastOccurrence(ev);
|
||||
|
||||
if(ev.length > 1){
|
||||
|
||||
this.selectedRecurringType = ev.filter(data => data != '-1');
|
||||
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
this.selectedRecurringType = "-1";
|
||||
} */
|
||||
this.postEvent.EventRecurrence.Type = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
calculetedLastOccurrence(type:number){
|
||||
var valor;
|
||||
var opcao: boolean;
|
||||
if (type == 0) {
|
||||
valor = 7;
|
||||
opcao = true;
|
||||
} else if(type == 1){
|
||||
valor = 30;
|
||||
opcao = true;
|
||||
} else if(type == 2){
|
||||
valor = 1;
|
||||
opcao = false;
|
||||
}else if(type == 3){
|
||||
valor = 5;
|
||||
opcao = false;
|
||||
}
|
||||
this.defineLastOccurrence(valor, opcao);
|
||||
}
|
||||
|
||||
|
||||
defineLastOccurrence(valor:number, opcao:boolean){
|
||||
var time = new Date(this.endDate);
|
||||
if (opcao == true) {
|
||||
time.setDate(time.getDate() + valor);
|
||||
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
|
||||
} else {
|
||||
time = new Date(
|
||||
time.getFullYear() + valor,
|
||||
time.getMonth(),
|
||||
time.getDate(),
|
||||
time.getHours(),
|
||||
time.getMinutes()
|
||||
);
|
||||
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
openLastOccurrence() {
|
||||
@@ -237,6 +278,12 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
|
||||
this.startDate = new Date(this.startDate);
|
||||
this.startDate.setHours(this.startDate.getHours() + 1);
|
||||
|
||||
this.endDate = new Date(this.endDate);
|
||||
this.endDate.setHours(this.endDate.getHours() + 1);
|
||||
|
||||
const event: EventToApproveEdit = {
|
||||
SerialNumber: this.eventProcess.serialNumber,
|
||||
Body: this.eventProcess.workflowInstanceDataFields.Body,
|
||||
@@ -263,9 +310,9 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
|
||||
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||
this.toastService.successMessage('Evento editado');
|
||||
this.toastService._successMessage('Evento editado');
|
||||
}, error =>{
|
||||
this.toastService.badRequest('Evento não editado');
|
||||
this.toastService._badRequest('Evento não editado');
|
||||
})
|
||||
|
||||
|
||||
@@ -273,16 +320,16 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
if(document['action'] == 'add') {
|
||||
delete document.action
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||
this.toastService.successMessage();
|
||||
this.toastService._successMessage();
|
||||
}, error =>{
|
||||
this.toastService.badRequest();
|
||||
this.toastService._badRequest();
|
||||
});
|
||||
} else if(document['action'] == 'delete') {
|
||||
delete document.action
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
}, error =>{
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Calendário do MDGPR
|
||||
Meu Calendário
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
Calendário Partilhado
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<div class="title">
|
||||
<div class="thetitle"><ion-label >Expediente</ion-label></div>
|
||||
<div class="theicon">
|
||||
<div class="theicon" (click)="refreshing()">
|
||||
<button title="Atualizar" class="btn-no-color" (click)="refreshing()">
|
||||
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -84,6 +84,7 @@ export class ExpedientesPrPage implements OnInit {
|
||||
}
|
||||
|
||||
refreshing() {
|
||||
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1000);
|
||||
|
||||
@@ -95,6 +95,7 @@ export class ExpedientsPage implements OnInit {
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1000)
|
||||
|
||||
@@ -24,14 +24,14 @@
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5">GABINETE DIGITAL</p>
|
||||
<div class="add-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text color-white">Presidente da República</p> -->
|
||||
<!-- <p class="logo-description-text color-white">Calendário Partilhado</p> -->
|
||||
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
|
||||
<div class="add-line-white"></div>
|
||||
</div>
|
||||
@@ -56,10 +56,21 @@
|
||||
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
|
||||
</div>
|
||||
<div class="logo-description d-flex align-center justify-content-center">
|
||||
|
||||
<div class="logo-description-content">
|
||||
<!-- <p class="logo-description-text">Presidente da República</p> -->
|
||||
<p class="logo-description-text">GABINETE DIGITAL</p>
|
||||
<div class="add-line"></div>
|
||||
<!-- <p class="logo-description-text">Calendário Partilhado</p> -->
|
||||
|
||||
<!-- <div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description-content">
|
||||
<p class="logo-description-text color-white">Calendário Partilhado</p>
|
||||
<div class="add-line color-white" style="border-bottom-color: white;"></div>
|
||||
<p class="logo-description-text color-white">GABINETE DIGITAL</p>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
|
||||
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
|
||||
<p *ngIf="!environment.presidencia" class="logo-description-text">GABINETE DIGITAL</p>
|
||||
<div class="add-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -171,6 +182,6 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="header-bottom-line"></div>
|
||||
<div [class.header-bottom-line] = "ThemeService.currentTheme == 'gov'" style="height: 5px;"></div>
|
||||
<!-- {{ RouteService.history | json }} -->
|
||||
</div>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
color: black;
|
||||
overflow: auto;
|
||||
|
||||
.logo-icon{
|
||||
.logo-icon {
|
||||
width: 25.33%;
|
||||
overflow: auto;
|
||||
|
||||
img{
|
||||
img {
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
}
|
||||
@@ -72,12 +72,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.header-btns{
|
||||
.header-btns {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.div-profile{
|
||||
.div-profile {
|
||||
height: fit-content;
|
||||
font-size: 45px;
|
||||
justify-content: flex-end;
|
||||
@@ -103,7 +103,7 @@
|
||||
position: absolute; /* changed */
|
||||
top: 5px; /* changed */
|
||||
right: 27px; /* changed */
|
||||
}
|
||||
}
|
||||
|
||||
.profile-text{
|
||||
font-size: 20px;
|
||||
@@ -113,11 +113,11 @@
|
||||
color: var(--profile-text-color);
|
||||
}
|
||||
}
|
||||
.main-tab{
|
||||
.main-tab {
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
.desktop{
|
||||
.desktop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ export class HeaderPage implements OnInit {
|
||||
permissionList = new PermissionList();
|
||||
|
||||
production = environment.production
|
||||
environment = environment
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
|
||||
@@ -72,14 +72,16 @@ export class DespachosOptionsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
sendExpedienteToPending() {
|
||||
const loader = this.toastService.loading()
|
||||
this.popoverController.dismiss();
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
this.toastService._successMessage()
|
||||
loader.remove()
|
||||
|
||||
this.close();
|
||||
},()=>{
|
||||
|
||||
loader.remove()
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,11 +98,14 @@ export class DespachosPrOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
|
||||
|
||||
this.toastService._successMessage()
|
||||
this.popoverController.dismiss('close')
|
||||
loader.remove()
|
||||
},()=>{
|
||||
loader.remove()
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
|
||||
@@ -107,12 +107,14 @@ export class DiplomasGerarOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
async sendExpedienteToPending() {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
this.despachoService.sendExpedienteToPending(this.serialNumber).subscribe(res => {
|
||||
this.goBack();
|
||||
this.toastService.successMessage()
|
||||
loader.remove()
|
||||
},
|
||||
error => {
|
||||
loader.remove()
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
});
|
||||
|
||||
|
||||
@@ -252,12 +252,14 @@ export class OptsExpedientePrPage implements OnInit {
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.popoverController.dismiss();
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
|
||||
loader.remove()
|
||||
this.close();
|
||||
},()=>{
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
loader.remove()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +81,14 @@ export class RequestOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
const loader = this.toastService.loading()
|
||||
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
|
||||
|
||||
this.toastService._successMessage()
|
||||
this.close();
|
||||
loader.remove()
|
||||
},()=>{
|
||||
loader.remove()
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
<ion-datetime
|
||||
<!-- <ion-datetime
|
||||
class="d-block d-md-none"
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
placeholder="Início"
|
||||
@@ -38,12 +38,12 @@
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
</ion-datetime> -->
|
||||
|
||||
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date*"
|
||||
placeholder="Data inicio*"
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
@@ -68,7 +68,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class d-flex flex-grow-1">
|
||||
<ion-datetime
|
||||
<!-- <ion-datetime
|
||||
class="flex-grow-1 d-md-none"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
placeholder="Fim"
|
||||
@@ -76,16 +76,16 @@
|
||||
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2025">
|
||||
</ion-datetime>
|
||||
</ion-datetime> -->
|
||||
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker2"
|
||||
placeholder="Choose a date*"
|
||||
placeholder="Data de fim*"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker2
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
|
||||
@@ -45,10 +45,10 @@ export class NewActionPage implements OnInit {
|
||||
this.folder = new PublicationFolder();
|
||||
|
||||
|
||||
this.folder = Object.assign(this.folder, {
|
||||
/* this.folder = Object.assign(this.folder, {
|
||||
DateBegin: new Date().toISOString(),
|
||||
DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(),
|
||||
})
|
||||
}) */
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user