improve edition of draft

This commit is contained in:
Eudes Inácio
2023-07-10 12:38:41 +01:00
parent 9676bab7eb
commit c69ea92c91
11 changed files with 124 additions and 33 deletions
@@ -1,6 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ModalController, NavParams } from '@ionic/angular';
import { error } from 'console';
import { PermissionService } from 'src/app/services/permission.service';
import { ProcessesService} from 'src/app/services/processes.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-event-details-documents-options',
@@ -9,12 +12,23 @@ import { PermissionService } from 'src/app/services/permission.service';
})
export class EventDetailsDocumentsOptionsPage implements OnInit {
Document: any
content: any = "";
constructor(
public p: PermissionService,
private modalController: ModalController,
) {}
private navParams: NavParams,
private processService: ProcessesService,
private erroHandler: HttpErrorHandle
) {
this.Document = this.navParams.get('Document')
this.content = this.navParams.get('content')
}
ngOnInit() {}
ngOnInit() {
console.log(this.content)
}
close() {
this.modalController.dismiss();
@@ -25,13 +39,51 @@ export class EventDetailsDocumentsOptionsPage implements OnInit {
}
async openBookMeetingModal() {
this.modalController.dismiss({component:'openBookMeetingModal', taskAction: ''});
this.modalController.dismiss({ component: 'openBookMeetingModal', taskAction: '' });
}
async openExpedientActionsModal( taskAction: any) {
this.modalController.dismiss({component:'openExpedientActionsModal', taskAction});
async openExpedientActionsModal(taskAction: any) {
this.modalController.dismiss({ component: 'openExpedientActionsModal', taskAction });
}
async distartExpedientModal(body:any) {}
async distartExpedientModal(body: any) { }
save(document,content) {
console.log(document)
let objectDraft = {
"status": true,
"description": document.Assunto,
"content": content,
"path": document.path,
"ownerId": document.ownerId
}
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => [
this.erroHandler.httpsSucessMessagge('Draft Save'),
this.modalController.dismiss()
],(error) => {
this.erroHandler.httpStatusHandle(error)
})
this.modalController.dismiss();
}
saveDraft(document, content) {
console.log(document)
let objectDraft = {
"status": false,
"description": document.Assunto,
"content": content,
"path": document.path,
"ownerId": document.ownerId
}
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => [
this.erroHandler.httpsSucessMessagge('Draft Save'),
this.modalController.dismiss()
],(error) => {
this.erroHandler.httpStatusHandle(error)
})
}
}