From b189ac8cd03bd753156f9409de7aaa5f9d543225 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 20 Nov 2024 10:41:12 +0100 Subject: [PATCH] adapt Notes: Tinymce, textarea, delete bsModal --- public/js/components/Notiz/Notiz.js | 227 +++++++++++++--------------- 1 file changed, 108 insertions(+), 119 deletions(-) diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index b017b830b..5e4632c84 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -217,6 +217,9 @@ export default { visible: this.showVariables.showId, title: this.$p.t('ui', 'extension_id') }); + cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + }); } } ], @@ -260,9 +263,15 @@ export default { }, methods: { actionDeleteNotiz(notiz_id) { - this.loadNotiz(notiz_id).then(() => { - this.$refs.deleteNotizModal.show(); - }); + this.loadNotiz(notiz_id); + + this.$fhcAlert + .confirmDelete() + .then(result => result + ? notiz_id + : Promise.reject({handled: true})) + .then(this.deleteNotiz) + .catch(this.$fhcAlert.handleSystemError); }, actionEditNotiz(notiz_id) { this.loadNotiz(notiz_id).then(() => { @@ -305,7 +314,8 @@ export default { formData.append('data', JSON.stringify(this.notizData)); Object.entries(this.notizData.anhang).forEach(([k, v]) => formData.append(k, v)); - //TODO(Manu) formvalidation: inform not working with tinymce textarea + this.$refs.formNotiz.clearValidation(); + return this.endpoint.addNewNotiz(this.$refs.formNotiz, this.id, formData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); @@ -322,10 +332,8 @@ export default { }, deleteNotiz(notiz_id) { return this.endpoint.deleteNotiz(notiz_id, this.typeId, this.id) - //return this.eost(this.endpoint + 'deleteNotiz/', this.param) .then(result => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); - this.$refs.deleteNotizModal.hide(); this.reload(); this.resetFormData(); }) @@ -358,7 +366,7 @@ export default { formData.append('data', JSON.stringify(this.notizData)); Object.entries(this.notizData.anhang).forEach(([k, v]) => formData.append(k, v)); - //TODO(Manu) formvalidation: inform not working with tinymce textarea + this.$refs.formNotiz.clearValidation(); return this.endpoint.updateNotiz(this.$refs.formNotiz, notiz_id, formData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); @@ -412,7 +420,7 @@ export default { const vm = this; tinymce.init({ - target: this.$refs.editor, //Important: not selector: to enable multiple import of component + target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component //height: 800, //plugins: ['lists'], //toolbar: " blocks | bold italic underline | alignleft aligncenter alignright alignjustify", @@ -500,19 +508,9 @@ export default { }, template: `
+
- - - - - - - + @@ -545,28 +543,41 @@ export default {
- -
- -
+ +
-
- - +
-
- -
-
- + > +
@@ -656,18 +667,6 @@ export default {
- - - - - - -
@@ -680,18 +679,13 @@ export default { :side-menu="false" reload new-btn-show - new-btn-label="Notiz" + :new-btn-label="this.$p.t('global', 'notiz')" @click:new="actionNewNotiz" >
- -

{{$p.t('notiz','notiz_new')}} [{{notizData.typeId}}]

@@ -717,20 +711,29 @@ export default {
- - + > +
- - + +
@@ -835,12 +838,6 @@ export default { >
-
@@ -856,17 +853,6 @@ export default {
- - - - - -
@@ -890,19 +876,29 @@ export default {
- - + +
- - + +
@@ -1008,12 +1004,6 @@ export default { >
-
@@ -1041,7 +1031,7 @@ export default { :side-menu="false" reload new-btn-show - new-btn-label="Notiz" + :new-btn-label="this.$p.t('global', 'notiz')" @click:new="actionNewNotiz" > @@ -1050,17 +1040,6 @@ export default {
- - - - - -