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
3b5928de
Commit
3b5928de
authored
Jul 06, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2466-rationalise-license-feature-codes' into 'master'
Rationalise license codes See merge request !2360
parents
89e685fb
ae8d9d8d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
26 additions
and
26 deletions
+26
-26
app/controllers/projects/path_locks_controller.rb
app/controllers/projects/path_locks_controller.rb
+1
-1
app/controllers/projects/refs_controller.rb
app/controllers/projects/refs_controller.rb
+1
-1
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+2
-2
app/models/license.rb
app/models/license.rb
+14
-14
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+1
-1
app/views/projects/commits/_head.html.haml
app/views/projects/commits/_head.html.haml
+1
-1
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+1
-1
lib/gitlab/checks/change_access.rb
lib/gitlab/checks/change_access.rb
+1
-1
spec/features/projects/path_locks_spec.rb
spec/features/projects/path_locks_spec.rb
+1
-1
spec/helpers/tree_helper_spec.rb
spec/helpers/tree_helper_spec.rb
+1
-1
spec/models/license_spec.rb
spec/models/license_spec.rb
+2
-2
No files found.
app/controllers/projects/path_locks_controller.rb
View file @
3b5928de
...
...
@@ -45,7 +45,7 @@ class Projects::PathLocksController < Projects::ApplicationController
private
def
check_license
unless
@project
.
feature_available?
(
:file_lock
)
unless
@project
.
feature_available?
(
:file_lock
s
)
flash
[
:alert
]
=
'You need a different license to enable FileLocks feature'
redirect_to
admin_license_path
end
...
...
app/controllers/projects/refs_controller.rb
View file @
3b5928de
...
...
@@ -52,7 +52,7 @@ class Projects::RefsController < Projects::ApplicationController
contents
.
push
(
*
tree
.
blobs
)
contents
.
push
(
*
tree
.
submodules
)
show_path_locks
=
@project
.
feature_available?
(
:file_lock
)
&&
@project
.
path_locks
.
any?
show_path_locks
=
@project
.
feature_available?
(
:file_lock
s
)
&&
@project
.
path_locks
.
any?
@logs
=
contents
[
@offset
,
@limit
].
to_a
.
map
do
|
content
|
file
=
@path
?
File
.
join
(
@path
,
content
.
name
)
:
content
.
name
...
...
app/helpers/tree_helper.rb
View file @
3b5928de
...
...
@@ -109,7 +109,7 @@ module TreeHelper
end
def
lock_file_link
(
project
=
@project
,
path
=
@path
,
html_options:
{})
return
unless
project
.
feature_available?
(
:file_lock
)
&&
current_user
return
unless
project
.
feature_available?
(
:file_lock
s
)
&&
current_user
return
if
path
.
blank?
path_lock
=
project
.
find_path_lock
(
path
,
downstream:
true
)
...
...
@@ -169,7 +169,7 @@ module TreeHelper
end
def
render_lock_icon
(
path
)
return
unless
@project
.
feature_available?
(
:file_lock
)
return
unless
@project
.
feature_available?
(
:file_lock
s
)
return
unless
@project
.
root_ref?
(
@ref
)
if
file_lock
=
@project
.
find_path_lock
(
path
,
exact_match:
true
)
...
...
app/models/license.rb
View file @
3b5928de
...
...
@@ -2,18 +2,18 @@ class License < ActiveRecord::Base
include
ActionView
::
Helpers
::
NumberHelper
AUDITOR_USER_FEATURE
=
'GitLab_Auditor_User'
.
freeze
BURNDOWN_CHARTS_FEATURE
=
'BurndownCharts'
.
freeze
CONTRIBUTION_ANALYTICS_FEATURE
=
'ContributionAnalytics'
.
freeze
BURNDOWN_CHARTS_FEATURE
=
'
GitLab_
BurndownCharts'
.
freeze
CONTRIBUTION_ANALYTICS_FEATURE
=
'
GitLab_
ContributionAnalytics'
.
freeze
DEPLOY_BOARD_FEATURE
=
'GitLab_DeployBoard'
.
freeze
ELASTIC_SEARCH_FEATURE
=
'GitLab_ElasticSearch'
.
freeze
EXPORT_ISSUES_FEATURE
=
'GitLab_ExportIssues'
.
freeze
FAST_FORWARD_MERGE_FEATURE
=
'GitLab_FastForwardMerge'
.
freeze
FILE_LOCK_FEATURE
=
'GitLab_FileLocks'
.
freeze
FILE_LOCK
S
_FEATURE
=
'GitLab_FileLocks'
.
freeze
GEO_FEATURE
=
'GitLab_Geo'
.
freeze
GROUP_WEBHOOKS_FEATURE
=
'GroupWebhooks'
.
freeze
GROUP_WEBHOOKS_FEATURE
=
'G
itLab_G
roupWebhooks'
.
freeze
ISSUABLE_DEFAULT_TEMPLATES_FEATURE
=
'GitLab_IssuableDefaultTemplates'
.
freeze
ISSUE_BOARD
S_FOCUS_MODE_FEATURE
=
'IssueBoards
FocusMode'
.
freeze
ISSUE_BOARD_MILESTONE_FEATURE
=
'IssueBoardMilestone'
.
freeze
ISSUE_BOARD
_FOCUS_MODE_FEATURE
=
'GitLab_IssueBoard
FocusMode'
.
freeze
ISSUE_BOARD_MILESTONE_FEATURE
=
'
GitLab_
IssueBoardMilestone'
.
freeze
ISSUE_WEIGHTS_FEATURE
=
'GitLab_IssueWeights'
.
freeze
MERGE_REQUEST_APPROVERS_FEATURE
=
'GitLab_MergeRequestApprovers'
.
freeze
MERGE_REQUEST_REBASE_FEATURE
=
'GitLab_MergeRequestRebase'
.
freeze
...
...
@@ -21,9 +21,9 @@ class License < ActiveRecord::Base
MULTIPLE_ISSUE_ASSIGNEES_FEATURE
=
'GitLab_MultipleIssueAssignees'
.
freeze
OBJECT_STORAGE_FEATURE
=
'GitLab_ObjectStorage'
.
freeze
PUSH_RULES_FEATURE
=
'GitLab_PushRules'
.
freeze
RELATED_ISSUES_FEATURE
=
'RelatedIssues'
.
freeze
RELATED_ISSUES_FEATURE
=
'
GitLab_
RelatedIssues'
.
freeze
SERVICE_DESK_FEATURE
=
'GitLab_ServiceDesk'
.
freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE
=
'VariableEnvironmentScope'
.
freeze
VARIABLE_ENVIRONMENT_SCOPE_FEATURE
=
'
GitLab_
VariableEnvironmentScope'
.
freeze
FEATURE_CODES
=
{
auditor_user:
AUDITOR_USER_FEATURE
,
...
...
@@ -40,10 +40,10 @@ class License < ActiveRecord::Base
deploy_board:
DEPLOY_BOARD_FEATURE
,
export_issues:
EXPORT_ISSUES_FEATURE
,
fast_forward_merge:
FAST_FORWARD_MERGE_FEATURE
,
file_lock
:
FILE_LOCK
_FEATURE
,
file_lock
s:
FILE_LOCKS
_FEATURE
,
group_webhooks:
GROUP_WEBHOOKS_FEATURE
,
issuable_default_templates:
ISSUABLE_DEFAULT_TEMPLATES_FEATURE
,
issue_board_focus_mode:
ISSUE_BOARD
S
_FOCUS_MODE_FEATURE
,
issue_board_focus_mode:
ISSUE_BOARD_FOCUS_MODE_FEATURE
,
issue_board_milestone:
ISSUE_BOARD_MILESTONE_FEATURE
,
issue_weights:
ISSUE_WEIGHTS_FEATURE
,
merge_request_approvers:
MERGE_REQUEST_APPROVERS_FEATURE
,
...
...
@@ -66,7 +66,7 @@ class License < ActiveRecord::Base
{
FAST_FORWARD_MERGE_FEATURE
=>
1
},
{
GROUP_WEBHOOKS_FEATURE
=>
1
},
{
ISSUABLE_DEFAULT_TEMPLATES_FEATURE
=>
1
},
{
ISSUE_BOARD
S
_FOCUS_MODE_FEATURE
=>
1
},
{
ISSUE_BOARD_FOCUS_MODE_FEATURE
=>
1
},
{
ISSUE_BOARD_MILESTONE_FEATURE
=>
1
},
{
ISSUE_WEIGHTS_FEATURE
=>
1
},
{
MERGE_REQUEST_APPROVERS_FEATURE
=>
1
},
...
...
@@ -81,7 +81,7 @@ class License < ActiveRecord::Base
*
EES_FEATURES
,
{
AUDITOR_USER_FEATURE
=>
1
},
{
DEPLOY_BOARD_FEATURE
=>
1
},
{
FILE_LOCK_FEATURE
=>
1
},
{
FILE_LOCK
S
_FEATURE
=>
1
},
{
GEO_FEATURE
=>
1
},
{
OBJECT_STORAGE_FEATURE
=>
1
},
{
SERVICE_DESK_FEATURE
=>
1
},
...
...
@@ -106,11 +106,11 @@ class License < ActiveRecord::Base
{
DEPLOY_BOARD_FEATURE
=>
1
},
{
EXPORT_ISSUES_FEATURE
=>
1
},
{
FAST_FORWARD_MERGE_FEATURE
=>
1
},
{
FILE_LOCK_FEATURE
=>
1
},
{
FILE_LOCK
S
_FEATURE
=>
1
},
{
GEO_FEATURE
=>
1
},
{
GROUP_WEBHOOKS_FEATURE
=>
1
},
{
ISSUABLE_DEFAULT_TEMPLATES_FEATURE
=>
1
},
{
ISSUE_BOARD
S
_FOCUS_MODE_FEATURE
=>
1
},
{
ISSUE_BOARD_FOCUS_MODE_FEATURE
=>
1
},
{
ISSUE_BOARD_MILESTONE_FEATURE
=>
1
},
{
ISSUE_WEIGHTS_FEATURE
=>
1
},
{
MERGE_REQUEST_APPROVERS_FEATURE
=>
1
},
...
...
app/views/projects/blob/_header.html.haml
View file @
3b5928de
...
...
@@ -20,7 +20,7 @@
=
render
'projects/fork_suggestion'
-
if
@project
.
feature_available?
(
:file_lock
)
-
if
@project
.
feature_available?
(
:file_lock
s
)
:javascript
PathLocks
.
init
(
'
#{
toggle_project_path_locks_path
(
@project
)
}
'
,
...
...
app/views/projects/commits/_head.html.haml
View file @
3b5928de
...
...
@@ -35,7 +35,7 @@
=
link_to
charts_project_graph_path
(
@project
,
current_ref
)
do
#{
_
(
'Charts'
)
}
-
if
@project
.
feature_available?
(
:file_lock
)
-
if
@project
.
feature_available?
(
:file_lock
s
)
=
nav_link
(
controller:
[
:path_locks
])
do
=
link_to
project_path_locks_path
(
@project
)
do
Locked Files
app/views/projects/tree/_tree_content.html.haml
View file @
3b5928de
...
...
@@ -23,7 +23,7 @@
=
render
'projects/blob/upload'
,
title:
_
(
'Upload New File'
),
placeholder:
_
(
'Upload New File'
),
button_title:
_
(
'Upload file'
),
form_path:
project_create_blob_path
(
@project
,
@id
),
method: :post
=
render
'projects/blob/new_dir'
-
if
@project
.
feature_available?
(
:file_lock
)
-
if
@project
.
feature_available?
(
:file_lock
s
)
:javascript
PathLocks
.
init
(
'
#{
toggle_project_path_locks_path
(
@project
)
}
'
,
...
...
lib/gitlab/checks/change_access.rb
View file @
3b5928de
...
...
@@ -248,7 +248,7 @@ module Gitlab
end
def
validate_path_locks?
@validate_path_locks
||=
@project
.
feature_available?
(
:file_lock
)
&&
@validate_path_locks
||=
@project
.
feature_available?
(
:file_lock
s
)
&&
project
.
path_locks
.
any?
&&
@newrev
&&
@oldrev
&&
project
.
default_branch
==
@branch_name
# locks protect default branch only
end
...
...
spec/features/projects/path_locks_spec.rb
View file @
3b5928de
...
...
@@ -6,7 +6,7 @@ feature 'Path Locks', feature: true, js: true do
let
(
:tree_path
)
{
project_tree_path
(
project
,
project
.
repository
.
root_ref
)
}
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:file_lock
)
{
true
}
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:file_lock
s
)
{
true
}
project
.
team
<<
[
user
,
:master
]
gitlab_sign_in
(
user
)
...
...
spec/helpers/tree_helper_spec.rb
View file @
3b5928de
...
...
@@ -35,7 +35,7 @@ describe TreeHelper do
before
do
allow
(
helper
).
to
receive
(
:can?
).
and_return
(
true
)
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:file_lock
)
{
true
}
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:file_lock
s
)
{
true
}
project
.
reload
end
...
...
spec/models/license_spec.rb
View file @
3b5928de
...
...
@@ -399,9 +399,9 @@ describe License do
context
'with add-ons'
do
it
'returns all available add-ons'
do
license
=
build_license_with_add_ons
({
License
::
DEPLOY_BOARD_FEATURE
=>
1
,
License
::
FILE_LOCK_FEATURE
=>
2
})
license
=
build_license_with_add_ons
({
License
::
DEPLOY_BOARD_FEATURE
=>
1
,
License
::
FILE_LOCK
S
_FEATURE
=>
2
})
expect
(
license
.
add_ons
.
keys
).
to
include
(
License
::
DEPLOY_BOARD_FEATURE
,
License
::
FILE_LOCK_FEATURE
)
expect
(
license
.
add_ons
.
keys
).
to
include
(
License
::
DEPLOY_BOARD_FEATURE
,
License
::
FILE_LOCK
S
_FEATURE
)
end
it
'can return details about a single add-on'
do
...
...
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