diff --git a/public/js/components/Dashboard/Admin.js b/public/js/components/Dashboard/Admin.js index 8921400b8..e554dd905 100644 --- a/public/js/components/Dashboard/Admin.js +++ b/public/js/components/Dashboard/Admin.js @@ -33,33 +33,32 @@ export default { methods: { dashboardAdd() { let _name = ''; - BsPrompt.popup('New Dashboard name').then( - name => { - _name = name; + BsPrompt + .popup('New Dashboard name') + .then(dashboard_kurzbz => { const params = { - dashboard_kurzbz: name + dashboard_kurzbz }; return this.$api .call(ApiDashboardBoard.add(params)) - .then(response =>{ + .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); let newDashboard = { dashboard_id: response.data, - dashboard_kurzbz: _name, + dashboard_kurzbz, beschreibung: '' }; this.dashboards.push(newDashboard); this.current = newDashboard.dashboard_id; }) .catch(this.$fhcAlert.handleSystemError); - }); + }); }, dashboardUpdate(dashboard) { - return this.$api + this.$api .call(ApiDashboardBoard.update(dashboard)) .then(response => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); let old = this.dashboards.find(el => el.dashboard_id == dashboard.dashboard_id); @@ -69,10 +68,11 @@ export default { .catch(this.$fhcAlert.handleSystemError); }, dashboardDelete(dashboard_id) { - return this.$api + this.$api .call(ApiDashboardBoard.delete(dashboard_id)) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); + this.current = -1; this.dashboards = this.dashboards.filter(el => el.dashboard_id != dashboard_id); }) @@ -90,37 +90,100 @@ export default { }) .catch(this.$fhcAlert.handleSystemError); }, - template: `
- + template: /* html */` +
- - + - +
-
- +
+
-
- +
+
-
- +
+
diff --git a/public/js/components/Dashboard/Admin/Edit.js b/public/js/components/Dashboard/Admin/Edit.js index c40d91183..aea461f1d 100644 --- a/public/js/components/Dashboard/Admin/Edit.js +++ b/public/js/components/Dashboard/Admin/Edit.js @@ -1,15 +1,15 @@ import BsConfirm from '../../Bootstrap/Confirm.js'; export default { - emits: [ - "change", - "delete" - ], props: { dashboard_id: Number, dashboard_kurzbz: String, beschreibung: String }, + emits: [ + "change", + "delete" + ], data() { return { kurzbz: this.dashboard_kurzbz, @@ -18,22 +18,43 @@ export default { }, methods: { sendDelete() { - BsConfirm.popup(this.$p.t('ui', 'confirm_delete') + " " + this.$p.t('ui', 'deleteInfo')) - .then(() => this.$emit('delete', this.dashboard_id)).catch(); + BsConfirm + .popup(this.$p.t('ui', 'confirm_delete') + " " + this.$p.t('ui', 'deleteInfo')) + .then(() => this.$emit('delete', this.dashboard_id)) + .catch(); } }, - template: `
+ template: /* html */` +
- +
- +
- - + +
` } diff --git a/public/js/components/Dashboard/Admin/Widgets.js b/public/js/components/Dashboard/Admin/Widgets.js index a0c7b2139..ddf0517f9 100644 --- a/public/js/components/Dashboard/Admin/Widgets.js +++ b/public/js/components/Dashboard/Admin/Widgets.js @@ -1,14 +1,14 @@ import ApiDashboardWidget from "../../../api/factory/dashboard/widget.js"; export default { - emits: [ - "change", - "assignWidgets" - ], props: { dashboard_id: Number, widgets: Array }, + emits: [ + "change", + "assignWidgets" + ], methods: { sendChange(widget_id) { let allow = !this.widgets.find(el => el.widget_id == widget_id).allowed; @@ -29,11 +29,27 @@ export default { }) .catch(this.$fhcAlert.handleSystemError); }, - template: ` + template: /* html */`
-
- - +
+ +
` } diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index f9fff9925..d715db15a 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -35,7 +35,7 @@ export default { }, provide() { return { - editMode: Vue.computed(()=>this.editMode), + editMode: Vue.computed(() => this.editMode), widgetsSetup: Vue.computed(() => this.widgetsSetup) } }, @@ -152,13 +152,28 @@ export default { }) .catch(this.$fhcAlert.handleSystemError); }, - template: ` + template: /* html */`

{{ $p.t('global/personalGreeting', [ viewData?.name ]) }} - +

- - + +
` }