This commit is contained in:
Peter Maquiran
2022-05-27 13:36:37 +01:00
parent 304975d823
commit ce7cee0876
25 changed files with 131 additions and 234 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ export class ViewEventPage implements OnInit {
alert.dismiss(); alert.dismiss();
}, 1500); }, 1500);
this.goBack(); this.goBack();
this.toastService.successMessage('Evento apagado'); this.toastService._successMessage('Evento apagado');
}, () => { }, }, () => { },
() => { () => {
loader.remove(); loader.remove();
+1
View File
@@ -458,6 +458,7 @@
<app-view-event *ngIf="mobileComponent.showEventDetails" <app-view-event *ngIf="mobileComponent.showEventDetails"
[profile]="profile" [profile]="profile"
[eventId]="selectedEventId" [eventId]="selectedEventId"
[CalendarId]="selectedEventCalendarId"
(viewEventDetailDismiss)="viewEventDetailDismiss($event)" (viewEventDetailDismiss)="viewEventDetailDismiss($event)"
[eventAttendees]="contacts" [eventAttendees]="contacts"
></app-view-event> ></app-view-event>
+8 -18
View File
@@ -3,7 +3,7 @@ import { CalendarComponent } from 'ionic2-calendar';
import { AlertController, ModalController, Platform } from '@ionic/angular'; import { AlertController, ModalController, Platform } from '@ionic/angular';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
import { Event } from '../../models/event.model'; import { Event } from '../../models/event.model';
import { Router, NavigationEnd } from '@angular/router'; import { Router, NavigationEnd, NavigationExtras } from '@angular/router';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
@@ -106,6 +106,7 @@ export class AgendaPage implements OnInit {
selectedEvent: Event; selectedEvent: Event;
selectedEventId: string | number; selectedEventId: string | number;
selectedEventCalendarId : string | number;
postEvent: any; postEvent: any;
// temporary data // temporary data
@@ -311,6 +312,7 @@ export class AgendaPage implements OnInit {
this.viewingEventObject = event; this.viewingEventObject = event;
this.selectedEventId = event.id; this.selectedEventId = event.id;
this.selectedEventCalendarId = event?.['event']?.CalendarId;
this.cloneAllmobileComponent(); this.cloneAllmobileComponent();
@@ -1251,24 +1253,12 @@ export class AgendaPage implements OnInit {
// open component // open component
async viewEventDetail(eventId: any) { async viewEventDetail(eventId: any) {
this.router.navigate(['/home/agenda', eventId, 'agenda']); const CalendarId = this.selectedEventCalendarId
/*
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: eventId,
adding: this.adding
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
// this.viewEventDetailDismiss(res);
}
}); */
} }
// open component // open component
@@ -40,6 +40,7 @@ export class ViewEventPage implements OnInit {
profile: string; profile: string;
eventId: string; eventId: string;
CalendarId: string;
caller: string; caller: string;
customDate: any; customDate: any;
today: any; today: any;
@@ -53,6 +54,7 @@ export class ViewEventPage implements OnInit {
task: ExpedientTaskModalPageNavParamsTask; task: ExpedientTaskModalPageNavParamsTask;
LoadedDocument: any = null; LoadedDocument: any = null;
sesseionStora = SessionStore sesseionStora = SessionStore
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
/* private navParams: NavParams, */ /* private navParams: NavParams, */
@@ -71,12 +73,20 @@ export class ViewEventPage implements OnInit {
private ionicStorage: Storage, private ionicStorage: Storage,
private CalendarService: CalendarService private CalendarService: CalendarService
) { ) {
this.isEventEdited = false; this.isEventEdited = false;
this.loadedEvent = new Event(); this.loadedEvent = new Event();
this.eventBody = { BodyType: "1", Text: "" }; this.eventBody = { BodyType: "1", Text: "" };
this.loadedEvent.Body = this.eventBody; this.loadedEvent.Body = this.eventBody;
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
this.eventId = params['params'].eventId; this.eventId = params['params'].eventId;
const urlParams = new URLSearchParams(window.location.search);
this.CalendarId = urlParams.get('CalendarId');
this.eventId = this.eventId.replace(' ', '')
if (params["params"].caller) { if (params["params"].caller) {
this.caller = (params["params"].caller); this.caller = (params["params"].caller);
} }
@@ -176,13 +186,10 @@ export class ViewEventPage implements OnInit {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(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() loader.remove()
}, (error) => { }, (error) => {
if (error.status === 0) { if (error.status === 0) {
this.getFromDb(); this.getFromDb();
} else { } else {
@@ -195,22 +202,15 @@ export class ViewEventPage implements OnInit {
}); });
} else { } else {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
// if(this.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(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() loader.remove()
}, (error) => { }, (error) => {
if (error.status === 0) { if (error.status === 0) {
this.getFromDb(); this.getFromDb();
} else { } else {
@@ -225,8 +225,6 @@ export class ViewEventPage implements OnInit {
} }
} }
deleteEvent() { deleteEvent() {
@@ -45,11 +45,6 @@
<ion-content> <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> -->
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe> <div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text"> <div class="welcome-text">
@@ -78,29 +73,6 @@
</div> </div>
<!-- <div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg ==''">
<div *ngIf="msg.file.type == 'application/img'">
<div class="message-item-options d-flex justify-content-end">
</div>
<div class="title">
<ion-label>{{msg.u.name ?? ""}}</ion-label>
<span class="time">{{msg.duration}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.file" class="message-attachments">
<div>
<div (click)="openPreview(msg)">
File
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
</div>
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
</div> -->
<div *ngIf="msg.file && msg.delate == false"> <div *ngIf="msg.file && msg.delate == false">
<div class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)"> <div class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
<div class="title"> <div class="title">
@@ -159,14 +159,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
}) })
//this.loadFiles();
VoiceRecorder.requestAudioRecordingPermission(); VoiceRecorder.requestAudioRecordingPermission();
this.getChatMembers(); this.getChatMembers();
/* Filesystem.mkdir({
path: IMAGE_DIR,
directory: Directory.Data,
recursive: true
}); */
} }
ngAfterViewInit() { ngAfterViewInit() {
@@ -185,9 +179,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
onEnd: ev => { onEnd: ev => {
Haptics.impact({ style: ImpactStyle.Light }) Haptics.impact({ style: ImpactStyle.Light })
this.stopRecording(); this.stopRecording();
/* setTimeout(() => {
this.loadFiles();
}, 500); */
} }
}, true); }, true);
longpress.enable(); longpress.enable();
+12 -12
View File
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular'; import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page'; import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service';
import { ChatService } from 'src/app/services/chat.service'; import { ChatService } from 'src/app/services/chat.service';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'; import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
@@ -35,8 +35,7 @@ export class NewGroupPage implements OnInit {
private processesService: ProcessesService, private processesService: ProcessesService,
public wsChatMethodsService: WsChatMethodsService, public wsChatMethodsService: WsChatMethodsService,
private authService: AuthService, private authService: AuthService,
) ) {
{
this.loggedUserChat = authService.ValidatedUserChat['data']; this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = false; this.isGroupCreated = false;
this.groupName = this.navParams.get('name'); this.groupName = this.navParams.get('name');
@@ -71,9 +70,9 @@ export class NewGroupPage implements OnInit {
let customFields = {} let customFields = {}
let res:any; let res:any;
if(this.thedate){ if(this.thedate) {
let customFields = { let customFields = {
"countDownDate":this.thedate "countDownDate": this.thedate
} }
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
@@ -86,12 +85,13 @@ export class NewGroupPage implements OnInit {
this.isGroupCreated = true; this.isGroupCreated = true;
this.addContacts(res.result); this.addContacts(res.result);
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result); setTimeout(() => {
console.log(res.result.rid) this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
}, 10)
} }
async addContacts(room){ async addContacts(room) {
this.close(); this.close();
let name = this.groupName.split(' ').join('-'); let name = this.groupName.split(' ').join('-');
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
{ {
text: 'Ok', text: 'Ok',
cssClass: 'btn-cancel', cssClass: 'btn-cancel',
handler:(value:any)=>{ handler:(value:any) => {
let now = new Date(); let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds()); this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -142,9 +142,9 @@ export class NewGroupPage implements OnInit {
] ]
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){ if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){ if(value.days.value > 0) {
if(value.days.value == 1){ if(value.days.value == 1) {
if(value.hours.value == 1){ if(value.hours.value == 1) {
this.displayDuration = value.days.value + " day " + this.displayDuration = value.days.value + " day " +
value.hours.value + " hora " + value.hours.value + " hora " +
value.minutes.value + " minutos"; value.minutes.value + " minutos";
@@ -101,16 +101,13 @@ export class EventListPage implements OnInit {
this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[] = []) => { this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[] = []) => {
this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
//this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null)
}) })
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => { this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => {
this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
}) })
}) })
} }
@@ -31,7 +31,7 @@ export class ExpedientePage implements OnInit {
expedienteTaskPipe = new ExpedienteTaskPipe() expedienteTaskPipe = new ExpedienteTaskPipe()
onlinecheck: boolean; onlinecheck: boolean;
listToPresent; listToPresent= []
constructor( constructor(
private processes: ProcessesService, private processes: ProcessesService,
private router: Router, private router: Router,
@@ -216,20 +216,6 @@
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p> <p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div> </div>
<!-- <div *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientesPrPage(); selectedElement='ExpedientesPr'" [class.active]="selectedElement == 'ExpedientesPr'" class="exp-card-long justify-center width-100 white-background">
<div class="center-div">F
<div class="exp-card-icon">
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
</div>
<div class="exp-card-text">
<p class="exp-card-title " *ngIf="loggeduser.Profile == mdgpr">Expediente Presidente</p>
<p class="exp-card-title " *ngIf="loggeduser.Profile == pr">Expediente</p>
<p class="exp-card-content"><span class="number">{{expedienteprstore.count}} </span> <span class="title1">Documentos</span> </p>
</div>
</div>
</div> -->
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_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])" (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="center-div">
<div class="exp-card-icon"> <div class="exp-card-icon">
@@ -3,16 +3,6 @@
<div class="div-title"> <div class="div-title">
<ion-label class="title">Editar acção presidencial</ion-label> <ion-label class="title">Editar acção presidencial</ion-label>
</div> </div>
<!-- <div class="actionType">
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="Viagem">
<ion-label>Viagem</ion-label>
</ion-segment-button>
<ion-segment-button value="Evento">
<ion-label>Evento</ion-label>
</ion-segment-button>
</ion-segment>
</div> -->
</div> </div>
</ion-header> </ion-header>
@@ -24,6 +24,7 @@
<div class="div-title flex-grow-1"> <div class="div-title flex-grow-1">
<ion-label class="title ">Acções Presidenciais</ion-label> <ion-label class="title ">Acções Presidenciais</ion-label>
</div> </div>
<div class="div-icon"> <div class="div-icon">
<button *ngIf="p.userPermission([p.permissionList.Actions.create])" title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()"> <button *ngIf="p.userPermission([p.permissionList.Actions.create])" title="Adicionar nova ação presidencial" class="btn-no-color" (click)="AddPublicationFolder()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
@@ -34,6 +35,9 @@
</button> </button>
</div> </div>
</div> </div>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
</div> </div>
</ion-toolbar> </ion-toolbar>
<!-- Content --> <!-- Content -->
@@ -230,7 +230,7 @@ export class PublicationsPage implements OnInit {
this.showLoader = false; this.showLoader = false;
}); });
}); });
this.storage.get('actionsViagens').then((viagens) => { this.storage.get('actionsViagens').then((viagens = []) => {
viagens.forEach(data => { viagens.forEach(data => {
let folder: PublicationFolder = { let folder: PublicationFolder = {
+3 -6
View File
@@ -218,12 +218,6 @@ export class AuthService {
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise() let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path message.file.guid = guid.path
// await this.storage.set(guid.path, message.file.image_url).then(() => {
//
// // message.getFileFromDb()
// });
message.downloadFileMsg() message.downloadFileMsg()
return true return true
@@ -235,10 +229,13 @@ export class AuthService {
} else { } else {
try { try {
const res = message.temporaryData const res = message.temporaryData
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise(); let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
message.attachments[0].title_link = url_no_options message.attachments[0].title_link = url_no_options
message.attachments[0].message_link = url_no_options message.attachments[0].message_link = url_no_options
return true return true
} catch(e) { } catch(e) {
+8 -17
View File
@@ -8,9 +8,9 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { showDateDuration } from 'src/plugin/showDateDuration'; import { showDateDuration } from 'src/plugin/showDateDuration';
import { ChatStorageService } from './chat-storage.service' import { ChatStorageService } from './chat-storage.service'
import { ChatMethodsService } from './chat-methods.service' import { ChatMethodsService } from './chat-methods.service'
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm' import { MessageModel } from '../../models/beast-orm'
import { AESEncrypt } from '../aesencrypt.service' import { AESEncrypt } from '../aesencrypt.service'
import { HttpClient, HttpEventType } from '@angular/common/http'; import { HttpEventType } from '@angular/common/http';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service'; import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
@@ -133,7 +133,11 @@ export class MessageService {
if(!this.hasFile) { if(!this.hasFile) {
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference} const params = {
roomId:this.rid,
msg:this.msg,
localReference: this.localReference
}
await this.sendRequest(params) await this.sendRequest(params)
@@ -153,13 +157,10 @@ export class MessageService {
this.errorUploadingAttachment = false this.errorUploadingAttachment = false
this.temporaryData = {} this.temporaryData = {}
const params = {roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file, localReference: this.localReference} const params = {roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file, localReference: this.localReference}
await this.sendRequest(params) await this.sendRequest(params)
} else if(this.WsChatService.isLogin == false) { } else if(this.WsChatService.isLogin == false) {
this.WsChatService.registerCallback({ this.WsChatService.registerCallback({
type: 'reConnect', type: 'reConnect',
funx: async ()=> { funx: async ()=> {
@@ -189,10 +190,6 @@ export class MessageService {
} }
} }
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) { if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
this.WsChatService.send(params).then( this.WsChatService.send(params).then(
@@ -243,13 +240,7 @@ export class MessageService {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''); downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} /* else if (this.file.type == 'application/audio') { }
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} */
this.attachments[0] = { this.attachments[0] = {
image_url: downloadFile, image_url: downloadFile,
@@ -362,6 +362,15 @@ export class WsChatMethodsService {
} }
} }
deleteRoom(roomId) {
delete this.group[roomId];
const index = this._group.findIndex((e)=> e.id == roomId);
this._group = this._group.splice(index, 1);
}
roomExist(roomId) { roomExist(roomId) {
return this.dm[roomId]?.id || this.group[roomId]?.id return this.dm[roomId]?.id || this.group[roomId]?.id
} }
@@ -45,6 +45,7 @@ export class ViewEventPage implements OnInit {
@Input() profile:string; @Input() profile:string;
@Input() eventId: string; @Input() eventId: string;
@Input() CalendarId: string;
@Output() viewEventDetailDismiss = new EventEmitter<any>(); @Output() viewEventDetailDismiss = new EventEmitter<any>();
sesseionStora = SessionStore sesseionStora = SessionStore
@@ -121,12 +122,12 @@ export class ViewEventPage implements OnInit {
}); });
} else { } else {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => { if(this.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.today = new Date(res.StartDate); this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
@@ -162,10 +163,10 @@ export class ViewEventPage implements OnInit {
}); });
} else { } else {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
if(event?.CalendarId) {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, event?.CalendarId).subscribe(async () => { if(this.CalendarId) {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.CalendarId).subscribe(async () => {
this.toastService.successMessage('Evento apagado'); this.toastService.successMessage('Evento apagado');
this.close(); this.close();
},()=>{}, },()=>{},
@@ -189,7 +190,7 @@ export class ViewEventPage implements OnInit {
loader.remove(); loader.remove();
}); });
} else { } else {
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => { this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.CalendarId).subscribe(async () => {
this.toastService.successMessage('Evento apagado'); this.toastService.successMessage('Evento apagado');
this.close(); this.close();
},()=>{}, },()=>{},
@@ -359,7 +359,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} }
async getChatMembers() { async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res => { this.chatService.getAllUsers().subscribe(res => {
// //
+1 -12
View File
@@ -606,17 +606,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
} }
/* const popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true,
});
return await popover.present(); */
const modal = await this.modalController.create({ const modal = await this.modalController.create({
enterAnimation, enterAnimation,
leaveAnimation, leaveAnimation,
@@ -631,7 +620,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
async takePictureMobile() { async takePictureMobile() {
console.log('take picture')
const roomId = this.roomId const roomId = this.roomId
const file = await Camera.getPhoto({ const file = await Camera.getPhoto({
+50 -56
View File
@@ -1,15 +1,13 @@
import { analyzeAndValidateNgModules } from '@angular/compiler';
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular'; import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'; import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { DataService } from 'src/app/services/data.service'; import { DataService } from 'src/app/services/data.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page'; import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
import { ToastService } from 'src/app/services/toast.service';
@Component({ @Component({
selector: 'app-new-group', selector: 'app-new-group',
@@ -25,7 +23,6 @@ export class NewGroupPage implements OnInit{
_day:any; _day:any;
selectedDuration = ['','','']; selectedDuration = ['','',''];
countDownTime:any; countDownTime:any;
//groupName:string;
task:any; task:any;
documents: any; documents: any;
loggedUserChat: any; loggedUserChat: any;
@@ -41,11 +38,11 @@ export class NewGroupPage implements OnInit{
private router: Router, private router: Router,
public wsChatMethodsService: WsChatMethodsService, public wsChatMethodsService: WsChatMethodsService,
private authService: AuthService, private authService: AuthService,
private toastService: ToastService,
) )
{ {
this.loggedUserChat = authService.ValidatedUserChat['data']; this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = false; this.isGroupCreated = false;
//this.groupName = this.navParams.get('name');
} }
ngOnInit() { ngOnInit() {
@@ -85,7 +82,7 @@ export class NewGroupPage implements OnInit{
this.addGroupMessage.emit(); this.addGroupMessage.emit();
} }
async createGroup(){ async createGroup() {
let name = this.groupName.split(' ').join('-'); let name = this.groupName.split(' ').join('-');
//Take out all special characters in string //Take out all special characters in string
@@ -94,44 +91,61 @@ export class NewGroupPage implements OnInit{
let customFields = {} let customFields = {}
let res:any; let res:any;
if(this.thedate){ if(this.thedate) {
let customFields = { let customFields = {
"countDownDate":this.thedate "countDownDate":this.thedate
} }
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
} }
else{ else {
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
// FsId
// DocId
if(res?.result?.rid) {
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)
} else {
this.toastService._badRequest('Existe um grupo com este nome!');
} }
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
console.log(res.result.rid)
console.log(this.documents)
this.addGroupMessage.emit(res.result.rid);
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: res,
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",
}],
})
});
this.wsChatMethodsService.getAllRooms()
} }
async addContacts(){ async addContacts(){
@@ -177,28 +191,8 @@ export class NewGroupPage implements OnInit{
cssClass: 'btn-cancel', cssClass: 'btn-cancel',
handler:(value:any)=>{ handler:(value:any)=>{
let now = new Date(); let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds()); this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
/* let timer = setInterval(() =>{
let difference = this.thedate.getTime() - new Date().getTime();
this._day = Math.floor(difference/(1000*60*60*24));
let c_day = Math.floor(difference/(1000*60*60*24));
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
this.countDownTime = c_day + ":" + c_hours + ":" + c_minutes + ":" + c_seconds ;
if(difference < 0){
clearInterval(timer);
this.countDownTime = "Expired";
}
}) */
this.selectedDuration = [ this.selectedDuration = [
value.days.value, value.days.value,
@@ -297,7 +291,7 @@ export class NewGroupPage implements OnInit{
] ]
}); });
await picker.present(); await picker.present();
picker.onDidDismiss().then(async data =>{ picker.onDidDismiss().then(async data => {
let day = await picker.getColumn('days'); let day = await picker.getColumn('days');
let hour = await picker.getColumn('hours'); let hour = await picker.getColumn('hours');
let minutes = await picker.getColumn('minutes'); let minutes = await picker.getColumn('minutes');
@@ -32,7 +32,7 @@ export class DespachosPage implements OnInit {
} }
} }
}); });
} }
goToDespacho({ SerialNumber } : customTask) { goToDespacho({ SerialNumber } : customTask) {
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
@@ -43,13 +43,9 @@ export class DespachosPage implements OnInit {
this.skeletonLoader = true; this.skeletonLoader = true;
await this.despachoRule.getList({updateStore: true}) await this.despachoRule.getList({updateStore: true})
//this.skeletonLoader = false; this.skeletonLoader = false;
} }
/* get skeletonLoader(): boolean {
return this.despachoRule.LoaderService.loading
} */
doRefresh() { doRefresh() {
setTimeout(() => { setTimeout(() => {
this.LoadList(); this.LoadList();
@@ -2,7 +2,6 @@ import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationStart, Router } from '@angular/router'; import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
import { DailyWorkTask } from '../../../models/dailyworktask.model'; import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -78,6 +78,8 @@ export class ChatPopoverPage implements OnInit {
let body = { "roomId":this.roomId, } let body = { "roomId":this.roomId, }
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId); let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
this.wsChatMethodsService.deleteRoom(this.roomId)
@@ -3,16 +3,6 @@
<div class="div-title"> <div class="div-title">
<ion-label class="title">Editar acção presidencial</ion-label> <ion-label class="title">Editar acção presidencial</ion-label>
</div> </div>
<!-- <div class="actionType">
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="Viagem">
<ion-label>Viagem</ion-label>
</ion-segment-button>
<ion-segment-button value="Evento">
<ion-label>Evento</ion-label>
</ion-segment-button>
</ion-segment>
</div> -->
</div> </div>
</ion-header> </ion-header>
@@ -103,12 +103,12 @@ export class EditActionPage implements OnInit {
await this.publicationsService.UpdatePresidentialAction(body).toPromise() await this.publicationsService.UpdatePresidentialAction(body).toPromise()
this.close(); this.close();
this.updateDesktopComponent.emit(); this.updateDesktopComponent.emit();
this.toastService.successMessage('Acção presidencial atualizada') this.toastService._successMessage('Acção presidencial atualizada')
this.getActions.emit() this.getActions.emit()
} catch (error) { } catch (error) {
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial') this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
} finally { } finally {
loader.remove() loader.remove()
} }