diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index b493d2813..74a8e799d 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -12,13 +12,14 @@ export class AuthGuard implements CanActivate { private router:Router, private localstoreService: LocalstoreService ){} - + canActivate( route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { - + if(!SessionStore.user.Inactivity) { this.router.navigate(['/']); + return false } else if(!SessionStore.exist) { this.router.navigate(['/']); @@ -27,5 +28,5 @@ export class AuthGuard implements CanActivate { return true } } - + } diff --git a/src/app/modals/view-document/view-document.page.ts b/src/app/modals/view-document/view-document.page.ts index cb5b52480..ff385dd90 100644 --- a/src/app/modals/view-document/view-document.page.ts +++ b/src/app/modals/view-document/view-document.page.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { ModalController, NavParams } from '@ionic/angular'; import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; -import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/search-document'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ProcessesService } from 'src/app/services/processes.service'; import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page'; diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index da4a939b0..5622ff7cf 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -8,7 +8,7 @@ - +
@@ -28,8 +28,8 @@ -
-
--> -
+
@@ -111,21 +111,21 @@ - - - - -
-
+
diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index 2c727befa..f15c6871c 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -180,7 +180,10 @@ export class NewEventPage implements OnInit { runValidation() { - this.validateFrom = true + this.validateFrom = true; + if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){ + this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento") + } } @@ -316,14 +319,14 @@ export class NewEventPage implements OnInit { const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendeesCC: EventPerson[] = data['taskParticipantsCc']; - + if(newAttendees.length) { this.setIntervenient(newAttendees); } if(newAttendeesCC) { this.setIntervenientCC(newAttendeesCC); } - + } } diff --git a/src/app/pages/agenda/view-event/view-event.page.html b/src/app/pages/agenda/view-event/view-event.page.html index 697350915..afced0e62 100644 --- a/src/app/pages/agenda/view-event/view-event.page.html +++ b/src/app/pages/agenda/view-event/view-event.page.html @@ -2,7 +2,7 @@ - + @@ -59,7 +59,13 @@

{{customDate}}

das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}

(Não se repete)

-

Repete

+

+ Diário + Semanal + Mensal + Anual + Nunca +

diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index d9da4bea1..31a2b15a3 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -2,7 +2,7 @@ - + @@ -123,7 +123,7 @@
- + diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index b17c1cbf8..5bd4148f8 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -7,7 +7,7 @@ import { ComponentFactoryResolver, ComponentRef, ComponentFactory, - Output + Output, } from '@angular/core'; import { ModalController, Platform } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; @@ -17,7 +17,6 @@ import { ContactsPage } from './messages/contacts/contacts.page'; import { MessagesPage } from './messages/messages.page'; import { NewGroupPage } from './new-group/new-group.page'; import { Storage } from '@ionic/storage'; -import { AlertService } from 'src/app/services/alert.service'; import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page'; import * as Rx from "rxjs/Rx"; import { Message } from 'src/app/models/message.model'; @@ -138,6 +137,7 @@ export class ChatPage implements OnInit { } ngOnInit() { + console.log(this.loggedUserChat); this.segment = "Contactos"; @@ -168,19 +168,23 @@ export class ChatPage implements OnInit { this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { - if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) { - //alert('OIII') - } else { - if (this.dataService.get("newGroup")) { - this.openNewGroupPage(); - } + if (this.dataService.get("newGroup")) { + this.openNewGroupPage(); } + else{ + this.closeAllDesktopComponents(); + this.showEmptyComponent = true; + } + } + else{ + this.dataService.set("newGroup", false); } }); } ngOnDestroy() { this.setStatus('offline'); + this.dataService.set("newGroup", false); console.log('On Destroy') } diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index f521c4176..cd041f368 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -57,7 +57,7 @@ A conversa original mantêm-se como chat individual
-
+
{{msg.u.name}} {{showDateDuration(msg._updatedAt)}} @@ -66,7 +66,9 @@ {{msg.msg}}
- image +
+ image +
diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index e571c6e4e..6a0063bdd 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -21,6 +21,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ThemeService } from 'src/app/services/theme.service' import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page'; +import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; @Component({ selector: 'app-group-messages', @@ -29,7 +30,7 @@ import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera. }) export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { - + showLoader: boolean; isGroupCreated:boolean; @@ -593,7 +594,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { }; zoomActive = false; zoomScale = 1; - + sliderZoomOpts = { allowSlidePrev: false, allowSlideNext: false, @@ -601,40 +602,40 @@ sliderZoomOpts = { maxRatio: 5 }, on: { - zoomChange: (scale, imageEl, slideEl) => { + zoomChange: (scale, imageEl, slideEl) => { this.zoomActive = true; this.zoomScale = scale/5; - this.changeDetectorRef.detectChanges(); + this.changeDetectorRef.detectChanges(); } } } - + async touchEnd(zoomslides: IonSlides, card) { // Zoom back to normal const slider = await zoomslides.getSwiper(); const zoom = slider.zoom; zoom.out(); - + // Card back to normal card.el.style['z-index'] = 9; - + this.zoomActive = false; this.changeDetectorRef.detectChanges(); } - + touchStart(card) { // Make card appear above backdrop card.el.style['z-index'] = 11; } - async openPreview(img) { + async openPreview(msg) { const modal = await this.modalController.create({ - component: PreviewCameraPage, - cssClass: 'transparent-modal', + component: ViewMediaPage, + cssClass: 'modal modal-desktop', componentProps: { - image: img.attachments[0].image_url, - username: img.u.name, - _updatedAt: img._updatedAt + image: msg.attachments[0].image_url, + username: msg.u.name, + _updatedAt: msg._updatedAt, } }); modal.present(); diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 5dba40e2f..20ba00ac8 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -112,7 +112,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.load(); this.setStatus('online'); - this.loadFiles(); + //this.loadFiles(); VoiceRecorder.requestAudioRecordingPermission(); Filesystem.mkdir({ path: IMAGE_DIR, diff --git a/src/app/pages/chat/new-group/new-group.page.ts b/src/app/pages/chat/new-group/new-group.page.ts index 9b5d33136..d1006c0e2 100644 --- a/src/app/pages/chat/new-group/new-group.page.ts +++ b/src/app/pages/chat/new-group/new-group.page.ts @@ -5,6 +5,7 @@ import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-d import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; import { ThemeService } from 'src/app/services/theme.service' import { ChatService } from 'src/app/services/chat.service'; +import { ProcessesService } from 'src/app/services/processes.service'; @Component({ selector: 'app-new-group', @@ -19,6 +20,7 @@ export class NewGroupPage implements OnInit { selectedDuration = ['','','']; thedate:any; groupName:string; + documents:any; constructor( private pickerController: PickerController, @@ -27,15 +29,18 @@ export class NewGroupPage implements OnInit { private navParams: NavParams, public ThemeService: ThemeService, private chatService: ChatService, + private processesService: ProcessesService, ) { this.isGroupCreated = false; this.groupName = this.navParams.get('name'); + this.documents = this.navParams.get('documents'); } ngOnInit() { - + console.log(this.documents); } + _ionChange(event){ this.showDuration = event.detail.checked; @@ -52,6 +57,7 @@ export class NewGroupPage implements OnInit { createGroup(){ let name = this.groupName.split(' ').join('-'); + //Take out all special characters in string name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); let body = { "name":name, } this.chatService.addGroup(body).subscribe(res=>{ @@ -73,6 +79,39 @@ export class NewGroupPage implements OnInit { this.isGroupCreated = true; this.addContacts(res['group']); + if(this.documents.length > 0){ + //If there is documents add + this.documents.forEach(async document => { + + let url = await this.processesService.GetDocumentUrl(document.DocId, document.ApplicationId).toPromise(); + let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); + + let body = { + "message": + { + "rid": res['group']._id, + "msg": "", + "attachments": [{ + "title": document.Assunto, + "description": document.DocTypeDesc, + "title_link": url_no_options, + "title_link_download": true, + //"thumb_url": "assets/images/webtrix-logo.png", + "message_link": url_no_options, + "type": "webtrix" + }], + "file":{ + "name": document.Assunto, + "type": "application/webtrix", + "ApplicationId": document.ApplicationType, + "DocId": document.Id, + "Assunto": document.Assunto, + } + } + } + this.chatService.sendMessage(body).toPromise(); + }); + } }); } diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html index d0b92ddcb..b0af3b7a3 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html @@ -1,7 +1,7 @@ - +
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index e4b35646b..f2eb86e87 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -2,7 +2,7 @@ - +
diff --git a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html index fc8bee16e..022fd0c0b 100644 --- a/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html +++ b/src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html @@ -2,7 +2,7 @@ - +
diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html index f70e98814..4f6a6ca7c 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html @@ -2,7 +2,7 @@ - +
diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html index 05ea1fc20..f53904935 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html @@ -52,8 +52,15 @@

1 {{customDate}}

2 das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

-

3 (Não se repete)

-

4 Repete

+

(Não se repete)

+ +

+ Diário + Semanal + Mensal + Anual + Nunca +

diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html index 28bbc19a8..b1a4da7f5 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html @@ -2,7 +2,7 @@ - +
@@ -51,8 +51,8 @@

{{customDate}}

das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}}

-

(Não se repete)

-

Repete

+

(Não se repete)

+

Repete

diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index a980387ca..9d96e8231 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -6,7 +6,7 @@
- +
@@ -111,17 +111,17 @@
- +
diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index e5ea396b7..7152230da 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -432,9 +432,10 @@ export class ExpedienteDetailPage implements OnInit { component: SearchPage, cssClass: 'modal-width-100-width-background modal', componentProps: { - type: 'AccoesPresidenciais & ArquivoDespachoElect', + type: 'Correspondencia', showSearchInput: true, - select: true + select: true, + findOnly: [8] } }); await modal.present(); @@ -442,7 +443,7 @@ export class ExpedienteDetailPage implements OnInit { if (res) { const data = res.data; this.documents.push(data.selected); - this.documents.forEach((element: any) => { + await this.documents.forEach( async (element: any) => { let body = { "InstanceID": this.task.InstanceID, @@ -458,18 +459,20 @@ export class ExpedienteDetailPage implements OnInit { const loader = this.toastService.loading() - this.attachmentsService.AddAttachment(body).subscribe((res) => { - this.toastService._successMessage() - }, () => { - this.toastService._badRequest() - }, () => { + try { loader.remove() - }); - + await this.attachmentsService.AddAttachment(body).toPromise() + this.toastService._successMessage() + } catch(e) { + this.toastService._badRequest() + } }); } - }); + setTimeout(() => { + this.LoadTaskDetail(this.serialNumber); + }, 5000); + }); } async openExpedientActionsModal(taskAction: any, task: any) { @@ -592,7 +595,7 @@ export class ExpedienteDetailPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(res => { - this.goBack(); + }); } @@ -634,16 +637,16 @@ export class ExpedienteDetailPage implements OnInit { } openNewGroupPage() { - this.router.navigate(['/home/chat']); - this.dataService.set("newGroup", true); - - if (window.innerWidth < 801) { + if (window.innerWidth < 701) { + this.router.navigate(['/home/chat']); this.newGroup(); } else { this.dataService.set("newGroup", true); this.dataService.set("task", this.task); this.dataService.set("newGroupName", this.task.Folio); + this.dataService.set("documents", this.fulltask.Documents); + this.router.navigate(['/home/chat']); } } diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html index 7e7fcfe71..a829e8d9c 100644 --- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html +++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html @@ -6,7 +6,7 @@
- +
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index bcdf3a838..3d76ebbd8 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -2,7 +2,7 @@ - + diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 2d701a46d..c3c98059d 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -30,6 +30,7 @@ import { SqliteService } from '../../services/sqlite.service'; import { Platform } from '@ionic/angular'; import { BackgroundService } from 'src/app/services/background.service'; import { SortService } from 'src/app/services/functions/sort.service'; +import { DataService } from 'src/app/services/data.service'; @Component({ selector: 'app-gabinete-digital', @@ -133,6 +134,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { private backgroundservice: BackgroundService, public ThemeService: ThemeService, private sortService: SortService, + private dataService: DataService, ) { this.loggeduser = authService.ValidatedUser; @@ -616,7 +618,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { doRefresh(event) { console.log(event); - + this.LoadCounts(); if (event) { diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html index 65578e163..9801094f5 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html @@ -2,7 +2,7 @@ - +
@@ -130,8 +130,8 @@
-
- +
+
diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index 5a7c2a1eb..a06ecb331 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -480,17 +480,17 @@ export class PedidoPage implements OnInit { modal.onDidDismiss(); } - openNewGroupPage(task?:any){ - this.router.navigate(['/home/chat']); - this.dataService.set("newGroup", true); - - if( window.innerWidth < 801){ + openNewGroupPage() { + if (window.innerWidth < 801) { + this.router.navigate(['/home/chat']); this.newGroup(); } - else{ + else { this.dataService.set("newGroup", true); this.dataService.set("task", this.task); this.dataService.set("newGroupName", this.task.Folio); + this.dataService.set("documents", this.fulltask.Documents); + this.router.navigate(['/home/chat']); } } diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts index 0f115b020..c48b45aff 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts @@ -126,6 +126,7 @@ export class PedidosPage implements OnInit { async LoadList() { + //Retirar esta chamada posteriormente - Eudes this.processes.GetTasksList("Pedido de Parecer", false).subscribe(async res => { this.skeletonLoader = true @@ -136,6 +137,8 @@ export class PedidosPage implements OnInit { let parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise(); let parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise(); + console.log(parecerPr); + this.skeletonLoader = false let allParecer = parecer.concat(parecerPr).reverse().filter(data => data.workflowInstanceDataFields.Status == "Active") @@ -145,8 +148,9 @@ export class PedidosPage implements OnInit { allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active").forEach(element => { let date = new Date(element.taskStartDate); - date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + const dateMonth = date.getMonth() + 1; + let month = date.getMonth() + 1; + let taskDate = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let task = { "SerialNumber": element.serialNumber, @@ -165,7 +169,7 @@ export class PedidosPage implements OnInit { this.addPedidoToDb(this.parecerList); this.listToPresentparecerList = this.sortService.sortDate(this.parecerList, 'CreateDate') - this.pedidosstorage.resetparecer(this.listToPresentparecerList); + this.pedidosstorage.resetparecer(this.listToPresentparecerList); } else if (this.segment == 'deferimento') { @@ -183,8 +187,9 @@ export class PedidosPage implements OnInit { res.forEach(element => { let date = new Date(element.taskStartDate); - date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + //date.setMonth(date.getMonth() + 1); + let month = date.getMonth() + 1; + let taskDate = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let task = { "SerialNumber": element.serialNumber, @@ -233,8 +238,9 @@ export class PedidosPage implements OnInit { process.forEach((element) => { if (JSON.parse(element.workflowInstanceDataFields).Status == "Active") { let date = new Date(element.taskStartDate); - date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + //date.setMonth(date.getMonth() + 1); + let month = date.getMonth() + 1; + let taskDate = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let task = { "SerialNumber": element.serialNumber, @@ -259,8 +265,9 @@ export class PedidosPage implements OnInit { process.forEach((element) => { if (JSON.parse(element.workflowInstanceDataFields).Status == "Active") { let date = new Date(element.taskStartDate); - date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + //date.setMonth(date.getMonth() + 1); + let month = date.getMonth() + 1; + let taskDate = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); let task = { "SerialNumber": element.serialNumber, diff --git a/src/app/pages/publications/edit-action/edit-action.page.scss b/src/app/pages/publications/edit-action/edit-action.page.scss index f14a5d70e..23f80b585 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.scss +++ b/src/app/pages/publications/edit-action/edit-action.page.scss @@ -48,8 +48,6 @@ .content-container{ width: 100%; margin:0 auto; - border-top-left-radius: 25px; - border-top-right-radius: 25px; background: #ffffff; height: 100%; padding: 25px 20px 0 20px; diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 196a9ada0..b81efd8d9 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -66,7 +66,7 @@ export class NewActionPage implements OnInit { private publication: PublicationsService, private toastService: ToastService - ) { + ) { this.folder = new PublicationFolder(); @@ -76,7 +76,7 @@ export class NewActionPage implements OnInit { this.folder.DateBegin = new Date().toISOString() this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString() - + } ngOnInit() { @@ -102,7 +102,13 @@ export class NewActionPage implements OnInit { } runValidation() { - this.validateFrom = true + this.validateFrom = true; + if(new Date(this.folder.DateBegin).toISOString() > new Date(this.folder.DateEnd).toISOString()){ + this.toastService.badRequest("A data de início não pode ser superior a data de fim"); + } + else if(this.folder.DateBegin > new Date().toISOString()){ + this.toastService.badRequest("A data de início não pode ser superior a data actual"); + } } injectValidation() { @@ -134,8 +140,8 @@ export class NewActionPage implements OnInit { DateEnd: this.folder.DateEnd, ActionType: this.segment, } - - + + const loader = this.toastService.loading() try { @@ -144,7 +150,7 @@ export class NewActionPage implements OnInit { this.toastService.successMessage("Ação presidencial criado"); this.close(); } catch (error) { - + this.toastService.badRequest("Ação presidencial não criado"); } finally { loader.remove() @@ -156,5 +162,5 @@ export class NewActionPage implements OnInit { close(){ this.modalController.dismiss(); } - + } diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index 1d61c1731..d4026c395 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -22,13 +22,13 @@
- +
Fotografia Anexada - + @@ -74,8 +74,8 @@
- + +
diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 60a6eaa06..7c4620165 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -107,24 +107,24 @@ export class NewPublicationPage implements OnInit { } async takePicture() { - const image = await Camera.getPhoto({ + const capturedImage = await Camera.getPhoto({ quality: 90, - allowEditing: false, - width:50, - height: 50, + // allowEditing: true, resultType: CameraResultType.Uri, - source: CameraSource.Camera // Camera, Photos or Prompt! - + source: CameraSource.Camera }); + const response = await fetch(capturedImage.webPath!); + const blob = await response.blob(); - if (image) { - this.saveImage(image) + this.photos.unshift({ + filepath: "soon...", + webviewPath: capturedImage.webPath + }); + this.capturedImage = await this.convertBlobToBase64(blob); + this.capturedImageTitle = new Date().getTime() + '.jpeg'; + //console.log(this.capturedImage); } - - - } - imageSize(image) { var canvas = document.createElement('canvas'); @@ -139,7 +139,7 @@ export class NewPublicationPage implements OnInit { const reader = new FileReader; reader.onerror = reject; reader.onload = () => { - resolve(reader.result); + resolve(reader.result); }; reader.readAsDataURL(blob); }); @@ -148,7 +148,7 @@ export class NewPublicationPage implements OnInit { async laodPicture() { const capturedImage = await Camera.getPhoto({ resultType: CameraResultType.Uri, - source: CameraSource.Camera, + source: CameraSource.Photos, quality: 90, width: 1080, height: 720, @@ -506,10 +506,10 @@ export class NewPublicationPage implements OnInit { /* compressImage() { let image = this.capturedImage; this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => { - + this.imgResultBeforeCompress = image; console.log('Size in bytes was:', this.imageCompress.byteCount(image)); - + this.imageCompress.compressFile(image, orientation, 50, 50).then( result => { this.imgResultAfterCompress = result; diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 9951a3376..860ddbca9 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -2,7 +2,7 @@ - +
@@ -38,9 +38,9 @@ -
+
- {{viagem.Description}}

{{viagem.Detail}}

-
- - -
@@ -94,10 +90,6 @@

{{evento.Description}}

-
- - -
@@ -115,6 +107,94 @@
+ +
+ + +
+ +
+
+ +

+

+
+
+ +
+ +
+
+ +

+

+
+
+ +
+ +
+
+ +

+

+
+
+ +
+ +
+
+ +

+

+
+
+
+ + +
+ +
+
+ + +

+
+
+
+ +
+ +
+
+ + +

+
+
+
+ +
+ +
+
+ + +

+
+
+
+
+
+
@@ -135,6 +215,7 @@ [folderId]="folderId" class="height-100 d-flex flex-column overflow-hidden flex-grow-1" (addNewPublication)="addNewPublication($event)" + (editPublication)="editPublication($event)" (openPublicationDetails)="openPublicationDetails($event)" (goBacktoPublicationDetails)="goBacktoPublicationDetails()" (goBackToViewPublications)="goBackToViewPublications()" diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index c98ad9b40..84cd1fecb 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -165,10 +165,13 @@ ion-toolbar{ width: 25px; font-size: 20px; } - .item-content-date-active, .item-content-title-active, .item-content-detail-active, .item-options-active{ + .item-content-date-active, .item-content-title-active, .item-content-detail-active{ color: #fff; } } + .item-options-active{ + display: none !important; + } } .item-active{ @@ -240,5 +243,7 @@ ion-toolbar{ } .item-options{ display: block !important; + padding: 10px; + } } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 3ceb83fc3..4ff0d213c 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -59,6 +59,7 @@ export class PublicationsPage implements OnInit { hideRefreshBtn = true; showSlidingOptions = true; idSelected: string; + skeletonLoader:boolean; constructor( private router: Router, @@ -70,10 +71,11 @@ export class PublicationsPage implements OnInit { private backgroundservice: BackgroundService, private platform: Platform, public ThemeService: ThemeService, - + ) { this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; + this.skeletonLoader = true; } ngOnInit() { @@ -140,6 +142,7 @@ export class PublicationsPage implements OnInit { getActions() { this.showLoader = true; + this.skeletonLoader = true; this.publications.GetPublicationFolderList().subscribe(res => { console.log('accoes', res) @@ -168,15 +171,13 @@ export class PublicationsPage implements OnInit { this.publicationsTravelFolderList.push(folder); } this.showLoader = false; - - /* this.publicationEventFolderStorage.reset(this.publicationsEventFolderList) - this.publicationTravelFolderService.reset(this.publicationsTravelFolderList) */ }); }, (error) => { this.getFromDB(); }); + this.skeletonLoader = false; } addActionToDB(folder) { @@ -187,7 +188,7 @@ export class PublicationsPage implements OnInit { } getFromDB() { - + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { this.sqliteservice.getAllActions().then((actions: any[]) => { @@ -237,9 +238,7 @@ export class PublicationsPage implements OnInit { } async deleteAction(id?: string) { - const loader = this.toastService.loading(); - try { await this.publications.DeletePresidentialAction(id).toPromise(); this.toastService._successMessage() @@ -249,7 +248,6 @@ export class PublicationsPage implements OnInit { finally { loader.remove() } - this.refreshing() } @@ -277,13 +275,12 @@ export class PublicationsPage implements OnInit { } goToPublicationsList(folderId: string) { - this.folderId = folderId - this.idSelected = folderId; - if (window.innerWidth <= 800) { this.router.navigate(['/home/publications', folderId]); + this.idSelected = ""; } else { this.closeDesktopComponent(); + this.idSelected = folderId; this.folderId = folderId this.desktopComponent.showViewPublication = true; } @@ -379,10 +376,14 @@ export class PublicationsPage implements OnInit { } this.publication = publication; - this.desktopComponent.showAddNewPublication = true; } + async editPublication(foolderId:string){ + this.closeDesktopComponent(); + this.desktopComponent.showEditActions = true; + } + async openPublicationDetails(publicationId: string) { this.publicationId = publicationId; @@ -405,6 +406,7 @@ export class PublicationsPage implements OnInit { showAddActions: false, showEditActions: false, } + this.idSelected = ""; } async openOptions(id?: string) { @@ -461,5 +463,5 @@ export class PublicationsPage implements OnInit { // newImage => console.log('new image path is: ' + newImage), // error => console.error('Error cropping image', error) // ); - + } diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index cd8f0035e..e30d9294a 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -13,8 +13,8 @@
- - + +
@@ -24,18 +24,18 @@
- +
- +
- +
- + - +
- +
  • @@ -98,7 +98,7 @@
  • - +
    - + {{ category.Name }} {{ category.Qtd }} - +
    - +
    - +
    - +
    @@ -146,8 +146,8 @@
    - -
    + +
    @@ -177,22 +177,22 @@
    • - - - + + src="assets/images/icons-default-agenda.svg">
      - +
      {{ searchDocument.Assunto}} - {{ searchDocument.appName}} + {{ searchDocument.appName}}
      {{ searchDocument.EntidadeOrganicaNome }} @@ -205,10 +205,10 @@
      - +
    - +
    -
    \ No newline at end of file +
    diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 3963f7fad..7d05ab861 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -60,7 +60,7 @@ export class SearchPage implements OnInit { private search: SearchService, private modalCtrl: ModalController, private navParams: NavParams, - public ThemeService: ThemeService) + public ThemeService: ThemeService) { this.ordinance = "recent"; this.currentPath= window.location.pathname; @@ -243,7 +243,8 @@ export class SearchPage implements OnInit { this.loadWordCloud(); }); - } else if ( this.type == "AccoesPresidenciais & ArquivoDespachoElect"){ + } + else if ( this.type == "AccoesPresidenciais & ArquivoDespachoElect"){ this.showLoader = true; @@ -319,7 +320,7 @@ export class SearchPage implements OnInit { }); } else { - let counter = 0; + let counter = 0; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ @@ -385,11 +386,93 @@ export class SearchPage implements OnInit { } this.loadWordCloud(); }); - } + } - } else if (this.type == "AccoesPresidenciais"){ + else if ( this.type == "Correspondencia"){ + + this.showLoader = true; + + this.searchCategories = []; + this.searchDocuments = []; + this.showSearchDocuments = []; + + if(this.select) { + + let counter = 0; + + this.search.searchForDoc(this.searchSubject, this.searchDocumentDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ + + res.Categories.forEach( e => { + e['Active'] = false; + this.searchCategories.push(e) + }); + + // bind respose + + this.sortArrayISODate(res.Documents).forEach(e => { + e['appName'] = 'Correspondencia' + this.searchDocuments.push(e) + }); + + this.reorderList(this.ordinance); + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + counter++; + + if(counter ==2){ + this.showLoader = false; + } + this.showLoader = false; + this.loadWordCloud(); + }); + + } else { + let counter = 0; + + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ + + res.Categories.forEach( e => { + e['Active'] = false; + this.searchCategories.push(e) + }); + + // bind respose + + this.sortArrayISODate(res.Documents).forEach(e => { + e['appName'] = 'Correspondencia' + this.searchDocuments.push(e) + }); + + this.reorderList(this.ordinance); + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + + counter++; + + if(counter ==2){ + this.showLoader = false; + } + + this.loadWordCloud(); + }); + } + } + + else if (this.type == "AccoesPresidenciais"){ this.showLoader = true; diff --git a/src/app/pipes/custom-task.pipe.ts b/src/app/pipes/custom-task.pipe.ts index 3c75b2ef3..6ebb1169d 100644 --- a/src/app/pipes/custom-task.pipe.ts +++ b/src/app/pipes/custom-task.pipe.ts @@ -9,8 +9,8 @@ export class CustomTaskPipe implements PipeTransform { transform(fullTask): customTask { let date = new Date(fullTask.taskStartDate); - date.setMonth(date.getMonth() + 1); - let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); + let month = date.getMonth() + 1; + let taskDate = date.getFullYear() + "-" + month +"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds(); return { "SerialNumber": fullTask.serialNumber, diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index b38ad2792..b011b1cc8 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -53,10 +53,11 @@ export class FileService { private platform: Platform, private loadingCtrl: LoadingController, private http: HttpClient, - ) { } + ) { + this.headers = new HttpHeaders(); + } uploadFile(formData:any){ - alert('OIEE') //const geturl = environment.apiURL + 'Tasks/DelegateTask'; const geturl = environment.apiURL + 'ObjectServer/UploadFiles'; @@ -74,6 +75,9 @@ export class FileService { params = params.set("path", guid); + this.headers = this.headers.set('responseType', 'blob'); + this.headers = this.headers.set('Content-Type', 'application/octet-stream'); + let options = { headers: this.headers, params: params @@ -339,24 +343,6 @@ export class FileService { //loader.remove(); }); */ } - async shareLocalFile(){ - this.http.get('./assets/any.svg', {responseType: 'blob'}).subscribe(res=>{ - const reader = new FileReader() - reader.onloadend=()=>{ - const result = reader.result as string - const base64Data = result.split(',')[1] - - /* FileSharer.share({ - filename:'any.pdf', - base64Data, - contentType: "application/pdf", - }) */ - reader.readAsDataURL(res) - } - - }) - -} addPictureToChat(roomId) { diff --git a/src/app/services/processes.service.ts b/src/app/services/processes.service.ts index 0385d53b5..c68ad489f 100644 --- a/src/app/services/processes.service.ts +++ b/src/app/services/processes.service.ts @@ -44,7 +44,6 @@ export class ProcessesService { } uploadFile(formData:any){ - alert('OIEE') //const geturl = environment.apiURL + 'Tasks/DelegateTask'; const geturl = environment.apiURL + 'lakefs/UploadFiles'; diff --git a/src/app/shared/agenda/approve-event/approve-event.page.html b/src/app/shared/agenda/approve-event/approve-event.page.html index 35da291f1..aaeec3984 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.html +++ b/src/app/shared/agenda/approve-event/approve-event.page.html @@ -69,6 +69,7 @@

    {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}}

    (Não se repete)

    Repete

    +
    diff --git a/src/app/shared/agenda/event-list/event-list.page.ts b/src/app/shared/agenda/event-list/event-list.page.ts index 924755b02..c845496d0 100644 --- a/src/app/shared/agenda/event-list/event-list.page.ts +++ b/src/app/shared/agenda/event-list/event-list.page.ts @@ -88,8 +88,9 @@ export class EventListPage implements OnInit { if(allEvents.length > 0){ this.eventsPRList = this.sortService.sortArrayByDate(allEvents).reverse(); } + this.showLoader = false; } - this.showLoader = false; + } async openApproveModal(eventSerialNumber, data) { diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index 9c068535c..b7ecf060c 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -93,8 +93,9 @@
    +
    -
    +
    @@ -102,7 +103,7 @@ -
    +
    -
    +
    new Date(this.postEvent.EndDate).getTime()){ + this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento") + } } injectValidation() { @@ -227,7 +228,7 @@ export class NewEventPage implements OnInit { const str: any = this.postEvent.EventRecurrence.Type.toString() this.postEvent.EventRecurrence.Type = str } - + this.Form = new FormGroup({ Subject: new FormControl(this.postEvent.Subject, [ Validators.required, @@ -255,8 +256,8 @@ export class NewEventPage implements OnInit { Date: new FormControl( new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok': null,[ Validators.required ]), - }) + } @@ -304,7 +305,6 @@ export class NewEventPage implements OnInit { close(){ this.deleteTemporaryData(); - this.cloneAllmobileComponent.emit(); this.clearContact.emit(); this.setIntervenient.emit([]); @@ -331,7 +331,6 @@ export class NewEventPage implements OnInit { - async save() { this.injectValidation() @@ -349,11 +348,6 @@ export class NewEventPage implements OnInit { this.postEvent.HasAttachments = true; } - if(this.selectedRecurringType != '-1') { - this.postEvent.EventRecurrence.Type = this.selectedRecurringType; - } - - // if(this.postEvent.EventRecurrence.Type == undefined) { this.postEvent.EventRecurrence.Type = '-1' } @@ -428,10 +422,8 @@ export class NewEventPage implements OnInit { (id) => { console.log(id); - const eventId: any = id; - const DocumentToSave: EventAttachment[] = this.documents.map((e) => { return { SourceTitle: e.Assunto, diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index 2a6e6eb74..639b69384 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -54,7 +54,14 @@

    das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}

    {{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}}

    (Não se repete)

    -

    Repete

    +

    + Diário + Semanal + Mensal + Anual + Nunca +

    +
    diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 0ebc7fdbb..b548ea7e6 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -44,7 +44,7 @@ A conversa original mantêm-se como chat individual
    -
    +
    @@ -60,7 +60,9 @@ {{msg.msg}}
    - image +
    + image +
    @@ -144,30 +146,31 @@ - + + +
    -
    + +
    - +
    -
    +
    -
    + +
    - + diff --git a/src/app/shared/chat/messages/messages.page.scss b/src/app/shared/chat/messages/messages.page.scss index ea06e1748..6fdf6f95c 100644 --- a/src/app/shared/chat/messages/messages.page.scss +++ b/src/app/shared/chat/messages/messages.page.scss @@ -179,10 +179,11 @@ ion-footer{ padding-top: 7.5px; padding-bottom: 7.5px; + .container{ justify-content: center; justify-content: space-evenly; - + align-items: center; } .chat-icon-options{ @@ -203,14 +204,15 @@ border: 1px solid #ebebeb; border-radius: 25px; padding-left: 15px; + margin: 0 15px 0 60px; align-items: center; overflow: auto; - ion-textarea{ - margin: 0 !important; - align-self: center; + ion-textarea{ + margin: 0 !important; + align-self: center; + } } - } } diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index faef30243..0f7608676 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -735,7 +735,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy cssClass: 'modal modal-desktop', componentProps: { image: msg.attachments[0].image_url, - username: msg.u.username, + username: msg.u.name, _updatedAt: msg._updatedAt } }); diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index afcdba940..a8fb7a4c5 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -1,8 +1,10 @@ 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 { ChatService } from 'src/app/services/chat.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 { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; @@ -22,6 +24,7 @@ export class NewGroupPage implements OnInit{ countDownTime:any; //groupName:string; task:any; + documents: any; @Input() groupName:string; @Output() addGroupMessage:EventEmitter = new EventEmitter(); @@ -32,31 +35,42 @@ export class NewGroupPage implements OnInit{ private modalController: ModalController, private chatService: ChatService, private dataService:DataService, + private processesService: ProcessesService, + private router: Router, ) { this.isGroupCreated = false; //this.groupName = this.navParams.get('name'); - } ngOnInit() { - if(this.dataService.get("newGroup")){ - this.task = this.dataService.get("task"); - this.groupName = this.task.Folio; - } - console.log(this.task); + this.router.events.forEach((event) => { + if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { + if (this.dataService.get("newGroup")) { + this.task = this.dataService.get("task"); + this.groupName = this.task.Folio; + this.documents = this.dataService.get("documents"); + } + } + else{ + this.dataService.set("newGroup", false); + } + }); + console.log(this.task); } + /* ngOnDestroy(){ alert('Destroy') this.dataService.set("newGroup", false); this.dataService.set("task", null); this.dataService.set("newGroupName", ''); } */ + _ionChange(event){ console.log(event); console.log(event.detail.checked); - this.showDuration = event.detail.checked; + this.showDuration = event.detail.checked; if(event.detail.checked){ this.thedate = new Date(); @@ -74,6 +88,8 @@ export class NewGroupPage implements OnInit{ createGroup(){ let name = this.groupName.split(' ').join('-'); + //Take out all special characters in string + name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); let body = { "name":name, } this.chatService.addGroup(body).subscribe(res=>{ console.log('group created'); @@ -90,6 +106,43 @@ export class NewGroupPage implements OnInit{ console.log(res); }); } + + if(this.documents.length > 0){ + //If there is documents add + this.documents.forEach(async document => { + + let url = await this.processesService.GetDocumentUrl(document.DocId, document.ApplicationId).toPromise(); + let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); + + let body = { + "message": + { + "rid": res['group']._id, + "msg": "", + "attachments": [{ + "title": document.Assunto, + "description": document.DocTypeDesc, + "title_link": url_no_options, + "title_link_download": true, + //"thumb_url": "assets/images/webtrix-logo.png", + "message_link": url_no_options, + "type": "webtrix" + }], + "file":{ + "name": document.Assunto, + "type": "application/webtrix", + "ApplicationId": document.ApplicationType, + "DocId": document.Id, + "Assunto": document.Assunto, + } + } + } + this.chatService.sendMessage(body).toPromise(); + }); + } + + + }); } diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts index 409e85bf9..4f94cd6d0 100644 --- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.ts @@ -95,6 +95,7 @@ export class PedidosPage implements OnInit { let task: customTask = this.customTaskPipe.transform(element); this.parecerList.push(task); + }); this.pedidosstore.resetparecer(this.sortService.sortDate(this.parecerList, 'CreateDate')); @@ -114,7 +115,7 @@ export class PedidosPage implements OnInit { this.deferimentoList.push(task); }); - + this.pedidosstore.resetdeferimento(this.sortService.sortDate(this.deferimentoList, 'CreateDate')); }); diff --git a/src/app/shared/header/header.page.scss b/src/app/shared/header/header.page.scss index 24def0c06..e0114021b 100644 --- a/src/app/shared/header/header.page.scss +++ b/src/app/shared/header/header.page.scss @@ -3,7 +3,7 @@ .div-top-header{ margin: 0 em(20px); // background-color: #0782c9; - padding-top: em(15px); + //padding-top: em(15px); border: 0!important; } diff --git a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html index e76aaf577..a0042f5a1 100644 --- a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html +++ b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html @@ -6,9 +6,9 @@
    - + - +
    diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts index f874a9f4d..da24ec370 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.ts +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.ts @@ -17,6 +17,7 @@ import { TaskService } from 'src/app/Rules/task.service' import { ExpedienteService } from 'src/app/Rules/expediente.service'; import { PermissionService } from 'src/app/services/worker/permission.service'; import { ThemeService } from 'src/app/services/theme.service' +import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page'; @Component({ @@ -66,8 +67,20 @@ export class OptsExpedientePage implements OnInit { }; } - openNewGroupPage(){ + async openNewGroupPage(){ + console.log(this.fulltask); + const modal = await this.modalController.create({ + component: NewGroupPage, + cssClass: 'modal modal-desktop', + componentProps: { + name: this.task.Folio, + task: this.task, + documents: this.fulltask.Documents, + }, + }); + await modal.present(); + modal.onDidDismiss(); } close() { diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index 7105f2577..d76118df8 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -42,6 +42,7 @@ +
    @@ -54,8 +55,8 @@
    -
    - -
    +
    diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts index b8616959b..f59911563 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -112,18 +112,20 @@ export class RequestOptionsPage implements OnInit { modal.onDidDismiss(); } - openNewGroupPage(){ - this.router.navigate(['/home/chat']); - this.dataService.set("newGroup", true); - - if( window.innerWidth < 801){ - this.newGroup(); - } - else{ - this.dataService.set("newGroup", true); - /* this.closeAllDesktopComponents(); - this.showNewGroup=true; */ - } + async openNewGroupPage(){ + const modal = await this.modalController.create({ + component: NewGroupPage, + cssClass: 'modal modal-desktop', + componentProps: { + name: this.task.Folio, + task: this.task, + documents: this.fulltask.Documents, + }, + }); + await modal.present(); + modal.onDidDismiss().then( () => { + this.popoverController.dismiss('close'); + }); } async newGroup(){ diff --git a/src/app/shared/publication/new-action/new-action.page.ts b/src/app/shared/publication/new-action/new-action.page.ts index 733434a1b..9fee8eedf 100644 --- a/src/app/shared/publication/new-action/new-action.page.ts +++ b/src/app/shared/publication/new-action/new-action.page.ts @@ -28,27 +28,27 @@ export class NewActionPage implements OnInit { public stepMinute = 5; public stepSecond = 5; public endMinDate = new Date(new Date().getTime() + 15 * 60000); - + Form: FormGroup; validateFrom = false public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); - + @Output() closeDesktopComponent= new EventEmitter(); @Output() getActions= new EventEmitter(); constructor( private publication: PublicationsService, private toastService: ToastService - ) { + ) { this.folder = new PublicationFolder(); this.folder = Object.assign(this.folder, { - DateBegin: moment(new Date()), - DateEnd: moment(new Date(new Date().getTime() + 15 * 60000)), + DateBegin: new Date().toISOString(), + DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(), }) } @@ -76,9 +76,15 @@ export class NewActionPage implements OnInit { return ['ok'] } } - + runValidation() { - this.validateFrom = true + this.validateFrom = true; + if((new Date(this.folder.DateBegin).getTime()) > (new Date(this.folder.DateEnd).getTime())){ + this.toastService._badRequest("A data de início não pode ser superior a data de fim"); + } + else if(new Date(this.folder.DateBegin).getTime() > new Date().getTime()){ + this.toastService._badRequest("A data de início não pode ser superior a data actual"); + } } injectValidation() { @@ -119,21 +125,21 @@ export class NewActionPage implements OnInit { ActionType: this.segment, } console.log(this.folder); - + const loader = this.toastService.loading() try { await this.publication.CreatePublicationFolder(this.folder).toPromise() this.close(); - this.toastService.successMessage('Acção presidencial criada') + this.toastService._successMessage('Acção presidencial criada') this.getActions.emit() } catch (error) { - this.toastService.badRequest('Não foi possivel criar a acção presidencial') + this.toastService._badRequest('Não foi possivel criar a acção presidencial') } finally { loader.remove() } - + } close(){ diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html index d3f327380..8732e0f57 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -70,7 +70,7 @@
    -
    +
    diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index 42526fa0b..723dcae5c 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -309,7 +309,7 @@ export class NewPublicationPage implements OnInit { clear(){ this.capturedImage = ''; } - + setTitle(){ if(this.publicationType == '1') { this.publicationTitle = 'Nova Publicação Rápida'; diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html index 3b7dfd51b..56d47eab9 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -1,24 +1,33 @@
    -
    +
    -
    - {{item.Description}} +
    +
    + {{item.Description}} +
    + +
    + + + + +
    +
    +

    {{item.Detail}}

    -
    - - - -
    +
    @@ -52,10 +61,17 @@

    {{publication.Message}}

    +

    {{error}}

    -
    +
    + + + + + + diff --git a/src/app/shared/publication/view-publications/view-publications.page.scss b/src/app/shared/publication/view-publications/view-publications.page.scss index 184ac8243..67e2f016e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.scss +++ b/src/app/shared/publication/view-publications/view-publications.page.scss @@ -61,7 +61,6 @@ overflow:hidden; padding: 25px 20px 0px 20px; color:#000; - } .main-container{ width: 100%; @@ -86,22 +85,30 @@ .back-icon{ float: left; font-size: 35px; - + } .div-title{ /* padding: 0!important; */ float: left; - margin: 2.5px 0 0 5px; + margin: 2.5px 0 0 0; + overflow: auto; + } + .div-body{ + overflow: auto; } .title{ + width: fit-content; font-size: 25px; + float: left; } - + .actions-icon{ display: flex; + width: fit-content; align-items: top; justify-content: flex-end; padding: 0 !important; + float: right; } .actions-icon ion-icon{ margin-left: 5px; @@ -157,10 +164,27 @@ color: #797979; text-align: right; } - .post-description{ - font-size: 13px; - color: #000; - } +.post-description{ + font-size: 13px; + color: #000; +} +ion-fab{ + overflow: auto !important; + padding-right: 25px; + padding-bottom: 15px; + background: transparent !important; +} +ion-fab-button{ + --background: #FFB81C; + --box-shadow: none; + opacity: 0.7; +} +ion-fab-button:hover{ + --background: #FFB81C; + opacity: 1; + +} + diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 72f6ae99f..3be412f5e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -11,6 +11,8 @@ import { PublicationEventFolderStorage } from 'src/app/store/publication-event-f import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service'; import { PublicationPipe } from 'src/app/pipes/publication.pipe'; import { ThemeService } from 'src/app/services/theme.service' +import { ToastService } from 'src/app/services/toast.service'; +import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page'; @Component({ selector: 'app-view-publications', @@ -28,6 +30,7 @@ export class ViewPublicationsPage implements OnInit { @Input() folderId: string; @Output() addNewPublication = new EventEmitter(); + @Output() editPublication = new EventEmitter(); @Output() openPublicationDetails= new EventEmitter(); @Output() goBackToViewPublications = new EventEmitter(); @Output() closeDesktopComponent = new EventEmitter(); @@ -45,7 +48,8 @@ export class ViewPublicationsPage implements OnInit { private loadingController: LoadingService, private modalController: ModalController, private publications: PublicationsService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + private toastService: ToastService, ) { this.item = new PublicationFolder(); } @@ -89,12 +93,10 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - - setTimeout(() => { - let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) - this.item = allActions.find((e)=> e.ProcessId == this.folderId); - },100); - + this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{ + console.log(res); + this.item = res; + }); } getPublications() { @@ -151,6 +153,39 @@ export class ViewPublicationsPage implements OnInit { } + async openEditPublication(folderId?:any){ + if( window.innerWidth < 701) { + const modal = await this.modalController.create({ + component: EditActionPage, + componentProps: { + folderId: folderId, + }, + cssClass: 'new-action modal modal-desktop', + backdropDismiss: true + }); + await modal.present(); + modal.onDidDismiss().then(() => { + //Do nothing + }); + } + else{ + this.editPublication.emit(folderId); + } + } + + async deletePublication(folderId?:any){ + const loader = this.toastService.loading(); + try { + await this.publications.DeletePresidentialAction(folderId).toPromise(); + this.toastService._successMessage() + } catch (e) { + this.toastService._badRequest() + } + finally { + loader.remove() + } + } + async viewPublicationDetail(publicationId:string) { diff --git a/src/assets/icon/icons-actions-grey.svg b/src/assets/icon/icons-actions-grey.svg new file mode 100644 index 000000000..3daded799 --- /dev/null +++ b/src/assets/icon/icons-actions-grey.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/images/theme/gov/icons-delete.svg b/src/assets/images/theme/gov/icons-delete.svg new file mode 100644 index 000000000..531880103 --- /dev/null +++ b/src/assets/images/theme/gov/icons-delete.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 1effa3995..a8ccf00ce 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,6 +1,6 @@ export const environment = { production: true, - apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V5/api/', + apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', apiChatUrl: 'https://www.tabularium.pt/api/v1/', domain: 'gabinetedigital.local', defaultuser: '', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 4faf624cb..98e1871b5 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,9 +4,8 @@ export const environment = { production: false, - //apiURL: 'https://tabularium.dyndns.info/GabineteDigital.Services/V5/api/', - //apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V5/api/', - apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', + apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', + // apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V4/api/', apiChatUrl: 'https://www.tabularium.pt/api/v1/', /* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */ domain: 'gabinetedigital.local', //gabinetedigital.local diff --git a/src/global.scss b/src/global.scss index 05174772d..32773b846 100644 --- a/src/global.scss +++ b/src/global.scss @@ -380,7 +380,7 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent- .desktop-search { padding-top: 0px !important; - margin-top: 80px !important; + margin-top: 100px !important; position: relative !important; ion-backdrop { @@ -751,9 +751,9 @@ app-header-no-search .ion-toolbar{ - - - + + + } @@ -794,8 +794,26 @@ ion-content { app-header .header-container{ background: var(--header-container-background) !important; color: var(--headercolor); - margin-bottom: 20px } + app-events .init-event-header, + app-agenda ion-content .container-wrapper, + app-view-event .container-wrapper, + app-gabinete-digital .container-wrapper, + app-publications .container-wrapper, + app-chat .container-wrapper, + app-pedido .container-wrapper, + app-diploma .container-wrapper, + app-diploma-assinar .container-wrapper, + app-expediente-detail .container-wrapper, + app-expediente-pr .container-wrapper, + app-approve-event .container-wrapper, + app-despacho .container-wrapper, + app-despacho-pr .container-wrapper + { + padding-top: 20px !important; + --padding-top:20px !important; + } + } @media only screen and (min-width : 321px) { @@ -998,11 +1016,11 @@ background: rgb(92, 92, 92); } -.calendar-component .monthview-container table.table tbody { - tr:nth-child(n+6) { - display: none; - } -} +// .calendar-component .monthview-container table.table tbody { +// tr:nth-child(n+6) { +// display: none; +// } +// } .modal { display: flex !important; @@ -1346,7 +1364,7 @@ ngx-mat-datetime-content{ ion-content { --background:transparent; - + } } @@ -1362,15 +1380,14 @@ ngx-mat-datetime-content{ } } - + $font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; $font-size: 11pt; ion-row ul > li{ font-family: $font-family; font-size: $font-size; - + } - \ No newline at end of file diff --git a/src/polyfills.ts b/src/polyfills.ts index 4f7af3834..f75239d4f 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -68,4 +68,4 @@ import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ -(window as any).global = window; \ No newline at end of file +(window as any).global = window;