recent_topics: Link timestamp to latest message.

Link the timestamp in recent topics to the
"near" link of the latest message within that topic.
Fixes #21356.
This commit is contained in:
Gaurav Pandey
2022-04-02 00:16:02 +05:30
committed by Tim Abbott
parent 1298484ac8
commit 3aa9e4c553
3 changed files with 7 additions and 4 deletions

View File

@@ -8,6 +8,7 @@ const $ = require("../zjsunit/zjquery");
const {page_params} = require("../zjsunit/zpage_params");
const noop = () => {};
const test_url = () => "https://www.example.com";
// We assign this in our test() wrapper.
let messages;
@@ -79,9 +80,9 @@ mock_esm("../../static/js/compose_closed_ui", {
update_buttons_for_recent_topics: noop,
});
mock_esm("../../static/js/hash_util", {
by_stream_url: () => "https://www.example.com",
by_stream_topic_url: () => "https://www.example.com",
by_stream_url: test_url,
by_stream_topic_url: test_url,
by_conversation_and_time_url: test_url,
});
mock_esm("../../static/js/message_list_data", {
MessageListData: class {},
@@ -277,6 +278,7 @@ function generate_topic_data(topic_info_array) {
invite_only: false,
is_web_public: true,
last_msg_time: "Just now",
last_msg_url: "https://www.example.com",
full_last_msg_date_time: "date at time",
senders: [1, 2],
stream: "stream" + stream_id,

View File

@@ -314,6 +314,7 @@ function format_topic(topic_data) {
topic_key: get_topic_key(stream_id, topic),
unread_count,
last_msg_time,
last_msg_url: hash_util.by_conversation_and_time_url(last_msg),
topic_url: hash_util.by_stream_topic_url(stream_id, topic),
senders: senders_info,
other_senders_count: Math.max(0, all_senders.length - MAX_AVATAR),

View File

@@ -49,7 +49,7 @@
</td>
<td class="recent_topic_timestamp">
<div class="last_msg_time tippy-zulip-tooltip" data-tippy-content="{{this.full_last_msg_date_time}}">
{{ last_msg_time }}
<a href="{{last_msg_url}}">{{ last_msg_time }}</a>
</div>
</td>
</tr>