mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: do not show composer actions if irrelevant
This commit is contained in:
@ -28,6 +28,7 @@ export default DropdownSelectBoxComponent.extend({
|
|||||||
allowInitialValueMutation: false,
|
allowInitialValueMutation: false,
|
||||||
allowAutoSelectFirst: false,
|
allowAutoSelectFirst: false,
|
||||||
showFullTitle: false,
|
showFullTitle: false,
|
||||||
|
isHidden: Ember.computed.empty("content"),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this._super();
|
this._super();
|
||||||
@ -68,7 +69,7 @@ export default DropdownSelectBoxComponent.extend({
|
|||||||
content(options, canWhisper, action) {
|
content(options, canWhisper, action) {
|
||||||
let items = [];
|
let items = [];
|
||||||
|
|
||||||
if (action !== CREATE_TOPIC && action !== CREATE_SHARED_DRAFT) {
|
if (action !== CREATE_TOPIC && action !== CREATE_SHARED_DRAFT && _topicSnapshot) {
|
||||||
items.push({
|
items.push({
|
||||||
name: I18n.t("composer.composer_actions.reply_as_new_topic.label"),
|
name: I18n.t("composer.composer_actions.reply_as_new_topic.label"),
|
||||||
description: I18n.t("composer.composer_actions.reply_as_new_topic.desc"),
|
description: I18n.t("composer.composer_actions.reply_as_new_topic.desc"),
|
||||||
|
@ -104,6 +104,15 @@ QUnit.test('shared draft', async assert => {
|
|||||||
assert.ok(find('#reply-control.composing-shared-draft').length === 1);
|
assert.ok(find('#reply-control.composing-shared-draft').length === 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test('hide component if no content', async assert => {
|
||||||
|
const composerActions = selectKit('.composer-actions');
|
||||||
|
|
||||||
|
await visit('/u/eviltrout/messages');
|
||||||
|
await click('.new-private-message');
|
||||||
|
|
||||||
|
assert.ok(composerActions.el().hasClass("is-hidden"));
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test('interactions', async assert => {
|
QUnit.test('interactions', async assert => {
|
||||||
const composerActions = selectKit('.composer-actions');
|
const composerActions = selectKit('.composer-actions');
|
||||||
const quote = 'Life is like riding a bicycle.';
|
const quote = 'Life is like riding a bicycle.';
|
||||||
|
Reference in New Issue
Block a user