Skip to content

Commit

Permalink
Add global accessibility switch
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Dec 19, 2023
1 parent 1a45dd0 commit bf355cf
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .htaccess
Expand Up @@ -96,3 +96,7 @@

AddDefaultCharset utf-8
Options -Indexes
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /index.php/error/403
ErrorDocument 404 /index.php/error/404
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
6 changes: 3 additions & 3 deletions lib/private/legacy/OC_Util.php
Expand Up @@ -1033,9 +1033,9 @@ public static function fileInfoLoaded() {
* @return void
*/
public static function obEnd() {
while (ob_get_level()) {
ob_end_clean();
}
// while (ob_get_level()) {
// ob_end_clean();
// }
}

/**
Expand Down

0 comments on commit bf355cf

Please sign in to comment.