2021-03-26 15:21:47 +01:00
|
|
|
import $ from "jquery";
|
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
import {$t, $t_html} from "./i18n";
|
|
|
|
import {narrow_error} from "./narrow_error";
|
2021-03-26 15:21:47 +01:00
|
|
|
import * as narrow_state from "./narrow_state";
|
|
|
|
import {page_params} from "./page_params";
|
|
|
|
import * as people from "./people";
|
2022-10-31 20:40:22 +01:00
|
|
|
import * as settings_config from "./settings_config";
|
2022-04-29 12:48:19 +02:00
|
|
|
import * as spectators from "./spectators";
|
2021-03-26 15:21:47 +01:00
|
|
|
import * as stream_data from "./stream_data";
|
|
|
|
|
2022-02-15 12:25:11 +01:00
|
|
|
const SPECTATOR_STREAM_NARROW_BANNER = {
|
|
|
|
title: "",
|
|
|
|
html: $t_html(
|
|
|
|
{
|
2022-04-29 12:50:45 +02:00
|
|
|
defaultMessage: "This is not a <z-link>publicly accessible</z-link> conversation.",
|
2022-02-15 12:25:11 +01:00
|
|
|
},
|
|
|
|
{
|
2022-11-03 20:14:03 +01:00
|
|
|
"z-link": (content_html) =>
|
2023-05-02 04:30:33 +02:00
|
|
|
`<a target="_blank" rel="noopener noreferrer" href="/help/public-access-option">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2022-02-15 12:25:11 +01:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
function retrieve_search_query_data() {
|
|
|
|
// when search bar contains multiple filters, only retrieve search queries
|
2021-03-26 15:21:47 +01:00
|
|
|
const current_filter = narrow_state.filter();
|
|
|
|
const search_query = current_filter.operands("search")[0];
|
|
|
|
const query_words = search_query.split(" ");
|
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
const search_string_result = {
|
|
|
|
query_words: [],
|
|
|
|
has_stop_word: false,
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
|
|
|
|
// Add in stream:foo and topic:bar if present
|
|
|
|
if (current_filter.has_operator("stream") || current_filter.has_operator("topic")) {
|
|
|
|
const stream = current_filter.operands("stream")[0];
|
|
|
|
const topic = current_filter.operands("topic")[0];
|
|
|
|
if (stream) {
|
2021-09-01 18:23:28 +02:00
|
|
|
search_string_result.stream_query = stream;
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
if (topic) {
|
2021-09-01 18:23:28 +02:00
|
|
|
search_string_result.topic_query = topic;
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
// Gather information about each query word
|
2021-03-26 15:21:47 +01:00
|
|
|
for (const query_word of query_words) {
|
|
|
|
if (page_params.stop_words.includes(query_word)) {
|
2021-09-01 18:23:28 +02:00
|
|
|
search_string_result.has_stop_word = true;
|
|
|
|
search_string_result.query_words.push({
|
|
|
|
query_word,
|
|
|
|
is_stop_word: true,
|
|
|
|
});
|
2021-03-26 15:21:47 +01:00
|
|
|
} else {
|
2021-09-01 18:23:28 +02:00
|
|
|
search_string_result.query_words.push({
|
|
|
|
query_word,
|
|
|
|
is_stop_word: false,
|
|
|
|
});
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
return search_string_result;
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function pick_empty_narrow_banner() {
|
2021-09-01 18:23:28 +02:00
|
|
|
const default_banner = {
|
2022-12-08 12:35:49 +01:00
|
|
|
title: $t({defaultMessage: "There are no messages here."}),
|
2022-04-29 12:50:45 +02:00
|
|
|
// Spectators cannot start a conversation.
|
|
|
|
html: page_params.is_spectator
|
|
|
|
? ""
|
|
|
|
: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<a href="#" class="empty_feed_compose_stream">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2022-04-29 12:50:45 +02:00
|
|
|
},
|
|
|
|
),
|
2021-09-01 18:23:28 +02:00
|
|
|
};
|
2023-03-16 14:56:35 +01:00
|
|
|
const default_banner_for_multiple_filters = $t({defaultMessage: "No search results."});
|
2021-03-26 15:21:47 +01:00
|
|
|
|
|
|
|
const current_filter = narrow_state.filter();
|
|
|
|
|
|
|
|
if (current_filter === undefined) {
|
|
|
|
return default_banner;
|
|
|
|
}
|
|
|
|
|
|
|
|
const first_term = current_filter.operators()[0];
|
|
|
|
const first_operator = first_term.operator;
|
|
|
|
const first_operand = first_term.operand;
|
|
|
|
const num_operators = current_filter.operators().length;
|
|
|
|
|
|
|
|
if (num_operators !== 1) {
|
|
|
|
// For invalid-multi-operator narrows, we display an invalid narrow message
|
|
|
|
const streams = current_filter.operands("stream");
|
2023-09-12 04:26:25 +02:00
|
|
|
const topics = current_filter.operands("topic");
|
2021-03-26 15:21:47 +01:00
|
|
|
|
|
|
|
// No message can have multiple streams
|
|
|
|
if (streams.length > 1) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-03-16 14:51:16 +01:00
|
|
|
title: default_banner_for_multiple_filters,
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html({
|
|
|
|
defaultMessage:
|
|
|
|
"<p>You are searching for messages that belong to more than one stream, which is not possible.</p>",
|
|
|
|
}),
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
// No message can have multiple topics
|
2023-09-12 04:26:25 +02:00
|
|
|
if (topics.length > 1) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-03-16 14:51:16 +01:00
|
|
|
title: default_banner_for_multiple_filters,
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html({
|
|
|
|
defaultMessage:
|
|
|
|
"<p>You are searching for messages that belong to more than one topic, which is not possible.</p>",
|
|
|
|
}),
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
// No message can have multiple senders
|
|
|
|
if (current_filter.operands("sender").length > 1) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-03-16 14:51:16 +01:00
|
|
|
title: default_banner_for_multiple_filters,
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html({
|
|
|
|
defaultMessage:
|
|
|
|
"<p>You are searching for messages that are sent by more than one person, which is not possible.</p>",
|
|
|
|
}),
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// For empty stream searches within other narrows, we display the stop words
|
|
|
|
if (current_filter.operands("search").length > 0) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-03-16 14:51:16 +01:00
|
|
|
title: default_banner_for_multiple_filters,
|
2021-09-01 18:23:28 +02:00
|
|
|
search_data: retrieve_search_query_data(),
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
|
2022-04-29 12:50:45 +02:00
|
|
|
if (
|
|
|
|
page_params.is_spectator &&
|
|
|
|
first_operator === "stream" &&
|
|
|
|
!stream_data.is_web_public_by_stream_name(first_operand)
|
|
|
|
) {
|
|
|
|
// For non web-public streams, show `login_to_access` modal.
|
|
|
|
spectators.login_to_access(true);
|
2022-02-15 12:25:11 +01:00
|
|
|
return SPECTATOR_STREAM_NARROW_BANNER;
|
|
|
|
}
|
|
|
|
|
2023-09-12 04:26:25 +02:00
|
|
|
// A stream > topic that doesn't exist yet.
|
|
|
|
if (num_operators === 2 && streams.length === 1 && topics.length === 1) {
|
|
|
|
return default_banner;
|
|
|
|
}
|
|
|
|
|
2021-03-26 15:21:47 +01:00
|
|
|
// For other multi-operator narrows, we just use the default banner
|
2023-03-16 14:51:16 +01:00
|
|
|
return {
|
|
|
|
title: default_banner_for_multiple_filters,
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
|
2021-03-31 17:30:47 +02:00
|
|
|
switch (first_operator) {
|
|
|
|
case "is":
|
|
|
|
switch (first_operand) {
|
|
|
|
case "starred":
|
2023-04-20 16:05:21 +02:00
|
|
|
// You currently have no starred messages.
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-04-20 16:05:21 +02:00
|
|
|
title: $t({defaultMessage: "You have no starred messages."}),
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage:
|
|
|
|
"Learn more about starring messages <z-link>here</z-link>.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2023-05-02 04:30:33 +02:00
|
|
|
`<a target="_blank" rel="noopener noreferrer" href="/help/star-a-message">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
case "mentioned":
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "You haven't been mentioned yet!"}),
|
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "Learn more about mentions <z-link>here</z-link>.",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2023-05-02 04:30:33 +02:00
|
|
|
`<a target="_blank" rel="noopener noreferrer" href="/help/mention-a-user-or-group">${content_html.join(
|
2022-11-03 20:14:03 +01:00
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2023-04-07 14:03:34 +02:00
|
|
|
case "dm":
|
|
|
|
// You have no direct messages.
|
2022-10-31 20:40:22 +01:00
|
|
|
if (
|
|
|
|
page_params.realm_private_message_policy ===
|
|
|
|
settings_config.private_message_policy_values.disabled.code
|
|
|
|
) {
|
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage:
|
2023-01-24 19:49:56 +01:00
|
|
|
"You are not allowed to send direct messages in this organization.",
|
2022-10-31 20:40:22 +01:00
|
|
|
}),
|
|
|
|
};
|
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-01-24 19:49:56 +01:00
|
|
|
title: $t({defaultMessage: "You have no direct messages yet!"}),
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// TODO: The href here is a bit weird; we probably want to migrate
|
|
|
|
// this to a button element down the line.
|
|
|
|
"z-link": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<a href="#" class="empty_feed_compose_private">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
case "unread":
|
|
|
|
// You have no unread messages.
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "You have no unread messages!"}),
|
|
|
|
};
|
2021-07-13 10:11:51 +02:00
|
|
|
case "resolved":
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "No topics are marked as resolved."}),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
|
|
|
// fallthrough to default case if no match is found
|
|
|
|
break;
|
|
|
|
case "stream":
|
2021-11-23 00:37:45 +01:00
|
|
|
if (!stream_data.is_subscribed_by_name(first_operand)) {
|
2021-03-31 17:30:47 +02:00
|
|
|
// You are narrowed to a stream which does not exist or is a private stream
|
|
|
|
// in which you were never subscribed.
|
2021-03-26 15:21:47 +01:00
|
|
|
|
2022-02-15 12:25:11 +01:00
|
|
|
if (page_params.is_spectator) {
|
2022-04-29 12:48:19 +02:00
|
|
|
spectators.login_to_access(true);
|
2022-02-15 12:25:11 +01:00
|
|
|
return SPECTATOR_STREAM_NARROW_BANNER;
|
|
|
|
}
|
|
|
|
|
2021-04-04 17:23:40 +02:00
|
|
|
function can_toggle_narrowed_stream() {
|
2023-06-26 18:52:26 +02:00
|
|
|
const stream_name = narrow_state.stream_name();
|
2021-03-26 15:21:47 +01:00
|
|
|
|
2021-03-31 17:30:47 +02:00
|
|
|
if (!stream_name) {
|
|
|
|
return false;
|
|
|
|
}
|
2021-03-26 15:21:47 +01:00
|
|
|
|
2021-03-31 17:30:47 +02:00
|
|
|
const stream_sub = stream_data.get_sub(first_operand);
|
2021-04-04 17:23:40 +02:00
|
|
|
return stream_sub && stream_data.can_toggle_subscription(stream_sub);
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2021-03-26 15:21:47 +01:00
|
|
|
|
2021-04-04 17:23:40 +02:00
|
|
|
if (can_toggle_narrowed_stream()) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage:
|
|
|
|
"You aren't subscribed to this stream and nobody has talked about that yet!",
|
|
|
|
}),
|
|
|
|
// TODO: Consider moving the button to be its own option in the template.
|
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "<z-button>Subscribe</z-button>",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-button": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<button class="button white rounded stream_sub_unsub_button sea-green" type="button" name="subscription">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</button>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2021-03-26 15:21:47 +01:00
|
|
|
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "This stream does not exist or is private."}),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
|
|
|
// else fallthrough to default case
|
|
|
|
break;
|
2021-09-01 18:23:28 +02:00
|
|
|
case "search": {
|
2021-03-31 17:30:47 +02:00
|
|
|
// You are narrowed to empty search results.
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-03-16 14:56:35 +01:00
|
|
|
title: $t({defaultMessage: "No search results."}),
|
2021-09-01 18:23:28 +02:00
|
|
|
search_data: retrieve_search_query_data(),
|
|
|
|
};
|
|
|
|
}
|
2023-04-11 21:04:33 +02:00
|
|
|
case "dm": {
|
2021-03-31 17:30:47 +02:00
|
|
|
if (!people.is_valid_bulk_emails_for_compose(first_operand.split(","))) {
|
|
|
|
if (!first_operand.includes(",")) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "This user does not exist!"}),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "One or more of these users do not exist!"}),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2022-11-04 14:39:50 +01:00
|
|
|
const user_ids = people.emails_strings_to_user_ids_array(first_operand);
|
2022-10-31 20:40:22 +01:00
|
|
|
if (
|
|
|
|
page_params.realm_private_message_policy ===
|
2022-11-04 14:39:50 +01:00
|
|
|
settings_config.private_message_policy_values.disabled.code &&
|
|
|
|
(user_ids.length !== 1 || !people.get_by_user_id(user_ids[0]).is_bot)
|
2022-10-31 20:40:22 +01:00
|
|
|
) {
|
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage:
|
2023-01-24 19:49:56 +01:00
|
|
|
"You are not allowed to send direct messages in this organization.",
|
2022-10-31 20:40:22 +01:00
|
|
|
}),
|
|
|
|
};
|
|
|
|
}
|
2021-03-26 15:21:47 +01:00
|
|
|
if (!first_operand.includes(",")) {
|
2023-04-07 14:03:34 +02:00
|
|
|
// You have no direct messages with this person
|
2021-03-31 17:30:47 +02:00
|
|
|
if (people.is_current_user(first_operand)) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage:
|
2023-01-24 19:49:56 +01:00
|
|
|
"You have not sent any direct messages to yourself yet!",
|
2021-09-01 18:23:28 +02:00
|
|
|
}),
|
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage:
|
|
|
|
"Why not <z-link>start a conversation with yourself</z-link>?",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<a href="#" class="empty_feed_compose_private">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2021-03-31 17:30:47 +02:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2022-11-22 14:03:12 +01:00
|
|
|
title: $t(
|
2022-11-04 14:39:50 +01:00
|
|
|
{
|
2023-01-24 19:49:56 +01:00
|
|
|
defaultMessage: "You have no direct messages with {person} yet.",
|
2022-11-04 14:39:50 +01:00
|
|
|
},
|
|
|
|
{person: people.get_by_user_id(user_ids[0]).full_name},
|
|
|
|
),
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<a href="#" class="empty_feed_compose_private">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2023-01-24 19:49:56 +01:00
|
|
|
title: $t({defaultMessage: "You have no direct messages with these users yet."}),
|
2021-09-01 18:23:28 +02:00
|
|
|
html: $t_html(
|
|
|
|
{
|
|
|
|
defaultMessage: "Why not <z-link>start the conversation</z-link>?",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"z-link": (content_html) =>
|
2022-11-03 20:14:03 +01:00
|
|
|
`<a href="#" class="empty_feed_compose_private">${content_html.join(
|
|
|
|
"",
|
|
|
|
)}</a>`,
|
2021-09-01 18:23:28 +02:00
|
|
|
},
|
|
|
|
),
|
|
|
|
};
|
2022-11-04 14:39:50 +01:00
|
|
|
}
|
|
|
|
case "sender": {
|
|
|
|
const sender = people.get_by_email(first_operand);
|
|
|
|
if (sender) {
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
2022-11-22 14:03:12 +01:00
|
|
|
title: $t(
|
2022-11-04 14:39:50 +01:00
|
|
|
{
|
|
|
|
defaultMessage:
|
|
|
|
"You haven't received any messages sent by {person} yet.",
|
|
|
|
},
|
|
|
|
{person: sender.full_name},
|
|
|
|
),
|
2021-09-01 18:23:28 +02:00
|
|
|
};
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
2021-09-01 18:23:28 +02:00
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "This user does not exist!"}),
|
|
|
|
};
|
2022-11-04 14:39:50 +01:00
|
|
|
}
|
2023-04-19 17:35:32 +02:00
|
|
|
case "dm-including": {
|
|
|
|
const person_in_dms = people.get_by_email(first_operand);
|
|
|
|
if (!person_in_dms) {
|
|
|
|
return {
|
|
|
|
title: $t({defaultMessage: "This user does not exist!"}),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
page_params.realm_private_message_policy ===
|
|
|
|
settings_config.private_message_policy_values.disabled.code &&
|
|
|
|
!person_in_dms.is_bot
|
|
|
|
) {
|
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage:
|
|
|
|
"You are not allowed to send direct messages in this organization.",
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if (people.is_current_user(first_operand)) {
|
|
|
|
return {
|
|
|
|
title: $t({
|
|
|
|
defaultMessage: "You don't have any direct message conversations yet.",
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
title: $t(
|
|
|
|
{
|
|
|
|
defaultMessage: "You have no direct messages including {person} yet.",
|
|
|
|
},
|
|
|
|
{person: person_in_dms.full_name},
|
|
|
|
),
|
|
|
|
};
|
|
|
|
}
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
return default_banner;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function show_empty_narrow_message() {
|
2021-09-01 18:23:28 +02:00
|
|
|
$(".empty_feed_notice_main").empty();
|
|
|
|
const rendered_narrow_banner = narrow_error(pick_empty_narrow_banner());
|
|
|
|
$(".empty_feed_notice_main").html(rendered_narrow_banner);
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export function hide_empty_narrow_message() {
|
2021-09-01 18:23:28 +02:00
|
|
|
$(".empty_feed_notice_main").empty();
|
2021-03-26 15:21:47 +01:00
|
|
|
}
|