Commit 29b90ce8 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Rename feature from "issue_board_milestone" to "scoped_issue_board"

parent 2e19d8ff
...@@ -16,7 +16,7 @@ class License < ActiveRecord::Base ...@@ -16,7 +16,7 @@ class License < ActiveRecord::Base
group_webhooks group_webhooks
issuable_default_templates issuable_default_templates
issue_board_focus_mode issue_board_focus_mode
issue_board_milestone scoped_issue_board
issue_weights issue_weights
jenkins_integration jenkins_integration
ldap_extras ldap_extras
......
...@@ -218,8 +218,8 @@ class Namespace < ActiveRecord::Base ...@@ -218,8 +218,8 @@ class Namespace < ActiveRecord::Base
feature_available?(:multiple_issue_boards) feature_available?(:multiple_issue_boards)
end end
def issue_board_milestone_available?(user = nil) def scoped_issue_board_available?(user = nil)
feature_available?(:issue_board_milestone) feature_available?(:scoped_issue_board)
end end
private private
......
...@@ -1532,8 +1532,8 @@ class Project < ActiveRecord::Base ...@@ -1532,8 +1532,8 @@ class Project < ActiveRecord::Base
feature_available?(:multiple_issue_boards, user) feature_available?(:multiple_issue_boards, user)
end end
def issue_board_milestone_available?(user = nil) def scoped_issue_board_available?(user = nil)
feature_available?(:issue_board_milestone, user) feature_available?(:scoped_issue_board, user)
end end
def full_path_was def full_path_was
......
module Boards module Boards
class UpdateService < Boards::BaseService class UpdateService < Boards::BaseService
def execute(board) def execute(board)
params.delete(:milestone_id) unless parent.feature_available?(:issue_board_milestone) params.delete(:milestone_id) unless parent.feature_available?(:scoped_issue_board)
board.update(params) board.update(params)
end end
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
%li %li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" } %a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" }
Edit board name Edit board name
- if parent.issue_board_milestone_available?(current_user) - if parent.scoped_issue_board_available?(current_user)
%li %li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('milestone')" } %a{ "href" => "#", "@click.stop.prevent" => "showPage('milestone')" }
Edit board milestone Edit board milestone
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%input.form-control{ type: "text", %input.form-control{ type: "text",
id: "board-new-name", id: "board-new-name",
"v-model" => "board.name" } "v-model" => "board.name" }
- if current_board_parent.issue_board_milestone_available?(current_user) - if current_board_parent.scoped_issue_board_available?(current_user)
.dropdown.board-inner-milestone-dropdown{ ":class" => "{ open: milestoneDropdownOpen }", .dropdown.board-inner-milestone-dropdown{ ":class" => "{ open: milestoneDropdownOpen }",
"v-if" => "currentPage === 'new'" } "v-if" => "currentPage === 'new'" }
%label.label-light{ for: "board-milestone" } %label.label-light{ for: "board-milestone" }
......
...@@ -8,7 +8,7 @@ module EE ...@@ -8,7 +8,7 @@ module EE
data = { data = {
board_milestone_title: board&.milestone&.title, board_milestone_title: board&.milestone&.title,
focus_mode_available: parent.feature_available?(:issue_board_focus_mode).to_s, focus_mode_available: parent.feature_available?(:issue_board_focus_mode).to_s,
show_promotion: (@project && show_promotions? && (!@project.feature_available?(:multiple_issue_boards) || !@project.feature_available?(:issue_board_milestone) || !@project.feature_available?(:issue_board_focus_mode))).to_s show_promotion: (@project && show_promotions? && (!@project.feature_available?(:multiple_issue_boards) || !@project.feature_available?(:scoped_issue_board) || !@project.feature_available?(:issue_board_focus_mode))).to_s
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- unless @project.feature_available?(:multiple_issue_boards) - unless @project.feature_available?(:multiple_issue_boards)
%li %li
= link_to _('Multiple issue boards'), help_page_path('user/project/issue_board.html', anchor:'use-cases-for-multiple-issue-boards'), target: '_blank' = link_to _('Multiple issue boards'), help_page_path('user/project/issue_board.html', anchor:'use-cases-for-multiple-issue-boards'), target: '_blank'
- unless @project.feature_available?(:issue_board_milestone) - unless @project.feature_available?(:scoped_issue_board)
%li %li
= link_to _('Issue boards with milestones'), help_page_path('user/project/issue_board.html', anchor:'board-with-a-milestone'), target: '_blank' = link_to _('Issue boards with milestones'), help_page_path('user/project/issue_board.html', anchor:'board-with-a-milestone'), target: '_blank'
- unless @project.feature_available?(:issue_board_focus_mode) - unless @project.feature_available?(:issue_board_focus_mode)
......
...@@ -796,7 +796,7 @@ module API ...@@ -796,7 +796,7 @@ module API
expose :name expose :name
expose :project, using: Entities::BasicProjectDetails expose :project, using: Entities::BasicProjectDetails
expose :milestone, expose :milestone,
if: -> (board, _) { board.project.feature_available?(:issue_board_milestone) } if: -> (board, _) { board.project.feature_available?(:scoped_issue_board) }
expose :lists, using: Entities::List do |board| expose :lists, using: Entities::List do |board|
board.lists.destroyable board.lists.destroyable
end end
......
...@@ -17,7 +17,7 @@ describe 'Board with milestone', :js do ...@@ -17,7 +17,7 @@ describe 'Board with milestone', :js do
context 'with the feature enabled' do context 'with the feature enabled' do
before do before do
stub_licensed_features(issue_board_milestone: true) stub_licensed_features(scoped_issue_board: true)
end end
context 'new board' do context 'new board' do
...@@ -173,7 +173,7 @@ describe 'Board with milestone', :js do ...@@ -173,7 +173,7 @@ describe 'Board with milestone', :js do
context 'with the feature disabled' do context 'with the feature disabled' do
before do before do
stub_licensed_features(issue_board_milestone: false) stub_licensed_features(scoped_issue_board: false)
visit project_boards_path(project) visit project_boards_path(project)
end end
......
...@@ -60,17 +60,17 @@ describe API::Boards do ...@@ -60,17 +60,17 @@ describe API::Boards do
end end
end end
context 'with the issue_board_milestone-feature available' do context 'with the scoped_issue_board-feature available' do
it 'returns the milestone when the `issue_board_milestone`-feature is enabled' do it 'returns the milestone when the `scoped_issue_board`-feature is enabled' do
stub_licensed_features(issue_board_milestone: true) stub_licensed_features(scoped_issue_board: true)
get api(base_url, user) get api(base_url, user)
expect(json_response.first["milestone"]).not_to be_nil expect(json_response.first["milestone"]).not_to be_nil
end end
it 'hides the milestone when the `issue_board_milestone`-feature is disabled' do it 'hides the milestone when the `scoped_issue_board`-feature is disabled' do
stub_licensed_features(issue_board_milestone: false) stub_licensed_features(scoped_issue_board: false)
get api(base_url, user) get api(base_url, user)
......
...@@ -26,7 +26,7 @@ describe Boards::UpdateService do ...@@ -26,7 +26,7 @@ describe Boards::UpdateService do
end end
it 'udpates the milestone with issue board milestones enabled' do it 'udpates the milestone with issue board milestones enabled' do
stub_licensed_features(issue_board_milestone: true) stub_licensed_features(scoped_issue_board: true)
milestone = create(:milestone, project: project) milestone = create(:milestone, project: project)
service = described_class.new(project, double, milestone_id: milestone.id) service = described_class.new(project, double, milestone_id: milestone.id)
...@@ -36,7 +36,7 @@ describe Boards::UpdateService do ...@@ -36,7 +36,7 @@ describe Boards::UpdateService do
end end
it 'udpates the milestone with the issue board milestones feature enabled' do it 'udpates the milestone with the issue board milestones feature enabled' do
stub_licensed_features(issue_board_milestone: false) stub_licensed_features(scoped_issue_board: false)
milestone = create(:milestone, project: project) milestone = create(:milestone, project: project)
service = described_class.new(project, double, milestone_id: milestone.id) service = described_class.new(project, double, milestone_id: milestone.id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment