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
b60a39f2
Commit
b60a39f2
authored
Feb 09, 2018
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default CI variables to unprotected
See
https://gitlab.com/gitlab-org/gitlab-ce/issues/42928
parent
dbb934c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
app/assets/javascripts/ci_variable_list/ci_variable_list.js
app/assets/javascripts/ci_variable_list/ci_variable_list.js
+1
-1
app/views/ci/variables/_variable_row.html.haml
app/views/ci/variables/_variable_row.html.haml
+1
-1
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
+1
-1
spec/support/features/variable_list_shared_examples.rb
spec/support/features/variable_list_shared_examples.rb
+4
-4
No files found.
app/assets/javascripts/ci_variable_list/ci_variable_list.js
View file @
b60a39f2
...
@@ -39,7 +39,7 @@ export default class VariableList {
...
@@ -39,7 +39,7 @@ export default class VariableList {
},
},
protected
:
{
protected
:
{
selector
:
'
.js-ci-variable-input-protected
'
,
selector
:
'
.js-ci-variable-input-protected
'
,
default
:
'
tru
e
'
,
default
:
'
fals
e
'
,
},
},
environment_scope
:
{
environment_scope
:
{
// We can't use a `.js-` class here because
// We can't use a `.js-` class here because
...
...
app/views/ci/variables/_variable_row.html.haml
View file @
b60a39f2
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
-
id
=
variable
&
.
id
-
id
=
variable
&
.
id
-
key
=
variable
&
.
key
-
key
=
variable
&
.
key
-
value
=
variable
&
.
value
-
value
=
variable
&
.
value
-
is_protected
=
variable
&&
!
only_key_value
?
variable
.
protected
:
tru
e
-
is_protected
=
variable
&&
!
only_key_value
?
variable
.
protected
:
fals
e
-
id_input_name
=
"
#{
form_field
}
[variables_attributes][][id]"
-
id_input_name
=
"
#{
form_field
}
[variables_attributes][][id]"
-
destroy_input_name
=
"
#{
form_field
}
[variables_attributes][][_destroy]"
-
destroy_input_name
=
"
#{
form_field
}
[variables_attributes][][_destroy]"
...
...
spec/javascripts/ci_variable_list/ci_variable_list_spec.js
View file @
b60a39f2
...
@@ -126,7 +126,7 @@ describe('VariableList', () => {
...
@@ -126,7 +126,7 @@ describe('VariableList', () => {
// Check for the correct default in the new row
// Check for the correct default in the new row
const
$protectedInput
=
$wrapper
.
find
(
'
.js-row:last-child
'
).
find
(
'
.js-ci-variable-input-protected
'
);
const
$protectedInput
=
$wrapper
.
find
(
'
.js-row:last-child
'
).
find
(
'
.js-ci-variable-input-protected
'
);
expect
(
$protectedInput
.
val
()).
toBe
(
'
tru
e
'
);
expect
(
$protectedInput
.
val
()).
toBe
(
'
fals
e
'
);
})
})
.
then
(
done
)
.
then
(
done
)
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
...
...
spec/support/features/variable_list_shared_examples.rb
View file @
b60a39f2
...
@@ -41,13 +41,13 @@ shared_examples 'variable list' do
...
@@ -41,13 +41,13 @@ shared_examples 'variable list' do
end
end
end
end
it
'adds new
un
protected variable'
do
it
'adds new protected variable'
do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'key'
)
find
(
'.js-ci-variable-input-key'
).
set
(
'key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'key value'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'key value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
fals
e'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
tru
e'
)
end
end
click_button
(
'Save variables'
)
click_button
(
'Save variables'
)
...
@@ -59,7 +59,7 @@ shared_examples 'variable list' do
...
@@ -59,7 +59,7 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:nth-child(1)'
)
do
page
.
within
(
'.js-ci-variable-list-section .js-row:nth-child(1)'
)
do
expect
(
find
(
'.js-ci-variable-input-key'
).
value
).
to
eq
(
'key'
)
expect
(
find
(
'.js-ci-variable-input-key'
).
value
).
to
eq
(
'key'
)
expect
(
find
(
'.js-ci-variable-input-value'
,
visible:
false
).
value
).
to
eq
(
'key value'
)
expect
(
find
(
'.js-ci-variable-input-value'
,
visible:
false
).
value
).
to
eq
(
'key value'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
fals
e'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'
tru
e'
)
end
end
end
end
...
@@ -143,7 +143,6 @@ shared_examples 'variable list' do
...
@@ -143,7 +143,6 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'unprotected_key'
)
find
(
'.js-ci-variable-input-key'
).
set
(
'unprotected_key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'unprotected_value'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'unprotected_value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'false'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'false'
)
end
end
...
@@ -178,6 +177,7 @@ shared_examples 'variable list' do
...
@@ -178,6 +177,7 @@ shared_examples 'variable list' do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
page
.
within
(
'.js-ci-variable-list-section .js-row:last-child'
)
do
find
(
'.js-ci-variable-input-key'
).
set
(
'protected_key'
)
find
(
'.js-ci-variable-input-key'
).
set
(
'protected_key'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'protected_value'
)
find
(
'.js-ci-variable-input-value'
).
set
(
'protected_value'
)
find
(
'.ci-variable-protected-item .js-project-feature-toggle'
).
click
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'true'
)
expect
(
find
(
'.js-ci-variable-input-protected'
,
visible:
false
).
value
).
to
eq
(
'true'
)
end
end
...
...
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