diff --git a/src/app/tiny-mce/tiny-mce.page.html b/src/app/tiny-mce/tiny-mce.page.html index 35b3ff341..23ac9196b 100644 --- a/src/app/tiny-mce/tiny-mce.page.html +++ b/src/app/tiny-mce/tiny-mce.page.html @@ -9,9 +9,9 @@ {{Document.Assunto}} -
+
@@ -26,13 +26,16 @@ apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p" plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', - 'insertdatetime media table paste code help wordcount print' + 'insertdatetime media table paste code help wordcount print autosave' ], + autosave_ask_before_unload: false, + autosave_interval: '30s', toolbar: 'undo redo | formatselect | bold italic backcolor | \ alignleft aligncenter alignright alignjustify | \ bullist numlist outdent indent | removeformat | print | help' }" initialValue='{{content}}' [(ngModel)]="content" - (onSaveContent)="somefunction()" + (onSaveContent)="saveDraft()" + > \ No newline at end of file diff --git a/src/app/tiny-mce/tiny-mce.page.ts b/src/app/tiny-mce/tiny-mce.page.ts index e1ed7be13..2ff61151b 100644 --- a/src/app/tiny-mce/tiny-mce.page.ts +++ b/src/app/tiny-mce/tiny-mce.page.ts @@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { NavParams } from '@ionic/angular'; import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-details-documents-options/event-details-documents-options.page'; import { AlertController, ModalController } from '@ionic/angular'; +import { ProcessesService } from '../services/processes.service'; +import { HttpErrorHandle } from '../services/http-error-handle.service'; @Component({ selector: 'app-tiny-mce', templateUrl: './tiny-mce.page.html', @@ -22,6 +24,8 @@ export class TinyMCEPage implements OnInit { constructor( private navParams: NavParams, private modalController: ModalController, + private processService: ProcessesService, + private erroHandler: HttpErrorHandle ) { this.Document = this.navParams.get('Document') @@ -36,9 +40,23 @@ export class TinyMCEPage implements OnInit { this.modalController.dismiss() } - somefunction() { - console.log(this.content) - } + saveDraft() { + console.log(document) + let objectDraft = { + "status": false, + "description": this.Document.Assunto, + "content": this.content, + "path": this.Document.path, + "ownerId": this.Document.ownerId + } + this.processService.SaveDraftByID(this.Document.DocId, objectDraft).subscribe((res) => [ + this.erroHandler.httpsSucessMessagge('Draft Save'), + this.modalController.dismiss() + ],(error) => { + this.erroHandler.httpStatusHandle(error) + }) + + } async openOptions() { const modal = await this.modalController.create({ diff --git a/src/assets/images/error_circle_warning.png b/src/assets/images/error_circle_warning.png new file mode 100644 index 000000000..a3d952cca Binary files /dev/null and b/src/assets/images/error_circle_warning.png differ diff --git a/version/git-version.ts b/version/git-version.ts index 29c45a8fd..033d55519 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "59928bd49", - "SHA": "59928bd49f0fafaa6a515fc0f33001b0160a5083", + "shortSHA": "451b38f18", + "SHA": "451b38f18d50434a76982f87291ee761607505b2", "branch": "developer-catch-merge", "lastCommitAuthor": "'Eudes InĂ¡cio'", - "lastCommitTime": "'Sun Jul 16 22:17:23 2023 +0100'", - "lastCommitMessage": "pull made", - "lastCommitNumber": "5085", + "lastCommitTime": "'Mon Jul 17 10:52:44 2023 +0100'", + "lastCommitMessage": "Git verson update", + "lastCommitNumber": "5087", "change": "", - "changeStatus": "On branch developer-catch-merge\nYour branch and 'origin/developer-catch-merge' have diverged,\nand have 3 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)", + "changeStatus": "On branch developer-catch-merge\nYour branch and 'origin/developer-catch-merge' have diverged,\nand have 4 and 3 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tnew file: src/assets/images/error_circle_warning.png", "changeAuthor": "eudes.inacio" } \ No newline at end of file