mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
settings_invites: Remove invited_as_values map.
This commit removes invited_as_values map in settings_invites.js. This object has been removed to avoid duplication as we already have role values in settings_config.js. A similar map is created from settings_config.user_role_values in settings_config.js and is used to populate invited_as_text for invites.
This commit is contained in:
parent
1f8f227444
commit
136c005f3f
@ -191,6 +191,9 @@ exports.user_role_values = {
|
||||
},
|
||||
};
|
||||
|
||||
const user_role_array = Object.values(exports.user_role_values);
|
||||
exports.user_role_map = new Map(user_role_array.map(role => [role.code, role.description]));
|
||||
|
||||
// NOTIFICATIONS
|
||||
|
||||
exports.general_notifications_table_labels = {
|
||||
|
||||
@ -16,16 +16,9 @@ function failed_listing_invites(xhr) {
|
||||
ui_report.error(i18n.t("Error listing invites"), xhr, $("#invites-field-status"));
|
||||
}
|
||||
|
||||
exports.invited_as_values = new Map([
|
||||
[100, i18n.t("Organization owner")],
|
||||
[200, i18n.t("Organization administrator")],
|
||||
[400, i18n.t("Member")],
|
||||
[600, i18n.t("Guest")],
|
||||
]);
|
||||
|
||||
function add_invited_as_text(invites) {
|
||||
for (const data of invites) {
|
||||
data.invited_as_text = exports.invited_as_values.get(data.invited_as);
|
||||
data.invited_as_text = settings_config.user_role_map.get(data.invited_as);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user