Skip to content

Commit

Permalink
Add empty threads info texts and update translations files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShoaibIqbal452 committed Jul 3, 2024
1 parent 96d71b1 commit 867ca25
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 8 deletions.
4 changes: 3 additions & 1 deletion plugins/chunter-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"DirectMessage": "Direct message",
"EditUpdate": "Save...",
"EditCancel": "Cancel",
"Comments" : "Comments",
"Comments": "Comments",
"About": "About",
"Members": "Members",
"NoMembers": "No members",
Expand All @@ -32,6 +32,8 @@
"Topic": "Topic",
"Thread": "Thread",
"Threads": "Threads",
"EmptyThreadHeader": "No Active Threads",
"EmpyThreadText": "Start a thread in a channel. You will be able to view all the threads here.",
"New": "New",
"MarkUnread": "Mark unread",
"GetNewReplies": "Get notified about new replies",
Expand Down
2 changes: 2 additions & 0 deletions plugins/chunter-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"Topic": "Tema",
"Thread": "Hilo",
"Threads": "Hilos",
"EmptyThreadHeader": "No hay hilos activos",
"EmpyThreadText": "Iniciar un hilo en un canal. Podrás ver todos los hilos aquí.",
"New": "Nuevo",
"MarkUnread": "Marcar como no leído",
"GetNewReplies": "Recibir notificaciones de nuevas respuestas",
Expand Down
2 changes: 2 additions & 0 deletions plugins/chunter-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"Topic": "Sujet",
"Thread": "Fil de discussion",
"Threads": "Fils de discussion",
"EmptyThreadHeader": "Aucun fil de discussion actif",
"EmpyThreadText": "Démarrez un fil de discussion dans une chaîne. Vous pourrez consulter tous les sujets ici.",
"New": "Nouveau",
"MarkUnread": "Marquer comme non lu",
"GetNewReplies": "Recevoir des notifications pour les nouvelles réponses",
Expand Down
2 changes: 2 additions & 0 deletions plugins/chunter-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"Topic": "Tópico",
"Thread": "Conversa em cadeia",
"Threads": "Conversas em cadeia",
"EmptyThreadHeader": "Nenhuma conversa em cadeia ativa",
"EmpyThreadText": "Inicie uma cobertura em cadeia em um canal. Você poderá ver todos os tópicos aqui.",
"New": "Novo(a)",
"MarkUnread": "Marcar como não lido",
"GetNewReplies": "Ser notificado sobre novas respostas",
Expand Down
4 changes: 3 additions & 1 deletion plugins/chunter-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"DirectMessage": "Личное сообщение",
"EditUpdate": "Сохранить...",
"EditCancel": "Отменить",
"Comments" : "Комментарии",
"Comments": "Комментарии",
"About": "Информация",
"Members": "Участники",
"NoMembers": "Нет участников",
Expand All @@ -32,6 +32,8 @@
"Topic": "Топик",
"Thread": "Обсуждение",
"Threads": "Обсуждения",
"EmptyThreadHeader": "Нет активных обсуждений",
"EmpyThreadText": "Начать кавер на канале. Здесь вы сможете просмотреть все темы.",
"New": "Новое",
"MarkUnread": "Отметить как непрочитанное",
"GetNewReplies": "Получать уведомления о новых ответах",
Expand Down
6 changes: 4 additions & 2 deletions plugins/chunter-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"DirectMessage": "直连消息",
"EditUpdate": "保存...",
"EditCancel": "取消",
"Comments" : "评论",
"Comments": "评论",
"About": "关于",
"Members": "成员",
"NoMembers": "无成员",
Expand All @@ -32,6 +32,8 @@
"Topic": "主题",
"Thread": "线程",
"Threads": "线程",
"EmptyThreadHeader": "没有活动线程",
"EmpyThreadText": "在通道中启动线程。您将能够在此处查看所有主题",
"New": "新的",
"MarkUnread": "标记未读",
"GetNewReplies": "收到新回复通知",
Expand Down Expand Up @@ -110,4 +112,4 @@
"JoinChannelHeader": "点击“加入”开始。",
"JoinChannelText": "加入后,你将能够阅读所有消息并参与讨论。"
}
}
}
35 changes: 31 additions & 4 deletions plugins/chunter-resources/src/components/threads/Threads.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script lang="ts">
import { getCurrentAccount, SortingOrder } from '@hcengineering/core'
import { createQuery } from '@hcengineering/presentation'
import { Scroller } from '@hcengineering/ui'
import { Icon, Label, Scroller } from '@hcengineering/ui'
import activity, { ActivityMessage } from '@hcengineering/activity'
import { PersonAccount } from '@hcengineering/contact'
import { ActivityMessagePresenter } from '@hcengineering/activity-resources'
Expand Down Expand Up @@ -50,14 +50,41 @@

<div class="body h-full w-full">
<Scroller padding="0.75rem 0.5rem">
{#each threads as thread}
<ActivityMessagePresenter value={thread} onClick={() => openMessageFromSpecial(thread)} withShowMore={false} />
{/each}
{#if threads.length > 0}
{#each threads as thread}
<ActivityMessagePresenter value={thread} onClick={() => openMessageFromSpecial(thread)} withShowMore={false} />
{/each}
{:else}
<div class="empty">
<Icon icon={chunter.icon.Thread} size="large" />
<div class="an-element__label header">
<Label label={chunter.string.EmptyThreadHeader} />
</div>
<span class="an-element__label">
<Label label={chunter.string.EmpyThreadText} />
</span>
</div>
{/if}
</Scroller>
</div>

<style lang="scss">
.body {
background-color: var(--theme-panel-color);
}
.empty {
display: flex;
align-self: center;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
height: inherit;
width: 30rem;
}
.header {
font-weight: 600;
margin: 1rem;
}
</style>
2 changes: 2 additions & 0 deletions plugins/chunter-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export default mergeIds(chunterId, chunter, {
Replies: '' as IntlString,
Topic: '' as IntlString,
Threads: '' as IntlString,
EmptyThreadHeader: '' as IntlString,
EmpyThreadText: '' as IntlString,
New: '' as IntlString,
GetNewReplies: '' as IntlString,
TurnOffReplies: '' as IntlString,
Expand Down

0 comments on commit 867ca25

Please sign in to comment.