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
032e5a88
Commit
032e5a88
authored
Aug 13, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor data attributes
- Move out to rails view helper
parent
e5a0dcd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+18
-0
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
...projects/_merge_request_approvals_settings_form.html.haml
+1
-12
No files found.
ee/app/helpers/ee/projects_helper.rb
View file @
032e5a88
...
...
@@ -94,6 +94,24 @@ module EE
{
date:
date
}
end
def
approvals_app_data
(
project
=
@project
)
{
data:
{
'project_id'
:
project
.
id
,
'can_edit'
:
can_modify_approvers
.
to_s
,
'project_path'
:
expose_path
(
api_v4_projects_path
(
id:
project
.
id
)),
'settings_path'
:
expose_path
(
api_v4_projects_approval_settings_path
(
id:
project
.
id
)),
'rules_path'
:
expose_path
(
api_v4_projects_approval_settings_rules_path
(
id:
project
.
id
)),
'allow_multi_rule'
:
project
.
multiple_approval_rules_available?
.
to_s
,
'eligible_approvers_docs_path'
:
help_page_path
(
'user/project/merge_requests/merge_request_approvals'
,
anchor:
'eligible-approvers'
),
'security_approvals_help_page_path'
:
help_page_path
(
'user/application_security/index.md'
,
anchor:
'security-approvals-in-merge-requests-ultimate'
),
'security_configuration_path'
:
project_security_configuration_path
(
project
),
'vulnerability_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-security-approvals-within-a-project'
),
'license_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-license-approvals-within-a-project'
)}
}
end
def
can_modify_approvers
(
project
=
@project
)
can?
(
current_user
,
:modify_approvers_rules
,
project
)
end
def
permanent_delete_message
(
project
)
message
=
_
(
'This action will %{strongOpen}permanently delete%{strongClose} %{codeOpen}%{project}%{codeClose} %{strongOpen}immediately%{strongClose}, including its repositories and all content: issues, merge requests, etc.'
)
html_escape
(
message
)
%
remove_message_data
(
project
)
...
...
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
View file @
032e5a88
-
can_override_approvers
=
project
.
can_override_approvers?
-
can_modify_approvers
=
can?
(
current_user
,
:modify_approvers_rules
,
@project
)
-
can_modify_merge_request_author_settings
=
can?
(
current_user
,
:modify_merge_request_author_setting
,
@project
)
-
can_modify_merge_request_committer_settings
=
can?
(
current_user
,
:modify_merge_request_committer_setting
,
@project
)
.form-group
=
form
.
label
:approver_ids
,
class:
'label-bold'
do
=
_
(
"Approval rules"
)
#js-mr-approvals-settings
{
data:
{
'project_id'
:
@project
.
id
,
'can_edit'
:
can_modify_approvers
.
to_s
,
'project_path'
:
expose_path
(
api_v4_projects_path
(
id:
@project
.
id
)),
'settings_path'
:
expose_path
(
api_v4_projects_approval_settings_path
(
id:
@project
.
id
)),
'rules_path'
:
expose_path
(
api_v4_projects_approval_settings_rules_path
(
id:
@project
.
id
)),
'allow_multi_rule'
:
@project
.
multiple_approval_rules_available?
.
to_s
,
'eligible_approvers_docs_path'
:
help_page_path
(
'user/project/merge_requests/merge_request_approvals'
,
anchor:
'eligible-approvers'
),
'security_approvals_help_page_path'
:
help_page_path
(
'user/application_security/index.md'
,
anchor:
'security-approvals-in-merge-requests-ultimate'
),
'security_configuration_path'
:
project_security_configuration_path
(
@project
),
'vulnerability_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-security-approvals-within-a-project'
),
'license_check_help_page_path'
:
help_page_path
(
'user/application_security/index'
,
anchor:
'enabling-license-approvals-within-a-project'
)}
}
#js-mr-approvals-settings
{
approvals_app_data
}
.text-center.gl-mt-3
=
sprite_icon
(
'spinner'
,
size:
24
,
css_class:
'gl-spinner'
)
...
...
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