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 ...@@ -17,7 +17,7 @@ class License < ActiveRecord::Base
GROUP_WEBHOOKS_FEATURE = 'GitLab_GroupWebhooks'.freeze GROUP_WEBHOOKS_FEATURE = 'GitLab_GroupWebhooks'.freeze
ISSUABLE_DEFAULT_TEMPLATES_FEATURE = 'GitLab_IssuableDefaultTemplates'.freeze ISSUABLE_DEFAULT_TEMPLATES_FEATURE = 'GitLab_IssuableDefaultTemplates'.freeze
ISSUE_BOARD_FOCUS_MODE_FEATURE = 'GitLab_IssueBoardFocusMode'.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 GROUP_ISSUE_BOARDS_FEATURE = 'GitLab_GroupIssueBoards'.freeze
ISSUE_WEIGHTS_FEATURE = 'GitLab_IssueWeights'.freeze ISSUE_WEIGHTS_FEATURE = 'GitLab_IssueWeights'.freeze
JENKINS_INTEGRATION_FEATURE = 'GitLab_JenkinsIntegration'.freeze JENKINS_INTEGRATION_FEATURE = 'GitLab_JenkinsIntegration'.freeze
...@@ -62,7 +62,7 @@ class License < ActiveRecord::Base ...@@ -62,7 +62,7 @@ class License < ActiveRecord::Base
group_webhooks: GROUP_WEBHOOKS_FEATURE, group_webhooks: GROUP_WEBHOOKS_FEATURE,
issuable_default_templates: ISSUABLE_DEFAULT_TEMPLATES_FEATURE, issuable_default_templates: ISSUABLE_DEFAULT_TEMPLATES_FEATURE,
issue_board_focus_mode: ISSUE_BOARD_FOCUS_MODE_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, group_issue_boards: GROUP_ISSUE_BOARDS_FEATURE,
issue_weights: ISSUE_WEIGHTS_FEATURE, issue_weights: ISSUE_WEIGHTS_FEATURE,
jenkins_integration: JENKINS_INTEGRATION_FEATURE, jenkins_integration: JENKINS_INTEGRATION_FEATURE,
...@@ -92,7 +92,7 @@ class License < ActiveRecord::Base ...@@ -92,7 +92,7 @@ class License < ActiveRecord::Base
{ GROUP_WEBHOOKS_FEATURE => 1 }, { GROUP_WEBHOOKS_FEATURE => 1 },
{ ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 }, { ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 },
{ ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 }, { ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 },
{ ISSUE_BOARD_MILESTONE_FEATURE => 1 }, { SCOPED_ISSUE_BOARD_FEATURE => 1 },
{ ISSUE_WEIGHTS_FEATURE => 1 }, { ISSUE_WEIGHTS_FEATURE => 1 },
{ JENKINS_INTEGRATION_FEATURE => 1 }, { JENKINS_INTEGRATION_FEATURE => 1 },
{ LDAP_EXTRAS_FEATURE => 1 }, { LDAP_EXTRAS_FEATURE => 1 },
...@@ -152,7 +152,7 @@ class License < ActiveRecord::Base ...@@ -152,7 +152,7 @@ class License < ActiveRecord::Base
{ GROUP_WEBHOOKS_FEATURE => 1 }, { GROUP_WEBHOOKS_FEATURE => 1 },
{ ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 }, { ISSUABLE_DEFAULT_TEMPLATES_FEATURE => 1 },
{ ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 }, { ISSUE_BOARD_FOCUS_MODE_FEATURE => 1 },
{ ISSUE_BOARD_MILESTONE_FEATURE => 1 }, { SCOPED_ISSUE_BOARD_FEATURE => 1 },
{ ISSUE_WEIGHTS_FEATURE => 1 }, { ISSUE_WEIGHTS_FEATURE => 1 },
{ JENKINS_INTEGRATION_FEATURE => 1 }, { JENKINS_INTEGRATION_FEATURE => 1 },
{ LDAP_EXTRAS_FEATURE => 1 }, { LDAP_EXTRAS_FEATURE => 1 },
......
...@@ -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)
......
...@@ -795,7 +795,7 @@ module API ...@@ -795,7 +795,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