diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 754591b8017..ea7acf9a5d1 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -40,10 +40,15 @@ class Issue < ApplicationRecord SORTING_PREFERENCE_FIELD = :issues_sort - # Types of issues that should be displayed on lists across the app - # for example, project issues list, group issues list and issue boards. - # Some issue types, like test cases, should be hidden by default. - TYPES_FOR_LIST = %w(issue incident).freeze + # Types of issues that should be displayed on issue lists across the app + # for example, project issues list, group issues list, and issues dashboard. + # + # This should be kept consistent with the enums used for the GraphQL issue list query in + # https://gitlab.com/gitlab-org/gitlab/-/blob/1379c2d7bffe2a8d809f23ac5ef9b4114f789c07/app/assets/javascripts/issues/list/constants.js#L154-158 + TYPES_FOR_LIST = %w(issue incident test_case task).freeze + + # Types of issues that should be displayed on issue board lists + TYPES_FOR_BOARD_LIST = %w(issue incident).freeze belongs_to :project belongs_to :namespace, inverse_of: :issues @@ -107,6 +112,7 @@ class Issue < ApplicationRecord enum issue_type: WorkItems::Type.base_types alias_method :issuing_parent, :project + alias_attribute :issuing_parent_id, :project_id alias_attribute :external_author, :service_desk_reply_to @@ -270,6 +276,10 @@ class Issue < ApplicationRecord end end + def self.participant_includes + [:assignees] + super + end + def next_object_by_relative_position(ignoring: nil, order: :asc) array_mapping_scope = -> (id_expression) do relation = Issue.where(Issue.arel_table[:project_id].eq(id_expression)) |