Commit 3fd677f6 authored by Sunjung Park's avatar Sunjung Park Committed by Nicolò Maria Mezzopera

Replace Glbutton in the Geo node secondary form - selecting shards

parent 06766b6a
<script> <script>
import { GlIcon, GlDeprecatedDropdown, GlDeprecatedButton } from '@gitlab/ui'; import { GlIcon, GlButton, GlDropdown } from '@gitlab/ui';
import { __, n__ } from '~/locale'; import { __, n__ } from '~/locale';
import { SELECTIVE_SYNC_SHARDS } from '../constants'; import { SELECTIVE_SYNC_SHARDS } from '../constants';
...@@ -7,8 +7,8 @@ export default { ...@@ -7,8 +7,8 @@ export default {
name: 'GeoNodeFormShards', name: 'GeoNodeFormShards',
components: { components: {
GlIcon, GlIcon,
GlDeprecatedDropdown, GlButton,
GlDeprecatedButton, GlDropdown,
}, },
props: { props: {
syncShardsOptions: { syncShardsOptions: {
...@@ -49,13 +49,21 @@ export default { ...@@ -49,13 +49,21 @@ export default {
</script> </script>
<template> <template>
<gl-deprecated-dropdown :text="dropdownTitle"> <gl-dropdown id="node-synchronization-shards-field" :text="dropdownTitle">
<li v-for="shard in syncShardsOptions" :key="shard.value"> <li
<gl-deprecated-button class="d-flex align-items-center" @click="toggleShard(shard)"> v-for="shard in syncShardsOptions"
<gl-icon :class="[{ invisible: !isSelected(shard) }]" name="mobile-issue-close" /> :key="shard.value"
<span class="ml-1">{{ shard.label }}</span> class="gl-display-flex! gl-align-items-center"
</gl-deprecated-button> >
<gl-icon
class="gl-mx-3"
:class="[{ invisible: !isSelected(shard) }]"
name="mobile-issue-close"
/>
<gl-button category="tertiary" @click="toggleShard(shard)">
<span class="gl-white-space-normal">{{ shard.label }}</span>
</gl-button>
</li> </li>
<div v-if="noSyncShards" class="text-secondary p-2">{{ __('Nothing found…') }}</div> <div v-if="noSyncShards" class="gl-text-gray-500 gl-p-3">{{ __('Nothing found…') }}</div>
</gl-deprecated-dropdown> </gl-dropdown>
</template> </template>
...@@ -19,3 +19,12 @@ ...@@ -19,3 +19,12 @@
padding-left: 1.75rem; padding-left: 1.75rem;
} }
} }
// Overrides max-width from `app/assets/stylesheets/framework/dropdowns.scss`
.geo-node-form-container {
#node-synchronization-shards-field {
.dropdown-menu {
width: auto;
}
}
}
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlIcon, GlDeprecatedDropdown } from '@gitlab/ui'; import { GlIcon, GlDropdown } from '@gitlab/ui';
import GeoNodeFormShards from 'ee/geo_node_form/components/geo_node_form_shards.vue'; import GeoNodeFormShards from 'ee/geo_node_form/components/geo_node_form_shards.vue';
import { MOCK_SYNC_SHARDS } from '../mock_data'; import { MOCK_SYNC_SHARDS } from '../mock_data';
...@@ -24,7 +24,7 @@ describe('GeoNodeFormShards', () => { ...@@ -24,7 +24,7 @@ describe('GeoNodeFormShards', () => {
wrapper.destroy(); wrapper.destroy();
}); });
const findGlDropdown = () => wrapper.find(GlDeprecatedDropdown); const findGlDropdown = () => wrapper.find(GlDropdown);
const findDropdownItems = () => findGlDropdown().findAll('li'); const findDropdownItems = () => findGlDropdown().findAll('li');
describe('template', () => { describe('template', () => {
......
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