summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /app/models/issue.rb
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
downloadgitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb18
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))