Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] Add global accessibility switch #42371

Merged
merged 1 commit into from Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/files/src/views/FilesList.vue
Expand Up @@ -46,7 +46,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"
Expand Down Expand Up @@ -113,6 +113,7 @@ import { orderBy } from 'natural-orderby'
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'
Expand Down Expand Up @@ -172,13 +173,17 @@ 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,
selectionStore,
uploaderStore,
userConfigStore,
viewConfigStore,
enableGridView,
}
},

Expand Down
7 changes: 7 additions & 0 deletions config/config.sample.php
Expand Up @@ -2405,4 +2405,11 @@
* Defaults to ``false``
*/
'unified_search.enabled' => false,

/**
* Enable features that are do respect accessibility standards yet.
*
* Defaults to ``true``
*/
'enable_non-accessible_features' => true,
];
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/private/Template/JSConfigHelper.php
Expand Up @@ -179,7 +179,8 @@ public function getConfig(): string {
'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 = [
Expand Down
4 changes: 2 additions & 2 deletions lib/private/TemplateLayout.php
Expand Up @@ -108,8 +108,8 @@ public function __construct($renderAs, $appId = '') {

$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');
Expand Down