Commit fea339fa authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Rename feature from "issue_board_milestone" to "scoped_issue_board"

parent ad71d446
......@@ -17,7 +17,7 @@ class License < ActiveRecord::Base
GROUP_WEBHOOKS_FEATURE = 'GitLab_GroupWebhooks'.freeze
ISSUABLE_DEFAULT_TEMPLATES_FEATURE = 'GitLab_IssuableDefaultTemplates'.freeze
ISSUE_BOARD_FOCUS_MODE_FEATURE = 'GitLab_IssueBoardFocusMode'.freeze
ISSUE_BOARD_MILESTONE_FEATURE = 'GitLab_IssueBoardMilestone'.freeze
SCOPED_ISSUE_BOARD_FEATURE = 'GitLab_ScopedIssueBoard'.freeze
GROUP_ISSUE_BOARDS_FEATURE = 'GitLab_GroupIssueBoards'.freeze
ISSUE_WEIGHTS_FEATURE = 'GitLab_IssueWeights'.freeze
JENKINS_INTEGRATION_FEATURE = 'GitLab_JenkinsIntegration'.freeze
......@@ -62,7 +62,7 @@ class License < ActiveRecord::Base
group_webhooks: GROUP_WEBHOOKS_FEATURE,
issuable_default_templates: ISSUABLE_DEFAULT_TEMPLATES_FEATURE,
issue_board_focus_mode: ISSUE_BOARD_FOCUS_MODE_FEATURE,
issue_board_milestone: ISSUE_BOARD_MILESTONE_FEATURE,
scoped_issue_board: SCOPED_ISSUE_BOARD_FEATURE,
group_issue_boards: GROUP_ISSUE_BOARDS_FEATURE,
issue_weights: ISSUE_WEIGHTS_FEATURE,
jenkins_integration: JENKINS_INTEGRATION_FEATURE,
......@@ -92,7 +92,7 @@ class License < ActiveRecord::Base
{ GROUP_WEBHOOKS_FEATURE => 1 },
{ ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 },
{ ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 },
{ ISSUE_BOARD_MILESTONE_FEATURE => 1 },
{ SCOPED_ISSUE_BOARD_FEATURE => 1 },
{ ISSUE_WEIGHTS_FEATURE => 1 },
{ JENKINS_INTEGRATION_FEATURE => 1 },
{ LDAP_EXTRAS_FEATURE => 1 },
......@@ -152,7 +152,7 @@ class License < ActiveRecord::Base
{ GROUP_WEBHOOKS_FEATURE => 1 },
{ ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 },
{ ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 },
{ ISSUE_BOARD_MILESTONE_FEATURE => 1 },
{ SCOPED_ISSUE_BOARD_FEATURE => 1 },
{ ISSUE_WEIGHTS_FEATURE => 1 },
{ JENKINS_INTEGRATION_FEATURE => 1 },
{ LDAP_EXTRAS_FEATURE => 1 },
......
......@@ -218,8 +218,8 @@ class Namespace < ActiveRecord::Base
feature_available?(:multiple_issue_boards)
end
def issue_board_milestone_available?(user = nil)
feature_available?(:issue_board_milestone)
def scoped_issue_board_available?(user = nil)
feature_available?(:scoped_issue_board)
end
private
......
......@@ -1532,8 +1532,8 @@ class Project < ActiveRecord::Base
feature_available?(:multiple_issue_boards, user)
end
def issue_board_milestone_available?(user = nil)
feature_available?(:issue_board_milestone, user)
def scoped_issue_board_available?(user = nil)
feature_available?(:scoped_issue_board, user)
end
def full_path_was
......
module Boards
class UpdateService < Boards::BaseService
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)
end
......
......@@ -57,7 +57,7 @@
%li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" }
Edit board name
- if parent.issue_board_milestone_available?(current_user)
- if parent.scoped_issue_board_available?(current_user)
%li
%a{ "href" => "#", "@click.stop.prevent" => "showPage('milestone')" }
Edit board milestone
......
......@@ -10,7 +10,7 @@
%input.form-control{ type: "text",
id: "board-new-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 }",
"v-if" => "currentPage === 'new'" }
%label.label-light{ for: "board-milestone" }
......
......@@ -8,7 +8,7 @@ module EE
data = {
board_milestone_title: board&.milestone&.title,
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 @@
- unless @project.feature_available?(:multiple_issue_boards)
%li
= 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
= 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)
......
......@@ -795,7 +795,7 @@ module API
expose :name
expose :project, using: Entities::BasicProjectDetails
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|
board.lists.destroyable
end
......
......@@ -17,7 +17,7 @@ describe 'Board with milestone', :js do
context 'with the feature enabled' do
before do
stub_licensed_features(issue_board_milestone: true)
stub_licensed_features(scoped_issue_board: true)
end
context 'new board' do
......@@ -173,7 +173,7 @@ describe 'Board with milestone', :js do
context 'with the feature disabled' do
before do
stub_licensed_features(issue_board_milestone: false)
stub_licensed_features(scoped_issue_board: false)
visit project_boards_path(project)
end
......
......@@ -60,17 +60,17 @@ describe API::Boards do
end
end
context 'with the issue_board_milestone-feature available' do
it 'returns the milestone when the `issue_board_milestone`-feature is enabled' do
stub_licensed_features(issue_board_milestone: true)
context 'with the scoped_issue_board-feature available' do
it 'returns the milestone when the `scoped_issue_board`-feature is enabled' do
stub_licensed_features(scoped_issue_board: true)
get api(base_url, user)
expect(json_response.first["milestone"]).not_to be_nil
end
it 'hides the milestone when the `issue_board_milestone`-feature is disabled' do
stub_licensed_features(issue_board_milestone: false)
it 'hides the milestone when the `scoped_issue_board`-feature is disabled' do
stub_licensed_features(scoped_issue_board: false)
get api(base_url, user)
......
......@@ -26,7 +26,7 @@ describe Boards::UpdateService do
end
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)
service = described_class.new(project, double, milestone_id: milestone.id)
......@@ -36,7 +36,7 @@ describe Boards::UpdateService do
end
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)
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