Browse Source
Add global accessibility switch
Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/42353/head
Louis Chemineau
2 years ago
Failed to extract signature
6 changed files with
20 additions and
7 deletions
-
apps/files/src/views/FilesList.vue
-
config/config.sample.php
-
dist/files-main.js
-
dist/files-main.js.map
-
lib/private/Template/JSConfigHelper.php
-
lib/private/TemplateLayout.php
|
|
@ -63,7 +63,7 @@ |
|
|
|
</template> |
|
|
|
</BreadCrumbs> |
|
|
|
|
|
|
|
<NcButton v-if="filesListWidth >= 512" |
|
|
|
<NcButton v-if="filesListWidth >= 512 && enableGridView" |
|
|
|
:aria-label="gridViewButtonLabel" |
|
|
|
:title="gridViewButtonLabel" |
|
|
|
class="files-list__header-grid-button" |
|
|
@ -132,6 +132,7 @@ import { showError } from '@nextcloud/dialogs' |
|
|
|
import { translate, translatePlural } from '@nextcloud/l10n' |
|
|
|
import { Type } from '@nextcloud/sharing' |
|
|
|
import { UploadPicker } from '@nextcloud/upload' |
|
|
|
import { loadState } from '@nextcloud/initial-state' |
|
|
|
import { defineComponent } from 'vue' |
|
|
|
|
|
|
|
import LinkIcon from 'vue-material-design-icons/Link.vue' |
|
|
@ -193,6 +194,9 @@ export default defineComponent({ |
|
|
|
const uploaderStore = useUploaderStore() |
|
|
|
const userConfigStore = useUserConfigStore() |
|
|
|
const viewConfigStore = useViewConfigStore() |
|
|
|
|
|
|
|
const enableGridView = (loadState('core', 'config', [])['enable_non-accessible_features'] ?? true) |
|
|
|
|
|
|
|
return { |
|
|
|
filesStore, |
|
|
|
pathsStore, |
|
|
@ -200,6 +204,7 @@ export default defineComponent({ |
|
|
|
uploaderStore, |
|
|
|
userConfigStore, |
|
|
|
viewConfigStore, |
|
|
|
enableGridView, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
@ -2405,4 +2405,11 @@ $CONFIG = [ |
|
|
|
* Defaults to ``false`` |
|
|
|
*/ |
|
|
|
'unified_search.enabled' => false, |
|
|
|
|
|
|
|
/** |
|
|
|
* Enable features that are do respect accessibility standards yet. |
|
|
|
* |
|
|
|
* Defaults to ``true`` |
|
|
|
*/ |
|
|
|
'enable_non-accessible_features' => true, |
|
|
|
]; |
|
|
@ -179,7 +179,8 @@ class JSConfigHelper { |
|
|
|
'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)), |
|
|
|
'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0), |
|
|
|
'version' => implode('.', Util::getVersion()), |
|
|
|
'versionstring' => \OC_Util::getVersionString() |
|
|
|
'versionstring' => \OC_Util::getVersionString(), |
|
|
|
'enable_non-accessible_features' => $this->config->getSystemValueBool('enable_non-accessible_features', true), |
|
|
|
]; |
|
|
|
|
|
|
|
$array = [ |
|
|
|
|
|
@ -108,8 +108,8 @@ class TemplateLayout extends \OC_Template { |
|
|
|
|
|
|
|
$this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry()); |
|
|
|
$this->initialState->provideInitialState('core', 'apps', $this->navigationManager->getAll()); |
|
|
|
|
|
|
|
if ($this->config->getSystemValueBool('unified_search.enabled', false)) { |
|
|
|
|
|
|
|
if ($this->config->getSystemValueBool('unified_search.enabled', false) || !$this->config->getSystemValueBool('enable_non-accessible_features', true)) { |
|
|
|
$this->initialState->provideInitialState('unified-search', 'limit-default', (int)$this->config->getAppValue('core', 'unified-search.limit-default', (string)SearchQuery::LIMIT_DEFAULT)); |
|
|
|
$this->initialState->provideInitialState('unified-search', 'min-search-length', (int)$this->config->getAppValue('core', 'unified-search.min-search-length', (string)1)); |
|
|
|
$this->initialState->provideInitialState('unified-search', 'live-search', $this->config->getAppValue('core', 'unified-search.live-search', 'yes') === 'yes'); |
|
|
|