follow_topics: Remove the 'development' guard.

This commit removes the 'development' guard and makes
the UI changes related to the 'Follow Topics' project visible
outside the development environment.

Cleans up the older UI elements related to mute and unmute topics.
This commit is contained in:
Prakhar Pratyush
2023-08-21 11:40:03 +05:30
committed by Tim Abbott
parent 5dba15160d
commit 3f2ab44f94
13 changed files with 99 additions and 204 deletions

View File

@@ -17,7 +17,6 @@ import {localstorage} from "./localstorage";
import * as message_store from "./message_store";
import * as modals from "./modals";
import * as overlays from "./overlays";
import {page_params} from "./page_params";
import * as people from "./people";
import * as popovers from "./popovers";
import * as sidebar_ui from "./sidebar_ui";
@@ -313,15 +312,11 @@ function format_topic(stream_id, topic, topic_unread_count, latest_msg_id) {
is_collapsed: collapsed_containers.has(STREAM_HEADER_PREFIX + stream_id),
mention_in_unread: unread.topic_has_any_unread_mentions(stream_id, topic),
latest_msg_id,
// The following two fields (development & all_visibility_policies)
// are not specific to this context, but this is the easiest way
// we've figured out for passing the data to the template rendering.
development: page_params.development_environment,
// The 'all_visibility_policies' field is not specific to this context,
// but this is the easiest way we've figured out for passing the data
// to the template rendering.
all_visibility_policies: user_topics.all_visibility_policies,
visibility_policy: user_topics.get_topic_visibility_policy(stream_id, topic),
topic_muted: Boolean(user_topics.is_topic_muted(stream_id, topic)),
topic_unmuted: Boolean(user_topics.is_topic_unmuted(stream_id, topic)),
stream_muted: sub_store.get(stream_id).is_muted,
};
return context;

View File

@@ -230,20 +230,16 @@ function populate_group_from_message_container(group, message_container) {
group.stream_id = -1;
} else {
group.stream_id = sub.stream_id;
group.stream_muted = sub.is_muted;
}
group.is_subscribed = stream_data.is_subscribed(group.stream_id);
group.topic_is_resolved = resolved_topic.is_resolved(group.topic);
group.topic_muted = user_topics.is_topic_muted(group.stream_id, group.topic);
group.topic_unmuted = user_topics.is_topic_unmuted(group.stream_id, group.topic);
group.visibility_policy = user_topics.get_topic_visibility_policy(
group.stream_id,
group.topic,
);
// The following two fields are not specific to this group, but this is the
// The following field is not specific to this group, but this is the
// easiest way we've figured out for passing the data to the template rendering.
group.development = page_params.development_environment;
group.all_visibility_policies = user_topics.all_visibility_policies;
} else if (group.is_private) {
group.pm_with_url = message_container.pm_with_url;

View File

@@ -118,7 +118,6 @@ export function get_actions_popover_content_context(message_id) {
export function get_topic_popover_content_context({stream_id, topic_name, url}) {
const sub = sub_store.get(stream_id);
const topic_muted = user_topics.is_topic_muted(sub.stream_id, topic_name);
const topic_unmuted = user_topics.is_topic_unmuted(sub.stream_id, topic_name);
const has_starred_messages = starred_messages.get_count_in_topic(sub.stream_id, topic_name) > 0;
const can_move_topic = settings_data.user_can_move_messages_between_streams();
@@ -130,7 +129,6 @@ export function get_topic_popover_content_context({stream_id, topic_name, url})
stream_id: sub.stream_id,
stream_muted: sub.is_muted,
topic_name,
topic_muted,
topic_unmuted,
can_move_topic,
can_rename_topic,
@@ -141,7 +139,6 @@ export function get_topic_popover_content_context({stream_id, topic_name, url})
url,
visibility_policy,
all_visibility_policies,
development: page_params.development_environment,
};
}

View File

@@ -471,7 +471,6 @@ function format_conversation(conversation_data) {
// Stream info
context.stream_id = last_msg.stream_id;
context.stream_name = stream_data.get_stream_name_from_id(last_msg.stream_id);
context.stream_muted = stream_info.is_muted;
context.stream_color = stream_info.color;
context.stream_url = hash_util.by_stream_url(context.stream_id);
context.invite_only = stream_info.invite_only;
@@ -484,10 +483,6 @@ function format_conversation(conversation_data) {
// We only supply the data to the topic rows and let jquery
// display / hide them according to filters instead of
// doing complete re-render.
context.topic_muted = Boolean(user_topics.is_topic_muted(context.stream_id, context.topic));
context.topic_unmuted = Boolean(
user_topics.is_topic_unmuted(context.stream_id, context.topic),
);
context.mention_in_unread = unread.topic_has_any_unread_mentions(
context.stream_id,
context.topic,
@@ -497,9 +492,8 @@ function format_conversation(conversation_data) {
context.stream_id,
context.topic,
);
// The following two fields are not specific to this context, but this is the
// The following field is not specific to this context, but this is the
// easiest way we've figured out for passing the data to the template rendering.
context.development = page_params.development_environment;
context.all_visibility_policies = user_topics.all_visibility_policies;
// Since the css for displaying senders in reverse order is much simpler,

View File

@@ -109,7 +109,6 @@ export function build_page() {
full_name: people.my_full_name(),
date_joined_text: get_parsed_date_of_joining(),
page_params,
development: page_params.development_environment,
enable_sound_select:
user_settings.enable_sounds || user_settings.enable_stream_audible_notifications,
zuliprc: "zuliprc",

View File

@@ -3,7 +3,6 @@ import $ from "jquery";
import render_user_topic_ui_row from "../templates/user_topic_ui_row.hbs";
import * as ListWidget from "./list_widget";
import {page_params} from "./page_params";
import * as scroll_util from "./scroll_util";
import * as settings_config from "./settings_config";
import * as user_topics from "./user_topics";
@@ -32,7 +31,6 @@ export function populate_list() {
user_topic,
user_topic_visibility_policy_values:
settings_config.user_topic_visibility_policy_values,
development: page_params.development_environment,
};
return render_user_topic_ui_row(context);
},

View File

@@ -47,33 +47,21 @@
<div class="inbox-right-part-wrapper">
<div class="inbox-right-part">
{{#if is_topic}}
{{#if development}}
<span class="visibility-policy-indicator change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" tabindex="0">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
</span>
{{else}}
<span class="visibility-policy-indicator" tabindex="0">
{{#if stream_muted}}
<i class="zulip-icon zulip-icon-unmute stream_muted {{#if topic_unmuted}}on_hover_topic_mute {{else}}on_hover_topic_unmute {{/if}} recipient_bar_icon tippy-zulip-tooltip" data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" role="button"
{{#if topic_unmuted}} data-tippy-content="{{t 'Mute topic' }}" aria-label="{{t 'Mute topic' }}" {{else}} data-tippy-content="{{t 'Unmute topic' }}" aria-label="{{t 'Unmute topic' }}" {{/if}} data-tippy-trigger="mouseenter"></i>
{{else}}
<i class="zulip-icon zulip-icon-mute stream_unmuted {{#if topic_muted}}on_hover_topic_unmute {{else}}on_hover_topic_mute {{/if}} recipient_bar_icon tippy-zulip-tooltip" data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" role="button"
{{#if topic_muted}} data-tippy-content="{{t 'Unmute topic' }}" aria-label="{{t 'Unmute topic' }}" {{else}} data-tippy-content="{{t 'Mute topic' }}" aria-label="{{t 'Mute topic' }}" {{/if}} data-tippy-trigger="mouseenter"></i>
{{/if}}
</span>
{{/if}}
<span class="visibility-policy-indicator change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" tabindex="0">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
</span>
{{/if}}
<div class="inbox-action-button inbox-topic-menu"
{{#if is_topic}}data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}"

View File

@@ -60,31 +60,21 @@
</div>
<div class="recent_topic_actions">
<div class="recent_view_focusable hidden-for-spectators">
{{#if development}}
<span class="change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
</span>
{{else}}
{{#if stream_muted}}
<i class="zulip-icon zulip-icon-unmute stream_muted {{#if topic_unmuted}}on_hover_topic_mute {{else}}on_hover_topic_unmute {{/if}} recipient_bar_icon tippy-zulip-tooltip" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" role="button" tabindex="0"
{{#if topic_unmuted}} data-tippy-content="{{t 'Mute topic' }}" aria-label="{{t 'Mute topic' }}" {{else}} data-tippy-content="{{t 'Unmute topic' }}" aria-label="{{t 'Unmute topic' }}" {{/if}} data-tippy-trigger="mouseenter"></i>
<span class="change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-mute stream_unmuted {{#if topic_muted}}on_hover_topic_unmute {{else}}on_hover_topic_mute {{/if}} recipient_bar_icon tippy-zulip-tooltip" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" role="button" tabindex="0"
{{#if topic_muted}} data-tippy-content="{{t 'Unmute topic' }}" aria-label="{{t 'Unmute topic' }}" {{else}} data-tippy-content="{{t 'Mute topic' }}" aria-label="{{t 'Mute topic' }}" {{/if}} data-tippy-trigger="mouseenter"></i>
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
{{/if}}
</span>
</div>
</div>
{{/if}}

View File

@@ -59,31 +59,21 @@
{{/if}}
{{#if is_subscribed}}
{{#if development}}
<span class="change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
</span>
{{else}}
{{#if stream_muted}}
<i class="zulip-icon zulip-icon-unmute stream_muted {{#if topic_unmuted}} on_hover_topic_mute {{else}} on_hover_topic_unmute {{/if}} recipient_bar_icon hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" role="button" tabindex="0"
{{#if topic_unmuted}} data-tooltip-template-id="topic-mute-tooltip-template" aria-label="{{t 'Mute topic' }}" {{else}} data-tooltip-template-id="topic-unmute-tooltip-template" aria-label="{{t 'Unmute topic' }}" {{/if}}></i>
<span class="change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.UNMUTED)}}
<i class="zulip-icon zulip-icon-unmute-new recipient_bar_icon" data-tippy-content="{{t 'You have unmuted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have unmuted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else}}
<i class="zulip-icon zulip-icon-mute stream_unmuted{{#if topic_muted}} on_hover_topic_unmute {{else}} on_hover_topic_mute {{/if}} recipient_bar_icon hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic}}" role="button" tabindex="0"
{{#if topic_muted}} data-tooltip-template-id="topic-unmute-tooltip-template" aria-label="{{t 'Unmute topic' }}" {{else}} data-tooltip-template-id="topic-mute-tooltip-template" aria-label="{{t 'Mute topic' }}" {{/if}}></i>
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'You will get default notifications for this topic'}}"
role="button" tabindex="0" aria-haspopup="true" aria-label="{{t 'You will get default notifications for this topic' }}"></i>
{{/if}}
{{/if}}
</span>
{{/if}}
</span>
<span class="recipient_row_date {{#if date_unchanged}}recipient_row_date_unchanged{{/if}}">{{{date}}}</span>

View File

@@ -28,18 +28,16 @@
</thead>
<tbody>
{{#each general_settings}}
{{#unless (and (eq this.label "Followed topics") (not ../development))}}
<tr>
<td>{{ this.label }}</td>
{{#each this.notification_settings}}
{{> notification_settings_checkboxes
setting_name=this.setting_name
is_checked=this.is_checked
is_disabled=this.is_disabled
prefix=../../prefix }}
{{/each}}
</tr>
{{/unless}}
<tr>
<td>{{ this.label }}</td>
{{#each this.notification_settings}}
{{> notification_settings_checkboxes
setting_name=this.setting_name
is_checked=this.is_checked
is_disabled=this.is_disabled
prefix=../../prefix }}
{{/each}}
</tr>
{{/each}}
</tbody>
{{#unless for_realm_settings}}
@@ -49,34 +47,32 @@
</table>
</div>
{{#if development}}
<div class="topic_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">
<div class="topic_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">
<div class="subsection-header inline-block">
<h3>{{t "Topic notifications" }}
{{> ../help_link_widget link="/help/mute-a-topic" }}
</h3>
{{> settings_save_discard_widget section_name="topic-notifications-settings" show_only_indicator=(not for_realm_settings) }}
<p>{{t "You will automatically follow topics that you have configured to both follow and unmute." }}</p>
</div>
<div class="input-group">
<label for="automatically_follow_topics_policy" class="dropdown-title">{{ settings_label.automatically_follow_topics_policy }}</label>
<select name="automatically_follow_topics_policy" class="setting_automatically_follow_topics_policy prop-element settings_select bootstrap-focus-style"
id="{{prefix}}automatically_follow_topics_policy" data-setting-widget-type="number">
{{> dropdown_options_widget option_values=automatically_follow_topics_policy_values}}
</select>
</div>
<div class="input-group">
<label for="automatically_unmute_topics_in_muted_streams_policy" class="dropdown-title">{{ settings_label.automatically_unmute_topics_in_muted_streams_policy }}</label>
<select name="automatically_unmute_topics_in_muted_streams_policy" class="setting_automatically_unmute_topics_in_muted_streams_policy prop-element settings_select bootstrap-focus-style"
id="{{prefix}}automatically_unmute_topics_in_muted_streams_policy" data-setting-widget-type="number">
{{> dropdown_options_widget option_values=automatically_unmute_topics_in_muted_streams_policy_values}}
</select>
</div>
<div class="subsection-header inline-block">
<h3>{{t "Topic notifications" }}
{{> ../help_link_widget link="/help/mute-a-topic" }}
</h3>
{{> settings_save_discard_widget section_name="topic-notifications-settings" show_only_indicator=(not for_realm_settings) }}
<p>{{t "You will automatically follow topics that you have configured to both follow and unmute." }}</p>
</div>
{{/if}}
<div class="input-group">
<label for="automatically_follow_topics_policy" class="dropdown-title">{{ settings_label.automatically_follow_topics_policy }}</label>
<select name="automatically_follow_topics_policy" class="setting_automatically_follow_topics_policy prop-element settings_select bootstrap-focus-style"
id="{{prefix}}automatically_follow_topics_policy" data-setting-widget-type="number">
{{> dropdown_options_widget option_values=automatically_follow_topics_policy_values}}
</select>
</div>
<div class="input-group">
<label for="automatically_unmute_topics_in_muted_streams_policy" class="dropdown-title">{{ settings_label.automatically_unmute_topics_in_muted_streams_policy }}</label>
<select name="automatically_unmute_topics_in_muted_streams_policy" class="setting_automatically_unmute_topics_in_muted_streams_policy prop-element settings_select bootstrap-focus-style"
id="{{prefix}}automatically_unmute_topics_in_muted_streams_policy" data-setting-widget-type="number">
{{> dropdown_options_widget option_values=automatically_unmute_topics_in_muted_streams_policy_values}}
</select>
</div>
</div>
<div class="desktop_notifications m-10 {{#if for_realm_settings}}settings-subsection-parent{{else}}subsection-parent{{/if}}">

View File

@@ -8,62 +8,26 @@
<hr />
{{#if development}}
<li class="hidden-for-spectators">
<div class="tabs-container">
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.MUTED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.MUTED}}" data-tippy-content="{{t 'Mute' }}" aria-label="{{t 'Mute' }}">
<i class="zulip-icon zulip-icon-mute-new"></i>
</div>
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.INHERIT)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.INHERIT}}" data-tippy-content="{{t 'Default' }}" aria-label="{{t 'Default' }}">
<i class="zulip-icon zulip-icon-inherit"></i>
</div>
{{#if (or stream_muted topic_unmuted)}}
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.UNMUTED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.UNMUTED}}" data-tippy-content="{{t 'Unmute' }}" aria-label="{{t 'Unmute' }}">
<i class="zulip-icon zulip-icon-unmute-new"></i>
</div>
{{/if}}
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.FOLLOWED}}" data-tippy-content="{{t 'Follow' }}" aria-label="{{t 'Follow' }}">
<i class="zulip-icon zulip-icon-follow"></i>
</div>
<li class="hidden-for-spectators">
<div class="tabs-container">
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.MUTED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.MUTED}}" data-tippy-content="{{t 'Mute' }}" aria-label="{{t 'Mute' }}">
<i class="zulip-icon zulip-icon-mute-new"></i>
</div>
</li>
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.INHERIT)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.INHERIT}}" data-tippy-content="{{t 'Default' }}" aria-label="{{t 'Default' }}">
<i class="zulip-icon zulip-icon-inherit"></i>
</div>
{{#if (or stream_muted topic_unmuted)}}
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.UNMUTED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.UNMUTED}}" data-tippy-content="{{t 'Unmute' }}" aria-label="{{t 'Unmute' }}">
<i class="zulip-icon zulip-icon-unmute-new"></i>
</div>
{{/if}}
<div class="tab-option tippy-zulip-tooltip {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}selected-tab{{/if}}" data-visibility-policy="{{all_visibility_policies.FOLLOWED}}" data-tippy-content="{{t 'Follow' }}" aria-label="{{t 'Follow' }}">
<i class="zulip-icon zulip-icon-follow"></i>
</div>
</div>
</li>
<hr/>
{{else}}
{{#if stream_muted}}
{{#unless topic_unmuted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-unmute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Unmute topic"}}
</a>
</li>
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-unmute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{/unless}}
{{else}}
{{#unless topic_muted}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-mute-topic" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-mute" aria-hidden="true"></i>
{{t "Mute topic"}}
</a>
</li>
{{else}}
<li class="hidden-for-spectators">
<a tabindex="0" class="sidebar-popover-remove-mute" data-stream-id="{{ stream_id }}" data-topic-name="{{ topic_name }}">
<i class="zulip-icon zulip-icon-unmute" aria-hidden="true"></i>
{{t "Unmute topic"}}
</a>
</li>
{{/unless}}
{{/if}}
{{/if}}
<hr/>
{{#if has_starred_messages}}
<li class="hidden-for-spectators">

View File

@@ -5,9 +5,7 @@
<td>
<select class="settings_user_topic_visibility_policy prop-element list_select bootstrap-focus-style" data-setting-widget-type="number">
{{#each ../user_topic_visibility_policy_values}}
{{#unless (and (eq this.description "Followed") (not ../../development))}}
<option value='{{this.code}}' {{#if (eq this.code ../visibility_policy)}}selected{{/if}}>{{this.description}}</option>
{{/unless}}
<option value='{{this.code}}' {{#if (eq this.code ../visibility_policy)}}selected{{/if}}>{{this.description}}</option>
{{/each}}
</select>
</td>

View File

@@ -117,12 +117,6 @@ mock_esm("../src/user_topics", {
}
return false;
},
is_topic_unmuted(stream_id, topic) {
if (stream_id === stream6 && topic === topic11) {
return true;
}
return false;
},
is_topic_unmuted_or_followed(stream_id, topic) {
if (stream_id === stream6 && (topic === topic11 || topic === topic12)) {
return true;
@@ -398,17 +392,13 @@ function generate_topic_data(topic_info_array) {
stream_name: "stream_name",
stream_color: "",
stream_id,
stream_muted: undefined,
stream_url: "https://www.example.com",
topic,
conversation_key: get_topic_key(stream_id, topic),
topic_url: "https://www.example.com",
unread_count,
mention_in_unread: false,
topic_muted: visibility_policy === all_visibility_policies.MUTED,
topic_unmuted: visibility_policy === all_visibility_policies.UNMUTED,
visibility_policy,
development: true,
all_visibility_policies,
});
}