[Advanced Settings] Fix badge counter for global settings (#150869)

## Summary

This PR fixes the badge count for Global settings, which was incorrectly
showing there are results, when there were in fact none. Also, changing
the owners of the `ui-settings` related packages and plugins from core
to `shared-ux`.

<img width="1231" alt="Screenshot 2023-02-10 at 13 04 58"
src="https://user-images.githubusercontent.com/1937956/218398812-67a9f644-6319-4d1c-a2a9-15894a1e3b2c.png">




### Checklist

Delete any items that are not applicable to this PR.

~- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
~- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
~- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios~
~- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
~- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
~- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
~- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
~- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Maja Grubic 2023-02-13 11:46:56 +01:00 committed by GitHub
parent f3c540d149
commit 99bb6fd203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 20 deletions

16
.github/CODEOWNERS vendored
View file

@ -9,7 +9,7 @@ x-pack/test/alerting_api_integration/common/plugins/aad @elastic/response-ops
packages/kbn-ace @elastic/platform-deployment-management
x-pack/plugins/actions @elastic/response-ops
x-pack/test/alerting_api_integration/common/plugins/actions_simulators @elastic/response-ops
src/plugins/advanced_settings @elastic/kibana-core
src/plugins/advanced_settings @elastic/appex-sharedux
x-pack/packages/ml/aiops_components @elastic/ml-ui
x-pack/plugins/aiops @elastic/ml-ui
x-pack/packages/ml/aiops_utils @elastic/ml-ui
@ -270,13 +270,13 @@ packages/core/test-helpers/core-test-helpers-test-utils @elastic/kibana-core
packages/core/theme/core-theme-browser @elastic/kibana-core
packages/core/theme/core-theme-browser-internal @elastic/kibana-core
packages/core/theme/core-theme-browser-mocks @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-browser @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-browser-internal @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-browser-mocks @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-common @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-server @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-server-internal @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-server-mocks @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-browser @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-browser-internal @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-browser-mocks @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-common @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server-internal @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server-mocks @elastic/appex-sharedux
packages/core/usage-data/core-usage-data-base-server-internal @elastic/kibana-core
packages/core/usage-data/core-usage-data-server @elastic/kibana-core
packages/core/usage-data/core-usage-data-server-internal @elastic/kibana-core

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/core-ui-settings-browser-internal",
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -2,5 +2,5 @@
"type": "shared-common",
"id": "@kbn/core-ui-settings-browser-mocks",
"devOnly": true,
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/core-ui-settings-browser",
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/core-ui-settings-common",
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/core-ui-settings-server-internal",
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -2,5 +2,5 @@
"type": "shared-common",
"id": "@kbn/core-ui-settings-server-mocks",
"devOnly": true,
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/core-ui-settings-server",
"owner": "@elastic/kibana-core"
"owner": "@elastic/appex-sharedux"
}

View file

@ -1,7 +1,7 @@
{
"type": "plugin",
"id": "@kbn/advanced-settings-plugin",
"owner": "@elastic/kibana-core",
"owner": "@elastic/appex-sharedux",
"plugin": {
"id": "advancedSettings",
"server": true,

View file

@ -281,19 +281,18 @@ export const Settings = (props: Props) => {
return (queryParams[QUERY] as string) ?? '';
};
const getQueryState = (search?: string, intialQuery = false): AdvancedSettingsState => {
const getQueryState = (search?: string, initialQuery = false): AdvancedSettingsState => {
const queryString = getQueryText(search);
const query = getQuery(queryString, intialQuery);
const query = getQuery(queryString, initialQuery);
const filteredSettings = {
namespace: mapSettings(Query.execute(query, settings)),
global: mapSettings(Query.execute(query, globalSettings)),
};
const footerQueryMatched = Object.keys(filteredSettings.namespace).length > 0;
return {
query,
filteredSettings,
footerQueryMatched,
footerQueryMatched: initialQuery ? false : queryState.footerQueryMatched,
};
};