buddy-data: Remove unimplemented `user_circle_status` description.

In #11882, the alternate tooltip text/behavior for user status
circles was removed from the implementation, but not from the
buddy list data.

This commit removes the `buddy_data.status_description` function
and related frontend tests. There are no remaining instances of
`user_circle_status` in the codebase.

Prep commit for transitioning from 'unavailable' user status
feature to 'invisible mode' user presence feature.
This commit is contained in:
Lauryn Menard 2022-09-20 12:42:40 +02:00 committed by Tim Abbott
parent b3b6449034
commit 9177ac7a4c
3 changed files with 1 additions and 29 deletions

View File

@ -389,7 +389,6 @@ test("first/prev/next", ({override, mock_template}) => {
name: "Alice Smith",
num_unread: 0,
user_circle_class: "user_circle_green",
user_circle_status: "translated: Active",
user_id: alice.user_id,
status_emoji_info: undefined,
status_text: undefined,
@ -409,7 +408,6 @@ test("first/prev/next", ({override, mock_template}) => {
is_current_user: false,
num_unread: 0,
user_circle_class: "user_circle_green",
user_circle_status: "translated: Active",
faded: false,
status_emoji_info: undefined,
status_text: undefined,
@ -458,7 +456,6 @@ test("insert_one_user_into_empty_list", ({override, mock_template}) => {
is_current_user: false,
num_unread: 0,
user_circle_class: "user_circle_green",
user_circle_status: "translated: Active",
faded: true,
status_emoji_info: undefined,
status_text: undefined,

View File

@ -121,7 +121,7 @@ function set_presence(user_id, status) {
});
}
test("user_circle, level, status_description", () => {
test("user_circle, level", () => {
add_canned_users();
set_presence(selma.user_id, "active");
@ -132,12 +132,10 @@ test("user_circle, level, status_description", () => {
assert.equal(buddy_data.get_user_circle_class(selma.user_id), "user_circle_empty_line");
user_status.revoke_away(selma.user_id);
assert.equal(buddy_data.get_user_circle_class(selma.user_id), "user_circle_green");
assert.equal(buddy_data.status_description(selma.user_id), "translated: Active");
set_presence(me.user_id, "active");
assert.equal(buddy_data.get_user_circle_class(me.user_id), "user_circle_green");
user_status.set_away(me.user_id);
assert.equal(buddy_data.status_description(me.user_id), "translated: Unavailable");
assert.equal(buddy_data.level(me.user_id), 0);
assert.equal(buddy_data.get_user_circle_class(me.user_id), "user_circle_empty_line");
@ -147,10 +145,8 @@ test("user_circle, level, status_description", () => {
set_presence(fred.user_id, "idle");
assert.equal(buddy_data.get_user_circle_class(fred.user_id), "user_circle_idle");
assert.equal(buddy_data.level(fred.user_id), 2);
assert.equal(buddy_data.status_description(fred.user_id), "translated: Idle");
set_presence(fred.user_id, undefined);
assert.equal(buddy_data.status_description(fred.user_id), "translated: Offline");
});
test("compose fade interactions (streams)", () => {
@ -528,7 +524,6 @@ test("get_items_for_users", () => {
status_emoji_info,
status_text: undefined,
user_circle_class: "user_circle_green",
user_circle_status: "translated: Active",
user_id: 1001,
user_list_style,
},
@ -541,7 +536,6 @@ test("get_items_for_users", () => {
status_emoji_info,
status_text: undefined,
user_circle_class: "user_circle_empty_line",
user_circle_status: "translated: Unavailable",
user_id: 1002,
user_list_style,
},
@ -554,7 +548,6 @@ test("get_items_for_users", () => {
status_emoji_info,
status_text: undefined,
user_circle_class: "user_circle_empty",
user_circle_status: "translated: Offline",
user_id: 1003,
user_list_style,
},

View File

@ -51,22 +51,6 @@ export function get_user_circle_class(user_id) {
}
}
export function status_description(user_id) {
const status = buddy_status(user_id);
switch (status) {
case "active":
return $t({defaultMessage: "Active"});
case "idle":
return $t({defaultMessage: "Idle"});
case "away_them":
case "away_me":
return $t({defaultMessage: "Unavailable"});
default:
return $t({defaultMessage: "Offline"});
}
}
export function level(user_id) {
if (people.is_my_user_id(user_id)) {
// Always put current user at the top.
@ -166,7 +150,6 @@ export function info_for(user_id) {
const person = people.get_by_user_id(user_id);
const status_emoji_info = user_status.get_status_emoji(user_id);
const user_circle_status = status_description(user_id);
const status_text = user_status.get_status_text(user_id);
const user_list_style_value = user_settings.user_list_style;
const user_list_style = {
@ -183,7 +166,6 @@ export function info_for(user_id) {
is_current_user: people.is_my_user_id(user_id),
num_unread: get_num_unread(user_id),
user_circle_class,
user_circle_status,
status_text,
user_list_style,
};