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
0102e02a
Commit
0102e02a
authored
Jul 02, 2020
by
Jason Goodman
Committed by
Andrew Fontaine
Jul 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always show delete button on feature flag strategies
Always allow the UI to set zero strategies for a flag
parent
52207f5e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
22 deletions
+10
-22
ee/app/assets/javascripts/feature_flags/components/form.vue
ee/app/assets/javascripts/feature_flags/components/form.vue
+0
-4
ee/app/assets/javascripts/feature_flags/components/strategy.vue
.../assets/javascripts/feature_flags/components/strategy.vue
+0
-5
ee/changelogs/unreleased/allow-no-strategies-in-ui.yml
ee/changelogs/unreleased/allow-no-strategies-in-ui.yml
+5
-0
ee/spec/frontend/feature_flags/components/strategy_spec.js
ee/spec/frontend/feature_flags/components/strategy_spec.js
+5
-13
No files found.
ee/app/assets/javascripts/feature_flags/components/form.vue
View file @
0102e02a
...
...
@@ -150,9 +150,6 @@ export default {
supportsStrategies
()
{
return
this
.
glFeatures
.
featureFlagsNewVersion
&&
this
.
version
===
NEW_VERSION_FLAG
;
},
canDeleteStrategy
()
{
return
this
.
formStrategies
.
length
>
1
;
},
showRelatedIssues
()
{
return
this
.
featureFlagIssuesEndpoint
.
length
>
0
;
},
...
...
@@ -349,7 +346,6 @@ export default {
:strategy=
"strategy"
:index=
"index"
:endpoint=
"environmentsEndpoint"
:can-delete=
"canDeleteStrategy"
:user-lists=
"userLists"
@
change=
"onFormStrategyChange($event, index)"
@
delete=
"deleteStrategy(strategy)"
...
...
ee/app/assets/javascripts/feature_flags/components/strategy.vue
View file @
0102e02a
...
...
@@ -50,10 +50,6 @@ export default {
required
:
false
,
default
:
''
,
},
canDelete
:
{
type
:
Boolean
,
required
:
true
,
},
userLists
:
{
type
:
Array
,
required
:
false
,
...
...
@@ -274,7 +270,6 @@ export default {
<div
class=
"align-self-end align-self-md-stretch order-first offset-md-0 order-md-0 ml-auto"
>
<gl-deprecated-button
v-if=
"canDelete"
data-testid=
"delete-strategy-button"
variant=
"danger"
@
click=
"$emit('delete')"
...
...
ee/changelogs/unreleased/allow-no-strategies-in-ui.yml
0 → 100644
View file @
0102e02a
---
title
:
Always show delete button on feature flag strategies
merge_request
:
35786
author
:
type
:
fixed
ee/spec/frontend/feature_flags/components/strategy_spec.js
View file @
0102e02a
...
...
@@ -23,7 +23,6 @@ describe('Feature flags strategy', () => {
strategy
:
{},
index
:
0
,
endpoint
:
''
,
canDelete
:
true
,
userLists
:
[
userList
],
},
},
...
...
@@ -56,7 +55,7 @@ describe('Feature flags strategy', () => {
parameters
[
parameter
]
=
value
;
}
strategy
=
{
name
,
parameters
};
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
canDelete
:
true
};
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
};
factory
({
propsData
});
});
...
...
@@ -92,7 +91,7 @@ describe('Feature flags strategy', () => {
let
strategy
;
beforeEach
(()
=>
{
strategy
=
{
name
:
ROLLOUT_STRATEGY_GITLAB_USER_LIST
,
userListId
:
'
2
'
,
parameters
:
{}
};
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
canDelete
:
true
,
userLists
:
[
userList
]
};
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
userLists
:
[
userList
]
};
factory
({
propsData
});
});
...
...
@@ -142,7 +141,7 @@ describe('Feature flags strategy', () => {
parameters
:
{
percentage
:
'
50
'
},
scopes
:
[{
environmentScope
:
'
*
'
}],
};
const
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
canDelete
:
true
};
const
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
};
factory
({
propsData
});
});
...
...
@@ -208,23 +207,16 @@ describe('Feature flags strategy', () => {
wrapper
.
find
(
GlDeprecatedButton
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
emitted
(
'
delete
'
)).
toEqual
([[]]);
});
it
(
'
should not display the delete button if can delete is false
'
,
()
=>
{
const
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
canDelete
:
false
};
factory
({
propsData
});
expect
(
wrapper
.
find
(
GlDeprecatedButton
).
exists
()).
toBe
(
false
);
});
});
describe
(
'
wi
ht
out scopes defined
'
,
()
=>
{
describe
(
'
wi
th
out scopes defined
'
,
()
=>
{
beforeEach
(()
=>
{
const
strategy
=
{
name
:
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
parameters
:
{
percentage
:
'
50
'
},
scopes
:
[],
};
const
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
,
canDelete
:
true
};
const
propsData
=
{
strategy
,
index
:
0
,
endpoint
:
''
};
factory
({
propsData
});
});
...
...
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