mirror of https://github.com/zulip/zulip.git
message_header: Add date on every recipient bar in search_results.
Fixes #31958
This commit is contained in:
parent
3ff6a89fe6
commit
5686233699
|
@ -106,6 +106,7 @@ export type MessageGroup = {
|
||||||
topic_url: string | undefined;
|
topic_url: string | undefined;
|
||||||
user_can_resolve_topic: boolean;
|
user_can_resolve_topic: boolean;
|
||||||
visibility_policy: number | false;
|
visibility_policy: number | false;
|
||||||
|
always_display_date: boolean;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
is_stream: false;
|
is_stream: false;
|
||||||
|
@ -114,6 +115,7 @@ export type MessageGroup = {
|
||||||
is_private: true;
|
is_private: true;
|
||||||
pm_with_url: string;
|
pm_with_url: string;
|
||||||
recipient_users: RecipientRowUser[];
|
recipient_users: RecipientRowUser[];
|
||||||
|
always_display_date: boolean;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -425,6 +427,14 @@ function maybe_restore_focus_to_message_edit_form(): void {
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_search_view(): boolean {
|
||||||
|
const current_filter = narrow_state.filter();
|
||||||
|
if (current_filter && !current_filter.supports_collapsing_recipients()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
type SubscriptionMarkers = {
|
type SubscriptionMarkers = {
|
||||||
bookend_top: boolean;
|
bookend_top: boolean;
|
||||||
stream_name: string;
|
stream_name: string;
|
||||||
|
@ -443,6 +453,9 @@ function populate_group_from_message(
|
||||||
const message_group_id = _.uniqueId("message_group_");
|
const message_group_id = _.uniqueId("message_group_");
|
||||||
const date = get_group_display_date(message, year_changed);
|
const date = get_group_display_date(message, year_changed);
|
||||||
|
|
||||||
|
// Each searched message is a self-contained result,
|
||||||
|
// so we always display date in the recipient bar for those messages.
|
||||||
|
const always_display_date = is_search_view();
|
||||||
if (is_stream) {
|
if (is_stream) {
|
||||||
assert(message.type === "stream");
|
assert(message.type === "stream");
|
||||||
// stream messages have string display_recipient
|
// stream messages have string display_recipient
|
||||||
|
@ -501,6 +514,7 @@ function populate_group_from_message(
|
||||||
topic_is_resolved,
|
topic_is_resolved,
|
||||||
visibility_policy,
|
visibility_policy,
|
||||||
all_visibility_policies,
|
all_visibility_policies,
|
||||||
|
always_display_date,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// Private message group
|
// Private message group
|
||||||
|
@ -520,6 +534,7 @@ function populate_group_from_message(
|
||||||
pm_with_url: message.pm_with_url,
|
pm_with_url: message.pm_with_url,
|
||||||
recipient_users: get_users_for_recipient_row(message),
|
recipient_users: get_users_for_recipient_row(message),
|
||||||
display_reply_to_for_tooltip: message_store.get_pm_full_names(user_ids),
|
display_reply_to_for_tooltip: message_store.get_pm_full_names(user_ids),
|
||||||
|
always_display_date,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
</span>
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
<span class="recipient_row_date {{#if date_unchanged}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>
|
<span class="recipient_row_date {{#if (and (not always_display_date) date_unchanged )}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
{{/tr~}}
|
{{/tr~}}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<span class="recipient_row_date {{#if date_unchanged}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>
|
<span class="recipient_row_date {{#if (and (not always_display_date) date_unchanged )}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue