diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 00:07:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 00:07:14 +0300 |
commit | b04f912deb494b6dc0d0dba36776a5e53f622b43 (patch) | |
tree | b6af17cf69082cda35c42801a123c6e090b28c12 /app | |
parent | 9e5484cee690f8bb2c1796013345d8cbc1872d77 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/tags/components/sort_dropdown.vue | 32 | ||||
-rw-r--r-- | app/models/ci/catalog/resource.rb | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/app/assets/javascripts/tags/components/sort_dropdown.vue b/app/assets/javascripts/tags/components/sort_dropdown.vue index 036ce2cca78..bb4f3ac0571 100644 --- a/app/assets/javascripts/tags/components/sort_dropdown.vue +++ b/app/assets/javascripts/tags/components/sort_dropdown.vue @@ -1,5 +1,5 @@ <script> -import { GlDropdown, GlDropdownItem, GlSearchBoxByClick } from '@gitlab/ui'; +import { GlCollapsibleListbox, GlSearchBoxByClick } from '@gitlab/ui'; import { mergeUrlParams, visitUrl, getParameterValues } from '~/lib/utils/url_utility'; import { s__ } from '~/locale'; @@ -8,8 +8,7 @@ export default { searchPlaceholder: s__('TagsPage|Filter by tag name'), }, components: { - GlDropdown, - GlDropdownItem, + GlCollapsibleListbox, GlSearchBoxByClick, }, inject: ['sortOptions', 'filterTagsPath'], @@ -23,6 +22,11 @@ export default { selectedSortMethod() { return this.sortOptions[this.selectedKey]; }, + sortOptionsListboxItems() { + return Object.entries(this.sortOptions).map(([value, text]) => { + return { value, text }; + }); + }, }, created() { const sortValue = getParameterValues('sort'); @@ -37,9 +41,6 @@ export default { } }, methods: { - isSortMethodSelected(sortKey) { - return sortKey === this.selectedKey; - }, visitUrlFromOption(sortKey) { this.selectedKey = sortKey; const urlParams = {}; @@ -62,16 +63,13 @@ export default { data-testid="tag-search" @submit="visitUrlFromOption(selectedKey)" /> - <gl-dropdown :text="selectedSortMethod" right data-testid="tags-dropdown"> - <gl-dropdown-item - v-for="(value, key) in sortOptions" - :key="key" - :is-checked="isSortMethodSelected(key)" - is-check-item - @click="visitUrlFromOption(key)" - > - {{ value }} - </gl-dropdown-item> - </gl-dropdown> + <gl-collapsible-listbox + v-model="selectedKey" + data-testid="tags-dropdown" + :items="sortOptionsListboxItems" + placement="right" + :toggle-text="selectedSortMethod" + @select="visitUrlFromOption" + /> </div> </template> diff --git a/app/models/ci/catalog/resource.rb b/app/models/ci/catalog/resource.rb index dfdf6bca251..f5bcc3867ec 100644 --- a/app/models/ci/catalog/resource.rb +++ b/app/models/ci/catalog/resource.rb @@ -29,3 +29,5 @@ module Ci end end end + +Ci::Catalog::Resource.prepend_mod_with('Ci::Catalog::Resource') |