mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 23:44:48 +08:00
UX: update chat icon to d-chat (#20744)
This commit is contained in:
@ -98,7 +98,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get prefixValue() {
|
get prefixValue() {
|
||||||
return "hashtag";
|
return "d-chat";
|
||||||
}
|
}
|
||||||
|
|
||||||
get prefixColor() {
|
get prefixColor() {
|
||||||
@ -285,7 +285,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
links[0].children[0].children[0].classList.contains("d-icon-hashtag"),
|
links[0].children[0].children[0].classList.contains("d-icon-d-chat"),
|
||||||
true,
|
true,
|
||||||
"displays prefix icon"
|
"displays prefix icon"
|
||||||
);
|
);
|
||||||
|
@ -86,7 +86,7 @@ class Wizard
|
|||||||
step.add_field(
|
step.add_field(
|
||||||
id: "chat_enabled",
|
id: "chat_enabled",
|
||||||
type: "checkbox",
|
type: "checkbox",
|
||||||
icon: "comment",
|
icon: "d-chat",
|
||||||
value: SiteSetting.chat_enabled,
|
value: SiteSetting.chat_enabled,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
class="chat-channel-title__category-badge"
|
class="chat-channel-title__category-badge"
|
||||||
style={{this.channelColorStyle}}
|
style={{this.channelColorStyle}}
|
||||||
>
|
>
|
||||||
{{d-icon "hashtag"}}
|
{{d-icon "d-chat"}}
|
||||||
{{#if this.channel.chatable.read_restricted}}
|
{{#if this.channel.chatable.read_restricted}}
|
||||||
{{d-icon "lock" class="chat-channel-title__restricted-category-icon"}}
|
{{d-icon "lock" class="chat-channel-title__restricted-category-icon"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
@action={{action "onCancelChatDraft"}}
|
@action={{action "onCancelChatDraft"}}
|
||||||
/>
|
/>
|
||||||
<h2 class="chat-draft-header__title">
|
<h2 class="chat-draft-header__title">
|
||||||
{{d-icon "comment"}}
|
{{d-icon "d-chat"}}
|
||||||
{{i18n "chat.draft_channel_screen.header"}}
|
{{i18n "chat.draft_channel_screen.header"}}
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
tabindex="0"
|
tabindex="0"
|
||||||
class={{concat-class "icon btn-flat" (if this.isActive "active")}}
|
class={{concat-class "icon btn-flat" (if this.isActive "active")}}
|
||||||
>
|
>
|
||||||
{{d-icon "comment"}}
|
{{d-icon "d-chat"}}
|
||||||
|
|
||||||
{{#unless this.currentUserInDnD}}
|
{{#unless this.currentUserInDnD}}
|
||||||
<ChatHeaderIconUnreadIndicator />
|
<ChatHeaderIconUnreadIndicator />
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
@class="btn-primary user-card-chat-btn"
|
@class="btn-primary user-card-chat-btn"
|
||||||
@action={{action "startChatting"}}
|
@action={{action "startChatting"}}
|
||||||
@label="chat.title_capitalized"
|
@label="chat.title_capitalized"
|
||||||
@icon="comment"
|
@icon="d-chat"
|
||||||
/>
|
/>
|
||||||
{{/if}}
|
{{/if}}
|
@ -1,6 +1,6 @@
|
|||||||
{{#if (or this.model.can_chat this.currentUser.admin)}}
|
{{#if (or this.model.can_chat this.currentUser.admin)}}
|
||||||
<LinkTo @route="preferences.chat">
|
<LinkTo @route="preferences.chat">
|
||||||
{{d-icon "comment"}}
|
{{d-icon "d-chat"}}
|
||||||
<span>{{i18n "chat.title_capitalized"}}</span>
|
<span>{{i18n "chat.title_capitalized"}}</span>
|
||||||
</LinkTo>
|
</LinkTo>
|
||||||
{{/if}}
|
{{/if}}
|
@ -4,10 +4,13 @@ import { bind } from "discourse-common/utils/decorators";
|
|||||||
import { getOwner } from "discourse-common/lib/get-owner";
|
import { getOwner } from "discourse-common/lib/get-owner";
|
||||||
import { MENTION_KEYWORDS } from "discourse/plugins/chat/discourse/components/chat-message";
|
import { MENTION_KEYWORDS } from "discourse/plugins/chat/discourse/components/chat-message";
|
||||||
import { clearChatComposerButtons } from "discourse/plugins/chat/discourse/lib/chat-composer-buttons";
|
import { clearChatComposerButtons } from "discourse/plugins/chat/discourse/lib/chat-composer-buttons";
|
||||||
|
import { replaceIcon } from "discourse-common/lib/icon-library";
|
||||||
|
|
||||||
let _lastForcedRefreshAt;
|
let _lastForcedRefreshAt;
|
||||||
const MIN_REFRESH_DURATION_MS = 180000; // 3 minutes
|
const MIN_REFRESH_DURATION_MS = 180000; // 3 minutes
|
||||||
|
|
||||||
|
replaceIcon("d-chat", "comment");
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "chat-setup",
|
name: "chat-setup",
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get prefixValue() {
|
get prefixValue() {
|
||||||
return "hashtag";
|
return "d-chat";
|
||||||
}
|
}
|
||||||
|
|
||||||
get prefixColor() {
|
get prefixColor() {
|
||||||
|
@ -69,7 +69,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get icon() {
|
get icon() {
|
||||||
return "comment";
|
return "d-chat";
|
||||||
}
|
}
|
||||||
|
|
||||||
get label() {
|
get label() {
|
||||||
@ -112,7 +112,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get icon() {
|
get icon() {
|
||||||
return "comment";
|
return "d-chat";
|
||||||
}
|
}
|
||||||
|
|
||||||
get count() {
|
get count() {
|
||||||
|
@ -33,7 +33,7 @@ const chatNotificationItem = {
|
|||||||
const title = this.notificationTitle(notificationName, data);
|
const title = this.notificationTitle(notificationName, data);
|
||||||
const text = this.text(notificationName, data);
|
const text = this.text(notificationName, data);
|
||||||
const html = new RawHtml({ html: `<div>${text}</div>` });
|
const html = new RawHtml({ html: `<div>${text}</div>` });
|
||||||
const contents = [iconNode("comment"), html];
|
const contents = [iconNode("d-chat"), html];
|
||||||
const href = this.url(data);
|
const href = this.url(data);
|
||||||
|
|
||||||
return h(
|
return h(
|
||||||
|
@ -179,7 +179,7 @@ html.rtl {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.d-icon:not(.d-icon-hashtag) {
|
.d-icon:not(.d-icon-d-chat) {
|
||||||
color: var(--primary-high);
|
color: var(--primary-high);
|
||||||
}
|
}
|
||||||
.category-hashtag {
|
.category-hashtag {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<a href="{{url}}">
|
<a href="{{url}}">
|
||||||
{{#is_category}}
|
{{#is_category}}
|
||||||
<span class="category-chat-badge" style="color: #{{color}}">
|
<span class="category-chat-badge" style="color: #{{color}}">
|
||||||
<svg class="fa d-icon d-icon-hashtag svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#hashtag"></use></svg>
|
<svg class="fa d-icon d-icon-d-chat svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#d-chat"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
{{/is_category}}
|
{{/is_category}}
|
||||||
<span class="clear-badge">{{{channel_name}}}</span>
|
<span class="clear-badge">{{{channel_name}}}</span>
|
||||||
@ -42,7 +42,7 @@
|
|||||||
<a class="chat-transcript-channel" href="/chat/c/-/{{channel_id}}">
|
<a class="chat-transcript-channel" href="/chat/c/-/{{channel_id}}">
|
||||||
{{#is_category}}
|
{{#is_category}}
|
||||||
<span class="category-chat-badge" style="color: #{{color}}">
|
<span class="category-chat-badge" style="color: #{{color}}">
|
||||||
<svg class="fa d-icon d-icon-hashtag svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#hashtag"></use></svg>
|
<svg class="fa d-icon d-icon-d-chat svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#d-chat"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
{{/is_category}}
|
{{/is_category}}
|
||||||
{{#is_topic}}
|
{{#is_topic}}
|
||||||
|
@ -17,7 +17,6 @@ register_asset "stylesheets/mobile/index.scss", :mobile
|
|||||||
|
|
||||||
register_svg_icon "comments"
|
register_svg_icon "comments"
|
||||||
register_svg_icon "comment-slash"
|
register_svg_icon "comment-slash"
|
||||||
register_svg_icon "hashtag"
|
|
||||||
register_svg_icon "lock"
|
register_svg_icon "lock"
|
||||||
register_svg_icon "file-audio"
|
register_svg_icon "file-audio"
|
||||||
register_svg_icon "file-video"
|
register_svg_icon "file-video"
|
||||||
|
@ -178,7 +178,7 @@ describe Chat do
|
|||||||
<h3 class="chat-onebox-title">
|
<h3 class="chat-onebox-title">
|
||||||
<a href="#{chat_url}">
|
<a href="#{chat_url}">
|
||||||
<span class="category-chat-badge" style="color: ##{chat_channel.chatable.color}">
|
<span class="category-chat-badge" style="color: ##{chat_channel.chatable.color}">
|
||||||
<svg class="fa d-icon d-icon-hashtag svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#hashtag"></use></svg>
|
<svg class="fa d-icon d-icon-d-chat svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#d-chat"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
<span class="clear-badge">#{chat_channel.name}</span>
|
<span class="clear-badge">#{chat_channel.name}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -210,7 +210,7 @@ describe Chat do
|
|||||||
</div>
|
</div>
|
||||||
<a class="chat-transcript-channel" href="/chat/c/-/#{chat_channel.id}">
|
<a class="chat-transcript-channel" href="/chat/c/-/#{chat_channel.id}">
|
||||||
<span class="category-chat-badge" style="color: ##{chat_channel.chatable.color}">
|
<span class="category-chat-badge" style="color: ##{chat_channel.chatable.color}">
|
||||||
<svg class="fa d-icon d-icon-hashtag svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#hashtag"></use></svg>
|
<svg class="fa d-icon d-icon-d-chat svg-icon svg-string" xmlns="http://www.w3.org/2000/svg"><use href="#d-chat"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
#{chat_channel.name}
|
#{chat_channel.name}
|
||||||
</a>
|
</a>
|
||||||
|
@ -30,7 +30,7 @@ RSpec.describe "Sidebar navigation menu", type: :system, js: true do
|
|||||||
visit("/")
|
visit("/")
|
||||||
|
|
||||||
expect(sidebar_page.channels_section).to have_css(
|
expect(sidebar_page.channels_section).to have_css(
|
||||||
".sidebar-section-link-#{channel_1.slug} .sidebar-section-link-prefix svg.prefix-icon.d-icon-hashtag",
|
".sidebar-section-link-#{channel_1.slug} .sidebar-section-link-prefix svg.prefix-icon.d-icon-d-chat",
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user