Skip to content

Commit 753a02a

Browse files
committed
Add global accessibility switch
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent f7bead0 commit 753a02a

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

apps/files/src/views/FilesList.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
</template>
6464
</BreadCrumbs>
6565

66-
<NcButton v-if="filesListWidth >= 512"
66+
<NcButton v-if="filesListWidth >= 512 && enableGridView"
6767
:aria-label="gridViewButtonLabel"
6868
:title="gridViewButtonLabel"
6969
class="files-list__header-grid-button"
@@ -132,6 +132,7 @@ import { showError } from '@nextcloud/dialogs'
132132
import { translate, translatePlural } from '@nextcloud/l10n'
133133
import { Type } from '@nextcloud/sharing'
134134
import { UploadPicker } from '@nextcloud/upload'
135+
import { loadState } from '@nextcloud/initial-state'
135136
import { defineComponent } from 'vue'
136137
137138
import LinkIcon from 'vue-material-design-icons/Link.vue'
@@ -193,13 +194,17 @@ export default defineComponent({
193194
const uploaderStore = useUploaderStore()
194195
const userConfigStore = useUserConfigStore()
195196
const viewConfigStore = useViewConfigStore()
197+
198+
const enableGridView = loadState('code', 'enable_non-accessible_features', true)
199+
196200
return {
197201
filesStore,
198202
pathsStore,
199203
selectionStore,
200204
uploaderStore,
201205
userConfigStore,
202206
viewConfigStore,
207+
enableGridView,
203208
}
204209
},
205210

config/config.sample.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,9 +2400,9 @@
24002400
'reference_opengraph' => true,
24012401

24022402
/**
2403-
* Enable use of old unified search
2403+
* Disable features that are do respect accessibility standards yet.
24042404
*
2405-
* Defaults to ``false``
2405+
* Defaults to ``true``
24062406
*/
2407-
'unified_search.enabled' => false,
2407+
'enable_non-accessible_features' => true,
24082408
];

lib/private/Template/JSConfigHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public function getConfig(): string {
179179
'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)),
180180
'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0),
181181
'version' => implode('.', Util::getVersion()),
182-
'versionstring' => \OC_Util::getVersionString()
182+
'versionstring' => \OC_Util::getVersionString(),
183+
'enable_non-accessible_features' => $this->config->getSystemValue('enable_non-accessible_features', true),
183184
];
184185

185186
$array = [

lib/private/TemplateLayout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public function __construct($renderAs, $appId = '') {
108108

109109
$this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry());
110110
$this->initialState->provideInitialState('core', 'apps', $this->navigationManager->getAll());
111-
112-
if ($this->config->getSystemValueBool('unified_search.enabled', false)) {
111+
112+
if (!$this->config->getSystemValueBool('enable_non-accessible_features', true)) {
113113
$this->initialState->provideInitialState('unified-search', 'limit-default', (int)$this->config->getAppValue('core', 'unified-search.limit-default', (string)SearchQuery::LIMIT_DEFAULT));
114114
$this->initialState->provideInitialState('unified-search', 'min-search-length', (int)$this->config->getAppValue('core', 'unified-search.min-search-length', (string)1));
115115
$this->initialState->provideInitialState('unified-search', 'live-search', $this->config->getAppValue('core', 'unified-search.live-search', 'yes') === 'yes');

0 commit comments

Comments
 (0)