diff --git a/assets/javascripts/discourse/components/ai-conversations-invite.gjs b/assets/javascripts/discourse/components/ai-conversations-invite.gjs new file mode 100644 index 000000000..cadb14425 --- /dev/null +++ b/assets/javascripts/discourse/components/ai-conversations-invite.gjs @@ -0,0 +1,29 @@ +import Component from "@glimmer/component"; +import { action } from "@ember/object"; +import { service } from "@ember/service"; +import DButton from "discourse/components/d-button"; +import AddPmParticipants from "discourse/components/modal/add-pm-participants"; + +export default class AiConversationsInvite extends Component { + @service site; + @service modal; + + @action + showInvite() { + this.modal.show(AddPmParticipants, { + model: { + title: "discourse_ai.ai_bot.invite_ai_conversation.title", + inviteModel: this.args.topic, + }, + }); + } + + +} diff --git a/assets/javascripts/discourse/connectors/topic-footer-main-buttons-before-create/ai-conversations-invite.gjs b/assets/javascripts/discourse/connectors/topic-footer-main-buttons-before-create/ai-conversations-invite.gjs new file mode 100644 index 000000000..92264a5de --- /dev/null +++ b/assets/javascripts/discourse/connectors/topic-footer-main-buttons-before-create/ai-conversations-invite.gjs @@ -0,0 +1,10 @@ +import Component from "@glimmer/component"; +import AiConversationsInvite from "../../components/ai-conversations-invite"; + +export default class AiConversationsInviteConnector extends Component { + static shouldRender(args) { + return args.topic.is_bot_pm; + } + + +} diff --git a/assets/stylesheets/modules/ai-bot-conversations/common.scss b/assets/stylesheets/modules/ai-bot-conversations/common.scss index 43b36dd53..4c0033db8 100644 --- a/assets/stylesheets/modules/ai-bot-conversations/common.scss +++ b/assets/stylesheets/modules/ai-bot-conversations/common.scss @@ -450,7 +450,8 @@ body.has-ai-conversations-sidebar { button:not( .create, .share-ai-conversation-button, - .topic-admin-menu-trigger + .topic-admin-menu-trigger, + .ai-conversations__invite-button ) { display: none; } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index a043ae315..142b1c7d6 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -709,9 +709,13 @@ en: delete: "Delete share" share_ai_conversation: - name: "Share AI conversation" + name: "Share" title: "Share this AI conversation publicly" + invite_ai_conversation: + button: "Invite" + title: "Invite to AI conversation" + ai_label: "AI" ai_title: "Conversation with AI"