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
63fe4408
Commit
63fe4408
authored
Sep 26, 2016
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix prevent_secrets checkbox on admin view
parent
5b2cbee5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
7 deletions
+34
-7
CHANGELOG
CHANGELOG
+1
-0
app/controllers/admin/push_rules_controller.rb
app/controllers/admin/push_rules_controller.rb
+6
-5
app/views/admin/push_rules/show.html.haml
app/views/admin/push_rules/show.html.haml
+0
-0
app/views/layouts/nav/_admin.html.haml
app/views/layouts/nav/_admin.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-1
spec/controllers/admin/push_rules_controller_spec.rb
spec/controllers/admin/push_rules_controller_spec.rb
+25
-0
No files found.
CHANGELOG
View file @
63fe4408
...
...
@@ -5,6 +5,7 @@ v 8.13.0 (unreleased)
v 8.12.2 (unreleased)
- Fix Import/Export not recognising correctly the imported services.
- Fix prevent_secrets checkbox on admin view
v 8.12.1
- Fix a memory leak in HTML::Pipeline::SanitizationFilter::WHITELIST
...
...
app/controllers/admin/push_rules_controller.rb
View file @
63fe4408
...
...
@@ -3,16 +3,16 @@ class Admin::PushRulesController < Admin::ApplicationController
respond_to
:html
def
index
def
show
end
def
update
@push_rule
.
update_attributes
(
push_rule_params
.
merge
(
is_sample:
true
)
)
@push_rule
.
update_attributes
(
push_rule_params
)
if
@push_rule
.
valid?
redirect_to
admin_push_rule
s_path
,
notice:
'Push Rules
updated successfully.'
redirect_to
admin_push_rule
_path
,
notice:
'Push Rule
updated successfully.'
else
render
:
index
render
:
show
end
end
...
...
@@ -20,7 +20,8 @@ class Admin::PushRulesController < Admin::ApplicationController
def
push_rule_params
params
.
require
(
:push_rule
).
permit
(
:deny_delete_tag
,
:delete_branch_regex
,
:commit_message_regex
,
:force_push_regex
,
:author_email_regex
,
:member_check
,
:file_name_regex
,
:max_file_size
)
:commit_message_regex
,
:force_push_regex
,
:author_email_regex
,
:member_check
,
:file_name_regex
,
:max_file_size
,
:prevent_secrets
)
end
def
push_rule
...
...
app/views/admin/push_rules/
index
.html.haml
→
app/views/admin/push_rules/
show
.html.haml
View file @
63fe4408
File moved
app/views/layouts/nav/_admin.html.haml
View file @
63fe4408
...
...
@@ -47,7 +47,7 @@
Spam Logs
=
nav_link
(
controller: :push_rules
)
do
=
link_to
admin_push_rule
s
_path
,
title:
'Push Rules'
do
=
link_to
admin_push_rule_path
,
title:
'Push Rules'
do
%span
Push Rules
...
...
config/routes.rb
View file @
63fe4408
...
...
@@ -259,7 +259,7 @@ Rails.application.routes.draw do
end
end
resource
s
:push_rules
,
only:
[
:index
,
:update
]
resource
:push_rule
,
only:
[
:show
,
:update
]
resource
:impersonation
,
only: :destroy
...
...
spec/controllers/admin/push_rules_controller_spec.rb
0 → 100644
View file @
63fe4408
require
'spec_helper'
describe
Admin
::
PushRulesController
do
let
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
end
describe
'#update'
do
it
'updates sample push rule'
do
params
=
{
deny_delete_tag:
true
,
delete_branch_regex:
"any"
,
commit_message_regex:
"any"
,
force_push_regex:
"any"
,
author_email_regex:
"any"
,
member_check:
true
,
file_name_regex:
"any"
,
max_file_size:
"0"
,
prevent_secrets:
true
}
expect_any_instance_of
(
PushRule
).
to
receive
(
:update_attributes
).
with
(
params
)
patch
:update
,
push_rule:
params
expect
(
response
).
to
redirect_to
(
admin_push_rule_path
)
end
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