mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
improve
This commit is contained in:
@@ -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