Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Eudes Inácio
2024-03-02 14:36:53 +01:00
24 changed files with 177 additions and 77 deletions
@@ -279,13 +279,13 @@
<div class="container-div width-100"> <div class="container-div width-100">
<div (click)="addParticipantsCC()" class="ion-item-class-2 cursor-pointer"> <div (click)="addParticipantsCC()" class="ion-item-class-2 cursor-pointer">
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div> </div>
<div class="ion-input-class-no-height d-flex"> <div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1"> <div class="list-people flex-grow-1">
<ion-item lines="none"> <ion-item lines="none">
<ion-list> <ion-list>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento*</ion-label> <ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label> <ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list> </ion-list>
</ion-item> </ion-item>
@@ -377,7 +377,7 @@
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()"> <button class="btn-cancel" fill="clear" color="#061b52" (click)="cancel()">
<ion-label>Cancelar</ion-label> <ion-label>Cancelar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
@@ -203,6 +203,10 @@ export class EditEventPage implements OnInit {
this.modalController.dismiss(); this.modalController.dismiss();
} }
cancel() {
this.modalController.dismiss({action:'cancel'});
}
goBack() { goBack() {
this.router.navigate(['/home', this.caller]); this.router.navigate(['/home', this.caller]);
@@ -18,6 +18,7 @@
</div> </div>
<div class="middle d-flex align-center"> <div class="middle d-flex align-center">
<p class="title" style="font-size: 21.1px"><span>{{loadedEvent.Subject}}</span></p> <p class="title" style="font-size: 21.1px"><span>{{loadedEvent.Subject}}</span></p>
<!-- Event details page -->
</div> </div>
<div class="menu-options d-flex"> <div class="menu-options d-flex">
<button class="btn-no-color" (click)="editEvent()"> <button class="btn-no-color" (click)="editEvent()">
@@ -247,6 +247,37 @@ export class ViewEventPage implements OnInit {
} }
loadEvent1() {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.getEvent(this.eventId).subscribe(res => {
res = this.dateService.fixDate(res as any)
this.loadedEvent = res;
this.setTimeZone()
// this.addEventToDb(res);
}, (error) => {
});
} else {
if(this.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
res = this.dateService.fixDate(res as any)
this.loadedEvent = res;
this.setTimeZone()
}, (error) => {
});
}
}
}
deleteYesOrNo() { deleteYesOrNo() {
this.alertController.create({ this.alertController.create({
header: 'Eliminar evento?', header: 'Eliminar evento?',
@@ -364,14 +395,13 @@ export class ViewEventPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
/* this.loadEvent(); */ /* this.loadEvent(); */
this.loadEvent() this.loadEvent1()
}, 250); }, 250);
this.isEventEdited = true; this.isEventEdited = true;
console.log('res', res) console.log('res', res, res.data?.action, 'cancel')
} }
}); });
@@ -399,7 +429,20 @@ export class ViewEventPage implements OnInit {
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
if (res) { if (res.data?.action == 'cancel') {
setTimeout(() => {
/* this.loadEvent(); */
this.loadEvent1()
}, 250);
this.isEventEdited = true;
if(res.data.Attendees?.length >= 1) {
this.loadedEvent.HasAttachments = true
this.getAttachments()
}
console.log('res', res)
} else {
setTimeout(() => { setTimeout(() => {
/* this.loadEvent(); */ /* this.loadEvent(); */
this.loadEvent() this.loadEvent()
@@ -7,6 +7,7 @@
<div style="color: black;"> <div style="color: black;">
Evento Pendente de Aprovação Evento Pendente de Aprovação
</div> </div>
<!-- Events to approve details mobile -->
</div> </div>
</div> </div>
@@ -72,7 +72,7 @@ export class ApproveEventPage implements OnInit {
}); });
window['approve-event-getTask'] = () => { window['approve-event-getTask'] = () => {
this.getTask1() this.getTask()
} }
} }
@@ -281,6 +281,7 @@ export class ApproveEventPage implements OnInit {
}); });
return await popover.present().then(() => { return await popover.present().then(() => {
this.TaskService.loadEventosParaAprovacao() this.TaskService.loadEventosParaAprovacao()
this.getTask();
}, (error) => { }, (error) => {
console.log(error) console.log(error)
}) })
@@ -6,6 +6,7 @@ import { DeviceService } from "src/app/services/device.service"
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { PermissionService } from 'src/app/services/permission.service'; import { PermissionService } from 'src/app/services/permission.service';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({ @Component({
selector: 'app-viewer-attachment', selector: 'app-viewer-attachment',
@@ -33,6 +34,7 @@ export class ViewerAttachmentPage implements OnInit {
private erroHandler: HttpErrorHandle, private erroHandler: HttpErrorHandle,
public p: PermissionService, public p: PermissionService,
private processService: ProcessesService, private processService: ProcessesService,
private HeaderSettingsService: HeaderSettingsService
) { } ) { }
ngOnInit() { ngOnInit() {
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HeaderSettingsService } from './header-settings.service';
describe('HeaderSettingsService', () => {
let service: HeaderSettingsService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HeaderSettingsService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,11 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class HeaderSettingsService {
hideHeader = false
constructor() { }
}
@@ -9,6 +9,7 @@
<div style="color: black;"> <div style="color: black;">
Evento Pendente de Aprovação Evento Pendente de Aprovação
</div> </div>
<!-- List events to approve desktop -->
</div> </div>
@@ -299,7 +299,7 @@
<div class="container-div width-100"> <div class="container-div width-100">
<div class="ion-item-class-2"> <div class="ion-item-class-2">
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div> </div>
<div class="ion-input-class-no-height d-flex cursor-pointer" (click)="addParticipantsCC()"> <div class="ion-input-class-no-height d-flex cursor-pointer" (click)="addParticipantsCC()">
<div class="list-people flex-grow-1"> <div class="list-people flex-grow-1">
@@ -309,7 +309,7 @@
display: grid; display: grid;
"> ">
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Adicionar Intervenientes</ion-label> <ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label> <ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list> </ion-list>
</ion-item> </ion-item>
@@ -12,6 +12,7 @@
.main-header{ .main-header{
font-family: Roboto; font-family: Roboto;
background-color: #fff; background-color: #fff;
min-height: 86px;
overflow:hidden; overflow:hidden;
transform: translate3d(0, 1px, 0); transform: translate3d(0, 1px, 0);
@@ -155,7 +155,7 @@ export class ViewEventPage implements OnInit {
div.innerHTML = res.Body.Text div.innerHTML = res.Body.Text
res.Body.Text = div.innerText */ res.Body.Text = div.innerText */
this.loadedEvent = res; this.loadedEvent = res;
console.log('Event details',res) // console.log('Event details',res)
this.setTimeZone() this.setTimeZone()
this.today = new Date(res.StartDate); this.today = new Date(res.StartDate);
@@ -8,7 +8,7 @@
<ion-header> <ion-header>
<div class="title-content"> <div class="title-content">
<div class="middle"> <div class="middle">
<ion-label class="title">Editar evento por aprovar ccxcxcxc</ion-label> <br> <ion-label class="title">Editar evento por aprovar</ion-label> <br>
<i style="margin-top: -5px; font-size: 15px;" > Campos marcados com * são obrigatórios</i> <i style="margin-top: -5px; font-size: 15px;" > Campos marcados com * são obrigatórios</i>
</div> </div>
@@ -241,13 +241,13 @@
<div class="container-div width-100" > <div class="container-div width-100" >
<div class="ion-item-class-2"> <div class="ion-item-class-2">
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div> </div>
<div class="ion-input-class-no-height d-flex" (click)="addParticipantsCC()"> <div class="ion-input-class-no-height d-flex" (click)="addParticipantsCC()">
<div class="list-people flex-grow-1"> <div class="list-people flex-grow-1">
<ion-item lines="none"> <ion-item lines="none">
<ion-list> <ion-list>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Adicionar Intervenientes</ion-label> <ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label> <ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list> </ion-list>
</ion-item> </ion-item>
@@ -13,7 +13,7 @@
margin-bottom: 20px; margin-bottom: 20px;
font-family: Roboto; font-family: Roboto;
background-color: #fff; background-color: #fff;
min-height: 79px; min-height: 86px;
overflow:hidden; overflow:hidden;
transform: translate3d(0, 1px, 0); transform: translate3d(0, 1px, 0);
@@ -318,7 +318,8 @@ export class EditEventToApproveComponent implements OnInit {
if(document['action'] == 'add') { if(document['action'] == 'add') {
delete document.action delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{ this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
this.toastService._successMessage(); window['approve-event-getTask'] ()
// this.toastService._successMessage();
}, error =>{ }, error =>{
if(error.status == 0) { if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
@@ -330,7 +331,8 @@ export class EditEventToApproveComponent implements OnInit {
} else if(document['action'] == 'delete') { } else if(document['action'] == 'delete') {
delete document.action delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{ this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
this.toastService._successMessage() window['approve-event-getTask'] ()
// this.toastService._successMessage()
}, error =>{ }, error =>{
if(error.status == 0) { if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão') this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
@@ -1,5 +1,5 @@
<ion-header *ngIf="task" class="ion-no-border "> <ion-header *ngIf="task" class="ion-no-border ">
<div *ngIf="dropButton" class="main-header mt-30 px-20"> <div [ngClass]="{'d-item': !dropButton}" class="main-header mt-30 px-20">
<div class="title-content width-100 d-flex justify-space-between align-center"> <div class="title-content width-100 d-flex justify-space-between align-center">
<div class=" btn-dismiss font-30-rem cursor-pointer" (click)="goBack.emit()" defaultHref="#"> <div class=" btn-dismiss font-30-rem cursor-pointer" (click)="goBack.emit()" defaultHref="#">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
@@ -28,7 +28,7 @@
</div> </div>
<div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" > <div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" >
<div *ngIf="dropButton" class="upper-content" > <div [ngClass]="{'d-item': !dropButton}" class="upper-content" >
<div class="content-details"> <div class="content-details">
<div class="mobile-header"> <div class="mobile-header">
<ion-label> <ion-label>
@@ -44,7 +44,7 @@
</ion-label> </ion-label>
</div> </div>
</div> </div>
<div *ngIf="dropButton" class="line mx-20"></div> <div [ngClass]="{'d-item': !dropButton}" class="line mx-20"></div>
<div style=" <div style="
display: flex; display: flex;
@@ -52,7 +52,7 @@
height: 100%; height: 100%;
flex-grow: 1; flex-grow: 1;
" class="overflow-y-auto-desktop"> " class="overflow-y-auto-desktop">
<div class="middle-content" *ngIf="dropButton"> <div class="middle-content" [ngClass]="{'d-item': !dropButton}">
<h5 class="font-17-rem" *ngIf="intervenientes">Intervenientes</h5> <h5 class="font-17-rem" *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding"> <ion-item class="ion-no-margin ion-no-padding">
<ion-label> <ion-label>
@@ -123,12 +123,12 @@
<div style="border-radius: 50px;position: relative;top: 3px;left: 25px;"> <div style="border-radius: 50px;position: relative;top: 3px;left: 25px;">
<ion-row class="timeline-date align-center pr-10 visionMobile-flex" > <ion-row class="timeline-date align-center pr-10 visionMobile-flex" >
<button class="no-color" *ngIf="dropButton" (click)="dropButton=!dropButton" > <button class="no-color" [ngClass]="{'d-item': !dropButton}" (click)="changeDropButton()" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-up.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-up.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-up.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-up.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-up.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-up.svg"></ion-icon>
</button> </button>
<button class="no-color visionMobile-flex" *ngIf="!dropButton" (click)="dropButton=!dropButton"> <button class="no-color visionMobile-flex" *ngIf="!dropButton" (click)="changeDropButton()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-down.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-down.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-down.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-down.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-down.svg" ></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-down.svg" ></ion-icon>
@@ -7,6 +7,7 @@ import { PermissionService } from 'src/app/services/permission.service';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page'; import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page'; import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({ @Component({
selector: 'app-task-details', selector: 'app-task-details',
@@ -33,7 +34,8 @@ export class TaskDetailsPage implements OnInit {
public DeviceService: DeviceService, public DeviceService: DeviceService,
private DocumentViewerOptionService: DocumentViewerOptionService, private DocumentViewerOptionService: DocumentViewerOptionService,
public p: PermissionService, public p: PermissionService,
private modalController: ModalController private modalController: ModalController,
private HeaderSettingsService: HeaderSettingsService
) { ) {
this.DeviceService.isDesktop(); this.DeviceService.isDesktop();
} }
@@ -129,4 +131,8 @@ export class TaskDetailsPage implements OnInit {
await modal.present(); await modal.present();
} }
changeDropButton() {
this.dropButton = !this.dropButton;
this.HeaderSettingsService.hideHeader = !this.dropButton
}
} }
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="header-container header-fix"> <div class="header-container header-fix" [ngClass]="{'d-none-header':HeaderSettingsService.hideHeader}" >
<div class="main-tab pb-10 ion-toolbar header-color"> <div class="main-tab pb-10 ion-toolbar header-color">
<div class="mobile pt-20 d-flex div-top-header justify-space-between"> <div class="mobile pt-20 d-flex div-top-header justify-space-between">
+2
View File
@@ -177,3 +177,5 @@
.tab { .tab {
color: var(--header-tab-text-white); color: var(--header-tab-text-white);
} }
+3 -1
View File
@@ -16,6 +16,7 @@ import { ActiveTabService } from 'src/app/services/active-tab.service';
import { NotificationsService } from 'src/app/services/notifications.service'; import { NotificationsService } from 'src/app/services/notifications.service';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { NotificationHolderService } from 'src/app/store/notification-holder.service'; import { NotificationHolderService } from 'src/app/store/notification-holder.service';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
@@ -59,7 +60,8 @@ export class HeaderPage implements OnInit {
private storageService: StorageService, private storageService: StorageService,
private zone: NgZone, private zone: NgZone,
private attachmentService: AttachmentsService, private attachmentService: AttachmentsService,
public NotificationHolderService: NotificationHolderService public NotificationHolderService: NotificationHolderService,
public HeaderSettingsService: HeaderSettingsService
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
router.events.subscribe((val) => { router.events.subscribe((val) => {
+1 -1
View File
@@ -58,7 +58,7 @@ export const DevDev: Environment = {
despachoLabel2: 'Despachos Presidênciais', despachoLabel2: 'Despachos Presidênciais',
production: false, production: false,
domain: 'gabinetedigital.local', domain: 'gabinetedigital.local',
defaultuser: 'paulo.pinto@gabinetedigital.local', defaultuser: 'dlima@gabinetedigital.local',
defaultuserpwd: 'tabteste@006', defaultuserpwd: 'tabteste@006',
chatOffline: true, chatOffline: true,
presidential: true, presidential: true,
+7
View File
@@ -1716,3 +1716,10 @@ h5, .buttons{
height: 100%; height: 100%;
width: 400px; width: 400px;
} }
@media only screen and (max-width: 1209px){
.d-none-header, .d-item {
display: none !important;
background-color: red;
}
}