Skip to content

UBERF-12988: Add integration status and redesign integration state #9643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/ui/src/components/StatusBadge.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script lang="ts">
import type { Status } from '@hcengineering/platform'
import { tooltip as tp } from '../tooltips'
import type { LabelAndProps } from '../types'

export let status: Status
export let overflow: boolean = true
export let multicolor: boolean = true
export let tooltip: LabelAndProps | undefined = undefined
</script>

<div class="flex-center container {status.severity}" class:overflow-label={overflow} class:multicolor use:tp={tooltip}>
<div class="status-circle"></div>
</div>

<style lang="scss">
.container {
user-select: none;
color: var(--theme-content-color);
&.OK {
color: var(--theme-won-color);
}
&.WARNING {
color: var(--theme-warning-color);
}
&.ERROR {
color: var(--theme-lost-color);
}
}

.status-circle {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: currentColor;
}
</style>
1 change: 1 addition & 0 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export { default as ButtonGroup } from './components/ButtonGroup.svelte'
export { default as FilterButton } from './components/FilterButton.svelte'
export { default as FilterCategoryPopup } from './components/FilterCategoryPopup.svelte'
export { default as Status } from './components/Status.svelte'
export { default as StatusBadge } from './components/StatusBadge.svelte'
export { default as StateTag } from './components/StateTag.svelte'
export { default as Component } from './components/Component.svelte'
export { default as Icon } from './components/Icon.svelte'
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Poslední",
"Weekday": "Všední den",
"WeekendDay": "Víkendový den",
"NotConnectedIntegration": "Účet {email} není integrován s pracovním prostorem",
"SynchronizedCalendars": "Synchronizované kalendáře",
"Account": "Účet",
"NoCalendars": "Kalendáře pro synchronizaci nejsou vybrány"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Letzter",
"Weekday": "Wochentag",
"WeekendDay": "Wochenendtag",
"NotConnectedIntegration": "Das Konto {email} ist nicht mit dem Arbeitsbereich integriert",
"SynchronizedCalendars": "Synchronisierte Kalender",
"Account": "Konto",
"NoCalendars": "Keine Kalender zur Synchronisation ausgewählt"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Last",
"Weekday": "Weekday",
"WeekendDay": "Weekend day",
"NotConnectedIntegration": "The account {email} is not integrated with the workspace",
"SynchronizedCalendars": "Synchronized calendars",
"Account": "Account",
"NoCalendars": "No calendars selected for synchronization"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Último",
"Weekday": "Día laborable",
"WeekendDay": "Día de descanso",
"NotConnectedIntegration": "La cuenta {email} no está integrada con el espacio de trabajo",
"SynchronizedCalendars": "Calendarios sincronizados",
"Account": "Cuenta",
"NoCalendars": "No se seleccionaron calendarios para la sincronización"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Dernier",
"Weekday": "Jour de la semaine",
"WeekendDay": "Jour de congé",
"NotConnectedIntegration": "Le compte {email} n'est pas intégré au workspace",
"SynchronizedCalendars": "Calendriers synchronisés",
"Account": "Compte",
"NoCalendars": "Aucun calendrier sélectionné pour la synchronisation"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Ultimo",
"Weekday": "Giorno lavorativo",
"WeekendDay": "Giorno libero",
"NotConnectedIntegration": "L'account {email} non è integrato con il workspace",
"SynchronizedCalendars": "Calendari sincronizzati",
"Account": "Account",
"NoCalendars": "Nessun calendario selezionato per la sincronizzazione"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Last": "最後",
"Weekday": "平日",
"WeekendDay": "休日",
"NotConnectedIntegration": "アカウント {email} はワークスペースに統合されていません",
"SynchronizedCalendars": "同期されたカレンダー",
"Account": "アカウント",
"NoCalendars": "同期するカレンダーが選択されていません"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Último",
"Weekday": "Dia da semana",
"WeekendDay": "Folga",
"NotConnectedIntegration": "A conta {email} não está integrada com o espaço de trabalho",
"SynchronizedCalendars": "Calendários sincronizados",
"Account": "Conta",
"NoCalendars": "Nenhum calendário encontrado"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "Последний",
"Weekday": "Будний день",
"WeekendDay": "Выходной день",
"NotConnectedIntegration": "Учетная запись {email} не интегрирована с рабочим пространством",
"SynchronizedCalendars": "Синхронизированные календари",
"Account": "Аккаунт",
"NoCalendars": "Календари для синхронизации не выбраны"
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"Last": "最后一个",
"Weekday": "工作日",
"WeekendDay": "周末日",
"NotConnectedIntegration": "帐户 {email} 未与工作区集成",
"SynchronizedCalendars": "已同步的日历",
"Account": "帐户",
"NoCalendars": "未选择同步日历"
Expand Down
1 change: 1 addition & 0 deletions plugins/calendar-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@hcengineering/presentation": "^0.6.3",
"@hcengineering/calendar": "^0.6.24",
"@hcengineering/setting": "^0.6.17",
"@hcengineering/setting-resources": "^0.6.0",
"@hcengineering/theme": "^0.6.5",
"svelte": "^4.2.19",
"@hcengineering/text": "^0.6.5",
Expand Down
74 changes: 15 additions & 59 deletions plugins/calendar-resources/src/components/IntegrationState.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
// limitations under the License.
-->
<script lang="ts">
import { fade } from 'svelte/transition'
import { Calendar } from '@hcengineering/calendar'
import { getCurrentAccount } from '@hcengineering/core'
import { createQuery } from '@hcengineering/presentation'
import { Label } from '@hcengineering/ui'
import type { Integration } from '@hcengineering/account-client'
import { BaseIntegrationState, IntegrationStateRow } from '@hcengineering/setting-resources'
import { OK } from '@hcengineering/platform'
import calendar from '../plugin'
export let integration: Integration
let calendars: Calendar[] = []
let syncedCalendars: Calendar[] = []
let isLoading = true
const query = createQuery()
query.query(
calendar.class.ExternalCalendar,
Expand All @@ -36,64 +37,19 @@
(res) => {
calendars = res
syncedCalendars = calendars.filter((c) => !c.hidden)
isLoading = false
}
)
</script>

<div class="integration-state">
<div class="state-content">
{#if integration.workspaceUuid == null}
<div class="flex-center" transition:fade={{ duration: 300 }}>
<span class="text-normal content-color">
<Label label={calendar.string.NotConnectedIntegration} params={{ email: integration?.data?.email ?? '' }} />
</span>
</div>
{:else if integration.data?.email !== undefined}
<div class="stats-list" transition:fade={{ duration: 300 }}>
<div class="stat-row">
<span class="text-normal content-color font-medium">{integration.data?.email}</span>
</div>
<div class="space-divider bottom" />
{#if syncedCalendars.length === 0}
<div class="stat-row">
<span class="text-normal content-color">{calendar.string.NoCalendars}</span>
</div>
{:else}
{#each syncedCalendars as calendar (calendar._id)}
<div class="stat-row">
<span class="text-normal content-halfcontent-color">{calendar.name}</span>
</div>
{/each}
{/if}
</div>
<BaseIntegrationState {integration} status={OK} {isLoading} value={integration?.data?.email}>
<svelte:fragment slot="content">
{#if syncedCalendars.length === 0}
<IntegrationStateRow label={calendar.string.NoCalendars} />
{:else}
{#each syncedCalendars as calendar (calendar._id)}
<IntegrationStateRow rawLabel={calendar.name} />
{/each}
{/if}
</div>
</div>

<style lang="scss">
.integration-state {
display: flex;
flex-direction: column;
gap: 1rem;
}
.state-content {
display: flex;
flex-direction: column;
}
.stats-list {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.stat-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
font-size: 0.85rem;
padding: 0.15rem 0;
}
</style>
</svelte:fragment>
</BaseIntegrationState>
1 change: 0 additions & 1 deletion plugins/calendar/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ const calendarPlugin = plugin(calendarId, {
MeetingScheduledNotification: '' as IntlString,
MeetingRescheduledNotification: '' as IntlString,
MeetingCanceledNotification: '' as IntlString,
NotConnectedIntegration: '' as IntlString,
SynchronizedCalendars: '' as IntlString,
Account: '' as IntlString,
NoCalendars: '' as IntlString
Expand Down
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Použití a přenos informací získaných z Google API do jakékoli jiné aplikace bude v souladu s <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">zásadami Google API Services User Data Policy</a>, včetně požadavků na omezené použití.",
"EmailNotificationsDescription": "Dostávejte osobní oznámení na e-mail.",
"FailedToConnect": "Služba Gmail není k dispozici",
"TotalMessages": "Celkový počet zpráv",
"FailedToLoadState": "Nepodařilo se načíst stav Gmailu",
"NotConnectedIntegration": "Účet {email} není integrován s pracovním prostorem"
"TotalMessages": "Celkový počet zpráv:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Die Nutzung und Übertragung von Informationen, die Huly von Google-APIs erhält, an andere Apps erfolgt gemäß der <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API Services User Data Policy</a>, einschließlich der Anforderungen zur eingeschränkten Nutzung.",
"EmailNotificationsDescription": "Erhalten Sie persönliche Benachrichtigungen per E-Mail.",
"FailedToConnect": "Gmail-Dienst ist nicht verfügbar",
"TotalMessages": "Gesamtanzahl der Nachrichten",
"FailedToLoadState": "Fehler beim Laden des Gmail-Zustands",
"NotConnectedIntegration": "Das Konto {email} ist nicht mit dem Arbeitsbereich integriert"
"TotalMessages": "Gesamtanzahl der Nachrichten:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Huly’s use and transfer of information received from Google APIs to any other app will adhere to <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API Services User Data Policy</a>, including the Limited Use requirements.",
"EmailNotificationsDescription": "Receive personal notifications on email.",
"FailedToConnect": "Gmail service is not available",
"TotalMessages": "Total messages",
"FailedToLoadState": "Failed to load Gmail state",
"NotConnectedIntegration": "The account {email} is not integrated with the workspace"
"TotalMessages": "Total messages:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Huly’s use and transfer of information received from Google APIs to any other app will adhere to <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API Services User Data Policy</a>, including the Limited Use requirements.",
"EmailNotificationsDescription": "Reciba notificaciones personales por correo electrónico.",
"FailedToConnect": "El servicio de Gmail no está disponible",
"TotalMessages": "Total de mensajes",
"FailedToLoadState": "Error al cargar el estado de Gmail",
"NotConnectedIntegration": "La cuenta {email} no está integrada con el espacio de trabajo"
"TotalMessages": "Total de mensajes:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "L'utilisation et le transfert des informations reçues des API Google par Huly à toute autre application respecteront les <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">règles d'utilisation des données utilisateur des services API Google</a>, y compris les exigences d'utilisation limitée.",
"EmailNotificationsDescription": "Recevez des notifications personnelles par e-mail.",
"FailedToConnect": "Le service Gmail n'est pas disponible",
"TotalMessages": "Total des messages",
"FailedToLoadState": "Échec du chargement de l'état de Gmail",
"NotConnectedIntegration": "Le compte {email} n'est pas intégré à l'espace de travail"
"TotalMessages": "Total des messages:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "L'uso e il trasferimento delle informazioni ricevute dalle API di Google a qualsiasi altra app di Huly adempirà alla <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Politica sui dati degli utenti dei servizi API di Google</a>, inclusi i requisiti di utilizzo limitato.",
"EmailNotificationsDescription": "Ricevi notifiche personali sulle email.",
"FailedToConnect": "Il servizio Gmail non è disponibile",
"TotalMessages": "Totale messaggi",
"FailedToLoadState": "Impossibile caricare lo stato di Gmail",
"NotConnectedIntegration": "L'account {email} non è integrato con il workspace"
"TotalMessages": "Totale messaggi:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Huly による Google API から受信した情報の他のアプリへの使用および転送は、<a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API Services User Data Policy</a>(限定的な使用の要件を含む)に準拠します。",
"EmailNotificationsDescription": "メールで個人通知を受け取る",
"FailedToConnect": "Gmail サービスは利用できません",
"TotalMessages": "メッセージの総数",
"FailedToLoadState": "Gmail の状態の読み込みに失敗しました",
"NotConnectedIntegration": "アカウント {email} はワークスペースに統合されていません"
"TotalMessages": "メッセージの総数:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Huly’s use and transfer of information received from Google APIs to any other app will adhere to <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API Services User Data Policy</a>, including the Limited Use requirements.",
"EmailNotificationsDescription": "Receba notificações pessoais por e-mail.",
"FailedToConnect": "O serviço Gmail não está disponível",
"TotalMessages": "Total de mensagens",
"FailedToLoadState": "Falha ao carregar o estado do Gmail",
"NotConnectedIntegration": "A conta {email} não está integrada com o espaço de trabalho"
"TotalMessages": "Total de mensagens:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Использование и передача информации, полученной Huly от Google API, будет соответствовать <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Политике использования данных пользователей Google API</a>, включая требования ограниченного использования.",
"EmailNotificationsDescription": "Получайте персональные уведомления на электронную почту.",
"FailedToConnect": "Gmail сервис недоступен",
"TotalMessages": "Всего сообщений",
"FailedToLoadState": "Не удалось загрузить состояние Gmail",
"NotConnectedIntegration": "Учетная запись {email} не интегрирована с рабочим пространством"
"TotalMessages": "Всего сообщений:"
}
}
4 changes: 1 addition & 3 deletions plugins/gmail-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
"GooglePrivacy": "Huly 从 Google API 接收的信息的使用和传输将遵守 <a href=\"https://developers.google.com/terms/api-services-user-data-policy#additional_requirements_for_specific_api_scopes\" target=\"_blank\">Google API 服务用户数据政策</a>,包括有限使用要求。",
"EmailNotificationsDescription": "透過電子郵件接收個人通知。",
"FailedToConnect": "Gmail 服务不可用",
"TotalMessages": "总消息数",
"FailedToLoadState": "无法加载 Gmail 状态",
"NotConnectedIntegration": "帐户 {email} 未与工作区集成"
"TotalMessages": "总消息数:"
}
}
3 changes: 2 additions & 1 deletion plugins/gmail-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/templates": "^0.6.11",
"@hcengineering/integration-client": "^0.6.0",
"@hcengineering/account-client": "^0.6.0"
"@hcengineering/account-client": "^0.6.0",
"@hcengineering/setting-resources": "^0.6.0"
}
}
Loading
Loading