Skip to content

Commit

Permalink
Merge pull request openSUSE#15860 from saraycp/staging_project_link
Browse files Browse the repository at this point in the history
Display link to staging project in conversation
  • Loading branch information
danidoni authored Mar 22, 2024
2 parents 6501616 + 5a671c0 commit eb178fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
- elsif element.instance_of?(HistoryElement::RequestReviewAdded) && element.review
= element.user_action_prefix
%strong
= element.action_target
- if element.review_by_staging_project?
= link_to element.action_target, project_show_path(element.action_target)
- else
= element.action_target
= element.user_action_suffix
- elsif element.instance_of?(HistoryElement::RequestAccepted) && pending_reviews?
#{element.user_action} and dismissed pending reviews
Expand Down
8 changes: 6 additions & 2 deletions src/api/app/models/history_element/request_review_added.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def user_action
end

def user_action_prefix
return 'set' if review&.staging_project?
return 'set' if review_by_staging_project?

'added'
end
Expand All @@ -21,7 +21,7 @@ def action_target
end

def user_action_suffix
return 'as a staging project' if review&.staging_project?
return 'as a staging project' if review_by_staging_project?

'as a reviewer'
end
Expand All @@ -32,6 +32,10 @@ def review

::Review.find(description_extension)
end

def review_by_staging_project?
review&.staging_project?
end
end
end

Expand Down

0 comments on commit eb178fe

Please sign in to comment.