This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/components/chat-selection-manager.hbs
Roman Rizzi 5c699e4384
DEV: Pass messageId as a dynamic segment instead of a query param (#20013)
* DEV: Rnemae channel path to just c

Also swap the channel id and channel slug params to be consistent with core.

* linting

* channel_path

* Drop slugify helper and channel route without slug

* Request slug and route models through the channel model if possible

* DEV: Pass messageId as a dynamic segment instead of a query param

* Ensure change is backwards-compatible

* drop query param from oneboxes

* Correctly extract channelId from routes

* Better route organization using siblings for regular and near-message

* Ensures sessions are unique even when using parallelism

* prevents didReceiveAttrs to clear input mid test

* we disable animations in capybara so sometimes the message was barely showing

* adds wait

* ensures finished loading

* is it causing more harm than good?

* this check is slowing things for no reason

* actually target the button

* more resilient select chat message

* apply similar fix to bookmark

* fix

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-02-01 12:39:23 -03:00

58 lines
1.5 KiB
Handlebars

<div
class={{concat-class
"chat-selection-management"
(if this.chatCopySuccess "chat-copy-success")
}}
>
<div class="chat-selection-management-buttons">
<DButton
@id="chat-quote-btn"
@class="btn-secondary"
@icon="quote-left"
@label="chat.selection.quote_selection"
@title="chat.selection.quote_selection"
@disabled={{not this.anyMessagesSelected}}
@action={{action "quoteMessages"}}
/>
{{#if this.site.desktopView}}
<DButton
@id="chat-copy-btn"
@class="btn-secondary"
@icon="copy"
@label="chat.selection.copy"
@title="chat.selection.copy"
@disabled={{not this.anyMessagesSelected}}
@action={{action "copyMessages"}}
/>
{{/if}}
{{#if this.showMoveMessageButton}}
<DButton
@id="chat-move-to-channel-btn"
@class="btn-secondary"
@icon="sign-out-alt"
@label="chat.selection.move_selection_to_channel"
@title="chat.selection.move_selection_to_channel"
@disabled={{not this.anyMessagesSelected}}
@action={{action "openMoveMessageModal"}}
/>
{{/if}}
<DButton
@id="chat-cancel-selection-btn"
@icon="times"
@class="btn-secondary cancel-btn"
@label="chat.selection.cancel"
@title="chat.selection.cancel"
@action={{this.cancelSelecting}}
/>
</div>
{{#if this.showChatCopySuccess}}
<div class="chat-selection-message">
{{i18n "chat.quote.copy_success"}}
</div>
{{/if}}
</div>