Merge branch 'developer' into developer_mobilefirst

This commit is contained in:
Eudes Inácio
2021-06-21 09:12:56 +01:00
15 changed files with 255 additions and 190 deletions
-10
View File
@@ -187,16 +187,6 @@ const routes: Routes = [
path:':folderId/:publicationId', path:':folderId/:publicationId',
loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule) loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule)
}, },
{
path:'publication-detail',
children: [
{
path: ':id',
loadChildren: ()=> import('../pages/publications/view-publications/publication-detail/publication-detail.module').then(m => m.PublicationDetailPageModule)
},
]
},
] ]
}, },
{ {
@@ -197,11 +197,10 @@ export class CreateProcessPage implements OnInit {
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log('this.postData', this.postData, this.taskType); console.log('this.postData', this.postData, this.taskType);
try { try {
await this.processes.postDespatcho(this.postData).toPromise(); await this.processes.postDespatcho(this.postData).toPromise();
this.FinalizarDespacho(); this.FinalizarDespacho();
this.toastService.successMessage('Despacho criado');
} catch (error) { } catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
} }
@@ -221,8 +220,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postParecer(this.postData).toPromise(); await this.processes.postParecer(this.postData).toPromise();
this.FinalizarParecer(); this.FinalizarParecer('Pedido de Parecer criado');
this.toastService.successMessage('Pedido de Parecer criado');
} }
catch (error) { catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
@@ -242,8 +240,7 @@ export class CreateProcessPage implements OnInit {
try { try {
await this.processes.postDeferimento(this.postData).toPromise(); await this.processes.postDeferimento(this.postData).toPromise();
this.executado(); this.executado('Pedido de Deferimento criado');
this.toastService.successMessage('Pedido de Deferimento criado');
} }
catch (error) { catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
@@ -270,11 +267,10 @@ export class CreateProcessPage implements OnInit {
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log('this.postData', this.postData, this.taskType); console.log('this.postData', this.postData, this.taskType);
try { try {
await this.processes.postDespatcho(this.postData).toPromise(); await this.processes.postDespatcho(this.postData).toPromise();
this.executado(); this.executado('Despacho criado');
this.toastService.successMessage('Despacho criado');
} catch (error) { } catch (error) {
this.toastService.badRequest('Processo não efectuado'); this.toastService.badRequest('Processo não efectuado');
} }
@@ -329,23 +325,13 @@ export class CreateProcessPage implements OnInit {
} }
async executado() { async executado(message?) {
let body = {
"serialNumber": this.task.serialNumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": '',
},
"AttachmentList" :null,
}
await this.processes.CompleteTask(body).toPromise();
}
async FinalizarDespacho() { let body;
if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho'){ if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho') {
let body = {
body = {
"serialNumber": this.task.serialNumber, "serialNumber": this.task.serialNumber,
"action": "Conhecimento", "action": "Conhecimento",
"ActionTypeId": 104, "ActionTypeId": 104,
@@ -354,10 +340,10 @@ export class CreateProcessPage implements OnInit {
}, },
"AttachmentList" :null, "AttachmentList" :null,
} }
await this.processes.CompleteTask(body).toPromise();
} }
else if(this.task.activityInstanceName =='Concluir Despacho'){ else if(this.task.activityInstanceName =='Concluir Despacho' || this.task.activityInstanceName == 'Concluir Parecer') {
let body = {
body = {
"serialNumber": this.task.serialNumber, "serialNumber": this.task.serialNumber,
"action": "Despacho", "action": "Despacho",
"ActionTypeId": 94, "ActionTypeId": 94,
@@ -366,11 +352,57 @@ export class CreateProcessPage implements OnInit {
}, },
"AttachmentList" :null, "AttachmentList" :null,
} }
}
try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
} }
} }
async FinalizarParecer() { async FinalizarDespacho() {
let body;
if(this.task.activityInstanceName =='Tarefa de Despacho' || this.task.activityInstanceName =='Reexecutar Despacho') {
body = {
"serialNumber": this.task.serialNumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": '',
},
"AttachmentList" :null,
}
}
else if(this.task.activityInstanceName =='Concluir Despacho' || this.task.activityInstanceName == 'Concluir Parecer') {
body = {
"serialNumber": this.task.serialNumber,
"action": "Despacho",
"ActionTypeId": 94,
"dataFields": {
"ReviewUserComment": '',
},
"AttachmentList" :null,
}
}
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('');
} catch (error) {
this.toastService.badRequest('Processo não efectuado');
}
}
async FinalizarParecer(message?) {
let body = { let body = {
"serialNumber": this.task.serialNumber, "serialNumber": this.task.serialNumber,
"action": "Parecer", "action": "Parecer",
@@ -380,7 +412,15 @@ export class CreateProcessPage implements OnInit {
}, },
"AttachmentList" :null, "AttachmentList" :null,
} }
await this.processes.CompleteTask(body).toPromise();
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage(message)
} catch (e) {
this.toastService.badRequest()
}
} }
async addParticipants() { async addParticipants() {
@@ -399,7 +439,7 @@ export class CreateProcessPage implements OnInit {
taskParticipants: this.taskParticipants, taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc taskParticipantsCc: this.taskParticipantsCc
}, },
cssClass: 'attendee', cssClass: 'modal attendee',
backdropDismiss: false backdropDismiss: false
}); });
@@ -417,8 +457,6 @@ export class CreateProcessPage implements OnInit {
this.setIntervenientCC(newAttendeesCC); this.setIntervenientCC(newAttendeesCC);
} }
}); });
} else { } else {
this.showAttendees=true this.showAttendees=true
} }
@@ -561,73 +599,4 @@ export class CreateProcessPage implements OnInit {
}); });
} }
async successMessage(message?: any, callback?) {
var notification = document.createElement('div')
notification.id = 'notification'
notification.innerHTML = `
<div class="main-content width-100 pa-20">
<p class="message d-flex align-center">
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
<p class="text">{{ message }}</p>
</p>
</div>
`
document.body.append(notification)
notification.querySelector('.text').innerHTML = message
setTimeout(()=>{
notification.remove()
},7000)
}
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
const wrapperAnimation = this.animationController.create()
.addElement(baseEl.querySelector('.modal-wrapper')!)
.keyframes([
{ offset: 0, opacity: '1', right: '-100%' },
{ offset: 1, opacity: '1', right: '0px' }
]);
return this.animationController.create()
.addElement(baseEl)
.easing('ease-out')
.duration(500)
.addAnimation([backdropAnimation, wrapperAnimation]);
}
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: BadRequestPage,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'notification-modal'
});
modal.present()
setTimeout(()=>{
if (callback) {
callback()
}
modal.dismiss()
},7000)
}
} }
+49 -30
View File
@@ -14,6 +14,7 @@ import { AlertService } from 'src/app/services/alert.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
@Component({ @Component({
selector: 'app-delegar', selector: 'app-delegar',
@@ -82,7 +83,10 @@ export class DelegarPage implements OnInit {
} }
async saveTask() { async saveTask() {
if(this.taskParticipants.length > 1){ if(this.taskParticipants.length < 1){
this.toastService.badRequest("Selecione um destinatário");
}
else if(this.taskParticipants.length > 1){
this.toastService.badRequest("Selecione apenas um destinatário"); this.toastService.badRequest("Selecione apenas um destinatário");
} }
else { else {
@@ -98,6 +102,7 @@ export class DelegarPage implements OnInit {
this.processes.DelegateTask(body).subscribe(res=>{ this.processes.DelegateTask(body).subscribe(res=>{
console.log(res); console.log(res);
this.toastService.successMessage('Processo delegado') this.toastService.successMessage('Processo delegado')
this.close();
}, },
(error)=>{ (error)=>{
this.toastService.badRequest("Processo não delegado") this.toastService.badRequest("Processo não delegado")
@@ -105,46 +110,60 @@ export class DelegarPage implements OnInit {
} }
} }
async addParticipants(){ async addParticipants() {
console.log('HERE');
this.adding = "intervenient"; this.adding = "intervenient";
if(window.innerWidth <= 800){ if(window.innerWidth <=800) {
this.showAttendees=false;
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: AddParticipantsModalPage, component: AttendeesPageModal,
componentProps: { componentProps: {
eventPersons: this.eventAttendees adding: this.adding,
taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc
}, },
cssClass: 'book-meeting-modal', cssClass: 'modal attendee',
backdropDismiss: false backdropDismiss: false
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((data) => {
/* this.taskParticipants = res.data; if(data) {
let newattendees: EventPerson[] = res['data']; data = data['data'];
if(newattendees != null){ const newAttendees: EventPerson[] = data['taskParticipants'];
newattendees.forEach(newattendee => { const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
let att = { this.setIntervenient(newAttendees);
"EmailAddress": newattendee.EmailAddress, this.setIntervenientCC(newAttendeesCC);
"Name": newattendee.Name, }
"IsRequired": true
};
if(this.eventAttendees == null){
this.eventAttendees = null;
}
this.eventAttendees = att;
console.log(att);
});
} */
}); });
} else { } else {
this.showAttendees = true; this.showAttendees=true
} }
} }
async setContact(data:EventPerson[]) {
if(this.adding == "intervenient"){
this.taskParticipants = data;
} else if (this.adding == "CC") {
this.taskParticipantsCc = data;
}
}
async setIntervenient(data) {
this.taskParticipants = data;
}
async setIntervenientCC(data) {
this.taskParticipantsCc = data;
}
async closeComponent() {
this.showAttendees = false;
}
async distartExpedientModal(){ async distartExpedientModal(){
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DiscartExpedientModalPage, component: DiscartExpedientModalPage,
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="content d-flex flex-column width-100"> <div class="content d-flex flex-column width-100">
<div class="header-content pb-20"> <div class="header-content pb-20">
<div class="header-title"> <div class="header-title">
<label>Delegar</label> <label>Reencaminhar</label>
</div> </div>
</div> </div>
<div class="overflow-y-auto"> <div class="overflow-y-auto">
@@ -1,11 +1,12 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { NavigationExtras, Router } from '@angular/router';
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { EmendMessageModalPage } from '../emend-message-modal/emend-message-modal.page';
@Component({ @Component({
selector: 'app-event-actions-popover', selector: 'app-event-actions-popover',
@@ -38,7 +39,17 @@ export class EventActionsPopoverPage implements OnInit {
goBack(){ goBack(){
this.closePopover(); this.closePopover();
if (window.innerWidth <= 801) {
this.router.navigate(['/home/gabinete-digital/event-list']); this.router.navigate(['/home/gabinete-digital/event-list']);
} else {
let navigationExtras: NavigationExtras = {
queryParams: {
'eventos': true
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
} }
closePopover(){ closePopover(){
@@ -58,16 +69,44 @@ export class EventActionsPopoverPage implements OnInit {
} }
} }
emendarTask() { async emendarTask() {
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" } console.log('Mobile');
console.log(body);
try { const modal = await this.modalController.create({
this.processes.PostTaskAction(body).toPromise(); component: EmendMessageModalPage,
this.toastService.successMessage(); componentProps:{
this.goBack(); },
} catch (error) { cssClass: 'emend-message-modal',
this.toastService.badRequest() backdropDismiss: false
} });
await modal.present();
modal.onDidDismiss()
.then( async (res) => {
console.log(res.data);
if(res.data !== ''){
let body = { "serialNumber": this.serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
console.log(body);
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage('Pedido enviado');
this.goBack();
} catch (error) {
this.toastService.badRequest();
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
} }
async rejeitar(){ async rejeitar(){
@@ -85,13 +85,16 @@ export class DespachoPrPage implements OnInit {
} }
goBack(){ goBack(){
let navigationExtras: NavigationExtras = { if (window.innerWidth <= 800) {
queryParams: { this.router.navigate(['/home/gabinete-digital/despachos-pr']);
"despachospr": true, } else {
} let navigationExtras: NavigationExtras = {
}; queryParams: {
this.router.navigate(['/home/gabinete-digital'], navigationExtras); "despachospr": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
} }
@@ -90,15 +90,17 @@ export class DespachoPage implements OnInit {
goBack() { goBack() {
// window.history.back() // window.history.back()
let navigationExtras: NavigationExtras = { if (window.innerWidth <= 800) {
queryParams: { this.router.navigate(['/home/gabinete-digital/despachos']);
// "serialNumber": serialNumber, } else {
//'despachos': true let navigationExtras: NavigationExtras = {
queryParams: {
'despachos': true
}
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
} }
@@ -56,13 +56,17 @@ export class DiplomaAssinarPage implements OnInit {
} }
goBack() { goBack() {
let navigationExtras: NavigationExtras = { if (window.innerWidth <= 800) {
queryParams: { this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
"diplomas": true, } else {
let navigationExtras: NavigationExtras = {
queryParams: {
"diplomasassinar": true,
}
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
async openOptions(taskAction?: any) { async openOptions(taskAction?: any) {
@@ -57,14 +57,16 @@ export class DiplomaPage implements OnInit {
} }
goBack() { goBack() {
if (window.innerWidth <= 800) {
let navigationExtras: NavigationExtras = { this.router.navigate(['/home/gabinete-digital/diplomas']);
queryParams: { } else {
"diplomas": true, let navigationExtras: NavigationExtras = {
queryParams: {
"diplomas": true,
}
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
} }
@@ -14,11 +14,11 @@
<ion-footer> <ion-footer>
<ion-toolbar class="width-100 d-flex justify-space-between px-20"> <ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start"> <ion-buttons slot="start">
<button class="btn-delete" shape="round" (click)="close()">Não</button> <button class="btn-delete" shape="round" (click)="save()">Sim</button>
</ion-buttons> </ion-buttons>
<ion-title></ion-title> <ion-title></ion-title>
<ion-buttons slot="end"> <ion-buttons slot="end">
<button class="btn-ok" shape="round" (click)="save()">Sim</button> <button class="btn-ok" shape="round" (click)="close()">Não</button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-footer> </ion-footer>
@@ -115,9 +115,47 @@ export class ApproveEventPage implements OnInit {
}); */ }); */
} }
emendTask(serialNumber:string){ async emendTask(serialNumber:string){
this.openEmendMessageModal(serialNumber); console.log('Desktop');
this.goBack();
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss()
.then( async (res) => {
console.log(res.data);
if(res.data !== ''){
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
console.log(body);
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage('Pedido enviado');
this.goBack();
} catch (error) {
this.toastService.badRequest();
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
//this.openEmendMessageModal(serialNumber);
//this.goBack();
} }
async rejeitar(serialNumber:string){ async rejeitar(serialNumber:string){
@@ -186,12 +186,12 @@ export class GabineteDigitalPage implements OnInit {
case params["diplomas"]: case params["diplomas"]:
this.openDiplomasPage(''); this.openDiplomasPage('');
this.selectedElement='DiplomasPorAssinar' this.selectedElement='DiplomasPorAssinar';
break; break;
case params["diplomasassinar"]: case params["diplomasassinar"]:
this.openDiplomasPage(''); this.openDiplomasPage('');
this.selectedElement='DiplomasAssinar' this.selectedElement='DiplomasAssinar';
break; break;
} }
}); });
@@ -243,7 +243,7 @@ export class PedidoPage implements OnInit {
} }
} }
sendExpedienteToPending(){ sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res); console.log(res);
this.goBack(); this.goBack();
+2
View File
@@ -69,6 +69,8 @@ export class ToastService {
</div> </div>
` `
notification.style.animationName = 'notification-top'
document.body.append(notification) document.body.append(notification)
notification.querySelector('.text').innerHTML = message || 'Processo não efetuado' notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
setTimeout(()=>{ setTimeout(()=>{
+2 -5
View File
@@ -817,7 +817,6 @@ background: rgb(92, 92, 92);
top: 23px; top: 23px;
right: 0px; right: 0px;
height: 87px; height: 87px;
max-width: 400px;
border-radius: 9px; border-radius: 9px;
-webkit-border-radius: 9px; -webkit-border-radius: 9px;
-moz-border-radius: 9px; -moz-border-radius: 9px;
@@ -835,9 +834,7 @@ background: rgb(92, 92, 92);
background-repeat: no-repeat; background-repeat: no-repeat;
min-width: 340px; min-width: 340px;
box-shadow: 0px 2px 10px #0000003d; box-shadow: 0px 2px 10px #0000003d;
display: flex; animation-name: notification;
align-items: center;
animation-name: example;
animation-duration: 1s; animation-duration: 1s;
animation-timing-function: ease-in; animation-timing-function: ease-in;
transition: 1s; transition: 1s;
@@ -891,7 +888,7 @@ background: rgb(92, 92, 92);
} }
@keyframes example { @keyframes notification {
from {right: -100%;} from {right: -100%;}
to {right: 0px;} to {right: 0px;}
} }