Add global accessibility switch

Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/42353/head
Louis Chemineau 1 year ago
parent bfee3167b3
commit a39b3a3d84
No known key found for this signature in database
  1. 7
      apps/files/src/views/FilesList.vue
  2. 7
      config/config.sample.php
  3. 4
      dist/files-main.js
  4. 2
      dist/files-main.js.map
  5. 3
      lib/private/Template/JSConfigHelper.php
  6. 4
      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,
];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

Loading…
Cancel
Save