diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2023-11-09 17:46:37 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2023-11-10 11:27:32 +0100 |
commit | 13d03f45a3735dc44ccdbebf7bedb0825460a477 (patch) | |
tree | f6ab70c286f817ba4f45ab3f8dc4731c5f5119fd /lib/private/TemplateLayout.php | |
parent | 20b3338288e85772ad74b956f566b80ce7a4cfb9 (diff) | |
download | nextcloud-server-13d03f45a3735dc44ccdbebf7bedb0825460a477.tar.gz nextcloud-server-13d03f45a3735dc44ccdbebf7bedb0825460a477.zip |
Add unified search toggle in config
The new global search UI is new and might be unstable, hence
we are giving users the option to use the old unified search UI, if
the encounter signficant bottlenecks.
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r-- | lib/private/TemplateLayout.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index 90ca9359740..011597e6c29 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -106,12 +106,18 @@ class TemplateLayout extends \OC_Template { $this->initialState->provideInitialState('core', 'active-app', $this->navigationManager->getActiveEntry()); $this->initialState->provideInitialState('core', 'apps', $this->navigationManager->getAll()); - $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'); - Util::addScript('core', 'unified-search', 'core'); - Util::addScript('core', 'global-search', 'core'); - + /* + * NB : Unified search enabled, defaults to true since new advanced search is + * unstable. Once we think otherwise, the default should be false. + */ + if ($this->config->getSystemValueBool('unified_search.enabled', 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'); + Util::addScript('core', 'unified-search', 'core'); + } else { + Util::addScript('core', 'global-search', 'core'); + } // Set body data-theme $this->assign('enabledThemes', []); if (\OC::$server->getAppManager()->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) { |