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
098d41be
Commit
098d41be
authored
Aug 16, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep protected environments section expanded after form submission
parent
09f9e1a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
ee/app/assets/javascripts/protected_environments/protected_environment_create.js
...ts/protected_environments/protected_environment_create.js
+2
-4
ee/app/controllers/projects/protected_environments_controller.rb
...controllers/projects/protected_environments_controller.rb
+2
-2
ee/app/views/projects/settings/ci_cd/_protected_environments.html.haml
...projects/settings/ci_cd/_protected_environments.html.haml
+1
-1
No files found.
ee/app/assets/javascripts/protected_environments/protected_environment_create.js
View file @
098d41be
...
...
@@ -48,10 +48,7 @@ export default class ProtectedEnvironmentCreate {
// Enable submit button after selecting an option
onSelect
()
{
const
$allowedToDeploy
=
this
[
`
${
ACCESS_LEVELS
.
DEPLOY
}
_dropdown`
].
getSelectedItems
();
const
toggle
=
!
(
this
.
$form
.
find
(
PROTECTED_ENVIRONMENT_INPUT
).
val
()
&&
$allowedToDeploy
.
length
);
const
toggle
=
!
(
this
.
$form
.
find
(
PROTECTED_ENVIRONMENT_INPUT
).
val
()
&&
$allowedToDeploy
.
length
);
this
.
$form
.
find
(
'
input[type="submit"]
'
).
attr
(
'
disabled
'
,
toggle
);
}
...
...
@@ -114,6 +111,7 @@ export default class ProtectedEnvironmentCreate {
axios
[
this
.
$form
.
attr
(
'
method
'
)](
this
.
$form
.
attr
(
'
action
'
),
this
.
getFormData
())
.
then
(()
=>
{
window
.
location
.
hash
=
'
js-protected-environments-settings
'
;
window
.
location
.
reload
();
})
.
catch
(()
=>
Flash
(
'
Failed to protect the environment
'
));
...
...
ee/app/controllers/projects/protected_environments_controller.rb
View file @
098d41be
...
...
@@ -12,7 +12,7 @@ class Projects::ProtectedEnvironmentsController < Projects::ApplicationControlle
flash
[
:alert
]
=
protected_environment
.
errors
.
full_messages
.
join
(
', '
)
end
redirect_to
project_settings_ci_cd_path
(
@project
)
redirect_to
project_settings_ci_cd_path
(
@project
,
anchor:
'js-protected-environments-settings'
)
end
def
update
...
...
@@ -34,7 +34,7 @@ class Projects::ProtectedEnvironmentsController < Projects::ApplicationControlle
flash
[
:alert
]
=
s_
(
"ProtectedEnvironment|Your environment can't be unprotected"
)
end
redirect_to
project_settings_ci_cd_path
(
@project
),
status: :found
redirect_to
project_settings_ci_cd_path
(
@project
,
anchor:
'js-protected-environments-settings'
),
status: :found
end
def
search
...
...
ee/app/views/projects/settings/ci_cd/_protected_environments.html.haml
View file @
098d41be
...
...
@@ -2,7 +2,7 @@
-
can_admin_project
=
can?
(
current_user
,
:admin_project
,
@project
)
-
if
protected_environments_enabled?
%section
.protected-environments-settings.settings.no-animate
{
class:
(
'expanded'
if
expanded
)
}
%section
.protected-environments-settings.settings.no-animate
#js-protected-environments-settings
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
%h4
=
_
(
'Protected Environments'
)
...
...
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