A platform for community discussion. Free, open, simple.
UX: Disable onebox painting in reviewable queued posts (#36036)
Krzysztof Kotlarekc0206702adc0
diff --git a/frontend/discourse/app/components/reviewable-queued-post.gjs b/frontend/discourse/app/components/reviewable-queued-post.gjsindex f615525794a..0a0afe86dab 100644--- a/frontend/discourse/app/components/reviewable-queued-post.gjs+++ b/frontend/discourse/app/components/reviewable-queued-post.gjs@@ -94,7 +94,7 @@ export default class ReviewableQueuedPost extends Component {@rawText={{highlightWatchedWords @reviewable.payload.raw @reviewable}}@categoryId={{@reviewable.category_id}}@topicId={{@reviewable.topic_id}}- @paintOneboxes={{true}}+ @paintOneboxes={{false}}@opts={{hash removeMissing=true}}@onOffsetHeightCalculated={{this.setPostBodyHeight}}/>diff --git a/frontend/discourse/app/components/reviewable-refresh/queued-post.gjs b/frontend/discourse/app/components/reviewable-refresh/queued-post.gjsindex 3db9e57b17c..4b686aafdeb 100644--- a/frontend/discourse/app/components/reviewable-refresh/queued-post.gjs+++ b/frontend/discourse/app/components/reviewable-refresh/queued-post.gjs@@ -61,7 +61,7 @@ export default class ReviewableQueuedPost extends Component {@rawText={{highlightWatchedWords @reviewable.payload.raw @reviewable}}@categoryId={{@reviewable.category_id}}@topicId={{@reviewable.topic_id}}- @paintOneboxes={{true}}+ @paintOneboxes={{false}}@opts={{hash removeMissing=true}}/>diff --git a/frontend/discourse/tests/acceptance/review-test.js b/frontend/discourse/tests/acceptance/review-test.jsindex a279dafa4e3..aea53208d28 100644--- a/frontend/discourse/tests/acceptance/review-test.js+++ b/frontend/discourse/tests/acceptance/review-test.js@@ -135,7 +135,9 @@ acceptance("Review", function (needs) {assert.dom(`${topic} .discourse-tag:nth-of-type(1)`).hasText("hello");assert.dom(`${topic} .discourse-tag:nth-of-type(2)`).hasText("world");- assert.dom(`${topic} .post-body`).hasText("existing body");+ assert+ .dom(`${topic} .post-body`)+ .hasText("existing body http://somegoodurl.com");await click(`${topic} .reviewable-action.edit`);await click(`${topic} .reviewable-action.save-edit`);@@ -155,7 +157,10 @@ acceptance("Review", function (needs) {assert.dom(`${topic} .post-body`)- .hasText("existing body", "cancelling does not update the value");+ .hasText(+ "existing body http://somegoodurl.com",+ "cancelling does not update the value"+ );await click(`${topic} .reviewable-action.edit`);let category = selectKit(`${topic} .category-id .select-kit`);@@ -214,4 +219,18 @@ acceptance("Review", function (needs) {assert.dom(".stale-help").doesNotExist();});++ test("Queued post does not paint oneboxes", async function (assert) {+ const topic = '.reviewable-item[data-reviewable-id="4321"]';++ await visit("/review");++ assert+ .dom(`${topic} .post-body`)+ .includesText("existing body http://somegoodurl.com");++ assert+ .dom(`${topic} .post-body aside.onebox`)+ .doesNotExist("onebox content is not painted in reviewable queued posts");+ });});diff --git a/frontend/discourse/tests/helpers/review-pretender.js b/frontend/discourse/tests/helpers/review-pretender.jsindex df78b2fbcf4..c9ebcbf975a 100644--- a/frontend/discourse/tests/helpers/review-pretender.js+++ b/frontend/discourse/tests/helpers/review-pretender.js@@ -35,7 +35,7 @@ export default function (helpers) {created_at: "2019-01-14T19:49:53.571Z",target_created_by_id: 1,payload: {- raw: "existing body",+ raw: "existing body\n\nhttp://somegoodurl.com",tags: ["hello", "world"],},version: 1,