diff options
Diffstat (limited to 'app/assets')
8 files changed, 33 insertions, 45 deletions
diff --git a/app/assets/javascripts/ml/model_registry/components/model_row.vue b/app/assets/javascripts/ml/model_registry/components/model_row.vue index ffae7e83099..15be7bd0b47 100644 --- a/app/assets/javascripts/ml/model_registry/components/model_row.vue +++ b/app/assets/javascripts/ml/model_registry/components/model_row.vue @@ -21,7 +21,7 @@ export default { if (!this.model.versionCount) return s__('MlModelRegistry|No registered versions'); return n__( - 'MlModelRegistry|· No other versions', + 'MlModelRegistry|· %d version', 'MlModelRegistry|· %d versions', this.model.versionCount, ); diff --git a/app/assets/javascripts/observability/client.js b/app/assets/javascripts/observability/client.js index b7e4ae8e8ea..4fc4ce06528 100644 --- a/app/assets/javascripts/observability/client.js +++ b/app/assets/javascripts/observability/client.js @@ -66,6 +66,7 @@ const SUPPORTED_FILTERS = { period: ['='], traceId: ['=', '!='], attribute: ['='], + status: ['=', '!='], // free-text 'search' temporarily ignored https://gitlab.com/gitlab-org/opstrace/opstrace/-/issues/2309 }; @@ -79,6 +80,7 @@ const FILTER_TO_QUERY_PARAM = { period: 'period', traceId: 'trace_id', attribute: 'attribute', + status: 'status', }; const FILTER_OPERATORS_PREFIX = { diff --git a/app/assets/javascripts/organizations/groups_and_projects/components/app.vue b/app/assets/javascripts/organizations/groups_and_projects/components/app.vue index ebe69925491..6f03783d15c 100644 --- a/app/assets/javascripts/organizations/groups_and_projects/components/app.vue +++ b/app/assets/javascripts/organizations/groups_and_projects/components/app.vue @@ -1,5 +1,5 @@ <script> -import { GlCollapsibleListbox, GlSorting, GlSortingItem } from '@gitlab/ui'; +import { GlCollapsibleListbox, GlSorting } from '@gitlab/ui'; import { isEqual } from 'lodash'; import { s__, __ } from '~/locale'; import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue'; @@ -31,7 +31,7 @@ export default { searchInputPlaceholder: s__('Organization|Search or filter list'), displayListboxHeaderText: __('Display'), }, - components: { FilteredSearchBar, GlCollapsibleListbox, GlSorting, GlSortingItem }, + components: { FilteredSearchBar, GlCollapsibleListbox, GlSorting }, filteredSearch: { tokens: [], namespace: 'organization_groups_and_projects', @@ -55,10 +55,10 @@ export default { } }, activeSortItem() { - return this.$options.sortItems.find((sortItem) => sortItem.name === this.sortName); + return this.$options.sortItems.find((sortItem) => sortItem.value === this.sortName); }, sortName() { - return this.$route.query.sort_name || SORT_ITEM_CREATED.name; + return this.$route.query.sort_name || SORT_ITEM_CREATED.value; }, isAscending() { return this.$route.query.sort_direction !== SORT_DIRECTION_DESC; @@ -97,12 +97,12 @@ export default { onDisplayListboxSelect(display) { this.pushQuery({ display }); }, - onSortItemClick(sortItem) { - if (this.$route.query.sort_name === sortItem.name) { + onSortItemClick(sortValue) { + if (this.$route.query.sort_name === sortValue) { return; } - this.pushQuery({ ...this.$route.query, sort_name: sortItem.name }); + this.pushQuery({ ...this.$route.query, sort_name: sortValue }); }, onSortDirectionChange(isAscending) { this.pushQuery({ @@ -158,17 +158,11 @@ export default { dropdown-class="gl-w-full" :text="sortText" :is-ascending="isAscending" + :sort-options="$options.sortItems" + :sort-by="activeSortItem.value" @sortDirectionChange="onSortDirectionChange" - > - <gl-sorting-item - v-for="sortItem in $options.sortItems" - :key="sortItem.name" - :active="activeSortItem.name === sortItem.name" - @click="onSortItemClick(sortItem)" - > - {{ sortItem.text }} - </gl-sorting-item> - </gl-sorting> + @sortByChange="onSortItemClick" + /> </div> </div> </div> diff --git a/app/assets/javascripts/organizations/groups_and_projects/constants.js b/app/assets/javascripts/organizations/groups_and_projects/constants.js index d79b632f6fb..7e2533b798b 100644 --- a/app/assets/javascripts/organizations/groups_and_projects/constants.js +++ b/app/assets/javascripts/organizations/groups_and_projects/constants.js @@ -20,7 +20,7 @@ export const SORT_DIRECTION_ASC = 'asc'; export const SORT_DIRECTION_DESC = 'desc'; export const SORT_ITEM_CREATED = { - name: 'created', + value: 'created', text: __('Created'), }; diff --git a/app/assets/javascripts/releases/components/releases_sort.vue b/app/assets/javascripts/releases/components/releases_sort.vue index 0f14b579da0..802392140b1 100644 --- a/app/assets/javascripts/releases/components/releases_sort.vue +++ b/app/assets/javascripts/releases/components/releases_sort.vue @@ -1,5 +1,5 @@ <script> -import { GlSorting, GlSortingItem } from '@gitlab/ui'; +import { GlSorting } from '@gitlab/ui'; import { ASCENDING_ORDER, DESCENDING_ORDER, @@ -17,7 +17,6 @@ export default { name: 'ReleasesSort', components: { GlSorting, - GlSortingItem, }, props: { value: { @@ -45,7 +44,7 @@ export default { return SORT_OPTIONS; }, sortText() { - return this.sortOptions.find((s) => s.orderBy === this.orderBy).label; + return this.sortOptions.find((s) => s.value === this.orderBy).text; }, isDirectionAscending() { return this.direction === ASCENDING_ORDER; @@ -56,11 +55,8 @@ export default { const direction = this.isDirectionAscending ? DESCENDING_ORDER : ASCENDING_ORDER; this.emitInputEventIfChanged(this.orderBy, direction); }, - onSortItemClick(item) { - this.emitInputEventIfChanged(item.orderBy, this.direction); - }, - isActiveSortItem(item) { - return this.orderBy === item.orderBy; + onSortItemClick(orderBy) { + this.emitInputEventIfChanged(orderBy, this.direction); }, emitInputEventIfChanged(orderBy, direction) { const newSort = SORT_MAP[orderBy][direction]; @@ -76,16 +72,10 @@ export default { <gl-sorting :text="sortText" :is-ascending="isDirectionAscending" + :sort-options="sortOptions" + :sort-by="orderBy" data-testid="releases-sort" @sortDirectionChange="onDirectionChange" - > - <gl-sorting-item - v-for="item of sortOptions" - :key="item.orderBy" - :active="isActiveSortItem(item)" - @click="onSortItemClick(item)" - > - {{ item.label }} - </gl-sorting-item> - </gl-sorting> + @sortByChange="onSortItemClick" + /> </template> diff --git a/app/assets/javascripts/releases/constants.js b/app/assets/javascripts/releases/constants.js index 5e9e65a01b3..b07ed67f9ba 100644 --- a/app/assets/javascripts/releases/constants.js +++ b/app/assets/javascripts/releases/constants.js @@ -22,12 +22,12 @@ export const CREATED_AT = 'created_at'; export const SORT_OPTIONS = [ { - orderBy: RELEASED_AT, - label: __('Released date'), + value: RELEASED_AT, + text: __('Released date'), }, { - orderBy: CREATED_AT, - label: __('Created date'), + value: CREATED_AT, + text: __('Created date'), }, ]; diff --git a/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget_with_edit.vue b/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget_with_edit.vue index 53149f62893..d94d0494ad9 100644 --- a/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget_with_edit.vue +++ b/app/assets/javascripts/work_items/components/shared/work_item_sidebar_dropdown_widget_with_edit.vue @@ -1,6 +1,7 @@ <script> import { GlButton, GlForm, GlLoadingIcon, GlCollapsibleListbox } from '@gitlab/ui'; -import { isEmpty } from 'lodash'; +import { isEmpty, debounce } from 'lodash'; +import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import { s__, __ } from '~/locale'; @@ -104,6 +105,9 @@ export default { }, }, }, + created() { + this.debouncedSearchKeyUpdate = debounce(this.setSearchKey, DEFAULT_DEBOUNCE_AND_THROTTLE_MS); + }, methods: { setSearchKey(value) { this.$emit('searchStarted', value); @@ -174,7 +178,7 @@ export default { :selected="localSelectedItem" :reset-button-label="resetButton" @reset="unassignValue" - @search="setSearchKey" + @search="debouncedSearchKeyUpdate" @select="handleItemClick" @shown="onListboxShown" @hidden="onListboxHide" diff --git a/app/assets/javascripts/work_items/components/work_item_milestone_with_edit.vue b/app/assets/javascripts/work_items/components/work_item_milestone_with_edit.vue index 45c12cb2e08..87b41c9d9ea 100644 --- a/app/assets/javascripts/work_items/components/work_item_milestone_with_edit.vue +++ b/app/assets/javascripts/work_items/components/work_item_milestone_with_edit.vue @@ -4,7 +4,6 @@ import * as Sentry from '~/sentry/sentry_browser_wrapper'; import Tracking from '~/tracking'; import { s__, __ } from '~/locale'; import { MILESTONE_STATE } from '~/sidebar/constants'; -import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import WorkItemSidebarDropdownWidgetWithEdit from '~/work_items/components/shared/work_item_sidebar_dropdown_widget_with_edit.vue'; import projectMilestonesQuery from '~/sidebar/queries/project_milestones.query.graphql'; import updateWorkItemMutation from '~/work_items/graphql/update_work_item.mutation.graphql'; @@ -102,7 +101,6 @@ export default { apollo: { milestones: { query: projectMilestonesQuery, - debounce: DEFAULT_DEBOUNCE_AND_THROTTLE_MS, variables() { return { fullPath: this.fullPath, |