mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -162,7 +162,7 @@ export class ViewEventPage implements OnInit {
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
this.goBack();
|
||||
this.toastService.successMessage('Evento apagado');
|
||||
this.toastService._successMessage('Evento apagado');
|
||||
}, () => { },
|
||||
() => {
|
||||
loader.remove();
|
||||
|
||||
@@ -458,6 +458,7 @@
|
||||
<app-view-event *ngIf="mobileComponent.showEventDetails"
|
||||
[profile]="profile"
|
||||
[eventId]="selectedEventId"
|
||||
[CalendarId]="selectedEventCalendarId"
|
||||
(viewEventDetailDismiss)="viewEventDetailDismiss($event)"
|
||||
[eventAttendees]="contacts"
|
||||
></app-view-event>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { CalendarComponent } from 'ionic2-calendar';
|
||||
import { AlertController, ModalController, Platform } from '@ionic/angular';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
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 { DomSanitizer } from "@angular/platform-browser";
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
@@ -106,6 +106,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
selectedEvent: Event;
|
||||
selectedEventId: string | number;
|
||||
selectedEventCalendarId : string | number;
|
||||
postEvent: any;
|
||||
|
||||
// temporary data
|
||||
@@ -311,6 +312,7 @@ export class AgendaPage implements OnInit {
|
||||
this.viewingEventObject = event;
|
||||
|
||||
this.selectedEventId = event.id;
|
||||
this.selectedEventCalendarId = event?.['event']?.CalendarId;
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
@@ -1251,24 +1253,12 @@ export class AgendaPage implements OnInit {
|
||||
// open component
|
||||
async viewEventDetail(eventId: any) {
|
||||
|
||||
this.router.navigate(['/home/agenda', eventId, 'agenda']);
|
||||
/*
|
||||
const CalendarId = this.selectedEventCalendarId
|
||||
|
||||
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);
|
||||
}
|
||||
}); */
|
||||
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
|
||||
|
||||
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
|
||||
|
||||
}
|
||||
|
||||
// open component
|
||||
|
||||
@@ -40,6 +40,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
profile: string;
|
||||
eventId: string;
|
||||
CalendarId: string;
|
||||
caller: string;
|
||||
customDate: any;
|
||||
today: any;
|
||||
@@ -53,6 +54,7 @@ export class ViewEventPage implements OnInit {
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
LoadedDocument: any = null;
|
||||
sesseionStora = SessionStore
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
/* private navParams: NavParams, */
|
||||
@@ -71,12 +73,20 @@ export class ViewEventPage implements OnInit {
|
||||
private ionicStorage: Storage,
|
||||
private CalendarService: CalendarService
|
||||
) {
|
||||
|
||||
this.isEventEdited = false;
|
||||
this.loadedEvent = new Event();
|
||||
this.eventBody = { BodyType: "1", Text: "" };
|
||||
this.loadedEvent.Body = this.eventBody;
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
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) {
|
||||
this.caller = (params["params"].caller);
|
||||
}
|
||||
@@ -176,13 +186,10 @@ export class ViewEventPage implements OnInit {
|
||||
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 {
|
||||
@@ -195,22 +202,15 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
} 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.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 {
|
||||
@@ -225,8 +225,6 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
deleteEvent() {
|
||||
|
||||
@@ -45,11 +45,6 @@
|
||||
|
||||
|
||||
<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 class="welcome-text">
|
||||
@@ -78,29 +73,6 @@
|
||||
</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 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">
|
||||
|
||||
@@ -159,14 +159,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
|
||||
|
||||
})
|
||||
//this.loadFiles();
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
this.getChatMembers();
|
||||
/* Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
}); */
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@@ -185,9 +179,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
onEnd: ev => {
|
||||
Haptics.impact({ style: ImpactStyle.Light })
|
||||
this.stopRecording();
|
||||
/* setTimeout(() => {
|
||||
this.loadFiles();
|
||||
}, 500); */
|
||||
}
|
||||
}, true);
|
||||
longpress.enable();
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.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 { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
|
||||
@@ -35,8 +35,7 @@ export class NewGroupPage implements OnInit {
|
||||
private processesService: ProcessesService,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
private authService: AuthService,
|
||||
)
|
||||
{
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = false;
|
||||
this.groupName = this.navParams.get('name');
|
||||
@@ -71,9 +70,9 @@ export class NewGroupPage implements OnInit {
|
||||
let customFields = {}
|
||||
let res:any;
|
||||
|
||||
if(this.thedate){
|
||||
if(this.thedate) {
|
||||
let customFields = {
|
||||
"countDownDate":this.thedate
|
||||
"countDownDate": this.thedate
|
||||
}
|
||||
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
|
||||
@@ -85,13 +84,14 @@ export class NewGroupPage implements OnInit {
|
||||
|
||||
this.isGroupCreated = true;
|
||||
this.addContacts(res.result);
|
||||
|
||||
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||
console.log(res.result.rid)
|
||||
|
||||
setTimeout(() => {
|
||||
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||
}, 10)
|
||||
|
||||
}
|
||||
|
||||
async addContacts(room){
|
||||
async addContacts(room) {
|
||||
this.close();
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
|
||||
{
|
||||
text: 'Ok',
|
||||
cssClass: 'btn-cancel',
|
||||
handler:(value:any)=>{
|
||||
handler:(value:any) => {
|
||||
|
||||
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());
|
||||
@@ -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 > 0){
|
||||
if(value.days.value == 1){
|
||||
if(value.hours.value == 1){
|
||||
if(value.days.value > 0) {
|
||||
if(value.days.value == 1) {
|
||||
if(value.hours.value == 1) {
|
||||
this.displayDuration = value.days.value + " day " +
|
||||
value.hours.value + " hora " +
|
||||
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.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.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
|
||||
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class ExpedientePage implements OnInit {
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
onlinecheck: boolean;
|
||||
|
||||
listToPresent;
|
||||
listToPresent= []
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private router: Router,
|
||||
|
||||
@@ -216,20 +216,6 @@
|
||||
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
|
||||
</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 class="center-div">
|
||||
<div class="exp-card-icon">
|
||||
|
||||
@@ -3,16 +3,6 @@
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Editar acção presidencial</ion-label>
|
||||
</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>
|
||||
</ion-header>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<div class="div-title flex-grow-1">
|
||||
<ion-label class="title ">Acções Presidenciais</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="div-icon">
|
||||
<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>
|
||||
@@ -34,6 +35,9 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<!-- Content -->
|
||||
|
||||
@@ -230,7 +230,7 @@ export class PublicationsPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
});
|
||||
});
|
||||
this.storage.get('actionsViagens').then((viagens) => {
|
||||
this.storage.get('actionsViagens').then((viagens = []) => {
|
||||
|
||||
viagens.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
|
||||
@@ -218,12 +218,6 @@ export class AuthService {
|
||||
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
|
||||
message.file.guid = guid.path
|
||||
|
||||
|
||||
// await this.storage.set(guid.path, message.file.image_url).then(() => {
|
||||
//
|
||||
// // message.getFileFromDb()
|
||||
// });
|
||||
|
||||
message.downloadFileMsg()
|
||||
|
||||
return true
|
||||
@@ -235,14 +229,17 @@ export class AuthService {
|
||||
} else {
|
||||
try {
|
||||
const res = message.temporaryData
|
||||
|
||||
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");
|
||||
message.attachments[0].title_link = url_no_options
|
||||
message.attachments[0].message_link = url_no_options
|
||||
|
||||
return true
|
||||
|
||||
} catch(e) {
|
||||
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { ChatStorageService } from './chat-storage.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 { HttpClient, HttpEventType } from '@angular/common/http';
|
||||
import { HttpEventType } from '@angular/common/http';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
|
||||
|
||||
@@ -133,7 +133,11 @@ export class MessageService {
|
||||
|
||||
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)
|
||||
|
||||
@@ -153,13 +157,10 @@ export class MessageService {
|
||||
this.errorUploadingAttachment = false
|
||||
this.temporaryData = {}
|
||||
|
||||
|
||||
const params = {roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file, localReference: this.localReference}
|
||||
await this.sendRequest(params)
|
||||
|
||||
|
||||
} else if(this.WsChatService.isLogin == false) {
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
@@ -189,10 +190,6 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||
|
||||
this.WsChatService.send(params).then(
|
||||
@@ -243,13 +240,7 @@ export class MessageService {
|
||||
|
||||
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] = {
|
||||
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) {
|
||||
return this.dm[roomId]?.id || this.group[roomId]?.id
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
@Input() profile:string;
|
||||
@Input() eventId: string;
|
||||
@Input() CalendarId: string;
|
||||
|
||||
@Output() viewEventDetailDismiss = new EventEmitter<any>();
|
||||
sesseionStora = SessionStore
|
||||
@@ -121,12 +122,12 @@ export class ViewEventPage implements OnInit {
|
||||
});
|
||||
} else {
|
||||
|
||||
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
|
||||
|
||||
|
||||
|
||||
if(event?.CalendarId) {
|
||||
if(this.CalendarId) {
|
||||
|
||||
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.today = new Date(res.StartDate);
|
||||
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 {
|
||||
|
||||
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.close();
|
||||
},()=>{},
|
||||
@@ -189,7 +190,7 @@ export class ViewEventPage implements OnInit {
|
||||
loader.remove();
|
||||
});
|
||||
} 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.close();
|
||||
},()=>{},
|
||||
|
||||
@@ -359,7 +359,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
async getChatMembers() {
|
||||
//return await this.chatService.getMembers(roomId).toPromise();
|
||||
|
||||
this.chatService.getAllUsers().subscribe(res => {
|
||||
//
|
||||
|
||||
|
||||
@@ -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({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
@@ -631,7 +620,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
|
||||
async takePictureMobile() {
|
||||
console.log('take picture')
|
||||
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import { analyzeAndValidateNgModules } from '@angular/compiler';
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
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 { 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 { SessionStore } from 'src/app/store/session.service';
|
||||
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-group',
|
||||
@@ -25,7 +23,6 @@ export class NewGroupPage implements OnInit{
|
||||
_day:any;
|
||||
selectedDuration = ['','',''];
|
||||
countDownTime:any;
|
||||
//groupName:string;
|
||||
task:any;
|
||||
documents: any;
|
||||
loggedUserChat: any;
|
||||
@@ -41,11 +38,11 @@ export class NewGroupPage implements OnInit{
|
||||
private router: Router,
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
)
|
||||
{
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = false;
|
||||
//this.groupName = this.navParams.get('name');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -85,7 +82,7 @@ export class NewGroupPage implements OnInit{
|
||||
this.addGroupMessage.emit();
|
||||
}
|
||||
|
||||
async createGroup(){
|
||||
async createGroup() {
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
//Take out all special characters in string
|
||||
@@ -94,44 +91,61 @@ export class NewGroupPage implements OnInit{
|
||||
let customFields = {}
|
||||
let res:any;
|
||||
|
||||
if(this.thedate){
|
||||
if(this.thedate) {
|
||||
let customFields = {
|
||||
"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);
|
||||
}
|
||||
|
||||
|
||||
// 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(){
|
||||
@@ -177,28 +191,8 @@ export class NewGroupPage implements OnInit{
|
||||
cssClass: 'btn-cancel',
|
||||
handler:(value:any)=>{
|
||||
|
||||
|
||||
|
||||
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());
|
||||
/* 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 = [
|
||||
value.days.value,
|
||||
@@ -297,7 +291,7 @@ export class NewGroupPage implements OnInit{
|
||||
]
|
||||
});
|
||||
await picker.present();
|
||||
picker.onDidDismiss().then(async data =>{
|
||||
picker.onDidDismiss().then(async data => {
|
||||
let day = await picker.getColumn('days');
|
||||
let hour = await picker.getColumn('hours');
|
||||
let minutes = await picker.getColumn('minutes');
|
||||
|
||||
@@ -32,7 +32,7 @@ export class DespachosPage implements OnInit {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
goToDespacho({ SerialNumber } : customTask) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
||||
@@ -43,13 +43,9 @@ export class DespachosPage implements OnInit {
|
||||
this.skeletonLoader = true;
|
||||
|
||||
await this.despachoRule.getList({updateStore: true})
|
||||
//this.skeletonLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
/* get skeletonLoader(): boolean {
|
||||
return this.despachoRule.LoaderService.loading
|
||||
} */
|
||||
|
||||
doRefresh() {
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
@@ -78,6 +78,8 @@ export class ChatPopoverPage implements OnInit {
|
||||
let body = { "roomId":this.roomId, }
|
||||
|
||||
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
|
||||
this.wsChatMethodsService.deleteRoom(this.roomId)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,16 +3,6 @@
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Editar acção presidencial</ion-label>
|
||||
</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>
|
||||
</ion-header>
|
||||
|
||||
@@ -103,12 +103,12 @@ export class EditActionPage implements OnInit {
|
||||
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
|
||||
this.close();
|
||||
this.updateDesktopComponent.emit();
|
||||
this.toastService.successMessage('Acção presidencial atualizada')
|
||||
this.toastService._successMessage('Acção presidencial atualizada')
|
||||
this.getActions.emit()
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
} finally {
|
||||
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user