mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Improve message
This commit is contained in:
@@ -63,7 +63,7 @@ export class AddNotePage implements OnInit {
|
|||||||
|
|
||||||
async successMessage(message?: any, callback?) {
|
async successMessage(message?: any, callback?) {
|
||||||
|
|
||||||
var notification = document.createElement('div')
|
let notification = document.createElement('div')
|
||||||
notification.id = 'notification'
|
notification.id = 'notification'
|
||||||
notification.innerHTML = `
|
notification.innerHTML = `
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export class DarParecerPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export class DelegarPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ export class EditEventPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export class EventActionsPopoverPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ export class NewEventPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -479,10 +479,11 @@ export class DespachoPrPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async badRequest(message?: string, callback?) {
|
async badRequest(message?: string, callback?) {
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ export class DespachoPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
+2
-2
@@ -547,7 +547,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
@@ -569,7 +569,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
`
|
`
|
||||||
|
|
||||||
document.body.append(notification)
|
document.body.append(notification)
|
||||||
notification.querySelector('.text').innerHTML = message
|
notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
notification.remove()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|||||||
@@ -24,94 +24,54 @@ export class ToastService {
|
|||||||
|
|
||||||
async successMessage(message?: any, callback?) {
|
async successMessage(message?: any, callback?) {
|
||||||
|
|
||||||
const enterAnimation = (baseEl: any) => {
|
let notification = document.createElement('div')
|
||||||
const backdropAnimation = this.animationController.create()
|
notification.id = 'notification'
|
||||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
notification.innerHTML = `
|
||||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
|
||||||
|
|
||||||
const wrapperAnimation = this.animationController.create()
|
<div class="main-content width-100 pa-20">
|
||||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
<p class="message d-flex align-center">
|
||||||
.keyframes([
|
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||||
{ offset: 0, opacity: '1', right: '-100%' },
|
<p class="text">{{ message }}</p>
|
||||||
{ offset: 1, opacity: '1', right: '0px' }
|
</p>
|
||||||
]);
|
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
return this.animationController.create()
|
document.body.append(notification)
|
||||||
.addElement(baseEl)
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
.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(()=>{
|
setTimeout(()=>{
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
modal.dismiss()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async badRequest(message?: string, callback?) {
|
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()
|
let notification = document.createElement('div')
|
||||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
notification.id = 'notification'
|
||||||
.keyframes([
|
notification.innerHTML = `
|
||||||
{ offset: 0, opacity: '1', right: '-100%' },
|
|
||||||
{ offset: 1, opacity: '1', right: '0px' }
|
|
||||||
]);
|
|
||||||
|
|
||||||
return this.animationController.create()
|
<div class="main-content width-100 pa-20">
|
||||||
.addElement(baseEl)
|
<p class="message d-flex align-center">
|
||||||
.easing('ease-out')
|
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
|
||||||
.duration(500)
|
<p class="text">{{ message }}</p>
|
||||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
</p>
|
||||||
}
|
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
const leaveAnimation = (baseEl: any) => {
|
document.body.append(notification)
|
||||||
return enterAnimation(baseEl).direction('reverse');
|
notification.querySelector('.text').innerHTML = message || 'Processo efetuado'
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
|
||||||
enterAnimation,
|
|
||||||
leaveAnimation,
|
|
||||||
component: BadRequestPage,
|
|
||||||
componentProps: {
|
|
||||||
message: message || 'Processo efetuado' ,
|
|
||||||
},
|
|
||||||
cssClass: 'notification-modal'
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.present()
|
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
modal.dismiss()
|
notification.remove()
|
||||||
},7000)
|
},7000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user