Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
12e01aee
Commit
12e01aee
authored
Feb 04, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improves title in FF empty state
The empty state title is based on the scope selected
parent
681d537f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
10 deletions
+63
-10
ee/app/assets/javascripts/feature_flags/components/feature_flags.vue
...ts/javascripts/feature_flags/components/feature_flags.vue
+11
-3
ee/changelogs/unreleased/9282-empty-states-ff.yml
ee/changelogs/unreleased/9282-empty-states-ff.yml
+5
-0
ee/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb
...rojects/feature_flags/user_sees_feature_flag_list_spec.rb
+1
-1
ee/spec/features/projects/feature_flags_spec.rb
ee/spec/features/projects/feature_flags_spec.rb
+2
-2
ee/spec/javascripts/feature_flags/components/feature_flags_spec.js
...avascripts/feature_flags/components/feature_flags_spec.js
+35
-1
locale/gitlab.pot
locale/gitlab.pot
+9
-3
No files found.
ee/app/assets/javascripts/feature_flags/components/feature_flags.vue
View file @
12e01aee
...
@@ -4,7 +4,7 @@ import _ from 'underscore';
...
@@ -4,7 +4,7 @@ import _ from 'underscore';
import
{
GlEmptyState
,
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlLoadingIcon
,
GlButton
}
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
{
__
}
from
'
~/locale
'
;
import
{
__
,
s__
}
from
'
~/locale
'
;
import
NavigationTabs
from
'
~/vue_shared/components/navigation_tabs.vue
'
;
import
NavigationTabs
from
'
~/vue_shared/components/navigation_tabs.vue
'
;
import
TablePagination
from
'
~/vue_shared/components/table_pagination.vue
'
;
import
TablePagination
from
'
~/vue_shared/components/table_pagination.vue
'
;
import
{
import
{
...
@@ -113,6 +113,14 @@ export default {
...
@@ -113,6 +113,14 @@ export default {
hasNewPath
()
{
hasNewPath
()
{
return
!
_
.
isEmpty
(
this
.
newFeatureFlagPath
);
return
!
_
.
isEmpty
(
this
.
newFeatureFlagPath
);
},
},
emptyStateTitle
()
{
if
(
this
.
scope
===
this
.
$options
.
scopes
.
disabled
)
{
return
s__
(
`FeatureFlags|There are no inactive Feature Flags`
);
}
else
if
(
this
.
scope
===
this
.
$options
.
scopes
.
enabled
)
{
return
s__
(
`FeatureFlags|There are no active Feature Flags`
);
}
return
s__
(
`FeatureFlags|Get started with Feature Flags`
);
},
},
},
created
()
{
created
()
{
this
.
setFeatureFlagsEndpoint
(
this
.
endpoint
);
this
.
setFeatureFlagsEndpoint
(
this
.
endpoint
);
...
@@ -196,10 +204,10 @@ export default {
...
@@ -196,10 +204,10 @@ export default {
<gl-empty-state
<gl-empty-state
v-else-if=
"shouldShowEmptyState"
v-else-if=
"shouldShowEmptyState"
class=
"js-feature-flags-empty-state"
class=
"js-feature-flags-empty-state"
:title=
"
s__(`FeatureFlags|Get started with feature flags`)
"
:title=
"
emptyStateTitle
"
:description=
"
:description=
"
s__(
s__(
`FeatureFlags|Feature
f
lags allow you to configure your code into different flavors by dynamically toggling certain functionality.`,
`FeatureFlags|Feature
F
lags allow you to configure your code into different flavors by dynamically toggling certain functionality.`,
)
)
"
"
:svg-path=
"errorStateSvgPath"
:svg-path=
"errorStateSvgPath"
...
...
ee/changelogs/unreleased/9282-empty-states-ff.yml
0 → 100644
View file @
12e01aee
---
title
:
Improves title in feature flags empty states
merge_request
:
author
:
type
:
changed
ee/spec/features/projects/feature_flags/user_sees_feature_flag_list_spec.rb
View file @
12e01aee
...
@@ -74,7 +74,7 @@ describe 'User sees feature flag list', :js do
...
@@ -74,7 +74,7 @@ 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 f
lags'
expect
(
page
).
to
have_text
'Get started with
Feature F
lags'
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
...
...
ee/spec/features/projects/feature_flags_spec.rb
View file @
12e01aee
...
@@ -138,7 +138,7 @@ describe 'Feature Flags', :js do
...
@@ -138,7 +138,7 @@ describe 'Feature Flags', :js do
shared_examples_for
'correct empty index behavior'
do
shared_examples_for
'correct empty index behavior'
do
it
'shows empty state'
do
it
'shows empty state'
do
expect
(
page
).
to
have_content
(
'Get started with
feature f
lags'
)
expect
(
page
).
to
have_content
(
'Get started with
Feature F
lags'
)
expect
(
page
).
to
have_link
(
'New Feature Flag'
)
expect
(
page
).
to
have_link
(
'New Feature Flag'
)
expect
(
page
).
to
have_button
(
'Configure'
)
expect
(
page
).
to
have_button
(
'Configure'
)
end
end
...
@@ -234,7 +234,7 @@ describe 'Feature Flags', :js do
...
@@ -234,7 +234,7 @@ describe 'Feature Flags', :js do
end
end
def
expect_empty_state
def
expect_empty_state
expect
(
page
).
to
have_
text
'Get started with feature flags'
expect
(
page
).
to
have_
selector
(
'.js-feature-flags-empty-state'
)
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
...
...
ee/spec/javascripts/feature_flags/components/feature_flags_spec.js
View file @
12e01aee
...
@@ -106,7 +106,7 @@ describe('Feature Flags', () => {
...
@@ -106,7 +106,7 @@ describe('Feature Flags', () => {
});
});
it
(
'
should render the empty state
'
,
()
=>
{
it
(
'
should render the empty state
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
All
(
'
.js-feature-flags-empty-state
'
)).
not
.
toBeNull
();
expect
(
component
.
$el
.
querySelector
(
'
.js-feature-flags-empty-state
'
)).
not
.
toBeNull
();
});
});
it
(
'
renders configure button
'
,
()
=>
{
it
(
'
renders configure button
'
,
()
=>
{
...
@@ -116,6 +116,40 @@ describe('Feature Flags', () => {
...
@@ -116,6 +116,40 @@ describe('Feature Flags', () => {
it
(
'
renders new feature flag button
'
,
()
=>
{
it
(
'
renders new feature flag button
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-ff-new
'
)).
not
.
toBeNull
();
expect
(
component
.
$el
.
querySelector
(
'
.js-ff-new
'
)).
not
.
toBeNull
();
});
});
describe
(
'
in all tab
'
,
()
=>
{
it
(
'
renders generic title
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-feature-flags-empty-state h4
'
).
textContent
.
trim
(),
).
toEqual
(
'
Get started with Feature Flags
'
);
});
});
describe
(
'
in disabled tab
'
,
()
=>
{
it
(
'
renders disabled title
'
,
done
=>
{
component
.
scope
=
'
disabled
'
;
Vue
.
nextTick
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-feature-flags-empty-state h4
'
).
textContent
.
trim
(),
).
toEqual
(
'
There are no inactive Feature Flags
'
);
done
();
});
});
});
describe
(
'
in enabled tab
'
,
()
=>
{
it
(
'
renders enabled title
'
,
done
=>
{
component
.
scope
=
'
enabled
'
;
Vue
.
nextTick
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-feature-flags-empty-state h4
'
).
textContent
.
trim
(),
).
toEqual
(
'
There are no active Feature Flags
'
);
done
();
});
});
});
});
});
describe
(
'
with paginated feature flags
'
,
()
=>
{
describe
(
'
with paginated feature flags
'
,
()
=>
{
...
...
locale/gitlab.pot
View file @
12e01aee
...
@@ -3860,13 +3860,13 @@ msgstr ""
...
@@ -3860,13 +3860,13 @@ msgstr ""
msgid "FeatureFlags|Feature Flags"
msgid "FeatureFlags|Feature Flags"
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|Feature flag
s 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|Get started with
feature f
lags"
msgid "FeatureFlags|Get started with
Feature F
lags"
msgstr ""
msgstr ""
msgid "FeatureFlags|Inactive"
msgid "FeatureFlags|Inactive"
...
@@ -3908,6 +3908,12 @@ msgstr ""
...
@@ -3908,6 +3908,12 @@ msgstr ""
msgid "FeatureFlags|Target environments"
msgid "FeatureFlags|Target environments"
msgstr ""
msgstr ""
msgid "FeatureFlags|There are no active Feature Flags"
msgstr ""
msgid "FeatureFlags|There are no inactive Feature Flags"
msgstr ""
msgid "FeatureFlags|There was an error fetching the feature flags."
msgid "FeatureFlags|There was an error fetching the feature flags."
msgstr ""
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment