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
pull/44562/head
Pytal 2 years ago
committed by GitHub
parent
commit
cc5e54d6e8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      apps/dashboard/lib/Controller/DashboardController.php
  2. 3
      apps/dashboard/src/DashboardApp.vue
  3. 4
      dist/dashboard-main.js
  4. 2
      dist/dashboard-main.js.map

1
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');

3
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: {},

4
dist/dashboard-main.js
File diff suppressed because it is too large
View File

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

Loading…
Cancel
Save