FIX: Hide summarization button from anons (#70)
This commit is contained in:
parent
261fe13599
commit
ba65d42940
|
@ -33,6 +33,9 @@ export default {
|
||||||
name: "discourse-ai-topic-summary",
|
name: "discourse-ai-topic-summary",
|
||||||
|
|
||||||
initialize(container) {
|
initialize(container) {
|
||||||
|
const user = container.lookup("service:current-user");
|
||||||
|
|
||||||
|
if (user) {
|
||||||
const settings = container.lookup("service:site-settings");
|
const settings = container.lookup("service:site-settings");
|
||||||
const summarizationEnabled =
|
const summarizationEnabled =
|
||||||
settings.discourse_ai_enabled && settings.ai_summarization_enabled;
|
settings.discourse_ai_enabled && settings.ai_summarization_enabled;
|
||||||
|
@ -40,5 +43,6 @@ export default {
|
||||||
if (summarizationEnabled) {
|
if (summarizationEnabled) {
|
||||||
withPluginApi("1.6.0", initializeTopicSummary);
|
withPluginApi("1.6.0", initializeTopicSummary);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,3 @@
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.topic-ai-summarization {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.topic-ai-summarization {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
.toggle-summary {
|
||||||
|
button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.topic-ai-summarization {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,7 +13,11 @@ gem "tiktoken_ruby", "0.0.5", platform: RUBY_PLATFORM
|
||||||
enabled_site_setting :discourse_ai_enabled
|
enabled_site_setting :discourse_ai_enabled
|
||||||
|
|
||||||
register_asset "stylesheets/modules/ai-helper/common/ai-helper.scss"
|
register_asset "stylesheets/modules/ai-helper/common/ai-helper.scss"
|
||||||
|
|
||||||
register_asset "stylesheets/modules/summarization/common/summarization.scss"
|
register_asset "stylesheets/modules/summarization/common/summarization.scss"
|
||||||
|
register_asset "stylesheets/modules/summarization/desktop/summarization.scss", :desktop
|
||||||
|
register_asset "stylesheets/modules/summarization/mobile/summarization.scss", :mobile
|
||||||
|
|
||||||
register_asset "stylesheets/modules/ai-bot/common/bot-replies.scss"
|
register_asset "stylesheets/modules/ai-bot/common/bot-replies.scss"
|
||||||
|
|
||||||
module ::DiscourseAi
|
module ::DiscourseAi
|
||||||
|
|
Loading…
Reference in New Issue