Skip to content

Commit 4bf0d9a

Browse files
committed
fix(dashboard): do not suggest to install new widgets if appstore is disabled
Signed-off-by: Thomas Citharel <[email protected]>
1 parent 6d3b4b0 commit 4bf0d9a

5 files changed

Lines changed: 429 additions & 5 deletions

File tree

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.

0 commit comments

Comments
 (0)