Skip to content

Commit cc5e54d

Browse files
authored
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
2 parents e317ebd + 7947668 commit cc5e54d

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

apps/dashboard/lib/Controller/DashboardController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public function index(): TemplateResponse {
8787
$this->initialState->provideInitialState('panels', $widgets);
8888
$this->initialState->provideInitialState('statuses', $statuses);
8989
$this->initialState->provideInitialState('layout', $userLayout);
90+
$this->initialState->provideInitialState('appStoreEnabled', $this->config->getSystemValueBool('appstoreenabled', true));
9091
$this->initialState->provideInitialState('firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1');
9192
$this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
9293

apps/dashboard/src/DashboardApp.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
</li>
100100
</Draggable>
101101

102-
<a v-if="isAdmin" :href="appStoreUrl" class="button">{{ t('dashboard', 'Get more widgets from the App Store') }}</a>
102+
<a v-if="isAdmin && appStoreEnabled" :href="appStoreUrl" class="button">{{ t('dashboard', 'Get more widgets from the App Store') }}</a>
103103

104104
<div v-if="statuses.weather && isStatusActive('weather')">
105105
<h2>{{ t('dashboard', 'Weather service') }}</h2>
@@ -176,6 +176,7 @@ export default {
176176
layout: loadState('dashboard', 'layout').filter((panelId) => panels[panelId]),
177177
modal: false,
178178
appStoreUrl: generateUrl('/settings/apps/dashboard'),
179+
appStoreEnabled: loadState('dashboard', 'appStoreEnabled', true),
179180
statuses: {},
180181
apiWidgets: [],
181182
apiWidgetItems: {},

dist/dashboard-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dashboard-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)