Commit 417c3e11 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch...

Merge branch 'Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/vue_shared/components/timezone_dropdown.vue' into 'master'

Gldeprecateddropdown to  Gldropdown in timezone_ dropdown.vue

See merge request gitlab-org/gitlab!41434
parents 29f5e454 a846c438
<script>
import { GlDropdown, GlDeprecatedDropdownItem, GlSearchBoxByType, GlIcon } from '@gitlab/ui';
import { GlDropdown, GlDropdownItem, GlSearchBoxByType } from '@gitlab/ui';
import { __ } from '~/locale';
import autofocusonshow from '~/vue_shared/directives/autofocusonshow';
......@@ -7,9 +7,8 @@ export default {
name: 'TimezoneDropdown',
components: {
GlDropdown,
GlDeprecatedDropdownItem,
GlDropdownItem,
GlSearchBoxByType,
GlIcon,
},
directives: {
autofocusonshow,
......@@ -74,29 +73,23 @@ export default {
};
</script>
<template>
<gl-dropdown :text="value" block lazy menu-class="gl-w-full!">
<template #button-content>
<span class="gl-flex-grow-1" :class="{ 'gl-text-gray-300': !value }">
{{ selectedTimezoneLabel }}
</span>
<gl-icon name="chevron-down" />
</template>
<gl-dropdown :text="selectedTimezoneLabel" block lazy menu-class="gl-w-full!">
<gl-search-box-by-type v-model.trim="searchTerm" v-autofocusonshow autofocus />
<gl-deprecated-dropdown-item
<gl-dropdown-item
v-for="timezone in filteredResults"
:key="timezone.formattedTimezone"
:is-checked="isSelected(timezone)"
:is-check-item="true"
@click="selectTimezone(timezone)"
>
<gl-icon
:class="{ invisible: !isSelected(timezone) }"
name="mobile-issue-close"
class="gl-vertical-align-middle"
/>
{{ timezone.formattedTimezone }}
</gl-deprecated-dropdown-item>
<gl-deprecated-dropdown-item v-if="!filteredResults.length" data-testid="noMatchingResults">
</gl-dropdown-item>
<gl-dropdown-item
v-if="!filteredResults.length"
class="gl-pointer-events-none"
data-testid="noMatchingResults"
>
{{ $options.tranlations.noResultsText }}
</gl-deprecated-dropdown-item>
</gl-dropdown-item>
</gl-dropdown>
</template>
---
title: Replace GlDeprecatedDropdown with GlDropDown in timezone-dropdown.vue
merge_request: 41434
author: nuwe1
type: other
import Vuex from 'vuex';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { GlDeprecatedDropdownItem, GlDropdown } from '@gitlab/ui';
import { GlDropdownItem, GlDropdown } from '@gitlab/ui';
import TimezoneDropdown from '~/vue_shared/components/timezone_dropdown.vue';
import createStore from '~/deploy_freeze/store';
......@@ -29,8 +29,8 @@ describe('Deploy freeze timezone dropdown', () => {
wrapper.setData({ searchTerm });
};
const findAllDropdownItems = () => wrapper.findAll(GlDeprecatedDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDeprecatedDropdownItem).at(index);
const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index);
afterEach(() => {
wrapper.destroy();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment