DEV: Prevent close of summary from outside clicks (#808)
Often it is helpful to have the summary box open while composing a reply to the topic. However, the summary box currently gets closed each time you click outside the box. In this PR we add `closeOnClickOutside: false` attribute to the `DMenu` options for summary box to prevent that from occurring.
This commit is contained in:
parent
e666266473
commit
95f80325e5
|
@ -196,6 +196,7 @@ export default class AiSummaryBox extends Component {
|
|||
@title={{i18n "summary.buttons.generate"}}
|
||||
@icon="discourse-sparkles"
|
||||
@triggerClass="ai-topic-summarization"
|
||||
@closeOnClickOutside={{false}}
|
||||
>
|
||||
<:content>
|
||||
<div class="ai-summary-container">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { click, visit } from "@ember/test-helpers";
|
||||
import { skip } from "qunit";
|
||||
import { skip, test } from "qunit";
|
||||
import topicFixtures from "discourse/tests/fixtures/topic";
|
||||
import {
|
||||
acceptance,
|
||||
|
@ -125,7 +125,7 @@ acceptance("Topic - Summary - Anon", function (needs) {
|
|||
});
|
||||
});
|
||||
|
||||
skip("displays cached summary immediately", async function (assert) {
|
||||
test("displays cached summary immediately", async function (assert) {
|
||||
await visit("/t/-/1");
|
||||
|
||||
await click(".ai-topic-summarization");
|
||||
|
@ -138,4 +138,11 @@ acceptance("Topic - Summary - Anon", function (needs) {
|
|||
.dom(".ai-summary-box .summarized-on")
|
||||
.exists("summary metadata exists");
|
||||
});
|
||||
|
||||
test("clicking outside of summary should not close the summary box", async function (assert) {
|
||||
await visit("/t/-/1");
|
||||
await click(".ai-topic-summarization");
|
||||
await click("#main-outlet-wrapper");
|
||||
assert.dom(".ai-summary-box").exists();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue