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
end
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 = {
board_milestone_title: board&.milestone&.title,
board_author_username: board&.author&.username,
......@@ -13,7 +17,7 @@ module EE
labels: board&.labels.to_json(only: [:id, :title, :color] ),
board_weight: board&.weight,
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)
......
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