diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-24 18:12:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-24 18:12:41 +0300 |
commit | 40a4f37126bb1a1dd6b6f4b3c0ebb414a3e3908a (patch) | |
tree | ff6b0774cbd1ab71b69d9e9bf9fa0e0b3d1ad799 /app/assets/javascripts/super_sidebar | |
parent | a19e3ec8e8545d5a6b275bab3e5ea8b0cc707449 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/super_sidebar')
-rw-r--r-- | app/assets/javascripts/super_sidebar/components/global_search/components/global_search_default_places.vue | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/super_sidebar/components/global_search/components/global_search_default_places.vue b/app/assets/javascripts/super_sidebar/components/global_search/components/global_search_default_places.vue index 9167be5c1cc..914d3c393f5 100644 --- a/app/assets/javascripts/super_sidebar/components/global_search/components/global_search_default_places.vue +++ b/app/assets/javascripts/super_sidebar/components/global_search/components/global_search_default_places.vue @@ -1,5 +1,6 @@ <script> import { GlDisclosureDropdownGroup } from '@gitlab/ui'; +import { kebabCase } from 'lodash'; import { PLACES } from '~/vue_shared/global_search/constants'; import { TRACKING_UNKNOWN_ID, TRACKING_UNKNOWN_PANEL } from '~/super_sidebar/constants'; import { TRACKING_CLICK_COMMAND_PALETTE_ITEM } from '../command_palette/constants'; @@ -20,7 +21,7 @@ export default { group() { return { name: this.$options.i18n.PLACES, - items: this.contextSwitcherLinks.map(({ title, link }) => ({ + items: this.contextSwitcherLinks.map(({ title, link, ...rest }) => ({ text: title, href: link, extraAttrs: { @@ -35,6 +36,12 @@ export default { // QA attributes 'data-testid': 'places-item-link', 'data-qa-places-item': title, + + // Any other data- attributes (e.g., for @rails/ujs) + ...Object.entries(rest).reduce((acc, [name, value]) => { + if (name.startsWith('data')) acc[kebabCase(name)] = value; + return acc; + }, {}), }, })), }; |