Commit 5caee568 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '52669-fixes-quick-actions-preview' into 'master'

Fixes close/reopen quick actions preview for issues and merge_requests

Closes #52669

See merge request gitlab-org/gitlab-ce!22343
parents 076398d8 9d885b34
...@@ -42,6 +42,6 @@ class IssueEntity < IssuableEntity ...@@ -42,6 +42,6 @@ class IssueEntity < IssuableEntity
end end
expose :preview_note_path do |issue| expose :preview_note_path do |issue|
preview_markdown_path(issue.project, quick_actions_target_type: 'Issue', quick_actions_target_id: issue.id) preview_markdown_path(issue.project, quick_actions_target_type: 'Issue', quick_actions_target_id: issue.iid)
end end
end end
...@@ -222,7 +222,7 @@ class MergeRequestWidgetEntity < IssuableEntity ...@@ -222,7 +222,7 @@ class MergeRequestWidgetEntity < IssuableEntity
end end
expose :preview_note_path do |merge_request| expose :preview_note_path do |merge_request|
preview_markdown_path(merge_request.project, quick_actions_target_type: 'MergeRequest', quick_actions_target_id: merge_request.id) preview_markdown_path(merge_request.project, quick_actions_target_type: 'MergeRequest', quick_actions_target_id: merge_request.iid)
end end
expose :merge_commit_path do |merge_request| expose :merge_commit_path do |merge_request|
......
---
title: Fixes close/reopen quick actions preview for issues and merge_requests
merge_request: 22343
author: Jacopo Beschi @jacopo-beschi
type: fixed
...@@ -77,6 +77,15 @@ shared_examples 'issuable record that supports quick actions in its description ...@@ -77,6 +77,15 @@ shared_examples 'issuable record that supports quick actions in its description
expect(issuable.labels).to eq [label_bug] expect(issuable.labels).to eq [label_bug]
expect(issuable.milestone).to eq milestone expect(issuable.milestone).to eq milestone
end end
it 'removes the quick action from note and explains it in the preview' do
preview_note("Awesome!\n\n/close")
expect(page).to have_content 'Awesome!'
expect(page).not_to have_content '/close'
issuable_name = issuable.is_a?(Issue) ? 'issue' : 'merge request'
expect(page).to have_content "Closes this #{issuable_name}."
end
end end
context 'with a note containing only commands' do context 'with a note containing only commands' do
......
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