Browse Source

Merge pull request #44506 from nextcloud/dashboard-no-widgets-if-no-appstore

fix(dashboard): do not suggest to install new widgets if appstore is disabled
Pytal 1 month ago
parent
commit
cc5e54d6e8

+ 1 - 0
apps/dashboard/lib/Controller/DashboardController.php

@@ -87,6 +87,7 @@ class DashboardController extends Controller {
 		$this->initialState->provideInitialState('panels', $widgets);
 		$this->initialState->provideInitialState('statuses', $statuses);
 		$this->initialState->provideInitialState('layout', $userLayout);
+		$this->initialState->provideInitialState('appStoreEnabled', $this->config->getSystemValueBool('appstoreenabled', true));
 		$this->initialState->provideInitialState('firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1');
 		$this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
 

+ 2 - 1
apps/dashboard/src/DashboardApp.vue

@@ -99,7 +99,7 @@
 					</li>
 				</Draggable>
 
-				<a v-if="isAdmin" :href="appStoreUrl" class="button">{{ t('dashboard', 'Get more widgets from the App Store') }}</a>
+				<a v-if="isAdmin && appStoreEnabled" :href="appStoreUrl" class="button">{{ t('dashboard', 'Get more widgets from the App Store') }}</a>
 
 				<div v-if="statuses.weather && isStatusActive('weather')">
 					<h2>{{ t('dashboard', 'Weather service') }}</h2>
@@ -176,6 +176,7 @@ export default {
 			layout: loadState('dashboard', 'layout').filter((panelId) => panels[panelId]),
 			modal: false,
 			appStoreUrl: generateUrl('/settings/apps/dashboard'),
+			appStoreEnabled: loadState('dashboard', 'appStoreEnabled', true),
 			statuses: {},
 			apiWidgets: [],
 			apiWidgetItems: {},

File diff suppressed because it is too large
+ 0 - 0
dist/dashboard-main.js


File diff suppressed because it is too large
+ 0 - 0
dist/dashboard-main.js.map


Some files were not shown because too many files changed in this diff