This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-21
lines changed
assets/javascripts/discourse/components Expand file tree Collapse file tree 3 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -12,32 +12,19 @@ export default class AiBotSidebarNewConversation extends Component {
1212 return this .sidebarState .isCurrentPanel (AI_CONVERSATIONS_PANEL );
1313 }
1414
15- get disabled () {
16- return this .router .currentRouteName === " discourse-ai-bot-conversations" ;
17- }
18-
19- get label () {
20- return this .disabled
21- ? " discourse_ai.ai_bot.conversations.enter_question"
22- : " discourse_ai.ai_bot.conversations.new" ;
23- }
24-
25- get icon () {
26- return this .disabled ? " keyboard" : " plus" ;
27- }
28-
2915 @action
3016 routeTo () {
31- this .router .transitionTo (" /discourse-ai/ai-bot/conversations" );
17+ if (this .router .currentRouteName !== " discourse-ai-bot-conversations" ) {
18+ this .router .transitionTo (" /discourse-ai/ai-bot/conversations" );
19+ }
3220 this .args .outletArgs ? .toggleNavigationMenu ? .();
3321 }
3422
3523 <template >
3624 {{#if this . shouldRender }}
3725 <DButton
38- @ label ={{this .label }}
39- @ icon ={{this .icon }}
40- @ disabled ={{this .disabled }}
26+ @ label =" discourse_ai.ai_bot.conversations.new"
27+ @ icon =" plus"
4128 @ action ={{this .routeTo }}
4229 class =" ai-new-question-button btn-default"
4330 />
Original file line number Diff line number Diff line change 726726 disclaimer : " Generative AI can make mistakes. Verify important information."
727727 placeholder : " Ask a question..."
728728 new : " New Question"
729- enter_question : " Enter Question"
730729 min_input_length_message : " Message must be longer than 10 characters"
731730 messages_sidebar_title : " Conversations"
732731 today : " Today"
Original file line number Diff line number Diff line change 208208 )
209209 end
210210
211- it "displays 'enter question' button on conversations homepage " do
211+ it "displays 'new question' button on the topic page " do
212212 ai_pm_homepage . visit
213213 expect ( sidebar ) . to have_css (
214214 "button.ai-new-question-button" ,
215- text : I18n . t ( "js.discourse_ai.ai_bot.conversations.enter_question " ) ,
215+ text : I18n . t ( "js.discourse_ai.ai_bot.conversations.new " ) ,
216216 )
217217 end
218218
You can’t perform that action at this time.
0 commit comments