Skip to content

Commit

Permalink
Merge pull request #42371 from nextcloud/artonge/backport/stable28/42353
Browse files Browse the repository at this point in the history
[stable28] Add global accessibility switch
  • Loading branch information
artonge authored Dec 19, 2023
2 parents 1a45dd0 + 7ba9a4b commit 74be33f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
7 changes: 6 additions & 1 deletion apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 74be33f

Please sign in to comment.