Commit 8f179ca0 authored by Andrew Fontaine's avatar Andrew Fontaine

Remove Deprecated Button Usage From Feature Flags

Makes the feature flag table buttons match the user list tables and uses
the new GlButton for the rest of the feature flag page.
parent 40bc0825
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import { createNamespacedHelpers } from 'vuex'; import { createNamespacedHelpers } from 'vuex';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { import {
GlButton,
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlDeprecatedButton,
GlModalDirective, GlModalDirective,
GlLink, GlLink,
GlAlert, GlAlert,
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
TablePagination, TablePagination,
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlDeprecatedButton, GlButton,
GlLink, GlLink,
GlAlert, GlAlert,
GlSprintf, GlSprintf,
...@@ -253,22 +253,25 @@ export default { ...@@ -253,22 +253,25 @@ export default {
<h3 class="page-title with-button"> <h3 class="page-title with-button">
{{ s__('FeatureFlags|Feature Flags') }} {{ s__('FeatureFlags|Feature Flags') }}
<div class="pull-right"> <div class="pull-right">
<button <gl-button
v-if="canUserConfigure" v-if="canUserConfigure"
v-gl-modal="'configure-feature-flags'" v-gl-modal="'configure-feature-flags'"
type="button" variant="info"
class="js-ff-configure gl-mr-3 btn-inverted btn btn-primary" category="secondary"
data-qa-selector="configure_feature_flags_button"
data-testid="ff-configure-button"
class="gl-mr-3"
> >
{{ s__('FeatureFlags|Configure') }} {{ s__('FeatureFlags|Configure') }}
</button> </gl-button>
<gl-button
<gl-deprecated-button
v-if="hasNewPath" v-if="hasNewPath"
:href="newFeatureFlagPath" :href="newFeatureFlagPath"
variant="success" variant="success"
class="js-ff-new" data-testid="ff-new-button"
>{{ s__('FeatureFlags|New feature flag') }}</gl-deprecated-button
> >
{{ s__('FeatureFlags|New feature flag') }}
</gl-button>
</div> </div>
</h3> </h3>
<gl-alert v-if="!isUserListAlertDismissed" @dismiss="isUserListAlertDismissed = true"> <gl-alert v-if="!isUserListAlertDismissed" @dismiss="isUserListAlertDismissed = true">
......
...@@ -201,9 +201,8 @@ export default { ...@@ -201,9 +201,8 @@ export default {
<gl-button <gl-button
v-gl-tooltip.hover.bottom="__('Edit')" v-gl-tooltip.hover.bottom="__('Edit')"
class="js-feature-flag-edit-button" class="js-feature-flag-edit-button"
variant="default"
category="primary"
icon="pencil" icon="pencil"
category="tertiary"
:href="featureFlag.edit_path" :href="featureFlag.edit_path"
/> />
</template> </template>
...@@ -212,7 +211,6 @@ export default { ...@@ -212,7 +211,6 @@ export default {
v-gl-tooltip.hover.bottom="__('Delete')" v-gl-tooltip.hover.bottom="__('Delete')"
class="js-feature-flag-delete-button" class="js-feature-flag-delete-button"
variant="danger" variant="danger"
category="primary"
icon="remove" icon="remove"
:disabled="!canDeleteFlag(featureFlag)" :disabled="!canDeleteFlag(featureFlag)"
@click="setDeleteModalData(featureFlag)" @click="setDeleteModalData(featureFlag)"
......
...@@ -93,7 +93,7 @@ RSpec.describe 'User sees feature flag list', :js do ...@@ -93,7 +93,7 @@ RSpec.describe 'User sees feature flag list', :js do
it 'shows empty page' do it 'shows empty page' do
expect(page).to have_text 'Get started with feature flags' expect(page).to have_text 'Get started with feature flags'
expect(page).to have_selector('.btn-success', text: 'New feature flag') expect(page).to have_selector('.btn-success', text: 'New feature flag')
expect(page).to have_selector('.btn-primary.btn-inverted', text: 'Configure') expect(page).to have_selector('[data-qa-selector="configure_feature_flags_button"]', text: 'Configure')
end end
end end
end end
...@@ -40,8 +40,8 @@ describe('Feature flags', () => { ...@@ -40,8 +40,8 @@ describe('Feature flags', () => {
}); });
}; };
const configureButton = () => wrapper.find('.js-ff-configure'); const configureButton = () => wrapper.find('[data-testid="ff-configure-button"]');
const newButton = () => wrapper.find('.js-ff-new'); const newButton = () => wrapper.find('[data-testid="ff-new-button"]');
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
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