Commit 2caaf1b1 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch '9230-remove-second-primary-button-from-feature-flags-empty-state' into 'master'

"Remove second primary button from feature flags empty state"

Closes #9230

See merge request gitlab-org/gitlab-ee!15841
parents cfa60456 7667bead
<script> <script>
import { createNamespacedHelpers } from 'vuex'; import { createNamespacedHelpers } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { GlEmptyState, GlLoadingIcon, GlButton, GlModalDirective } from '@gitlab/ui'; import { GlEmptyState, GlLoadingIcon, GlButton, GlModalDirective, GlLink } from '@gitlab/ui';
import FeatureFlagsTable from './feature_flags_table.vue'; import FeatureFlagsTable from './feature_flags_table.vue';
import store from '../store'; import store from '../store';
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
...@@ -26,6 +26,7 @@ export default { ...@@ -26,6 +26,7 @@ export default {
GlEmptyState, GlEmptyState,
GlLoadingIcon, GlLoadingIcon,
GlButton, GlButton,
GlLink,
ConfigureFeatureFlagsModal, ConfigureFeatureFlagsModal,
}, },
directives: { directives: {
...@@ -151,11 +152,11 @@ export default { ...@@ -151,11 +152,11 @@ export default {
}, },
emptyStateTitle() { emptyStateTitle() {
if (this.scope === this.$options.scopes.disabled) { if (this.scope === this.$options.scopes.disabled) {
return s__(`FeatureFlags|There are no inactive Feature Flags`); return s__(`FeatureFlags|There are no inactive feature flags`);
} else if (this.scope === this.$options.scopes.enabled) { } else if (this.scope === this.$options.scopes.enabled) {
return s__(`FeatureFlags|There are no active Feature Flags`); return s__(`FeatureFlags|There are no active feature flags`);
} }
return s__(`FeatureFlags|Get started with Feature Flags`); return s__(`FeatureFlags|Get started with feature flags`);
}, },
}, },
created() { created() {
...@@ -234,7 +235,7 @@ export default { ...@@ -234,7 +235,7 @@ export default {
:href="newFeatureFlagPath" :href="newFeatureFlagPath"
variant="success" variant="success"
class="js-ff-new" class="js-ff-new"
>{{ s__('FeatureFlags|New Feature Flag') }}</gl-button >{{ s__('FeatureFlags|New feature flag') }}</gl-button
> >
</div> </div>
</h3> </h3>
...@@ -245,7 +246,7 @@ export default { ...@@ -245,7 +246,7 @@ export default {
<gl-loading-icon <gl-loading-icon
v-if="isLoading" v-if="isLoading"
:label="s__('FeatureFlags|Loading Feature Flags')" :label="s__('FeatureFlags|Loading feature flags')"
:size="3" :size="3"
class="js-loading-state prepend-top-20" class="js-loading-state prepend-top-20"
/> />
...@@ -261,15 +262,19 @@ export default { ...@@ -261,15 +262,19 @@ export default {
v-else-if="shouldShowEmptyState" v-else-if="shouldShowEmptyState"
class="js-feature-flags-empty-state" class="js-feature-flags-empty-state"
:title="emptyStateTitle" :title="emptyStateTitle"
:description=" :svg-path="errorStateSvgPath"
>
<template v-slot:description>
{{
s__( s__(
`FeatureFlags|Feature Flags allow you to configure your code into different flavors by dynamically toggling certain functionality.`, 'FeatureFlags|Feature flags allow you to configure your code into different flavors by dynamically toggling certain functionality.',
) )
" }}
:svg-path="errorStateSvgPath" <gl-link :href="featureFlagsHelpPagePath" target="_blank" rel="noopener noreferrer">
:primary-button-link="featureFlagsHelpPagePath" {{ s__('FeatureFlags|More information') }}
:primary-button-text="s__(`FeatureFlags|More Information`)" </gl-link>
/> </template>
</gl-empty-state>
<feature-flags-table <feature-flags-table
v-else-if="shouldRenderTable" v-else-if="shouldRenderTable"
......
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
</script> </script>
<template> <template>
<div> <div>
<h3 class="page-title">{{ s__('FeatureFlags|New Feature Flag') }}</h3> <h3 class="page-title">{{ s__('FeatureFlags|New feature flag') }}</h3>
<div v-if="error.length" class="alert alert-danger"> <div v-if="error.length" class="alert alert-danger">
<p v-for="(message, index) in error" :key="index" class="mb-0">{{ message }}</p> <p v-for="(message, index) in error" :key="index" class="mb-0">{{ message }}</p>
......
---
title: Remove primary button from feature flags empty state and update text
merge_request: 15841
author:
type: changed
...@@ -74,8 +74,8 @@ describe 'User sees feature flag list', :js do ...@@ -74,8 +74,8 @@ describe 'User sees feature flag list', :js do
end end
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('.btn-primary.btn-inverted', text: 'Configure')
end end
end end
......
...@@ -7,7 +7,7 @@ import { TEST_HOST } from 'spec/test_constants'; ...@@ -7,7 +7,7 @@ import { TEST_HOST } from 'spec/test_constants';
const localVue = createLocalVue(); const localVue = createLocalVue();
describe('Feature Flags > Environments dropdown ', () => { describe('Feature flags > Environments dropdown ', () => {
let wrapper; let wrapper;
let mock; let mock;
......
...@@ -7,7 +7,7 @@ import { trimText } from 'spec/helpers/text_helper'; ...@@ -7,7 +7,7 @@ import { trimText } from 'spec/helpers/text_helper';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import { getRequestData } from '../mock_data'; import { getRequestData } from '../mock_data';
describe('Feature Flags', () => { describe('Feature flags', () => {
const mockData = { const mockData = {
endpoint: `${TEST_HOST}/endpoint.json`, endpoint: `${TEST_HOST}/endpoint.json`,
csrfToken: 'testToken', csrfToken: 'testToken',
...@@ -82,7 +82,7 @@ describe('Feature Flags', () => { ...@@ -82,7 +82,7 @@ describe('Feature Flags', () => {
expect(loadingElement).not.toBeNull(); expect(loadingElement).not.toBeNull();
expect(loadingElement.querySelector('span').getAttribute('aria-label')).toEqual( expect(loadingElement.querySelector('span').getAttribute('aria-label')).toEqual(
'Loading Feature Flags', 'Loading feature flags',
); );
setTimeout(() => { setTimeout(() => {
...@@ -130,7 +130,7 @@ describe('Feature Flags', () => { ...@@ -130,7 +130,7 @@ describe('Feature Flags', () => {
it('renders generic title', () => { it('renders generic title', () => {
expect( expect(
component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(), component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(),
).toEqual('Get started with Feature Flags'); ).toEqual('Get started with feature flags');
}); });
}); });
...@@ -141,7 +141,7 @@ describe('Feature Flags', () => { ...@@ -141,7 +141,7 @@ describe('Feature Flags', () => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect( expect(
component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(), component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(),
).toEqual('There are no inactive Feature Flags'); ).toEqual('There are no inactive feature flags');
done(); done();
}); });
}); });
...@@ -154,7 +154,7 @@ describe('Feature Flags', () => { ...@@ -154,7 +154,7 @@ describe('Feature Flags', () => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect( expect(
component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(), component.$el.querySelector('.js-feature-flags-empty-state h4').textContent.trim(),
).toEqual('There are no active Feature Flags'); ).toEqual('There are no active feature flags');
done(); done();
}); });
}); });
......
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
DEFAULT_PERCENT_ROLLOUT, DEFAULT_PERCENT_ROLLOUT,
} from 'ee/feature_flags/constants'; } from 'ee/feature_flags/constants';
describe('Feature Flag table', () => { describe('Feature flag table', () => {
let Component; let Component;
let vm; let vm;
......
...@@ -51,7 +51,7 @@ describe('New feature flag form', () => { ...@@ -51,7 +51,7 @@ describe('New feature flag form', () => {
}); });
it('renders form title', () => { it('renders form title', () => {
expect(wrapper.find('h3').text()).toEqual('New Feature Flag'); expect(wrapper.find('h3').text()).toEqual('New feature flag');
}); });
it('should render feature flag form', () => { it('should render feature flag form', () => {
......
...@@ -6460,13 +6460,13 @@ msgstr "" ...@@ -6460,13 +6460,13 @@ msgstr ""
msgid "FeatureFlags|Feature Flags" msgid "FeatureFlags|Feature Flags"
msgstr "" msgstr ""
msgid "FeatureFlags|Feature Flags allow you to configure your code into different flavors by dynamically toggling certain functionality." msgid "FeatureFlags|Feature flag %{name} will be removed. Are you sure?"
msgstr "" msgstr ""
msgid "FeatureFlags|Feature flag %{name} will be removed. Are you sure?" msgid "FeatureFlags|Feature flags allow you to configure your code into different flavors by dynamically toggling certain functionality."
msgstr "" msgstr ""
msgid "FeatureFlags|Get started with Feature Flags" msgid "FeatureFlags|Get started with feature flags"
msgstr "" msgstr ""
msgid "FeatureFlags|Inactive" msgid "FeatureFlags|Inactive"
...@@ -6481,10 +6481,10 @@ msgstr "" ...@@ -6481,10 +6481,10 @@ msgstr ""
msgid "FeatureFlags|Instance ID" msgid "FeatureFlags|Instance ID"
msgstr "" msgstr ""
msgid "FeatureFlags|Loading Feature Flags" msgid "FeatureFlags|Loading feature flags"
msgstr "" msgstr ""
msgid "FeatureFlags|More Information" msgid "FeatureFlags|More information"
msgstr "" msgstr ""
msgid "FeatureFlags|Name" msgid "FeatureFlags|Name"
...@@ -6496,6 +6496,9 @@ msgstr "" ...@@ -6496,6 +6496,9 @@ msgstr ""
msgid "FeatureFlags|New Feature Flag" msgid "FeatureFlags|New Feature Flag"
msgstr "" msgstr ""
msgid "FeatureFlags|New feature flag"
msgstr ""
msgid "FeatureFlags|Percent rollout (logged in users)" msgid "FeatureFlags|Percent rollout (logged in users)"
msgstr "" msgstr ""
...@@ -6526,10 +6529,10 @@ msgstr "" ...@@ -6526,10 +6529,10 @@ msgstr ""
msgid "FeatureFlags|Target user behaviour is built up by creating a list of active user IDs. These IDs should be the users in the system in which the feature flag is set, not GitLab ids. Target users apply across %{strong_start}All Environments%{strong_end} and are not affected by Target Environment rules." msgid "FeatureFlags|Target user behaviour is built up by creating a list of active user IDs. These IDs should be the users in the system in which the feature flag is set, not GitLab ids. Target users apply across %{strong_start}All Environments%{strong_end} and are not affected by Target Environment rules."
msgstr "" msgstr ""
msgid "FeatureFlags|There are no active Feature Flags" msgid "FeatureFlags|There are no active feature flags"
msgstr "" msgstr ""
msgid "FeatureFlags|There are no inactive Feature Flags" msgid "FeatureFlags|There are no inactive feature flags"
msgstr "" msgstr ""
msgid "FeatureFlags|There was an error fetching the feature flags." msgid "FeatureFlags|There was an error fetching the feature flags."
......
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