From 7c8a901b841878c7d63940baa551f5982958874e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 10 Feb 2022 23:56:05 +0100 Subject: Cleanup admin settings js files * Move admin.js to webpack, so that this use the bundled jquery files instead of the deprecated window.$ Also fixing formatting * Remove log.js that seems to be from a time where logreader was bundled with server and I couldn't find an usage of it anymore * Fix recent regression in rebuild navigation function (now not depending on jquery anymore and bundled by webpack). Signed-off-by: Carl Schwan --- apps/settings/src/mixins/AppManagement.js | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'apps/settings/src/mixins/AppManagement.js') diff --git a/apps/settings/src/mixins/AppManagement.js b/apps/settings/src/mixins/AppManagement.js index 96f2c1dad4a..cf44a37a53f 100644 --- a/apps/settings/src/mixins/AppManagement.js +++ b/apps/settings/src/mixins/AppManagement.js @@ -20,6 +20,9 @@ * */ +import { showError } from '@nextcloud/dialogs' +import rebuildNavigation from '../service/rebuild-navigation.js' + export default { computed: { appGroups() { @@ -109,33 +112,33 @@ export default { }, forceEnable(appId) { this.$store.dispatch('forceEnableApp', { appId, groups: [] }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, enable(appId) { this.$store.dispatch('enableApp', { appId, groups: [] }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, disable(appId) { this.$store.dispatch('disableApp', { appId }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, remove(appId) { this.$store.dispatch('uninstallApp', { appId }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, install(appId) { this.$store.dispatch('enableApp', { appId }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, update(appId) { this.$store.dispatch('updateApp', { appId }) - .then((response) => { OC.Settings.Apps.rebuildNavigation() }) - .catch((error) => { OC.Notification.show(error) }) + .then((response) => { rebuildNavigation() }) + .catch((error) => { showError(error) }) }, }, } -- cgit v1.2.3