Commit 41aaa3c1 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch...

Merge branch 'Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/monitoring' into 'master'

Replace GlDeprecatedDropdown in app/assets/javascripts/monitoring

See merge request gitlab-org/gitlab!41422
parents 47d41fea bd6b75ed
<script> <script>
import { GlFormGroup, GlDeprecatedDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui'; import { GlFormGroup, GlDropdown, GlDropdownItem } from '@gitlab/ui';
export default { export default {
components: { components: {
GlFormGroup, GlFormGroup,
GlDeprecatedDropdown, GlDropdown,
GlDeprecatedDropdownItem, GlDropdownItem,
}, },
props: { props: {
name: { name: {
...@@ -41,16 +41,13 @@ export default { ...@@ -41,16 +41,13 @@ export default {
</script> </script>
<template> <template>
<gl-form-group :label="label"> <gl-form-group :label="label">
<gl-deprecated-dropdown <gl-dropdown toggle-class="dropdown-menu-toggle" :text="text || s__('Metrics|Select a value')">
toggle-class="dropdown-menu-toggle" <gl-dropdown-item
:text="text || s__('Metrics|Select a value')"
>
<gl-deprecated-dropdown-item
v-for="val in options.values" v-for="val in options.values"
:key="val.value" :key="val.value"
@click="onUpdate(val.value)" @click="onUpdate(val.value)"
>{{ val.text }}</gl-deprecated-dropdown-item >{{ val.text }}</gl-dropdown-item
> >
</gl-deprecated-dropdown> </gl-dropdown>
</gl-form-group> </gl-form-group>
</template> </template>
---
title: Replace-GlDeprecatedDropdown-with-GlDropdown-in-app/assets/javascripts/monitoring
merge_request: 41422
author: nuwe1
type: other
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedDropdown, GlDeprecatedDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import DropdownField from '~/monitoring/components/variables/dropdown_field.vue'; import DropdownField from '~/monitoring/components/variables/dropdown_field.vue';
describe('Custom variable component', () => { describe('Custom variable component', () => {
...@@ -23,8 +23,8 @@ describe('Custom variable component', () => { ...@@ -23,8 +23,8 @@ describe('Custom variable component', () => {
}); });
}; };
const findDropdown = () => wrapper.find(GlDeprecatedDropdown); const findDropdown = () => wrapper.find(GlDropdown);
const findDropdownItems = () => wrapper.findAll(GlDeprecatedDropdownItem); const findDropdownItems = () => wrapper.findAll(GlDropdownItem);
it('renders dropdown element when all necessary props are passed', () => { it('renders dropdown element when all necessary props are passed', () => {
createShallowWrapper(); createShallowWrapper();
......
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