Skip to content

Commit

Permalink
Merge pull request #44506 from nextcloud/dashboard-no-widgets-if-no-a…
Browse files Browse the repository at this point in the history
…ppstore

fix(dashboard): do not suggest to install new widgets if appstore is disabled
  • Loading branch information
Pytal authored Mar 28, 2024
2 parents e317ebd + 7947668 commit cc5e54d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 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.

2 changes: 1 addition & 1 deletion dist/dashboard-main.js.map

Large diffs are not rendered by default.

0 comments on commit cc5e54d

Please sign in to comment.