FIX: Make sure that topic gists are displayed ONLY on the hot list. (#873)
This commit is contained in:
parent
820b506910
commit
37b6461d68
|
@ -0,0 +1,24 @@
|
||||||
|
import Component from "@glimmer/component";
|
||||||
|
import { service } from "@ember/service";
|
||||||
|
|
||||||
|
export default class AiTopicGist extends Component {
|
||||||
|
@service router;
|
||||||
|
|
||||||
|
get showGist() {
|
||||||
|
return (
|
||||||
|
this.router.currentRoute.attributes?.filterType === "hot" &&
|
||||||
|
this.args.topic?.ai_topic_gist &&
|
||||||
|
!this.args.topic?.excerpt
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
<template>
|
||||||
|
{{#if this.showGist}}
|
||||||
|
<div class="ai-topic-gist">
|
||||||
|
<div class="ai-topic-gist__text">
|
||||||
|
{{@topic.ai_topic_gist}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</template>
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
import Component from "@glimmer/component";
|
||||||
|
import AiTopicGist from "../../components/ai-topic-gist";
|
||||||
|
|
||||||
|
export default class AiTopicGistPlacement extends Component {
|
||||||
|
static shouldRender(_outletArgs, helper) {
|
||||||
|
const settings = helper.siteSettings;
|
||||||
|
return settings.discourse_ai_enabled && settings.ai_summarization_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<AiTopicGist @topic={{@outletArgs.topic}} />
|
||||||
|
</template>
|
||||||
|
}
|
|
@ -1,15 +0,0 @@
|
||||||
import Component from "@glimmer/component";
|
|
||||||
|
|
||||||
export default class AiTopicGist extends Component {
|
|
||||||
static shouldRender(outletArgs) {
|
|
||||||
return outletArgs?.topic?.ai_topic_gist && !outletArgs.topic.excerpt;
|
|
||||||
}
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="ai-topic-gist">
|
|
||||||
<div class="ai-topic-gist__text">
|
|
||||||
{{@outletArgs.topic.ai_topic_gist}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
}
|
|
|
@ -354,6 +354,7 @@ discourse_ai:
|
||||||
hidden: true
|
hidden: true
|
||||||
ai_summarization_enabled:
|
ai_summarization_enabled:
|
||||||
default: false
|
default: false
|
||||||
|
client: true
|
||||||
validator: "DiscourseAi::Configuration::LlmDependencyValidator"
|
validator: "DiscourseAi::Configuration::LlmDependencyValidator"
|
||||||
ai_summarization_model:
|
ai_summarization_model:
|
||||||
default: ""
|
default: ""
|
||||||
|
|
Loading…
Reference in New Issue