Commit 7c351e35 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch...

Merge branch '219899-replace-gl-deprecated-button-with-gl-button-in-ee-app-assets-javascripts-feature_flags' into 'master'

Resolve "Replace <gl-deprecated-button> with <gl-button> in ee/app/assets/javascripts/feature_flags/components/form.vue"

Closes #219899

See merge request gitlab-org/gitlab!39220
parents f5bb7cef 705db698
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import Vue from 'vue'; import Vue from 'vue';
import { memoize, isString, cloneDeep, isNumber, uniqueId } from 'lodash'; import { memoize, isString, cloneDeep, isNumber, uniqueId } from 'lodash';
import { import {
GlDeprecatedButton, GlButton,
GlDeprecatedBadge as GlBadge, GlDeprecatedBadge as GlBadge,
GlTooltip, GlTooltip,
GlTooltipDirective, GlTooltipDirective,
...@@ -15,7 +15,6 @@ import { s__ } from '~/locale'; ...@@ -15,7 +15,6 @@ import { s__ } from '~/locale';
import flash, { FLASH_TYPES } from '~/flash'; import flash, { FLASH_TYPES } from '~/flash';
import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import featureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import ToggleButton from '~/vue_shared/components/toggle_button.vue'; import ToggleButton from '~/vue_shared/components/toggle_button.vue';
import Icon from '~/vue_shared/components/icon.vue';
import EnvironmentsDropdown from './environments_dropdown.vue'; import EnvironmentsDropdown from './environments_dropdown.vue';
import Strategy from './strategy.vue'; import Strategy from './strategy.vue';
import { import {
...@@ -32,14 +31,13 @@ import RelatedIssuesRoot from 'ee/related_issues/components/related_issues_root. ...@@ -32,14 +31,13 @@ import RelatedIssuesRoot from 'ee/related_issues/components/related_issues_root.
export default { export default {
components: { components: {
GlDeprecatedButton, GlButton,
GlBadge, GlBadge,
GlFormTextarea, GlFormTextarea,
GlFormCheckbox, GlFormCheckbox,
GlTooltip, GlTooltip,
GlSprintf, GlSprintf,
ToggleButton, ToggleButton,
Icon,
EnvironmentsDropdown, EnvironmentsDropdown,
Strategy, Strategy,
RelatedIssuesRoot, RelatedIssuesRoot,
...@@ -340,9 +338,9 @@ export default { ...@@ -340,9 +338,9 @@ export default {
<h4>{{ s__('FeatureFlags|Strategies') }}</h4> <h4>{{ s__('FeatureFlags|Strategies') }}</h4>
<div class="flex align-items-baseline justify-content-between"> <div class="flex align-items-baseline justify-content-between">
<p class="mr-3">{{ $options.translations.newHelpText }}</p> <p class="mr-3">{{ $options.translations.newHelpText }}</p>
<gl-deprecated-button variant="success" category="secondary" @click="addStrategy"> <gl-button variant="success" category="secondary" @click="addStrategy">
{{ s__('FeatureFlags|Add strategy') }} {{ s__('FeatureFlags|Add strategy') }}
</gl-deprecated-button> </gl-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -523,15 +521,14 @@ export default { ...@@ -523,15 +521,14 @@ export default {
{{ s__('FeatureFlags|Remove') }} {{ s__('FeatureFlags|Remove') }}
</div> </div>
<div class="table-mobile-content js-feature-flag-delete"> <div class="table-mobile-content js-feature-flag-delete">
<gl-deprecated-button <gl-button
v-if="!isAllEnvironment(scope.environmentScope) && canUpdateScope(scope)" v-if="!isAllEnvironment(scope.environmentScope) && canUpdateScope(scope)"
v-gl-tooltip v-gl-tooltip
:title="s__('FeatureFlags|Remove')" :title="s__('FeatureFlags|Remove')"
class="js-delete-scope btn-transparent pr-3 pl-3" class="js-delete-scope btn-transparent pr-3 pl-3"
icon="clear"
@click="removeScope(scope)" @click="removeScope(scope)"
> />
<icon name="clear" />
</gl-deprecated-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -592,7 +589,7 @@ export default { ...@@ -592,7 +589,7 @@ export default {
</fieldset> </fieldset>
<div class="form-actions"> <div class="form-actions">
<gl-deprecated-button <gl-button
ref="submitButton" ref="submitButton"
:disabled="readOnly" :disabled="readOnly"
type="button" type="button"
...@@ -601,14 +598,10 @@ export default { ...@@ -601,14 +598,10 @@ export default {
@click="handleSubmit" @click="handleSubmit"
> >
{{ submitText }} {{ submitText }}
</gl-deprecated-button> </gl-button>
<gl-deprecated-button <gl-button :href="cancelPath" class="js-ff-cancel col-xs-12 float-right">
:href="cancelPath"
variant="secondary"
class="js-ff-cancel col-xs-12 float-right"
>
{{ __('Cancel') }} {{ __('Cancel') }}
</gl-deprecated-button> </gl-button>
</div> </div>
</form> </form>
</template> </template>
---
title: Update feature flag form buttons to gl-button
merge_request: 39220
author:
type: changed
import { uniqueId } from 'lodash'; import { uniqueId } from 'lodash';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlFormTextarea, GlFormCheckbox, GlDeprecatedButton } from '@gitlab/ui'; import { GlFormTextarea, GlFormCheckbox, GlButton } from '@gitlab/ui';
import Api from 'ee/api'; import Api from 'ee/api';
import Form from 'ee/feature_flags/components/form.vue'; import Form from 'ee/feature_flags/components/form.vue';
import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue'; import EnvironmentsDropdown from 'ee/feature_flags/components/environments_dropdown.vue';
...@@ -455,7 +455,7 @@ describe('feature flag form', () => { ...@@ -455,7 +455,7 @@ describe('feature flag form', () => {
}); });
it('adds an all users strategy when clicking the Add button', () => { it('adds an all users strategy when clicking the Add button', () => {
wrapper.find(GlDeprecatedButton).vm.$emit('click'); wrapper.find(GlButton).vm.$emit('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
const strategies = wrapper.findAll(Strategy); const strategies = wrapper.findAll(Strategy);
......
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