mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
left sidebar: Rename convos => conversations variable names.
This name violated our policy against abbreviations.
This commit is contained in:
@@ -55,7 +55,7 @@ function test(label, f) {
|
||||
});
|
||||
}
|
||||
|
||||
test("get_convos", ({override}) => {
|
||||
test("get_conversations", ({override}) => {
|
||||
pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
|
||||
pm_conversations.recent.insert([me.user_id], 2);
|
||||
let num_unread_for_person = 1;
|
||||
@@ -90,23 +90,23 @@ test("get_convos", ({override}) => {
|
||||
},
|
||||
];
|
||||
|
||||
let pm_data = pm_list_data.get_convos();
|
||||
let pm_data = pm_list_data.get_conversations();
|
||||
assert.deepEqual(pm_data, expected_data);
|
||||
|
||||
num_unread_for_person = 0;
|
||||
|
||||
pm_data = pm_list_data.get_convos();
|
||||
pm_data = pm_list_data.get_conversations();
|
||||
expected_data[0].unread = 0;
|
||||
expected_data[0].is_zero = true;
|
||||
expected_data[1].unread = 0;
|
||||
expected_data[1].is_zero = true;
|
||||
assert.deepEqual(pm_data, expected_data);
|
||||
|
||||
pm_data = pm_list_data.get_convos();
|
||||
pm_data = pm_list_data.get_conversations();
|
||||
assert.deepEqual(pm_data, expected_data);
|
||||
});
|
||||
|
||||
test("get_convos bot", ({override}) => {
|
||||
test("get_conversations bot", ({override}) => {
|
||||
pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
|
||||
pm_conversations.recent.insert([bot_test.user_id], 2);
|
||||
|
||||
@@ -139,7 +139,7 @@ test("get_convos bot", ({override}) => {
|
||||
},
|
||||
];
|
||||
|
||||
const pm_data = pm_list_data.get_convos();
|
||||
const pm_data = pm_list_data.get_conversations();
|
||||
assert.deepEqual(pm_data, expected_data);
|
||||
});
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ export function close() {
|
||||
}
|
||||
|
||||
export function _build_private_messages_list() {
|
||||
const convos = pm_list_data.get_convos();
|
||||
const dom_ast = pm_list_dom.pm_ul(convos);
|
||||
const conversations = pm_list_data.get_conversations();
|
||||
const dom_ast = pm_list_dom.pm_ul(conversations);
|
||||
return dom_ast;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export function get_active_user_ids_string() {
|
||||
return people.emails_strings_to_user_ids_string(emails);
|
||||
}
|
||||
|
||||
export function get_convos() {
|
||||
export function get_conversations() {
|
||||
const private_messages = pm_conversations.recent.get();
|
||||
const display_messages = [];
|
||||
const active_user_ids_string = get_active_user_ids_string();
|
||||
|
||||
@@ -4,28 +4,28 @@ import render_pm_list_item from "../templates/pm_list_item.hbs";
|
||||
|
||||
import * as vdom from "./vdom";
|
||||
|
||||
export function keyed_pm_li(convo) {
|
||||
const render = () => render_pm_list_item(convo);
|
||||
export function keyed_pm_li(conversation) {
|
||||
const render = () => render_pm_list_item(conversation);
|
||||
|
||||
const eq = (other) => _.isEqual(convo, other.convo);
|
||||
const eq = (other) => _.isEqual(conversation, other.conversation);
|
||||
|
||||
const key = convo.user_ids_string;
|
||||
const key = conversation.user_ids_string;
|
||||
|
||||
return {
|
||||
key,
|
||||
render,
|
||||
convo,
|
||||
conversation,
|
||||
eq,
|
||||
};
|
||||
}
|
||||
|
||||
export function pm_ul(convos) {
|
||||
export function pm_ul(conversations) {
|
||||
const attrs = [
|
||||
["class", "expanded_private_messages"],
|
||||
["data-name", "private"],
|
||||
];
|
||||
return vdom.ul({
|
||||
attrs,
|
||||
keyed_nodes: convos.map((convo) => keyed_pm_li(convo)),
|
||||
keyed_nodes: conversations.map((conversation) => keyed_pm_li(conversation)),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,17 +67,17 @@ export function zoom_out() {
|
||||
rebuild(parent_widget, stream_id);
|
||||
}
|
||||
|
||||
export function keyed_topic_li(convo) {
|
||||
const render = () => render_topic_list_item(convo);
|
||||
export function keyed_topic_li(conversation) {
|
||||
const render = () => render_topic_list_item(conversation);
|
||||
|
||||
const eq = (other) => _.isEqual(convo, other.convo);
|
||||
const eq = (other) => _.isEqual(conversation, other.conversation);
|
||||
|
||||
const key = "t:" + convo.topic_name;
|
||||
const key = "t:" + conversation.topic_name;
|
||||
|
||||
return {
|
||||
key,
|
||||
render,
|
||||
convo,
|
||||
conversation,
|
||||
eq,
|
||||
};
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export class TopicListWidget {
|
||||
|
||||
const attrs = [["class", "topic-list"]];
|
||||
|
||||
const nodes = list_info.items.map((convo) => keyed_topic_li(convo));
|
||||
const nodes = list_info.items.map((conversation) => keyed_topic_li(conversation));
|
||||
|
||||
if (spinner) {
|
||||
nodes.push(spinner_li());
|
||||
|
||||
Reference in New Issue
Block a user