Commit 6977b272 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Extract feature promotion logic to a variable

parent fc1226fe
...@@ -5,6 +5,10 @@ module EE ...@@ -5,6 +5,10 @@ module EE
end end
def board_data def board_data
show_feature_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
data = { data = {
board_milestone_title: board&.milestone&.title, board_milestone_title: board&.milestone&.title,
board_author_username: board&.author&.username, board_author_username: board&.author&.username,
...@@ -13,7 +17,7 @@ module EE ...@@ -13,7 +17,7 @@ module EE
labels: board&.labels.to_json(only: [:id, :title, :color] ), labels: board&.labels.to_json(only: [:id, :title, :color] ),
board_weight: board&.weight, board_weight: board&.weight,
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?(:scoped_issue_board) || !@project.feature_available?(:issue_board_focus_mode))).to_s show_promotion: show_feature_promotion
} }
super.merge(data) super.merge(data)
......
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