Skip to content

Commit

Permalink
fix(dashboard): do not suggest to install new widgets if appstore is …
Browse files Browse the repository at this point in the history
…disabled

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld committed Mar 28, 2024
1 parent e317ebd commit 9ba0168
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 5 deletions.
1 change: 1 addition & 0 deletions apps/dashboard/lib/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function index(): TemplateResponse {
$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');

Expand Down
3 changes: 2 additions & 1 deletion apps/dashboard/src/DashboardApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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: {},
Expand Down
4 changes: 2 additions & 2 deletions dist/dashboard-main.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9ba0168

Please sign in to comment.