- Adicionar intervenientes
+ Adicionar intervenientes
{{participant.Name}}
diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
index 10021e2db..9a0e38226 100644
--- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts
@@ -7,8 +7,6 @@ import { Participant } from 'src/app/models/participant.model';
import { Folder } from 'src/app/models/folder.model';
import { AuthService } from 'src/app/services/auth.service';
import { ProcessesService } from 'src/app/services/processes.service';
-import { AddParticipantsCcModalPage } from '../add-participants-cc-modal/add-participants-cc-modal.page';
-import { AddParticipantsModalPage } from '../add-participants-modal/add-participants-modal.page';
import { environment } from 'src/environments/environment';
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
@@ -20,6 +18,8 @@ import { EventAttachment } from 'src/app/models/attachment.model';
import { User } from 'src/app/models/user.model';
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 { ToastService } from 'src/app/services/toast.service';
+import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
@Component({
selector: 'app-expedient-task-modal',
@@ -76,11 +76,11 @@ export class ExpedientTaskModalPage implements OnInit {
private alertController: AlertService,
private authService: AuthService,
private userAuth: AuthService,
- private animationController: AnimationController) {
-
+ private animationController: AnimationController,
+ private toastService: ToastService,
+ ) {
this.loggeduser = userAuth.ValidatedUser;
-
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task');
@@ -88,6 +88,9 @@ export class ExpedientTaskModalPage implements OnInit {
this.taskType = this.navParams.get('taskAction');
+ //Initialize SubjectTypes Array with the value "Indefinido"
+ this.selectedTypes = ['99999850'];
+
this.postData = new Despacho();
this.participants = this.participants = new Array();
this.dispatchFolder = {
@@ -98,7 +101,7 @@ export class ExpedientTaskModalPage implements OnInit {
SourceType: 'DOC', //FOLDER
SourceId: this.task.workflowInstanceDataFields.DocID, //FolderId
DeadlineType: '',
- SubjectTypes: ['99999844'],
+ SubjectTypes: this.selectedTypes,
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber,
};
@@ -126,6 +129,17 @@ export class ExpedientTaskModalPage implements OnInit {
this.getSubjectType();
}
+ onSelectedTypesChanged(ev:any){
+ console.log(ev);
+ if(ev.length > 1){
+ console.log(ev.filter(data => data != '99999850'));
+ this.selectedTypes = ev.filter(data => data != '99999850');
+ }
+ if(ev.length == 0){
+ this.selectedTypes = ["99999850"];
+ }
+ }
+
close(){
this.router.navigate(['/home/gabinete-digital/expediente']);
this.modalController.dismiss(null);
@@ -191,7 +205,6 @@ export class ExpedientTaskModalPage implements OnInit {
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
AttachmentList: docs,
- //SubjectTypes: [],
}
try {
let action_despacho = {
@@ -205,11 +218,17 @@ export class ExpedientTaskModalPage implements OnInit {
console.log(this.postData);
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
- this.modalController.dismiss(action_despacho);
- //await this.successMessage('Processo efetuado');
+ await this.toastService.successMessage('Processo efetuado', () =>{
+ console.log('Hoje Teste T');
+ this.modalController.dismiss(action_despacho);
+ });
+ /* setInterval(()=>{
+ console.log('Hoje Teste T');
+ this.modalController.dismiss(action_despacho);
+ }, 7000); */
} catch (error) {
- await this.badRequest('Processo não efetuado')
+ await this.toastService.badRequest('Processo não efetuado')
}
console.log('this.taskResult', this.taskResult);
break;
@@ -234,11 +253,14 @@ export class ExpedientTaskModalPage implements OnInit {
"Note": "",
}
}
- this.taskResult = await this.processes.postParecer(this.postData).toPromise();
- this.modalController.dismiss(action_parecer);
- //await this.successMessage('Processo efetuado')
+ //this.taskResult = await this.processes.postParecer(this.postData).toPromise();
+ await this.toastService.successMessage('Processo efetuado');
+ setInterval(()=>{
+ this.modalController.dismiss(action_parecer);
+ }, 7000);
+
} catch (error) {
- await this.badRequest('Processo não efetuado')
+ await this.toastService.badRequest('Processo não efetuado')
}
break;
case '2':
@@ -262,10 +284,11 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
- this.modalController.dismiss(action_deferimento);
- //await this.successMessage('Processo efetuado')
+ await this.toastService.successMessage('Processo efetuado', () =>{
+ this.modalController.dismiss(action_deferimento);
+ });
} catch (error) {
- await this.badRequest('Processo não efetuado')
+ await this.toastService.badRequest('Processo não efetuado')
}
console.log('this.taskResult', this.taskResult);
break;
@@ -299,10 +322,12 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
- this.modalController.dismiss(action_despacho_pr);
- //await this.successMessage('Processo efetuado')
+
+ await this.toastService.successMessage('Processo efetuado', () =>{
+ this.modalController.dismiss(action_despacho_pr);
+ });
} catch (error) {
- await this.badRequest('Processo não efetuado')
+ await this.toastService.badRequest('Processo não efetuado')
}
console.log('this.taskResult', this.taskResult);
break;
@@ -328,10 +353,12 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
- this.modalController.dismiss(action_parecer_pr);
- //await this.successMessage('Processo efetuado')
+
+ await this.toastService.badRequest('Processo efetuado', () =>{
+ this.modalController.dismiss(action_parecer_pr);
+ })
} catch (error) {
- await this.badRequest('Processo não efetuado')
+ await this.toastService.badRequest('Processo não efetuado')
}
break;
}
@@ -346,89 +373,71 @@ export class ExpedientTaskModalPage implements OnInit {
});
}
-
- async addParticipants() {
- /* console.log('HERES'); */
-
- this.adding = "intervenient";
- this.contacts = this.taskParticipants;
-
- if(window.innerWidth <=800){
-
- this.showAttendees=false;
+ async openAttendees() {
+ if(window.innerWidth <= 1024) {
const modal = await this.modalController.create({
- component: AddParticipantsModalPage,
+ component: AttendeesPageModal,
componentProps: {
- eventPersons: this.participants
+ adding: this.adding,
+ taskParticipants: this.taskParticipants,
+ taskParticipantsCc: this.taskParticipantsCc
},
- cssClass: 'add-participants-modal',
+ cssClass: 'attendee modal modal-desktop',
backdropDismiss: false
});
+
await modal.present();
- modal.onDidDismiss().then((res) => {
- this.taskParticipants = res.data;
- let newattendees: EventPerson[] = res['data'];
- if(newattendees!= null){
- newattendees.forEach(newattendee => {
- let att = {
- 'UserEmail': newattendee.EmailAddress,
- 'UserType': 'I',
- };
- if(this.participants == null){
- this.participants = new Array();
- }
- this.participants.push(att);
- });
+
+ modal.onDidDismiss().then((data) => {
+
+ if(data){
+ data = data['data'];
+
+ const newAttendees: EventPerson[] = data['taskParticipants'];
+ const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
+
+ this.setIntervenient(newAttendees);
+ this.setIntervenientCC(newAttendeesCC);
}
- this.postData.UsersSelected = this.participants;
- console.log(this.postData);
});
} else {
- this.showAttendees=true
+ this.showAttendees = true
}
}
+
+ /* setIntervenient(data){
+ this.taskParticipants = data;
+ //this.postData.UsersSelected = data;
+ }
+
+ setIntervenientCC(data){
+ this.taskParticipantsCc = data;
+ } */
+
+
+ async setIntervenient(data) {
+ this.taskParticipants = data;
+ }
+
+ async setIntervenientCC(data) {
+ this.taskParticipantsCc = data;
+ }
+
+ async addParticipants() {
+ this.adding = 'intervenient'
+ this.openAttendees();
+ }
async addParticipantsCc() {
-
this.adding = "CC";
- this.contacts = this.taskParticipantsCc;
-
- if(window.innerWidth <=800){
- this.showAttendees=false;
-
- const modal = await this.modalController.create({
- component: AddParticipantsCcModalPage,
- componentProps: {
- eventPersons: this.participants
- },
- cssClass: 'add-participants-cc-modal',
- backdropDismiss: false
- });
- await modal.present();
- modal.onDidDismiss().then((res) => {
- this.taskParticipantsCc = res.data;
- let newattendees: EventPerson[] = res['data'];
- if(newattendees!= null){
- newattendees.forEach(newattendee => {
- let att = {
- 'UserEmail': newattendee.EmailAddress,
- 'UserType': 'CC',
- };
- if(this.participants == null){
- this.participants = new Array();
- }
- this.participants.push(att);
- });
- }
- this.postData.UsersSelected = this.participants;
- console.log(this.postData);
- });
- } else {
- this.showAttendees=true
- }
+ this.openAttendees();
+ }
+ dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
+ this.taskParticipants = taskParticipants;
+ this.taskParticipantsCc = taskParticipantsCc;
}
async distartExpedientModal() {
@@ -464,13 +473,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
- async setIntervenient(data) {
- this.taskParticipants = data;
- }
- async setIntervenientCC(data) {
- this.taskParticipantsCc = data;
- }
async closeComponent() {
this.showAttendees = false;
@@ -530,94 +533,47 @@ export class ExpedientTaskModalPage implements OnInit {
async successMessage(message?: any, callback?) {
- const enterAnimation = (baseEl: any) => {
- const backdropAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('ion-backdrop')!)
- .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
+ var notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
- const wrapperAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('.modal-wrapper')!)
- .keyframes([
- { offset: 0, opacity: '1', right: '-100%' },
- { offset: 1, opacity: '1', right: '0px' }
- ]);
+
+
+
+
{{ message }}
+
+
+
+ `
- 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
+ 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' }
- ]);
+ var notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
+
+
+
+
{{ message }}
+
+
+
+ `
- 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 efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
+ notification.remove()
},7000)
+
}
}
\ No newline at end of file
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 afa3def5c..8e2063760 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
@@ -56,7 +56,7 @@ export class ExpedienteDetailPage implements OnInit {
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
- private animationController: AnimationController
+ private animationController: AnimationController,
) {
this.activateRoute.paramMap.subscribe(params => {
@@ -120,14 +120,14 @@ export class ExpedienteDetailPage implements OnInit {
});
}
- sendExpedienteToPending(){
+ sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
- this.successMessage('Processo enviado para pendentes')
+ this.toastService.successMessage('Processo enviado para pendentes')
this.goBack();
},
(error)=>{
- this.badRequest('Processo não enviado para pendentes')
+ this.toastService.badRequest('Processo não enviado para pendentes')
});
}
@@ -266,10 +266,10 @@ export class ExpedienteDetailPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
- this.successMessage('Processo descartado');
+ this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
- this.badRequest('Processo não descartado')
+ this.toastService.badRequest('Processo não descartado')
}
}
@@ -281,10 +281,10 @@ export class ExpedienteDetailPage implements OnInit {
if(res['data']== 'Yes'){
try {
await this.processes.CompleteTask(body).toPromise();
- this.successMessage('Processo descartado');
+ this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
- this.badRequest('Processo não descartado')
+ this.toastService.badRequest('Processo não descartado')
}
this.goBack();
}
@@ -292,10 +292,10 @@ export class ExpedienteDetailPage implements OnInit {
console.log('Update');
try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
- this.successMessage();
+ this.toastService.successMessage();
this.goBack();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
}
@@ -361,52 +361,7 @@ export class ExpedienteDetailPage implements OnInit {
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.scss b/src/app/pages/gabinete-digital/expediente/expediente.page.scss
index d05e043cd..e015a7eb4 100644
--- a/src/app/pages/gabinete-digital/expediente/expediente.page.scss
+++ b/src/app/pages/gabinete-digital/expediente/expediente.page.scss
@@ -34,7 +34,6 @@
//DIV
ion-item{
- border: 1px solid blue;
margin: 0 !important;
padding: 0 !important;
--background: none;
diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
index 94327f159..f3bef7308 100644
--- a/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
+++ b/src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts
@@ -21,6 +21,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.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 { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-expediente-pr',
@@ -56,6 +57,7 @@ export class ExpedientePrPage implements OnInit {
private activatedRoute: ActivatedRoute,
private userAuth: AuthService,
private animationController: AnimationController,
+ private toastService: ToastService,
) {
this.loggeduser = userAuth.ValidatedUser;
@@ -102,11 +104,11 @@ export class ExpedientePrPage implements OnInit {
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
- this.successMessage('Processo enviado para pendentes')
+ this.toastService.successMessage('Processo enviado para pendentes')
this.goBack();
},
(error)=>{
- this.badRequest('Processo não enviado para pendentes')
+ this.toastService.badRequest('Processo não enviado para pendentes')
});
}
@@ -201,9 +203,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage('Processo aprovado')
+ this.toastService.successMessage('Processo aprovado')
} catch(error) {
- this.badRequest('Processo não aprovado')
+ this.toastService.badRequest('Processo não aprovado')
}
}
@@ -221,9 +223,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch(error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -329,9 +331,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise();
- this.successMessage('Processo descartado')
+ this.toastService.successMessage('Processo descartado')
} catch (error) {
- this.badRequest('Processo não descartado')
+ this.toastService.badRequest('Processo não descartado')
}
@@ -345,10 +347,10 @@ export class ExpedientePrPage implements OnInit {
try {
//await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.goBack();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -360,9 +362,9 @@ export class ExpedientePrPage implements OnInit {
try {
await this.processes.UpdateTaskStatus(this.task.FolderId);
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -440,52 +442,7 @@ export class ExpedientePrPage implements OnInit {
return await popover.present();
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
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 d3b28cdd0..e947f2181 100644
--- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts
+++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts
@@ -24,6 +24,7 @@ import { AuthService } from 'src/app/services/auth.service';
import { User } from 'src/app/models/user.model';
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 { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-pedido',
@@ -56,7 +57,8 @@ export class PedidoPage implements OnInit {
private alertService: AlertService,
public popoverController: PopoverController,
authService: AuthService,
- private animationController: AnimationController) {
+ private animationController: AnimationController,
+ private toastService: ToastService,) {
this.loggeduser = authService.ValidatedUser;
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
@@ -199,10 +201,10 @@ export class PedidoPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -221,10 +223,10 @@ export class PedidoPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage('Processo arquivado')
+ this.toastService.successMessage('Processo arquivado')
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -418,52 +420,7 @@ export class PedidoPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts
index 61caa66f5..e6d604414 100644
--- a/src/app/pages/login/login.page.ts
+++ b/src/app/pages/login/login.page.ts
@@ -50,6 +50,7 @@ export class LoginPage implements OnInit {
public alertController: AlertController,
private modalController: ModalController,
private animationController: AnimationController,
+
//private fcm: FCM
) {
@@ -186,10 +187,10 @@ export class LoginPage implements OnInit {
const encrypted = crypto.SHA1(code)
if( encrypted == localStorage.getItem('PIN')) {
- //this.successMessage()
+ //this.toastService.successMessage()
this.router.navigate(['/home/events']);
} else {
- this.badRequest('Pin incorreto')
+ this.toastService.badRequest('Pin incorreto')
this.code = []
}
@@ -206,52 +207,7 @@ export class LoginPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
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 0def7afd9..74e1a0924 100644
--- a/src/app/pages/publications/new-action/new-action.page.ts
+++ b/src/app/pages/publications/new-action/new-action.page.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController } from '@ionic/angular';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
+import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
@@ -19,6 +20,7 @@ export class NewActionPage implements OnInit {
private modalController: ModalController,
private publication: PublicationsService,
private animationController: AnimationController,
+ private toastService: ToastService
) {
this.folder = new PublicationFolder();
@@ -45,10 +47,10 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise()
- this.successMessage("Ação presidencial criado")
+ this.toastService.successMessage("Ação presidencial criado")
this.close();
} catch (error) {
- this.badRequest("Ação presidencial não criado")
+ this.toastService.badRequest("Ação presidencial não criado")
}
}
@@ -56,96 +58,8 @@ export class NewActionPage implements OnInit {
this.modalController.dismiss();
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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 realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts
index 0d4a520af..70f9891df 100644
--- a/src/app/pages/publications/publication-detail/publication-detail.page.ts
+++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
import { Publication } from 'src/app/models/publication';
import { PublicationsService } from 'src/app/services/publications.service';
+import { ToastService } from 'src/app/services/toast.service';
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 { ImageModalPage } from '../gallery/image-modal/image-modal.page';
@@ -23,7 +24,8 @@ export class PublicationDetailPage implements OnInit {
private modalController: ModalController,
private navParams:NavParams,
private publications:PublicationsService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService
) {
this.publicationId = this.navParams.get('publicationId');
/* this.folderId = this.navParams.get('folderIdId'); */
@@ -83,10 +85,10 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
- this.successMessage('Publicação eliminado')
+ this.toastService.successMessage('Publicação eliminado')
this.close();
} catch (error) {
- this.badRequest('Publicação não eliminado')
+ this.toastService.badRequest('Publicação não eliminado')
}
}
@@ -122,95 +124,7 @@ export class PublicationDetailPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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 realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
index cced89669..423a66043 100644
--- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
+++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
import { Publication } from 'src/app/models/publication';
import { PublicationsService } from 'src/app/services/publications.service';
+import { ToastService } from 'src/app/services/toast.service';
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 { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
@@ -22,7 +23,8 @@ export class PublicationDetailPage implements OnInit {
private modalController: ModalController,
private navParams:NavParams,
private publications:PublicationsService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService,
) {
this.publicationId = this.navParams.get('publicationId');
this.folderId = this.navParams.get('folderId');
@@ -83,13 +85,13 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
- this.successMessage('Publicaçao eliminado')
+ this.toastService.successMessage('Publicaçao eliminado')
this.close();
//this.goBackToViewPublications.emit();
} catch (error) {
- this.badRequest('Publicaçao não eliminado')
+ this.toastService.badRequest('Publicaçao não eliminado')
}
}
@@ -124,96 +126,8 @@ export class PublicationDetailPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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: 'Processo não realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/app/services/toast.service.ts b/src/app/services/toast.service.ts
index 04b4726e4..4260275e8 100644
--- a/src/app/services/toast.service.ts
+++ b/src/app/services/toast.service.ts
@@ -24,94 +24,54 @@ export class ToastService {
async successMessage(message?: any, callback?) {
- const enterAnimation = (baseEl: any) => {
- const backdropAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('ion-backdrop')!)
- .fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
+ let notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
- const wrapperAnimation = this.animationController.create()
- .addElement(baseEl.querySelector('.modal-wrapper')!)
- .keyframes([
- { offset: 0, opacity: '1', right: '-100%' },
- { offset: 1, opacity: '1', right: '0px' }
- ]);
+
+
+
+
{{ message }}
+
+
+
+ `
- 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
setTimeout(()=>{
if (callback) {
callback()
}
- modal.dismiss()
+ 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' }
- ]);
+ let notification = document.createElement('div')
+ notification.id = 'notification'
+ notification.innerHTML = `
- return this.animationController.create()
- .addElement(baseEl)
- .easing('ease-out')
- .duration(500)
- .addAnimation([backdropAnimation, wrapperAnimation]);
- }
+
+
+
+
{{ message }}
+
+
+
+ `
- const leaveAnimation = (baseEl: any) => {
- return enterAnimation(baseEl).direction('reverse');
- }
-
-
- const modal = await this.modalController.create({
- enterAnimation,
- leaveAnimation,
- component: BadRequestPage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
+ document.body.append(notification)
+ notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
setTimeout(()=>{
if (callback) {
callback()
}
- modal.dismiss()
+ notification.remove()
},7000)
+
}
}
diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts
index 321717fb4..20a45e21a 100644
--- a/src/app/shared/agenda/approve-event/approve-event.page.ts
+++ b/src/app/shared/agenda/approve-event/approve-event.page.ts
@@ -11,6 +11,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { EditEventToApproveComponent } from '../../gabinete-digital/edit-event-to-approve/edit-event.page';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
@@ -47,7 +48,8 @@ export class ApproveEventPage implements OnInit {
private menu: MenuController,
private alertService: AlertService,
private iab: InAppBrowser,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService
) {
// $$$
@@ -88,9 +90,9 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.modalController.dismiss(serialNumber);
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
/* this.approveEventDismiss.emit({
@@ -112,7 +114,7 @@ export class ApproveEventPage implements OnInit {
await this.openEmendMessageModal(serialNumber);
this.modalController.dismiss(null);
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -126,9 +128,9 @@ export class ApproveEventPage implements OnInit {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
- this.successMessage('Evento rejeitado')
+ this.toastService.successMessage('Evento rejeitado')
} catch (error) {
- this.badRequest('Evento não rejeitado')
+ this.toastService.badRequest('Evento não rejeitado')
}
}
@@ -180,7 +182,7 @@ export class ApproveEventPage implements OnInit {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
- "ReviewerUseComment": res.data,
+ "ReviewUserComment": res.data,
}
}
console.log(body);
@@ -189,9 +191,9 @@ export class ApproveEventPage implements OnInit {
await this.processes.PostTaskAction(body).toPromise()
//this.router.navigate(['/home/gabinete-digital/event-list']);
this.goToEventsToApprove();
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -236,52 +238,7 @@ export class ApproveEventPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
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 df0c2ec93..a12e0824b 100644
--- a/src/app/shared/agenda/new-event/new-event.page.ts
+++ b/src/app/shared/agenda/new-event/new-event.page.ts
@@ -11,6 +11,7 @@ import { SearchDocument } from "src/app/models/search-document";
import { EventAttachment } from 'src/app/models/attachment.model';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
@@ -49,6 +50,7 @@ export class NewEventPage implements OnInit {
private eventService: EventsService,
private attachmentsService: AttachmentsService,
private animationController: AnimationController,
+ private toastService: ToastService
) {}
@@ -206,11 +208,11 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
- this.successMessage('Evento criado')
+ this.toastService.successMessage('Evento criado')
},
error => {
- this.badRequest('Evento não criado')
+ this.toastService.badRequest('Evento não criado')
});
}
else if(this.profile=='pr') {
@@ -247,7 +249,7 @@ export class NewEventPage implements OnInit {
this.afterSave();
}
- this.successMessage('Evento criado')
+ this.toastService.successMessage('Evento criado')
});
}
}
@@ -315,97 +317,9 @@ export class NewEventPage implements OnInit {
window['temp.path:/home/agenda/new-event.component.ts'] = {}
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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 realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts b/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts
index 384a9efd2..b1c0e4fea 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts
+++ b/src/app/shared/event/attendee-modal/attendee-modal-routing.module.ts
@@ -1,12 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
-import { AttendeeModalPage } from './attendee-modal.page';
+import { AttendeePage } from './attendee-modal.page';
const routes: Routes = [
{
path: '',
- component: AttendeeModalPage
+ component: AttendeePage
}
];
diff --git a/src/app/shared/event/attendee-modal/attendee-modal.module.ts b/src/app/shared/event/attendee-modal/attendee-modal.module.ts
index bc1113349..f8fc059de 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal.module.ts
+++ b/src/app/shared/event/attendee-modal/attendee-modal.module.ts
@@ -6,7 +6,7 @@ import { IonicModule } from '@ionic/angular';
import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module';
-import { AttendeeModalPage } from './attendee-modal.page';
+import { AttendeePage } from './attendee-modal.page';
@NgModule({
imports: [
@@ -15,7 +15,7 @@ import { AttendeeModalPage } from './attendee-modal.page';
IonicModule,
AttendeeModalPageRoutingModule
],
- declarations: [AttendeeModalPage],
- exports: [AttendeeModalPage]
+ declarations: [AttendeePage],
+ exports: [AttendeePage]
})
export class AttendeeModalPageModule {}
diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.html b/src/app/shared/event/attendee-modal/attendee-modal.page.html
index d0f026983..97b1d4b7b 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal.page.html
+++ b/src/app/shared/event/attendee-modal/attendee-modal.page.html
@@ -1,6 +1,7 @@
Adicionar intervenientes
+ Agenda Desktop
diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts
index f247abe63..47eefcadd 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts
+++ b/src/app/shared/event/attendee-modal/attendee-modal.page.spec.ts
@@ -1,19 +1,19 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
-import { AttendeeModalPage } from './attendee-modal.page';
+import { AttendeePage } from './attendee-modal.page';
-describe('AttendeeModalPage', () => {
- let component: AttendeeModalPage;
- let fixture: ComponentFixture;
+describe('AttendeePage', () => {
+ let component: AttendeePage;
+ let fixture: ComponentFixture;
beforeEach(async(() => {
TestBed.configureTestingModule({
- declarations: [ AttendeeModalPage ],
+ declarations: [ AttendeePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
- fixture = TestBed.createComponent(AttendeeModalPage);
+ fixture = TestBed.createComponent(AttendeePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
diff --git a/src/app/shared/event/attendee-modal/attendee-modal.page.ts b/src/app/shared/event/attendee-modal/attendee-modal.page.ts
index 418700419..e6011df58 100644
--- a/src/app/shared/event/attendee-modal/attendee-modal.page.ts
+++ b/src/app/shared/event/attendee-modal/attendee-modal.page.ts
@@ -8,7 +8,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
templateUrl: './attendee-modal.page.html',
styleUrls: ['./attendee-modal.page.scss'],
})
-export class AttendeeModalPage implements OnInit {
+export class AttendeePage implements OnInit {
// Defined by the API
contacts: EventPerson[];
@@ -118,7 +118,7 @@ export class AttendeeModalPage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
- const result1 = this.LtaskParticipants.find((contact, index)=>{
+ const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
@@ -127,7 +127,7 @@ export class AttendeeModalPage implements OnInit {
});
// if to show
- if(undefined != result1){
+ if(undefined != result){
return false;
}
diff --git a/src/app/shared/event/attendees/attendees-routing.module.ts b/src/app/shared/event/attendees/attendees-routing.module.ts
deleted file mode 100644
index 9f8738216..000000000
--- a/src/app/shared/event/attendees/attendees-routing.module.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
-import { AttendeesPage } from './attendees.page';
-
-const routes: Routes = [];
-
-@NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule],
-})
-export class AttendeesPageRoutingModule {}
diff --git a/src/app/shared/event/attendees/attendees.module.ts b/src/app/shared/event/attendees/attendees.module.ts
deleted file mode 100644
index 36e9da0d5..000000000
--- a/src/app/shared/event/attendees/attendees.module.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-
-import { IonicModule } from '@ionic/angular';
-
-import { AttendeesPageRoutingModule } from './attendees-routing.module';
-
-import { AttendeesPage } from './attendees.page';
-
-@NgModule({
- imports: [
- CommonModule,
- FormsModule,
- IonicModule,
- AttendeesPageRoutingModule
- ],
- declarations: [AttendeesPage],
- exports: [AttendeesPage]
-})
-export class AttendeesPageModule {}
diff --git a/src/app/shared/event/attendees/attendees.page.html b/src/app/shared/event/attendees/attendees.page.html
deleted file mode 100644
index 4a71dcbc8..000000000
--- a/src/app/shared/event/attendees/attendees.page.html
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
- Participantes
-
-
-
-
- Intervenientes
-
-
- Com Conhecimento
-
-
-
-
-
-
-
- Adicionar participantes
-
-
-
-
-
-
- Apagar
-
-
-
-
- {{ attendee.Name }}
- {{ attendee.EmailAddress }}
-
-
-
-
-
-
-
-
-
-
-
-
- Cancelar
-
-
-
-
-
-
- OK
-
-
-
-
-
\ No newline at end of file
diff --git a/src/app/shared/event/attendees/attendees.page.scss b/src/app/shared/event/attendees/attendees.page.scss
deleted file mode 100644
index 853c08fcf..000000000
--- a/src/app/shared/event/attendees/attendees.page.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-
-ion-item{
- border-bottom:1px solid #ccc;
-}
diff --git a/src/app/shared/event/attendees/attendees.page.spec.ts b/src/app/shared/event/attendees/attendees.page.spec.ts
deleted file mode 100644
index d2cb216ae..000000000
--- a/src/app/shared/event/attendees/attendees.page.spec.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { AttendeesPage } from './attendees.page';
-
-describe('AttendeesPage', () => {
- let component: AttendeesPage;
- let fixture: ComponentFixture;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [ AttendeesPage ],
- imports: [IonicModule.forRoot()]
- }).compileComponents();
-
- fixture = TestBed.createComponent(AttendeesPage);
- component = fixture.componentInstance;
- fixture.detectChanges();
- }));
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/src/app/shared/event/attendees/attendees.page.ts b/src/app/shared/event/attendees/attendees.page.ts
deleted file mode 100644
index 64a8dce6d..000000000
--- a/src/app/shared/event/attendees/attendees.page.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { EventPerson } from 'src/app/models/eventperson.model';
-import { EventsService } from 'src/app/services/events.service';
-import { ModalController, NavController } from '@ionic/angular';
-// import { AttendeeModalPage } from '../attendee-modal/attendee-modal.page';
-
-@Component({
- selector: 'app-attendees',
- templateUrl: './attendees.page.html',
- styleUrls: ['./attendees.page.scss'],
-})
-export class AttendeesPage implements OnInit {
-
-
- segment:string = "true";
- shouldShowCancel:boolean = true;
-
- searchCountryString = ''; // initialize your searchCountryString string empty
-
- @Output() openAttendeeModal = new EventEmitter();
- @Output() openAddEvent = new EventEmitter();
- @Input() eventAttendees: EventPerson[];
- @Output() GoBackEditOrAdd = new EventEmitter();
-
-
- constructor(private eventService: EventsService, private modalCtrl: ModalController,
- private navCtrl: NavController) {
- }
-
-
- ngOnInit() {
- }
-
- save(){
- this.GoBackEditOrAdd.emit();
- //this.openAddEvent.emit();
- // this.modalCtrl.dismiss(this.eventAttendees);
- }
-
- close(){
- this.GoBackEditOrAdd.emit();
- // this.modalCtrl.dismiss(null);
- //this.openAddEvent.emit();
- }
-
- removeAttendee(attendee: EventPerson)
- {
- let index: number = this.eventAttendees.findIndex((att) => {
- return att.EmailAddress == attendee.EmailAddress
- });
-
- this.eventAttendees.splice(index, 1);
- }
-
- async addAttendees() {
-
- console.log('Event Intervenient');
- this.openAttendeeModal.emit();
-
- /* const modal = await this.modalCtrl.create({
- component: AttendeeModalPage,
- componentProps: {
- eventPersons: this.eventAttendees
- },
- cssClass: 'attendee-modal',
- backdropDismiss: false
- });
-
- await modal.present();
-
- modal.onDidDismiss().then((data) => {
- let newattendees: EventPerson[] = data['data'];
-
- if (newattendees != null)
- {
- newattendees.forEach(newattendee => {
- let att = {
- "EmailAddress": newattendee.EmailAddress,
- "Name": newattendee.Name,
- "IsRequired": (this.segment == "true")
- };
- if (this.eventAttendees == null)
- {
- this.eventAttendees = new Array();
- }
- this.eventAttendees.push(att);
- });
- }
- }); */
-
- }
-
-}
\ No newline at end of file
diff --git a/src/app/shared/fingerprint/fingerprint.page.ts b/src/app/shared/fingerprint/fingerprint.page.ts
index d1997b19e..356cf0a65 100644
--- a/src/app/shared/fingerprint/fingerprint.page.ts
+++ b/src/app/shared/fingerprint/fingerprint.page.ts
@@ -59,12 +59,12 @@ export class FingerprintPage implements OnInit {
// })
// .then((FingerPrintHash: any) => {
- // this.successMessage()
+ // this.toastService.successMessage()
// localStorage.setItem('FingerPrintHash', FingerPrintHash)
// })
// .catch((error: any) => {
- // this.badRequest()
+ // this.toastService.badRequest()
// });
}
diff --git a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
index c55082221..dd027d5b5 100644
--- a/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
+++ b/src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts
@@ -3,11 +3,12 @@ import { AlertController, AnimationController, ModalController, NavParams } from
import { Attachment } from 'src/app/models/attachment.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchDocument } from 'src/app/models/search-document';
-import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
+import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { ProcessesService } from 'src/app/services/processes.service';
+import { ToastService } from 'src/app/services/toast.service';
import { Event, EventToApproveEdit } from '../../../models/event.model';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
@@ -140,7 +141,8 @@ export class EditEventToApproveComponent implements OnInit {
public alertController: AlertController,
private attachmentsService: AttachmentsService,
private processes:ProcessesService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService,
) {
this.serialNumber = this.navParams.get('serialNumber');
@@ -253,9 +255,9 @@ export class EditEventToApproveComponent implements OnInit {
}
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
- this.successMessage('Evento editado')
+ this.toastService.successMessage('Evento editado');
}, error =>{
- this.badRequest('Evento não editado')
+ this.toastService.badRequest('Evento não editado');
})
@@ -263,16 +265,16 @@ export class EditEventToApproveComponent implements OnInit {
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
- //this.successMessage()
+ this.toastService.successMessage();
}, error =>{
- this.badRequest()
+ this.toastService.badRequest();
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
- //this.successMessage()
+ this.toastService.successMessage()
}, error =>{
- this.badRequest()
+ this.toastService.badRequest()
})
}
@@ -287,7 +289,7 @@ export class EditEventToApproveComponent implements OnInit {
if(window.innerWidth <= 1024) {
const modal = await this.modalController.create({
- component: AttendeesPage,
+ component: AttendeesPageModal,
componentProps: {
adding: this.adding,
taskParticipants: this.taskParticipants,
@@ -407,96 +409,4 @@ export class EditEventToApproveComponent implements OnInit {
});
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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 efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
-
}
\ No newline at end of file
diff --git a/src/app/shared/pin/pin.page.ts b/src/app/shared/pin/pin.page.ts
index 0646d4796..1dcae286e 100644
--- a/src/app/shared/pin/pin.page.ts
+++ b/src/app/shared/pin/pin.page.ts
@@ -3,6 +3,7 @@ import { AnimationController, ModalController } from '@ionic/angular';
import { BadRequestPage } from '../popover/bad-request/bad-request.page';
import { SuccessMessagePage } from '../popover/success-message/success-message.page';
import crypto from 'crypto-js'
+import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-pin',
templateUrl: './pin.page.html',
@@ -12,7 +13,8 @@ export class PinPage implements OnInit {
code = []
constructor( private modalController: ModalController,
- private animationController: AnimationController) { }
+ private animationController: AnimationController,
+ private toastService: ToastService) { }
ngOnInit() {
}
@@ -41,7 +43,7 @@ export class PinPage implements OnInit {
if(this.code.length == 4) {
this.close()
- //this.successMessage()
+ //this.toastService.successMessage()
const code = this.code.join('')
const encrypted = crypto.SHA1(code)
@@ -49,94 +51,13 @@ export class PinPage implements OnInit {
localStorage.setItem('PIN', encrypted)
} else {
- this.badRequest()
+ this.toastService.badRequest()
}
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
- modal.present()
-
- modal.dismiss()
-
- }
-
- 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 efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- this.close()
- modal.dismiss()
- },3000)
- }
}
\ No newline at end of file
diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts
index 827cdc242..5dd759f56 100644
--- a/src/app/shared/popover/deploma-options/deploma-options.page.ts
+++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts
@@ -4,6 +4,7 @@ import { AnimationController, ModalController, PopoverController } from '@ionic/
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { ProcessesService } from 'src/app/services/processes.service';
+import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from '../bad-request/bad-request.page';
import { SuccessMessagePage } from '../success-message/success-message.page';
@@ -25,7 +26,8 @@ export class DeplomaOptionsPage implements OnInit {
private modalController: ModalController,
private activatedRoute: ActivatedRoute,
private processes: ProcessesService,
- private animationController: AnimationController) {
+ private animationController: AnimationController,
+ private toastService: ToastService) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
@@ -99,9 +101,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -138,9 +140,9 @@ export class DeplomaOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html
index 5158a629c..1ef3745fc 100644
--- a/src/app/shared/popover/despachos-options/despachos-options.page.html
+++ b/src/app/shared/popover/despachos-options/despachos-options.page.html
@@ -8,7 +8,16 @@
+
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts
index fac026cb2..8d0d743e0 100644
--- a/src/app/shared/popover/despachos-options/despachos-options.page.ts
+++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts
@@ -5,7 +5,7 @@ import { EventsService } from 'src/app/services/events.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { formatDate } from '@angular/common';
-import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
+import { AnimationController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { momentG } from 'src/plugin/momentG'
@@ -17,6 +17,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
@@ -42,7 +43,14 @@ export class DespachosOptionsPage implements OnInit {
private alertService: AlertService,
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
- private animationController: AnimationController) { }
+ private animationController: AnimationController,
+ private navParams: NavParams,
+ private toastService: ToastService) {
+
+ this.task = this.navParams.get('task')
+ this.fulltask = this.navParams.get('fulltask')
+
+ }
ngOnInit() {
@@ -175,10 +183,10 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -202,9 +210,7 @@ export class DespachosOptionsPage implements OnInit {
modal.onDidDismiss().then(res => {
console.log(res);
- if(res.data){
-
-
+ if(res.data) {
const DocumentToSave = res.data.documents.map((e) => {
return {
@@ -238,7 +244,7 @@ export class DespachosOptionsPage implements OnInit {
});
}
- async arquivar(note:string, documents:any){
+ async arquivar(note:string, documents:any) {
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
@@ -250,10 +256,10 @@ export class DespachosOptionsPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage('Processo arquivado')
+ this.toastService.successMessage('Processo arquivado')
this.close();
} catch (error) {
- this.badRequest('Processo não arquivado')
+ this.toastService.badRequest('Processo não arquivado')
}
}
@@ -273,60 +279,15 @@ export class DespachosOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch(error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const modal = await this.modalController.create({
@@ -361,22 +322,24 @@ export class DespachosOptionsPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
goBack() {
+
let navigationExtras: NavigationExtras = {
queryParams: {
- "despachospr": true,
+ // "despachospr": true,
}
- };
- this.router.navigate(['/home/gabinete-digital'], navigationExtras);
+ }
+
+ this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
// window.history.back()
}
diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts
index fd4e0b524..3d6cc62e0 100644
--- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts
+++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts
@@ -17,6 +17,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
@@ -43,7 +44,8 @@ export class DespachosPrOptionsPage implements OnInit {
private alertService: AlertService,
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
- private animationController: AnimationController) { }
+ private animationController: AnimationController,
+ private toastService: ToastService) { }
ngOnInit() {
@@ -176,10 +178,10 @@ export class DespachosPrOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -251,10 +253,10 @@ export class DespachosPrOptionsPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage('Processo arquivado')
+ this.toastService.successMessage('Processo arquivado')
this.close();
} catch (error) {
- this.badRequest('Processo não arquivado')
+ this.toastService.badRequest('Processo não arquivado')
}
}
@@ -274,60 +276,15 @@ export class DespachosPrOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch(error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const modal = await this.modalController.create({
@@ -362,10 +319,10 @@ export class DespachosPrOptionsPage implements OnInit {
}
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.close();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
index 4608d15dd..141bf24f5 100644
--- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
+++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts
@@ -11,6 +11,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
import { AuthService } from 'src/app/services/auth.service';
import { EventsService } from 'src/app/services/events.service';
import { ProcessesService } from 'src/app/services/processes.service';
+import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from '../bad-request/bad-request.page';
import { SuccessMessagePage } from '../success-message/success-message.page';
@@ -43,7 +44,8 @@ export class OptsExpedientePrPage implements OnInit {
private userAuth: AuthService,
private navParams: NavParams,
private animationController: AnimationController,
- private router: Router
+ private router: Router,
+ private toastService: ToastService
) {
@@ -122,9 +124,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch(error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -148,11 +150,11 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
this.goBack();
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -169,9 +171,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
@@ -198,9 +200,9 @@ export class OptsExpedientePrPage implements OnInit {
try {
await this.processes.CompleteTask(body);
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch(error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -289,52 +291,7 @@ export class OptsExpedientePrPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const modal = await this.modalController.create({
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 65f5c9507..b838e0723 100644
--- a/src/app/shared/popover/request-options/request-options.page.ts
+++ b/src/app/shared/popover/request-options/request-options.page.ts
@@ -8,6 +8,7 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
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 { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
@@ -31,7 +32,8 @@ export class RequestOptionsPage implements OnInit {
private navParams: NavParams,
private processes: ProcessesService,
private activatedRoute: ActivatedRoute,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService
) {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -166,9 +168,9 @@ export class RequestOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage()
+ this.toastService.successMessage()
} catch (error) {
- this.badRequest()
+ this.toastService.badRequest()
}
}
@@ -232,9 +234,9 @@ export class RequestOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
- this.successMessage('Processo arquivado')
+ this.toastService.successMessage('Processo arquivado')
} catch (error) {
- this.badRequest('Processo não arquivado')
+ this.toastService.badRequest('Processo não arquivado')
}
@@ -285,52 +287,7 @@ export class RequestOptionsPage implements OnInit {
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
-
- }
async badRequest(message?: string, callback?) {
const enterAnimation = (baseEl: any) => {
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 3c982c133..530df12c8 100644
--- a/src/app/shared/publication/new-action/new-action.page.ts
+++ b/src/app/shared/publication/new-action/new-action.page.ts
@@ -2,6 +2,7 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { AnimationController, ModalController } from '@ionic/angular';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
+import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
@@ -20,7 +21,8 @@ export class NewActionPage implements OnInit {
constructor(
private modalController: ModalController,
private publication: PublicationsService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService
) {
this.folder = new PublicationFolder();
}
@@ -47,9 +49,9 @@ export class NewActionPage implements OnInit {
try {
await this.publication.CreatePublicationFolder(this.folder).toPromise()
this.close();
- this.successMessage('Publicação criado')
+ this.toastService.successMessage('Publicação criado')
} catch (error) {
- this.badRequest('Publicação não criado')
+ this.toastService.badRequest('Publicação não criado')
}
}
@@ -59,96 +61,8 @@ export class NewActionPage implements OnInit {
}
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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: 'Processo não realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
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 b09b55bee..2d82d4b0d 100644
--- a/src/app/shared/publication/new-publication/new-publication.page.ts
+++ b/src/app/shared/publication/new-publication/new-publication.page.ts
@@ -18,6 +18,7 @@ import { ViewPublicationsPage } from '../view-publications/view-publications.pag
import { LoadingService } from 'src/app/services/loading.service';
import { BadRequestPage } from '../../popover/bad-request/bad-request.page';
import { SuccessMessagePage} from '../../popover/success-message/success-message.page';
+import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-new-publication',
@@ -57,7 +58,8 @@ export class NewPublicationPage implements OnInit {
public photoService: PhotoService,
private publications: PublicationsService,
private camera: Camera,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService,
) {
this.publicationTitle = 'Nova Publicação';
}
@@ -159,11 +161,11 @@ export class NewPublicationPage implements OnInit {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
- this.successMessage("Publicação criado")
+ this.toastService.successMessage("Publicação criado")
this.goBack();
} catch (error) {
- this.badRequest("Publicação não criado")
+ this.toastService.badRequest("Publicação não criado")
}
}
@@ -183,11 +185,11 @@ export class NewPublicationPage implements OnInit {
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
- this.successMessage("Publicação criado")
+ this.toastService.successMessage("Publicação criado")
this.goBack();
} catch (error) {
- this.badRequest("Publicação não criado")
+ this.toastService.badRequest("Publicação não criado")
}
}
@@ -209,11 +211,11 @@ export class NewPublicationPage implements OnInit {
try {
console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
- this.successMessage("Publicação criado")
+ this.toastService.successMessage("Publicação criado")
this.goBackToViewPublications.emit();
} catch (error) {
- this.badRequest("Publicação não criado")
+ this.toastService.badRequest("Publicação não criado")
}
}
@@ -275,96 +277,8 @@ export class NewPublicationPage implements OnInit {
} */
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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: 'Processo não realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts
index e6dbee632..47260d6fc 100644
--- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts
+++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts
@@ -4,6 +4,7 @@ import { Publication } from 'src/app/models/publication';
import { ImageModalPage } from 'src/app/pages/publications/gallery/image-modal/image-modal.page';
import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';
import { PublicationsService } from 'src/app/services/publications.service';
+import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
@@ -26,7 +27,8 @@ export class PublicationDetailPage implements OnInit {
constructor(
private modalController: ModalController,
private publications:PublicationsService,
- private animationController: AnimationController
+ private animationController: AnimationController,
+ private toastService: ToastService,
) {
/* this.folderId = this.navParams.get('folderIdId'); */
@@ -88,10 +90,10 @@ export class PublicationDetailPage implements OnInit {
try {
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
- this.successMessage("Publicação eliminado")
+ this.toastService.successMessage("Publicação eliminado")
this.goBackToViewPublications.emit();
} catch (error) {
- this.badRequest("Publicação não eliminado")
+ this.toastService.badRequest("Publicação não eliminado")
}
}
@@ -141,96 +143,8 @@ export class PublicationDetailPage implements OnInit {
- async successMessage(message?: any, 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: SuccessMessagePage,
- componentProps: {
- message: message || 'Processo efetuado' ,
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },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: 'Processo não realizado com sucesso',
- },
- cssClass: 'notification-modal'
- });
-
- modal.present()
-
- setTimeout(()=>{
- if (callback) {
- callback()
- }
- modal.dismiss()
- },7000)
- }
}
diff --git a/src/global.scss b/src/global.scss
index 9428fbef0..4a4c6ce11 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -632,7 +632,8 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent-
// center
app-approve-event ion-content .main-content,
-app-view-event ion-content .main-content{
+app-view-event ion-content .main-content,
+app-expediente-pr .main-content{
max-width: 1366px !important;
margin: 0px auto !important;
}
@@ -751,79 +752,48 @@ ion-icon{
}
-
-
-
-
-@media only screen and (min-width: 300px) {
+@media only screen and (max-width: 500px) {
::-webkit-scrollbar {
- width: 5px;
- height: 5px;
- }
-
- /* Track */
- ::-webkit-scrollbar-track {
- background: #f1f1f1;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- }
-
- /* Handle */
- ::-webkit-scrollbar-thumb {
- background: #888;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- }
-
- /* Handle on hover */
- ::-webkit-scrollbar-thumb:hover {
- background: rgb(92, 92, 92);
+ width: 5px !important;
+ height: 5px !important;
}
}
-@media only screen and (min-width: 800px) {
+::-webkit-scrollbar {
+ width: 10px;
+ height: 10px;
+}
+
+/* Track */
+::-webkit-scrollbar-track {
+background: #f1f1f1;
+border-radius: 5px;
+-webkit-border-radius: 5px;
+-moz-border-radius: 5px;
+-ms-border-radius: 5px;
+-o-border-radius: 5px;
+}
- ::-webkit-scrollbar {
- width: 10px;
- height: 10px;
- }
-
- /* Track */
- ::-webkit-scrollbar-track {
- background: #f1f1f1;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- }
-
- /* Handle */
- ::-webkit-scrollbar-thumb {
- background: #888;
- border-radius: 5px;
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- }
-
- /* Handle on hover */
- ::-webkit-scrollbar-thumb:hover {
- background: rgb(92, 92, 92);
- }
+/* Handle */
+::-webkit-scrollbar-thumb {
+background: #888;
+border-radius: 5px;
+-webkit-border-radius: 5px;
+-moz-border-radius: 5px;
+-ms-border-radius: 5px;
+-o-border-radius: 5px;
+}
+
+/* Handle on hover */
+::-webkit-scrollbar-thumb:hover {
+background: rgb(92, 92, 92);
}
+// ===================================
.hide-scroll::-webkit-scrollbar {
display: none !important;
}
@@ -842,3 +812,39 @@ ion-icon{
.hide-scroll::-webkit-scrollbar-thumb:hover {
display: none !important;
}
+
+
+
+#notification{
+ position: absolute;
+ top: 23px;
+ right: 0px;
+ height: 87px;
+ max-width: 400px;
+ border-radius: 9px;
+ -webkit-border-radius: 9px;
+ -moz-border-radius: 9px;
+ -ms-border-radius: 9px;
+ -o-border-radius: 9px;
+ background-color: white;
+ text-align: center;
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ background-image: url("/assets/background/background-circle-negative.svg");
+ background-size: 686px 674px;
+ background-position: center;
+ background-position-y: 0px;
+ background-repeat: no-repeat;
+ min-width: 340px;
+ box-shadow: 0px 2px 10px #0000003d;
+ display: flex;
+ align-items: center;
+ .main-content {
+ display: flex;
+ align-items: center;
+ }
+ .message {
+ font-size: 12pt;
+ }
+}
\ No newline at end of file