From 89c3db663b7d512d4cd7ddcb2fc03674557c97cd Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 8 Dec 2021 20:27:05 +0100 Subject: [PATCH 01/42] save --- .../group-messages/group-messages.page.html | 6 ++- .../group-messages/group-messages.page.ts | 29 ++++++------- .../group-messages/group-messages.page.html | 6 ++- .../group-messages/group-messages.page.ts | 41 ++++++++++--------- 4 files changed, 44 insertions(+), 38 deletions(-) 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/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 0ebc7fdbb..6d04f1ced 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 +
diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index cf0ac3345..7c07a530d 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -20,6 +20,7 @@ import { FileService } from 'src/app/services/functions/file.service'; 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'; /* import * as pdfjsLib from 'pdfjs-dist'; @@ -769,7 +770,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } } - + sliderOpts = { zoom: false, slidesPerView: 1.5, @@ -778,7 +779,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe }; zoomActive = false; zoomScale = 1; - + sliderZoomOpts = { allowSlidePrev: false, allowSlideNext: false, @@ -786,44 +787,44 @@ 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) { - const modal = await this.modalController.create({ - component: PreviewCameraPage, - cssClass: 'transparent-modal', - componentProps: { - image: img.attachments[0].image_url, - username: img.u.username, - _updatedAt: img._updatedAt - } - }); - modal.present(); - } +async openPreview(msg) { + const modal = await this.modalController.create({ + component: ViewMediaPage, + cssClass: 'modal modal-desktop', + componentProps: { + image: msg.attachments[0].image_url, + username: msg.u.name, + _updatedAt: msg._updatedAt, + } + }); + modal.present(); +} } From 3908eac19395077a20537b9946290472c896f6e8 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 9 Dec 2021 18:03:15 +0100 Subject: [PATCH 02/42] Improve --- src/app/guards/auth.guard.ts | 1 + src/app/pages/agenda/agenda.page.html | 14 +++++----- src/app/pages/agenda/agenda.page.scss | 37 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index b493d2813..6d859eafe 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -19,6 +19,7 @@ export class AuthGuard implements CanActivate { if(!SessionStore.user.Inactivity) { this.router.navigate(['/']); + return false } else if(!SessionStore.exist) { this.router.navigate(['/']); diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index da4a939b0..3723d055b 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -28,8 +28,8 @@ -
-
--> -
+
@@ -111,21 +111,21 @@ - - - - -
-
+
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 @@ -
+
-
+
Date: Fri, 10 Dec 2021 10:32:49 +0100 Subject: [PATCH 04/42] continue work on opening chat from expediente --- src/app/guards/auth.guard.ts | 7 +-- .../view-document/view-document.page.ts | 1 - src/app/pages/chat/chat.page.ts | 37 ++++++++++--- .../pages/chat/new-group/new-group.page.ts | 40 +++++++++++++- .../expediente-detail.page.ts | 4 ++ .../gabinete-digital/gabinete-digital.page.ts | 4 +- src/app/services/functions/file.service.ts | 18 ------- .../shared/chat/new-group/new-group.page.ts | 53 +++++++++++++++++-- .../opts-expediente/opts-expediente.page.ts | 15 +++++- src/polyfills.ts | 2 +- 10 files changed, 144 insertions(+), 37 deletions(-) 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/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 4921e409b..4638e3d19 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -7,7 +7,9 @@ import { ComponentFactoryResolver, ComponentRef, ComponentFactory, - Output + Output, + AfterViewChecked, + AfterViewInit } from '@angular/core'; import { ModalController, Platform } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; @@ -17,7 +19,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'; @@ -39,7 +40,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; templateUrl: './chat.page.html', styleUrls: ['./chat.page.scss'], }) -export class ChatPage implements OnInit { +export class ChatPage implements OnInit, AfterViewInit { showLoader: boolean; @@ -136,6 +137,7 @@ export class ChatPage implements OnInit { } ngOnInit() { + console.log(this.loggedUserChat); this.segment = "Contactos"; @@ -162,17 +164,38 @@ export class ChatPage implements OnInit { this.openNewGroupPage(); } */ + + 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 { + alert('Aqui' + this.dataService.get("newGroup")) + if (this.dataService.get("newGroup")) { + this.openNewGroupPage(); + } + /* if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) { + alert(this.dataService.get("newGroup")) + } + else { if (this.dataService.get("newGroup")) { this.openNewGroupPage(); } - } + } */ + } + else{ + this.dataService.set("newGroup", false); } }); + if (this.dataService.get("newGroup")) { + this.openNewGroupPage(); + } + } + + ngAfterViewInit() { + alert(this.dataService.get("newGroup")) + } + + ngAfterViewChecked(){ + //alert(this.dataService.get("newGroup")) } ngOnDestroy() { 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..9042db2fd 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; @@ -73,6 +78,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/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index e5ea396b7..0f23afe55 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 @@ -634,6 +634,9 @@ export class ExpedienteDetailPage implements OnInit { } openNewGroupPage() { + console.log(this.fulltask); + this.dataService.set("newGroup", true); + this.router.navigate(['/home/chat']); this.dataService.set("newGroup", true); @@ -644,6 +647,7 @@ export class ExpedienteDetailPage implements OnInit { 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); } } 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/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 5973e67df..00883b376 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -315,24 +315,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/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index afcdba940..d50435ade 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -3,6 +3,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angu 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 +23,7 @@ export class NewGroupPage implements OnInit{ countDownTime:any; //groupName:string; task:any; + documents: any; @Input() groupName:string; @Output() addGroupMessage:EventEmitter = new EventEmitter(); @@ -32,31 +34,37 @@ export class NewGroupPage implements OnInit{ private modalController: ModalController, private chatService: ChatService, private dataService:DataService, + private processesService: ProcessesService, ) { this.isGroupCreated = false; //this.groupName = this.navParams.get('name'); - } ngOnInit() { - if(this.dataService.get("newGroup")){ + //alert(this.dataService.get("newGroup")) + setTimeout(() => { + //alert(this.dataService.get("newGroup")) + }, 100) + if(this.dataService.get("newGroup") == true){ this.task = this.dataService.get("task"); this.groupName = this.task.Folio; + this.documents = this.dataService.get("documents"); } 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(); @@ -90,6 +98,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/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/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; From d7300080c3b1ab53faeadf057c33113ac0a0d5e5 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 10 Dec 2021 11:41:24 +0100 Subject: [PATCH 05/42] Take out all special characters in string --- src/app/pages/chat/chat.page.ts | 43 +++++++------------ .../expediente-detail.page.ts | 8 +--- .../shared/chat/new-group/new-group.page.ts | 28 ++++++++---- 3 files changed, 37 insertions(+), 42 deletions(-) diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 4638e3d19..074c036e7 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -8,8 +8,6 @@ import { ComponentRef, ComponentFactory, Output, - AfterViewChecked, - AfterViewInit } from '@angular/core'; import { ModalController, Platform } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; @@ -40,7 +38,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; templateUrl: './chat.page.html', styleUrls: ['./chat.page.scss'], }) -export class ChatPage implements OnInit, AfterViewInit { +export class ChatPage implements OnInit { showLoader: boolean; @@ -164,42 +162,25 @@ export class ChatPage implements OnInit, AfterViewInit { this.openNewGroupPage(); } */ - - this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { - alert('Aqui' + this.dataService.get("newGroup")) if (this.dataService.get("newGroup")) { this.openNewGroupPage(); } - /* if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) { - alert(this.dataService.get("newGroup")) + else{ + this.closeAllDesktopComponents(); + this.showEmptyComponent = true; } - else { - if (this.dataService.get("newGroup")) { - this.openNewGroupPage(); - } - } */ } else{ this.dataService.set("newGroup", false); } }); - if (this.dataService.get("newGroup")) { - this.openNewGroupPage(); - } - } - - ngAfterViewInit() { - alert(this.dataService.get("newGroup")) - } - - ngAfterViewChecked(){ - //alert(this.dataService.get("newGroup")) } ngOnDestroy() { this.setStatus('offline'); + this.dataService.set("newGroup", false); console.log('On Destroy') } @@ -513,6 +494,13 @@ export class ChatPage implements OnInit, AfterViewInit { console.log('Chat list', res); if (res != 200) { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + this.userDirectMessages = res.ims.sort((a, b) => { + var dateA = new Date(a._updatedAt).getTime(); + var dateB = new Date(b._updatedAt).getTime(); + return dateB - dateA; + }); + } //console.log(res.ims); /* this.userDirectMessages = res.ims.sort((a, b) => { var dateA = new Date(a._updatedAt).getTime(); @@ -557,9 +545,10 @@ export class ChatPage implements OnInit, AfterViewInit { this.chatService.getAllUsers().subscribe(res => { console.log('chatusers', res); this.transformDataUserList(res['users']) - - //this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username); - //console.log(this.dmUsers); + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username); + console.log(this.dmUsers); + } }); } 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 0f23afe55..1a60e2b39 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 @@ -634,13 +634,8 @@ export class ExpedienteDetailPage implements OnInit { } openNewGroupPage() { - console.log(this.fulltask); - this.dataService.set("newGroup", true); - - this.router.navigate(['/home/chat']); - this.dataService.set("newGroup", true); - if (window.innerWidth < 801) { + this.router.navigate(['/home/chat']); this.newGroup(); } else { @@ -648,6 +643,7 @@ export class ExpedienteDetailPage implements OnInit { 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/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index d50435ade..96bd41d83 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -1,5 +1,6 @@ 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'; @@ -35,22 +36,29 @@ export class NewGroupPage implements OnInit{ private chatService: ChatService, private dataService:DataService, private processesService: ProcessesService, + private router: Router, ) { this.isGroupCreated = false; //this.groupName = this.navParams.get('name'); + alert('New group '+this.dataService.get("newGroup")) } ngOnInit() { - //alert(this.dataService.get("newGroup")) - setTimeout(() => { - //alert(this.dataService.get("newGroup")) - }, 100) - if(this.dataService.get("newGroup") == true){ - this.task = this.dataService.get("task"); - this.groupName = this.task.Folio; - this.documents = this.dataService.get("documents"); - } + this.router.events.forEach((event) => { + if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { + alert('New group '+this.dataService.get("newGroup")) + 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); } @@ -82,6 +90,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'); From 7a2a21ec706bb5169088d9fcce7d16bfac0441b2 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 10 Dec 2021 11:46:28 +0100 Subject: [PATCH 06/42] Take out all special characters in string --- src/app/pages/chat/new-group/new-group.page.ts | 1 + src/app/shared/chat/new-group/new-group.page.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) 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 9042db2fd..d1006c0e2 100644 --- a/src/app/pages/chat/new-group/new-group.page.ts +++ b/src/app/pages/chat/new-group/new-group.page.ts @@ -57,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=>{ 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 96bd41d83..a8fb7a4c5 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -41,13 +41,11 @@ export class NewGroupPage implements OnInit{ { this.isGroupCreated = false; //this.groupName = this.navParams.get('name'); - alert('New group '+this.dataService.get("newGroup")) } ngOnInit() { this.router.events.forEach((event) => { if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { - alert('New group '+this.dataService.get("newGroup")) if (this.dataService.get("newGroup")) { this.task = this.dataService.get("task"); this.groupName = this.task.Folio; From 7c7341b34b8fa0ab1c4d5ebe10082364dae272c3 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 10 Dec 2021 12:31:37 +0100 Subject: [PATCH 07/42] add sart chat from Parecer --- .../pedidos/pedido/pedido.page.html | 4 +-- .../pedidos/pedido/pedido.page.ts | 12 ++++----- .../request-options/request-options.page.html | 7 ++--- .../request-options/request-options.page.ts | 26 ++++++++++--------- 4 files changed, 26 insertions(+), 23 deletions(-) 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..ed64311d0 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html @@ -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/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(){ From 8bd05fe84daf24e48e452a871580be0bd6c052bd Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 10 Dec 2021 14:55:55 +0100 Subject: [PATCH 08/42] improve --- src/app/pages/agenda/agenda.page.html | 2 +- src/app/pages/agenda/agenda.page.ts | 2 +- src/global.scss | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index e755593ce..adca4bea3 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -194,7 +194,7 @@ -
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/approve-event.page.html b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html index 28bbc19a8..beb25cf4c 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 @@ - +
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..6efae1d10 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 @@
- +
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/pedidos/pedido/pedido.page.html b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html index ed64311d0..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 @@ - +
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/publications.page.html b/src/app/pages/publications/publications.page.html index 9951a3376..151742973 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -2,7 +2,7 @@ - +
diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index cd8f0035e..d37b6ab0f 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 @@
    - -
    + +
    @@ -182,14 +182,14 @@ - + + src="assets/images/icons-default-agenda.svg">
    - +
    {{ searchDocument.Assunto}} {{ searchDocument.appName}} @@ -205,10 +205,10 @@
    - +
    - +
    -
    \ No newline at end of file +
    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/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/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/global.scss b/src/global.scss index 05174772d..1a8e0250a 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-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) { @@ -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 From f29528169f5cf223eee01be770a889d9085539dc Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 10 Dec 2021 16:22:37 +0100 Subject: [PATCH 10/42] Fix event occurrency --- src/app/shared/agenda/new-event/new-event.page.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 058c0910f..dc4d542b1 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -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' } From 07880d223ecc229d37ff91aaec12a7c2433cd879 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 10 Dec 2021 17:04:40 +0100 Subject: [PATCH 11/42] save --- .../event-list/approve-event/approve-event.page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 beb25cf4c..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 @@ -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

    From 86393de050c23e375be151ccb60b2b9aafb6d120 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 11 Dec 2021 16:27:41 +0100 Subject: [PATCH 12/42] add event repeat specification --- src/app/pages/agenda/view-event/view-event.page.html | 8 +++++++- .../approve-event-modal/approve-event-modal.page.html | 11 +++++++++-- .../expediente-detail/expediente-detail.page.ts | 2 +- .../agenda/approve-event/approve-event.page.html | 1 + src/app/shared/agenda/view-event/view-event.page.html | 9 ++++++++- 5 files changed, 26 insertions(+), 5 deletions(-) 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..f559fdb33 100644 --- a/src/app/pages/agenda/view-event/view-event.page.html +++ b/src/app/pages/agenda/view-event/view-event.page.html @@ -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/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/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index 1a60e2b39..f2e25ce8b 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 @@ -592,7 +592,7 @@ export class ExpedienteDetailPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(res => { - this.goBack(); + }); } 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/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 +

    +
    From 621e2180f33510792a55ccd8d577e8ad58bbf641 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 11 Dec 2021 16:43:22 +0100 Subject: [PATCH 13/42] Update attachment list --- .../expediente-detail.page.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 f2e25ce8b..8c3da2e24 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 @@ -442,7 +442,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, @@ -457,16 +457,17 @@ export class ExpedienteDetailPage implements OnInit { body.Attachments = Attachments; 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() + } }); + + this.LoadTaskDetail(this.serialNumber); } }); From e2d261521049082b02d5639830d262f78073c04c Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 11 Dec 2021 17:10:25 +0100 Subject: [PATCH 14/42] Fix Anexar Documentos button --- .../expediente-detail/expediente-detail.page.ts | 3 ++- src/app/pages/search/search.page.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) 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 8c3da2e24..c98925dfc 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 @@ -434,7 +434,8 @@ export class ExpedienteDetailPage implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, - select: true + select: true, + findOnly: [8] } }); await modal.present(); diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 3963f7fad..73c6df583 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -53,6 +53,7 @@ export class SearchPage implements OnInit { type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda"; select: boolean = false; + findOnly = [] showSearchInput = false @@ -69,6 +70,7 @@ export class SearchPage implements OnInit { this.type = this.navParams.get('type'); this.select = this.navParams.get('select'); + this.findOnly = this.navParams.get('findOnly') this.showSearchInput = this.navParams.get('showSearchInput'); @@ -199,6 +201,12 @@ export class SearchPage implements OnInit { } else { this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) } + + + if(this.findOnly.length >= 1) { + this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) + } + } sortArrayISODate(myArray: any) { @@ -528,10 +536,10 @@ export class SearchPage implements OnInit { } - async filterDocList(categoryName:string){ + async filterDocList(categoryName:string) { // show all category - if(this. showCategory == categoryName ){ + if(this. showCategory == categoryName ) { this.showSearchDocuments = this.searchDocuments; From 83155d3ad64f0e56911696c86ff64f31edc86d70 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Sun, 12 Dec 2021 06:52:44 +0100 Subject: [PATCH 15/42] save --- src/app/pages/search/search.page.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 73c6df583..163c97e95 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -61,7 +61,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; @@ -206,7 +206,7 @@ export class SearchPage implements OnInit { if(this.findOnly.length >= 1) { this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) } - + } sortArrayISODate(myArray: any) { From 75e29d7adad1e983a7d1b18645e2ef106ec2f4f6 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Sun, 12 Dec 2021 07:01:09 +0100 Subject: [PATCH 16/42] save --- src/app/pages/publications/edit-action/edit-action.page.scss | 2 -- 1 file changed, 2 deletions(-) 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; From b18aa83bfa568891d972dabadb4205f5a9a5f600 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 06:22:04 +0100 Subject: [PATCH 17/42] hide add media options --- src/app/shared/chat/group-messages/group-messages.page.html | 4 ++-- src/app/shared/chat/messages/messages.page.html | 4 ++-- .../chat-options-popover/chat-options-popover.page.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 6d04f1ced..9c73ae1d4 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -146,7 +146,7 @@ - + diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index e2f1887cc..f837907fe 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -120,7 +120,7 @@ -
    - + - +
    From 22d079acbc581b6b373251848ccba0c51c391e1e Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 09:51:57 +0100 Subject: [PATCH 18/42] fix add photo in publication on mobile view --- .../new-publication/new-publication.page.html | 12 +++---- .../new-publication/new-publication.page.ts | 32 +++++++++---------- .../new-publication/new-publication.page.ts | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) 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/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'; From 71d7ff67b271f3d26680e8275ec8f3fbefc43fb9 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 10:24:54 +0100 Subject: [PATCH 19/42] fix bug in search --- src/app/pages/search/search.page.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 163c97e95..7181ae1c8 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -202,9 +202,10 @@ export class SearchPage implements OnInit { this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) } - - if(this.findOnly.length >= 1) { - this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) + if(this.findOnly){ + if(this.findOnly.length >= 1) { + this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) + } } } From 10c63575e7f7cd681b084a097b2fc858998cd156 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 11:13:21 +0100 Subject: [PATCH 20/42] fix search --- src/app/pages/search/search.page.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 163c97e95..f297717b6 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -53,7 +53,6 @@ export class SearchPage implements OnInit { type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda"; select: boolean = false; - findOnly = [] showSearchInput = false @@ -70,7 +69,6 @@ export class SearchPage implements OnInit { this.type = this.navParams.get('type'); this.select = this.navParams.get('select'); - this.findOnly = this.navParams.get('findOnly') this.showSearchInput = this.navParams.get('showSearchInput'); @@ -201,12 +199,6 @@ export class SearchPage implements OnInit { } else { this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) } - - - if(this.findOnly.length >= 1) { - this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) - } - } sortArrayISODate(myArray: any) { @@ -536,10 +528,10 @@ export class SearchPage implements OnInit { } - async filterDocList(categoryName:string) { + async filterDocList(categoryName:string){ // show all category - if(this. showCategory == categoryName ) { + if(this. showCategory == categoryName ){ this.showSearchDocuments = this.searchDocuments; From 25d9aefa9df09bf0db03a1ef9422b1100be87119 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 11:18:59 +0100 Subject: [PATCH 21/42] show "Anexar Foto" even in desktop --- .../publication/new-publication/new-publication.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@
    -
    +
    From 3ab9d3445dbda321272ca0c51ace9f5769c61794 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 12:49:47 +0100 Subject: [PATCH 22/42] fix add atachment in Expediente --- .../expediente-detail.page.ts | 11 ++- src/app/pages/search/search.page.html | 6 +- src/app/pages/search/search.page.ts | 91 ++++++++++++++++++- 3 files changed, 96 insertions(+), 12 deletions(-) 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 c98925dfc..62a4f6236 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,7 +432,7 @@ export class ExpedienteDetailPage implements OnInit { component: SearchPage, cssClass: 'modal-width-100-width-background modal', componentProps: { - type: 'AccoesPresidenciais & ArquivoDespachoElect', + type: 'Correspondencia', showSearchInput: true, select: true, findOnly: [8] @@ -458,7 +458,7 @@ export class ExpedienteDetailPage implements OnInit { body.Attachments = Attachments; const loader = this.toastService.loading() - + try { loader.remove() await this.attachmentsService.AddAttachment(body).toPromise() @@ -467,11 +467,12 @@ export class ExpedienteDetailPage implements OnInit { this.toastService._badRequest() } }); - - this.LoadTaskDetail(this.serialNumber); } - }); + setTimeout(() => { + this.LoadTaskDetail(this.serialNumber); + }, 5000); + }); } async openExpedientActionsModal(taskAction: any, task: any) { diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index d37b6ab0f..e30d9294a 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -177,10 +177,10 @@
    • - - {{ searchDocument.Assunto}} - {{ searchDocument.appName}} + {{ searchDocument.appName}}
      {{ searchDocument.EntidadeOrganicaNome }} diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index f297717b6..7d05ab861 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -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; From e524062ed9fff6f2c707b5a4137226385f658154 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 13 Dec 2021 15:34:16 +0100 Subject: [PATCH 23/42] add validation to date in new event --- src/app/pages/agenda/new-event/new-event.page.ts | 9 ++++++--- src/app/services/functions/file.service.ts | 1 - src/app/services/processes.service.ts | 1 - src/app/shared/agenda/new-event/new-event.page.ts | 9 ++++++--- .../shared/chat/group-messages/group-messages.page.html | 4 ++-- src/app/shared/chat/messages/messages.page.html | 4 ++-- 6 files changed, 16 insertions(+), 12 deletions(-) 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/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 00883b376..087e77394 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -54,7 +54,6 @@ export class FileService { ) { } uploadFile(formData:any){ - alert('OIEE') //const geturl = environment.apiURL + 'Tasks/DelegateTask'; const geturl = environment.apiURL + 'lakefs/UploadFiles'; 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/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index dc4d542b1..e615df6a8 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -218,7 +218,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") + } } injectValidation() { @@ -227,7 +230,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 +258,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 ]), - }) + } 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 9c73ae1d4..086fa5332 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -148,11 +148,11 @@ - + diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index f837907fe..d1afd2f27 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -122,11 +122,11 @@ - + From 7e5388e4e1d6c316733b2ab4e8cd69a629c57660 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 14:58:34 +0100 Subject: [PATCH 24/42] add message errors in new action. --- .../new-action/new-action.page.ts | 20 ++++++++----- src/app/services/functions/file.service.ts | 7 ++++- .../shared/agenda/new-event/new-event.page.ts | 5 ---- .../group-messages/group-messages.page.html | 4 +-- .../shared/chat/messages/messages.page.html | 4 +-- src/app/shared/chat/messages/messages.page.ts | 1 + .../publication/new-action/new-action.page.ts | 28 +++++++++++-------- 7 files changed, 41 insertions(+), 28 deletions(-) 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/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 087e77394..ee3d2d9de 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -51,7 +51,9 @@ export class FileService { private platform: Platform, private loadingCtrl: LoadingController, private http: HttpClient, - ) { } + ) { + this.headers = new HttpHeaders(); + } uploadFile(formData:any){ @@ -71,6 +73,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 diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index e615df6a8..dd837f708 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -201,13 +201,11 @@ export class NewEventPage implements OnInit { } }) } - this.taskParticipants = removeDuplicate(this.taskParticipants); this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); this.setIntervenient.emit(this.taskParticipants); this.setIntervenientCC.emit(this.taskParticipantsCc); - } @@ -307,7 +305,6 @@ export class NewEventPage implements OnInit { close(){ this.deleteTemporaryData(); - this.cloneAllmobileComponent.emit(); this.clearContact.emit(); this.setIntervenient.emit([]); @@ -425,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/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 086fa5332..6947bcfa7 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -149,9 +149,9 @@ - + diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index d1afd2f27..4fcb6d4e2 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -123,9 +123,9 @@ - + diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 67fb6bc09..6d8d05816 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -250,6 +250,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy if(msg.file.type == "application/img"){ let response:any = await this.fileService.getFile(msg.file.guid).toPromise(); console.log(response); + alert(response); //this.openPreview(msg); 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(){ From 2428fe5ceeda9228d13571f99037e52fbf15c28e Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 16:02:28 +0100 Subject: [PATCH 25/42] hide options when presidential action is selected --- src/app/pages/publications/publications.page.html | 3 +-- src/app/pages/publications/publications.page.scss | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 151742973..3ebb7d4de 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -40,7 +40,7 @@
      - {{viagem.Detail}}

      -
      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; + } } From d644b5dc0fbefac92b0b7b5639552b5a85ed888e Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 16:22:53 +0100 Subject: [PATCH 26/42] remove duplicated button in expediente --- src/app/pages/publications/publications.page.ts | 11 +++++------ .../shared/chat/messages/contacts/contacts.page.ts | 2 +- .../popover/opts-expediente/opts-expediente.page.html | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 3ceb83fc3..671e6a488 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -70,7 +70,7 @@ 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"]; @@ -187,7 +187,7 @@ export class PublicationsPage implements OnInit { } getFromDB() { - + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { this.sqliteservice.getAllActions().then((actions: any[]) => { @@ -277,13 +277,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; } @@ -461,5 +460,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/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index 308e81dc6..f277dc474 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -49,7 +49,7 @@ export class ContactsPage implements OnInit { } openMessagesPage(username:string){ - if( window.innerWidth <= 1024){ + if( window.innerWidth < 701){ this.createRoom(username); } else{ diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index 57bd27f4e..c8a439597 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -28,13 +28,12 @@
      -
      - + From 4b5d3c87aa4c118d7c98dd8843311d743378dad6 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 16:42:09 +0100 Subject: [PATCH 27/42] save --- .../chat/messages/contacts/contacts.page.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index f277dc474..e3b72fc64 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -117,10 +117,10 @@ export class ContactsPage implements OnInit { this.chatService.createRoom(body).subscribe(res => { console.log(res); this.room = res['room']; - this.getDirectMessage(this.room._id); + this.openMessagesModal(this.room._id); }); } - getDirectMessage(roomId:any){ + /* getDirectMessage(roomId:any){ console.log(roomId); this.chatService.getAllDirectMessages().subscribe(res=>{ @@ -129,17 +129,17 @@ export class ContactsPage implements OnInit { console.log(this.dm); this.openModal(this.dm); }); - } - async openModal(dm:any){ - this.close(); - console.log(dm); + } */ + + async openMessagesModal(roomId: any) { + + console.log(roomId); const modal = await this.modalController.create({ component: MessagesPage, - cssClass: 'group-messages', - backdropDismiss: false, + cssClass: 'modal modal-desktop isMessagesChatOpened', componentProps: { - dm: dm, + roomId: roomId, }, }); await modal.present(); From 243cbe5cf9adad2065c6016357000310e276e1e3 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 17:09:53 +0100 Subject: [PATCH 28/42] fixed bug in mobile view --- src/app/pages/chat/messages/messages.page.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index b5295fc19..ed27104e0 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -110,7 +110,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.load(); this.setStatus('online'); - this.loadFiles(); + //this.loadFiles(); VoiceRecorder.requestAudioRecordingPermission(); Filesystem.mkdir({ path: IMAGE_DIR, @@ -562,7 +562,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { let msgChat = { _id: element.Id, - attachments: this.isJson(element.Attachments), + attachments: this.isJson(element.Attachments), channels: this.isJson(element.Channels), file: this.isJson(element.File), mentions: this.isJson(element.Mentions), @@ -613,7 +613,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { this.sqlservice.addChatMSG(chatmsg) }); } - + } async serverLongPull() { @@ -643,8 +643,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { // Show Error //showMessage(response.statusText); //this.loadMessages() - //this.messages = res['messages'].reverse(); - //this.chatMessageStore.add(roomId, this.messages) + + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + this.messages = res['messages'].reverse(); + this.chatMessageStore.add(roomId, this.messages) + } //console.log(this.messages); // Reconnect in one second From 710098146765913698f25b42fa169cfde9437c96 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 17:12:32 +0100 Subject: [PATCH 29/42] save --- src/app/shared/chat/messages/contacts/contacts.page.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index e3b72fc64..fdfbefb5a 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -120,16 +120,6 @@ export class ContactsPage implements OnInit { this.openMessagesModal(this.room._id); }); } - /* getDirectMessage(roomId:any){ - console.log(roomId); - - this.chatService.getAllDirectMessages().subscribe(res=>{ - let result = res['ims'].filter(data => data._id == roomId); - this.dm = result[0]; - console.log(this.dm); - this.openModal(this.dm); - }); - } */ async openMessagesModal(roomId: any) { From 9d2fcc9fc9c11a874ea3c54ae65c36602b59601c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 14 Dec 2021 23:04:03 +0100 Subject: [PATCH 30/42] fix footer of individual chat and group chat --- .../group-messages/group-messages.page.html | 5 +- .../group-messages/group-messages.page.scss | 76 ++++++++++--------- .../shared/chat/messages/messages.page.html | 4 +- .../shared/chat/messages/messages.page.scss | 12 +-- 4 files changed, 51 insertions(+), 46 deletions(-) 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 6947bcfa7..a9c145708 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -161,7 +161,8 @@
      -
      + +
      -
      +
      -
      + +
      From 2c5067a3629fafc6d97857b15720d7f0a39ccddb Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 09:02:21 +0100 Subject: [PATCH 33/42] save --- .../expediente/expediente-detail/expediente-detail.page.html | 2 +- .../expediente/expediente-detail/expediente-detail.page.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 bf506ebf5..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 @@ -118,7 +118,7 @@ - +
      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 62a4f6236..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 @@ -637,7 +637,7 @@ export class ExpedienteDetailPage implements OnInit { } openNewGroupPage() { - if (window.innerWidth < 801) { + if (window.innerWidth < 701) { this.router.navigate(['/home/chat']); this.newGroup(); } From bc56534e0e8635ef9a12f75511eed394258b7daf Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 10:03:28 +0100 Subject: [PATCH 34/42] save --- src/app/pages/agenda/view-event/view-event.page.html | 4 ++-- src/global.scss | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 f559fdb33..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 @@ - + @@ -64,7 +64,7 @@ Semanal Mensal Anual - Nunca + Nunca

      diff --git a/src/global.scss b/src/global.scss index 4e6bf9ad3..5c1d0e183 100644 --- a/src/global.scss +++ b/src/global.scss @@ -797,6 +797,7 @@ ion-content { } 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, From 5bc5799c58acdbb31b2f582952e89a572e44f4a5 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 10:05:34 +0100 Subject: [PATCH 35/42] save --- src/global.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/global.scss b/src/global.scss index 5c1d0e183..32773b846 100644 --- a/src/global.scss +++ b/src/global.scss @@ -814,7 +814,6 @@ ion-content { --padding-top:20px !important; } - } @media only screen and (min-width : 321px) { From 4d6c2e6775376ac4878518d5eb72b1b2c64fa61c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 15:07:26 +0100 Subject: [PATCH 36/42] added button edit and delete in presidential action detail view in desktop --- .../pages/publications/publications.page.html | 1 + .../pages/publications/publications.page.ts | 10 +++-- .../view-publications.page.html | 41 ++++++++++++------- .../view-publications.page.scss | 15 +++++-- .../view-publications.page.ts | 39 +++++++++++++++++- src/assets/images/theme/gov/icons-delete.svg | 4 ++ 6 files changed, 87 insertions(+), 23 deletions(-) create mode 100644 src/assets/images/theme/gov/icons-delete.svg diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 3ebb7d4de..2d4f24bca 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -134,6 +134,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.ts b/src/app/pages/publications/publications.page.ts index 671e6a488..fb589b982 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -237,9 +237,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 +247,6 @@ export class PublicationsPage implements OnInit { finally { loader.remove() } - this.refreshing() } @@ -378,10 +375,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; @@ -404,6 +405,7 @@ export class PublicationsPage implements OnInit { showAddActions: false, showEditActions: false, } + this.idSelected = ""; } async openOptions(id?: string) { 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..58dbe2f59 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,37 @@
      -
      +
      -
      - {{item.Description}} +
      +
      + {{item.Description}} +
      + +
      + + + + + +
      +
      +

      {{item.Detail}}

      -
      - - - -
      +
      @@ -57,5 +70,5 @@

      {{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..6091c5695 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; 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 e7b3590b6..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(); } @@ -149,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/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 @@ + + + + From c015277f0aa796f30963f988487643e01be70edc Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 15:24:29 +0100 Subject: [PATCH 37/42] change API address --- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 1effa3995..76b20ba47 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://tabularium.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 c34c5fe3b..0b0bd282a 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V5/api/', + apiURL: 'https://tabularium.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/', */ From 60febae868c3155ad215cbf9fbe897a4600e3e25 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 15 Dec 2021 15:50:25 +0100 Subject: [PATCH 38/42] remove 3 dots options in presidential actions as requested by Paulo --- src/app/pages/publications/publications.page.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 2d4f24bca..049292745 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -57,9 +57,9 @@

      {{viagem.Description}}

      {{viagem.Detail}}

      -
      + @@ -93,10 +93,9 @@

      {{evento.Description}}

      -
      - + From add3ecee186eb892a171515a780ef7d5f58cb672 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 16 Dec 2021 15:26:55 +0100 Subject: [PATCH 39/42] change add publication button place on the view --- .../view-publications.page.html | 11 ++++++-- .../view-publications.page.scss | 25 ++++++++++++++++--- src/environments/environment.ts | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) 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 58dbe2f59..656b0aea6 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -11,10 +11,10 @@
      -
      +

    {{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 6091c5695..67e2f016e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.scss +++ b/src/app/shared/publication/view-publications/view-publications.page.scss @@ -164,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/environments/environment.ts b/src/environments/environment.ts index 0b0bd282a..f6b819510 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiURL: 'https://tabularium.dyndns.info/GabineteDigital.Services/V5/api/', + apiURL: 'http://gpr-dev-01.gabinetedigital.local/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/', */ From 1358c6ef9a757d2896a32e7217cbb99af99a462e Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 16 Dec 2021 16:16:44 +0100 Subject: [PATCH 40/42] send message when pressed ENTER in chat --- .../chat/group-messages/group-messages.page.html | 2 +- src/app/shared/chat/messages/messages.page.html | 2 +- .../view-publications/view-publications.page.html | 10 +++------- 3 files changed, 5 insertions(+), 9 deletions(-) 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 a9c145708..b548ea7e6 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -164,7 +164,7 @@
    - + diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 8a18f5964..b3b64ecf4 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -138,7 +138,7 @@
    - + 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 656b0aea6..56d47eab9 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -11,20 +11,16 @@
    - - +
    From b9028cf296fb38ed932a80affe749b55222f20ee Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 16 Dec 2021 19:11:30 +0100 Subject: [PATCH 41/42] add skeleton in presidencial actions --- .../pages/publications/publications.page.html | 96 +++++++++++++++++-- .../pages/publications/publications.page.ts | 7 +- src/assets/icon/icons-actions-grey.svg | 5 + src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- 5 files changed, 100 insertions(+), 12 deletions(-) create mode 100644 src/assets/icon/icons-actions-grey.svg diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 049292745..860ddbca9 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -38,7 +38,7 @@ -
    +
    @@ -57,9 +57,6 @@

    {{viagem.Description}}

    {{viagem.Detail}}

    - @@ -93,9 +90,6 @@

    {{evento.Description}}

    - @@ -113,6 +107,94 @@
    + +
    + + +
    + +
    +
    + +

    +

    +
    +
    + +
    + +
    +
    + +

    +

    +
    +
    + +
    + +
    +
    + +

    +

    +
    +
    + +
    + +
    +
    + +

    +

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

    +
    +
    +
    + +
    + +
    +
    + + +

    +
    +
    +
    + +
    + +
    +
    + + +

    +
    +
    +
    +
    +
    +
    diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index fb589b982..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, @@ -74,6 +75,7 @@ export class PublicationsPage implements OnInit { ) { 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) { 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/environments/environment.prod.ts b/src/environments/environment.prod.ts index 76b20ba47..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://tabularium.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 f6b819510..98e1871b5 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - 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/', */ From 1ea764398140ee94330d306542d88eef4d00d08a Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 17 Dec 2021 09:40:28 +0100 Subject: [PATCH 42/42] show name of user when displaying image, instead of username --- src/app/shared/chat/messages/messages.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 6d8d05816..52a5f4999 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -614,7 +614,7 @@ touchStart(card) { cssClass: 'modal modal-desktop', componentProps: { image: msg.attachments[0].image_url, - username: msg.u.username, + username: msg.u.name, _updatedAt: msg._updatedAt } });