mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Add modal message
This commit is contained in:
@@ -9,7 +9,8 @@ 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 { Event, EventToApproveEdit } from '../../../models/event.model';
|
||||
|
||||
import { BadRequestComponent } from '../../popover/bad-request/bad-request.component';
|
||||
import { SuccessMessageComponent } from '../../popover/success-message/success-message.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
@@ -21,7 +22,6 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
serialNumber: string
|
||||
loadedAttachments: Attachment[]= []
|
||||
|
||||
|
||||
eventProcess = {
|
||||
serialNumber: "",
|
||||
taskStartDate: "",
|
||||
@@ -232,8 +232,6 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
const event: any = {
|
||||
Agenda: this.eventProcess.workflowInstanceDataFields.Agenda,
|
||||
Body: this.eventProcess.workflowInstanceDataFields.Body,
|
||||
@@ -253,16 +251,28 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
ReviewerComments: ''
|
||||
}
|
||||
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe()
|
||||
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
|
||||
this.successMessage()
|
||||
}, error =>{
|
||||
this.badRequest()
|
||||
})
|
||||
|
||||
|
||||
this.loadedAttachments.forEach((document:any)=>{
|
||||
if(document['action'] == 'add') {
|
||||
delete document.action
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{});
|
||||
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
|
||||
//this.successMessage()
|
||||
}, error =>{
|
||||
this.badRequest()
|
||||
});
|
||||
} else if(document['action'] == 'delete') {
|
||||
delete document.action
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{})
|
||||
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
|
||||
//this.successMessage()
|
||||
}, error =>{
|
||||
this.badRequest()
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
@@ -396,4 +406,38 @@ export class EditEventToApproveComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async successMessage() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: SuccessMessageComponent,
|
||||
componentProps: {
|
||||
message: 'hello',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest() {
|
||||
const modal = await this.modalController.create({
|
||||
component: BadRequestComponent,
|
||||
componentProps: {
|
||||
message: 'hello',
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
setTimeout(()=>{
|
||||
modal.dismiss()
|
||||
},1000)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user