mirror of
https://github.com/zulip/zulip.git
synced 2025-10-22 20:42:14 +00:00
stream_privacy: Add archive icon for archived channels.
Archived channels are now displayed with an archived icon.
This commit is contained in:
@@ -1325,6 +1325,10 @@ export class Filter {
|
||||
icon = "question-circle-o";
|
||||
break;
|
||||
}
|
||||
if (sub.is_archived) {
|
||||
zulip_icon = "archive";
|
||||
break;
|
||||
}
|
||||
if (sub.invite_only) {
|
||||
zulip_icon = "lock";
|
||||
break;
|
||||
|
@@ -962,6 +962,7 @@ input.settings_text_input {
|
||||
width: 12px;
|
||||
|
||||
&.zulip-icon-globe,
|
||||
&.zulip-icon-archive,
|
||||
&.zulip-icon-hashtag {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{{! This controls whether the swatch next to streams in the left sidebar has a lock icon. }}
|
||||
{{~#if stream.invite_only ~}}
|
||||
{{~#if stream.is_archived ~}}
|
||||
<i class="zulip-icon zulip-icon-archive stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
|
||||
{{~ else if stream.invite_only ~}}
|
||||
<i class="zulip-icon zulip-icon-lock stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
|
||||
{{~ else if stream.is_web_public ~}}
|
||||
<i class="zulip-icon zulip-icon-globe stream-privacy-type-icon" {{#if show_colored_icon}}style="color: {{stream.color}}"{{/if}} aria-hidden="true"></i> {{stream.name ~}}
|
||||
|
@@ -4,7 +4,8 @@
|
||||
<span class="stream-privacy-original-color-{{stream.stream_id}} stream-privacy filter-icon" style="color: {{stream.color}}">
|
||||
{{> ../stream_privacy
|
||||
invite_only=stream.invite_only
|
||||
is_web_public=stream.is_web_public }}
|
||||
is_web_public=stream.is_web_public
|
||||
is_archived=stream.is_archived }}
|
||||
</span>
|
||||
<span class="popover-stream-name">{{stream.name}}</span>
|
||||
</li>
|
||||
|
@@ -1,5 +1,7 @@
|
||||
{{! This controls whether the swatch next to streams in the left sidebar has a lock icon. }}
|
||||
{{#if invite_only}}
|
||||
{{#if is_archived}}
|
||||
<i class="zulip-icon zulip-icon-archive" aria-hidden="true"></i>
|
||||
{{else if invite_only}}
|
||||
<i class="zulip-icon zulip-icon-lock" aria-hidden="true"></i>
|
||||
{{else if is_web_public}}
|
||||
<i class="zulip-icon zulip-icon-globe" aria-hidden="true"></i>
|
||||
|
@@ -2,6 +2,7 @@
|
||||
{{#unless preview_url}}{{t "Add subscribers to "}}{{/unless}}
|
||||
{{> stream_privacy_icon
|
||||
invite_only=sub.invite_only
|
||||
is_web_public=sub.is_web_public }}
|
||||
is_web_public=sub.is_web_public
|
||||
is_archived=sub.is_archived }}
|
||||
<span class="stream-name-title">{{sub.name}}</span>
|
||||
</a>
|
||||
|
@@ -1,5 +1,9 @@
|
||||
{{! This controls whether the swatch next to streams in the stream edit page has a lock icon. }}
|
||||
{{#if invite_only}}
|
||||
{{#if is_archived}}
|
||||
<div class="large-icon" {{#if title_icon_color}}style="color: {{title_icon_color}}{{/if}}">
|
||||
<i class="zulip-icon zulip-icon-archive" aria-hidden="true"></i>
|
||||
</div>
|
||||
{{else if invite_only}}
|
||||
<div class="large-icon" {{#if title_icon_color}}style="color: {{title_icon_color}}"{{/if}}>
|
||||
<i class="zulip-icon zulip-icon-lock" aria-hidden="true"></i>
|
||||
</div>
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<div class="icon" style="background-color: {{color}}">
|
||||
<div class="flex">
|
||||
{{#if invite_only}}
|
||||
{{#if is_archived}}
|
||||
<i class="zulip-icon zulip-icon-archive fa-lg" aria-hidden="true"></i>
|
||||
{{else if invite_only}}
|
||||
<i class="zulip-icon zulip-icon-lock" aria-hidden="true"></i>
|
||||
{{else if is_web_public}}
|
||||
<i class="zulip-icon zulip-icon-globe fa-lg" aria-hidden="true"></i>
|
||||
|
@@ -2094,6 +2094,15 @@ function make_web_public_sub(name, stream_id) {
|
||||
stream_data.add_sub(sub);
|
||||
}
|
||||
|
||||
function make_archived_sub(name, stream_id) {
|
||||
const sub = {
|
||||
name,
|
||||
stream_id,
|
||||
is_archived: true,
|
||||
};
|
||||
stream_data.add_sub(sub);
|
||||
}
|
||||
|
||||
test("navbar_helpers", ({override}) => {
|
||||
stream_data.add_sub(foo_sub);
|
||||
|
||||
@@ -2185,6 +2194,9 @@ test("navbar_helpers", ({override}) => {
|
||||
const web_public_sub_id = new_stream_id();
|
||||
make_web_public_sub("webPublicSub", web_public_sub_id); // capitalized just to try be tricky and robust.
|
||||
const web_public_channel = [{operator: "channel", operand: web_public_sub_id.toString()}];
|
||||
const archived_sub_id = new_stream_id();
|
||||
make_archived_sub("archivedSub", archived_sub_id);
|
||||
const archived_channel_term = [{operator: "channel", operand: archived_sub_id.toString()}];
|
||||
const dm = [{operator: "dm", operand: "joe@example.com"}];
|
||||
const dm_with = [
|
||||
{operator: "dm", operand: "joe@example.com"},
|
||||
@@ -2343,6 +2355,13 @@ test("navbar_helpers", ({override}) => {
|
||||
title: "webPublicSub",
|
||||
redirect_url_with_search: `/#narrow/channel/${web_public_sub_id}-webPublicSub`,
|
||||
},
|
||||
{
|
||||
terms: archived_channel_term,
|
||||
is_common_narrow: true,
|
||||
zulip_icon: "archive",
|
||||
title: "archivedSub",
|
||||
redirect_url_with_search: `/#narrow/channel/${archived_sub_id}-archivedSub`,
|
||||
},
|
||||
{
|
||||
terms: dm,
|
||||
is_common_narrow: true,
|
||||
|
Reference in New Issue
Block a user