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
7fabd9a8
Commit
7fabd9a8
authored
Jan 21, 2019
by
Filipa Lacerda
Committed by
Phil Hughes
Jan 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds environment column to the feature flags page
parent
a055cb9c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
12 deletions
+98
-12
ee/app/assets/javascripts/feature_flags/components/feature_flags_table.vue
...ascripts/feature_flags/components/feature_flags_table.vue
+36
-9
ee/app/assets/stylesheets/pages/feature_flags.scss
ee/app/assets/stylesheets/pages/feature_flags.scss
+11
-0
ee/changelogs/unreleased/8621-add-environment-info-index.yml
ee/changelogs/unreleased/8621-add-environment-info-index.yml
+5
-0
ee/spec/javascripts/projects/feature_flags/feature_flags_table_spec.js
...cripts/projects/feature_flags/feature_flags_table_spec.js
+24
-0
ee/spec/javascripts/projects/feature_flags/mock_data.js
ee/spec/javascripts/projects/feature_flags/mock_data.js
+16
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-3
No files found.
ee/app/assets/javascripts/feature_flags/components/feature_flags_table.vue
View file @
7fabd9a8
<
script
>
import
{
GlButton
,
GlLink
,
GlTooltipDirective
}
from
'
@gitlab/ui
'
;
import
{
sprintf
,
s__
}
from
'
~/locale
'
;
import
DeleteFeatureFlag
from
'
./delete_feature_flag.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
...
...
@@ -23,6 +24,13 @@ export default {
required
:
true
,
},
},
methods
:
{
scopeTooltipText
(
scope
)
{
return
!
scope
.
active
?
sprintf
(
s__
(
'
Inactive flag for %{scope}
'
),
{
scope
:
scope
.
environment_scope
})
:
''
;
},
},
};
</
script
>
<
template
>
...
...
@@ -31,8 +39,11 @@ export default {
<div
class=
"table-section section-10"
role=
"columnheader"
>
{{
s__
(
'
FeatureFlags|Status
'
)
}}
</div>
<div
class=
"table-section section-20"
role=
"columnheader"
>
{{
s__
(
'
FeatureFlags|Feature Flag
'
)
}}
</div>
<div
class=
"table-section section-50"
role=
"columnheader"
>
{{
s__
(
'
FeatureFlags|
Feature flag
'
)
}}
{{
s__
(
'
FeatureFlags|
Environment Specs
'
)
}}
</div>
</div>
...
...
@@ -41,16 +52,14 @@ export default {
<div
class=
"table-section section-10"
role=
"gridcell"
>
<div
class=
"table-mobile-header"
role=
"rowheader"
>
{{
s__
(
'
FeatureFlags|Status
'
)
}}
</div>
<div
class=
"table-mobile-content js-feature-flag-status"
>
<template
v-if=
"featureFlag.active"
>
<span
class=
"badge badge-success"
>
{{
s__
(
'
FeatureFlags|Active
'
)
}}
</span>
</
template
>
<
template
v-else
>
<span
class=
"badge badge-danger"
>
{{
s__
(
'
FeatureFlags|Inactive
'
)
}}
</span>
</
template
>
<span
v-if=
"featureFlag.active"
class=
"badge badge-success"
>
{{
s__
(
'
FeatureFlags|Active
'
)
}}
</span>
<span
v-else
class=
"badge badge-danger"
>
{{
s__
(
'
FeatureFlags|Inactive
'
)
}}
</span>
</div>
</div>
<div
class=
"table-section section-
5
0"
role=
"gridcell"
>
<div
class=
"table-section section-
2
0"
role=
"gridcell"
>
<div
class=
"table-mobile-header"
role=
"rowheader"
>
{{
s__
(
'
FeatureFlags|Feature Flag
'
)
}}
</div>
...
...
@@ -62,7 +71,25 @@ export default {
</div>
</div>
<div
class=
"table-section section-40 table-button-footer"
role=
"gridcell"
>
<div
class=
"table-section section-50"
role=
"gridcell"
>
<div
class=
"table-mobile-header"
role=
"rowheader"
>
{{
s__
(
'
FeatureFlags|Environment Specs
'
)
}}
</div>
<div
class=
"table-mobile-content d-flex flex-wrap justify-content-end js-feature-flag-environments"
>
<span
v-for=
"scope in featureFlag.scopes"
:key=
"scope.id"
v-gl-tooltip.hover=
"scopeTooltipText(scope)"
class=
"badge append-right-8 prepend-top-2"
:class=
"
{ 'badge-active': scope.active, 'badge-inactive': !scope.active }"
>
{{
scope
.
environment_scope
}}
</span
>
</div>
</div>
<div
class=
"table-section section-20 table-button-footer"
role=
"gridcell"
>
<div
class=
"table-action-buttons btn-group"
>
<template
v-if=
"featureFlag.edit_path"
>
<gl-button
...
...
ee/app/assets/stylesheets/pages/feature_flags.scss
0 → 100644
View file @
7fabd9a8
$label-blue
:
#428bca
;
.badge-active
{
color
:
$white-light
;
background-color
:
$label-blue
;
}
.badge-inactive
{
color
:
$white-light
;
background-color
:
$gray-500
;
}
ee/changelogs/unreleased/8621-add-environment-info-index.yml
0 → 100644
View file @
7fabd9a8
---
title
:
Adds environment column to the feature flags page
merge_request
:
author
:
type
:
changed
ee/spec/javascripts/projects/feature_flags/feature_flags_table_spec.js
View file @
7fabd9a8
...
...
@@ -43,6 +43,30 @@ describe('Feature Flag table', () => {
);
});
it
(
'
should render a environments specs column
'
,
()
=>
{
const
envColumn
=
vm
.
$el
.
querySelector
(
'
.js-feature-flag-environments
'
);
expect
(
envColumn
).
not
.
toBeNull
();
expect
(
envColumn
.
textContent
.
trim
()).
toContain
(
featureFlag
.
scopes
[
0
].
environment_scope
);
expect
(
envColumn
.
textContent
.
trim
()).
toContain
(
featureFlag
.
scopes
[
1
].
environment_scope
);
});
it
(
'
should render a environments specs badge with inactive class
'
,
()
=>
{
const
envColumn
=
vm
.
$el
.
querySelector
(
'
.js-feature-flag-environments
'
);
expect
(
envColumn
.
querySelector
(
'
.badge-inactive
'
).
textContent
.
trim
()).
toContain
(
featureFlag
.
scopes
[
1
].
environment_scope
,
);
});
it
(
'
should render a environments specs badge with active class
'
,
()
=>
{
const
envColumn
=
vm
.
$el
.
querySelector
(
'
.js-feature-flag-environments
'
);
expect
(
envColumn
.
querySelector
(
'
.badge-active
'
).
textContent
.
trim
()).
toContain
(
featureFlag
.
scopes
[
0
].
environment_scope
,
);
});
it
(
'
Should render an actions column
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.table-action-buttons
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-feature-flag-delete-button
'
)).
not
.
toBeNull
();
...
...
ee/spec/javascripts/projects/feature_flags/mock_data.js
View file @
7fabd9a8
...
...
@@ -20,4 +20,20 @@ export const featureFlag = {
description
:
'
flag for tests
'
,
destroy_path
:
'
feature_flags/1
'
,
edit_path
:
'
feature_flags/1/edit
'
,
scopes
:
[
{
id
:
1
,
active
:
true
,
environment_scope
:
'
*
'
,
created_at
:
'
2019-01-14T06:41:40.987Z
'
,
updated_at
:
'
2019-01-14T06:41:40.987Z
'
,
},
{
id
:
2
,
active
:
false
,
environment_scope
:
'
production
'
,
created_at
:
'
2019-01-14T06:41:40.987Z
'
,
updated_at
:
'
2019-01-14T06:41:40.987Z
'
,
},
],
};
locale/gitlab.pot
View file @
7fabd9a8
...
...
@@ -3764,13 +3764,13 @@ msgstr ""
msgid "FeatureFlags|Edit Feature Flag"
msgstr ""
msgid "FeatureFlags|
Feature Flag
"
msgid "FeatureFlags|
Environment Specs
"
msgstr ""
msgid "FeatureFlags|Feature Flag
s
"
msgid "FeatureFlags|Feature Flag"
msgstr ""
msgid "FeatureFlags|Feature
flag
"
msgid "FeatureFlags|Feature
Flags
"
msgstr ""
msgid "FeatureFlags|Feature flag %{name} will be removed. Are you sure?"
...
...
@@ -4903,6 +4903,9 @@ msgstr ""
msgid "In the next step, you'll be able to select the projects you want to import."
msgstr ""
msgid "Inactive flag for %{scope}"
msgstr ""
msgid "Include a Terms of Service agreement and Privacy Policy that all users must accept."
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