mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
settings_config: Move Stream level notification settings.
This commit is contained in:
@@ -159,13 +159,24 @@ exports.msg_delete_limit_dropdown_values = time_limit_dropdown_values;
|
|||||||
|
|
||||||
// NOTIFICATIONS
|
// NOTIFICATIONS
|
||||||
|
|
||||||
exports.general_notifications_table_columns = [
|
exports.general_notifications_table_labels = {
|
||||||
/* An array of notification settings of any category like
|
realm: [
|
||||||
* `stream_notification_settings` which makes a single row of
|
/* An array of notification settings of any category like
|
||||||
* "Notification triggers" table should follow this order
|
* `stream_notification_settings` which makes a single row of
|
||||||
*/
|
* "Notification triggers" table should follow this order
|
||||||
"visual", "audio", "mobile", "email", "all_mentions",
|
*/
|
||||||
];
|
"visual", "audio", "mobile", "email", "all_mentions",
|
||||||
|
],
|
||||||
|
stream: {
|
||||||
|
is_muted: i18n.t("Mute stream"),
|
||||||
|
desktop_notifications: i18n.t("Visual desktop notifications"),
|
||||||
|
audible_notifications: i18n.t("Audible desktop notifications"),
|
||||||
|
push_notifications: i18n.t("Mobile notifications"),
|
||||||
|
email_notifications: i18n.t("Email notifications"),
|
||||||
|
pin_to_top: i18n.t("Pin stream to top of left sidebar"),
|
||||||
|
wildcard_mentions_notify: i18n.t("Notifications for @all/@everyone mentions"),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
exports.stream_specific_notification_settings = [
|
exports.stream_specific_notification_settings = [
|
||||||
"desktop_notifications",
|
"desktop_notifications",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const render_stream_specific_notification_row = require('../templates/settings/s
|
|||||||
const settings_config = require("./settings_config");
|
const settings_config = require("./settings_config");
|
||||||
|
|
||||||
exports.get_notifications_table_row_data = function (notify_settings) {
|
exports.get_notifications_table_row_data = function (notify_settings) {
|
||||||
return settings_config.general_notifications_table_columns.map((column, index) => {
|
return settings_config.general_notifications_table_labels.realm.map((column, index) => {
|
||||||
const setting_name = notify_settings[index];
|
const setting_name = notify_settings[index];
|
||||||
if (setting_name === undefined) {
|
if (setting_name === undefined) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const render_stream_member_list_entry = require('../templates/stream_member_list
|
|||||||
const render_subscription_settings = require('../templates/subscription_settings.hbs');
|
const render_subscription_settings = require('../templates/subscription_settings.hbs');
|
||||||
const render_subscription_stream_privacy_modal = require("../templates/subscription_stream_privacy_modal.hbs");
|
const render_subscription_stream_privacy_modal = require("../templates/subscription_stream_privacy_modal.hbs");
|
||||||
const settings_data = require("./settings_data");
|
const settings_data = require("./settings_data");
|
||||||
|
const settings_config = require("./settings_config");
|
||||||
|
|
||||||
function setup_subscriptions_stream_hash(sub) {
|
function setup_subscriptions_stream_hash(sub) {
|
||||||
const hash = hash_util.stream_edit_uri(sub);
|
const hash = hash_util.stream_edit_uri(sub);
|
||||||
@@ -253,21 +254,10 @@ exports.is_notification_setting = function (setting_label) {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const settings_labels = {
|
|
||||||
is_muted: i18n.t("Mute stream"),
|
|
||||||
desktop_notifications: i18n.t("Visual desktop notifications"),
|
|
||||||
audible_notifications: i18n.t("Audible desktop notifications"),
|
|
||||||
push_notifications: i18n.t("Mobile notifications"),
|
|
||||||
email_notifications: i18n.t("Email notifications"),
|
|
||||||
pin_to_top: i18n.t("Pin stream to top of left sidebar"),
|
|
||||||
wildcard_mentions_notify: i18n.t("Notifications for @all/@everyone mentions"),
|
|
||||||
};
|
|
||||||
|
|
||||||
const check_realm_setting = {
|
|
||||||
push_notifications: !page_params.realm_push_notifications_enabled,
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.stream_settings = function (sub) {
|
exports.stream_settings = function (sub) {
|
||||||
|
const settings_labels = settings_config.general_notifications_table_labels.stream;
|
||||||
|
const check_realm_setting = settings_config.all_notifications().show_push_notifications_tooltip;
|
||||||
|
|
||||||
const settings = Object.keys(settings_labels).map((setting) => {
|
const settings = Object.keys(settings_labels).map((setting) => {
|
||||||
const ret = {
|
const ret = {
|
||||||
name: setting,
|
name: setting,
|
||||||
|
|||||||
Reference in New Issue
Block a user