Skip to content
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
14 changes: 12 additions & 2 deletions plugins/contact-resources/src/components/SelectAvatarPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import type { Ref } from '@hcengineering/core'
import { Blob as PlatformBlob } from '@hcengineering/core'
import { Asset } from '@hcengineering/platform'
import presentation, { Card, getFileUrl } from '@hcengineering/presentation'
import {
import presentation, { Card, getFileUrl, uiContext } from '@hcengineering/presentation'
import ui, {
AnySvelteComponent,
Button,
ColorDefinition,
Label,
TabList,
Expand Down Expand Up @@ -171,6 +172,12 @@
}
}

function handleClearClick (): void {
selectedAvatar = undefined
selectedAvatarType = AvatarType.COLOR
selectedAvatarProps = { color: getPlatformAvatarColorForTextDef(name ?? '', $themeStore.dark).name }
}

const showColorPopup = (event: MouseEvent) => {
showPopup(
ColorsPopup,
Expand Down Expand Up @@ -238,6 +245,9 @@
on:select={handleDropdownSelection}
/>
</div>
<svelte:fragment slot="buttons">
<Button minWidth={'5rem'} label={ui.string.Clear} kind={'ghost'} size={'large'} on:click={handleClearClick} />
</svelte:fragment>
<svelte:fragment slot="footer">
{#if selectedAvatarType === AvatarType.GRAVATAR}
<div class="flex-col">
Expand Down
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@
"IntegrationIsUnstable": "Integrační služba má problémy. Některé funkce nemusí fungovat správně.",
"MinValue": "Minimální hodnota",
"MaxValue": "Maximální hodnota",
"IntegerOnly": "Pouze celá čísla"
"IntegerOnly": "Pouze celá čísla",
"AccessControl": "Řízení přístupu",
"DangerZone": "Nebezpečná zóna",
"ApiAccess": "Přístup k API",
"ApiToken": "API token",
"GenerateApiToken": "Vygenerovat API token"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "Der Integrationsdienst hat Probleme. Einige Funktionen funktionieren möglicherweise nicht richtig.",
"MinValue": "Minimalwert",
"MaxValue": "Maximalwert",
"IntegerOnly": "Nur ganze Zahlen"
"IntegerOnly": "Nur ganze Zahlen",
"AccessControl": "Zugriffskontrolle",
"DangerZone": "Gefahrenzone",
"ApiAccess": "API-Zugriff",
"ApiToken": "API-Token",
"GenerateApiToken": "API-Token generieren"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "Integration service is experiencing issues. Some features may not work properly.",
"MinValue": "Minimum value",
"MaxValue": "Maximum value",
"IntegerOnly": "Integer numbers only"
"IntegerOnly": "Integer numbers only",
"AccessControl": "Access control",
"DangerZone": "Danger zone",
"ApiAccess": "API access",
"ApiToken": "API token",
"GenerateApiToken": "Generate API token"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@
"IntegrationIsUnstable": "El servicio de integración está experimentando problemas. Es posible que algunas funciones no funcionen correctamente.",
"MinValue": "Valor mínimo",
"MaxValue": "Valor máximo",
"IntegerOnly": "Solo números enteros"
"IntegerOnly": "Solo números enteros",
"AccessControl": "Control de acceso",
"DangerZone": "Zona de peligro",
"ApiAccess": "Acceso API",
"ApiToken": "Token API",
"GenerateApiToken": "Generar token API"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "Le service d'intégration rencontre des problèmes. Certaines fonctionnalités peuvent ne pas fonctionner correctement.",
"MinValue": "Valeur minimale",
"MaxValue": "Valeur maximale",
"IntegerOnly": "Nombres entiers uniquement"
"IntegerOnly": "Nombres entiers uniquement",
"AccessControl": "Contrôle d'accès",
"DangerZone": "Zone dangereuse",
"ApiAccess": "Accès API",
"ApiToken": "Token API",
"GenerateApiToken": "Générer un token API"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "L'integrazione è instabile. Alcune funzionalità potrebbero non funzionare correttamente.",
"MinValue": "Valore minimo",
"MaxValue": "Valore massimo",
"IntegerOnly": "Solo numeri interi"
"IntegerOnly": "Solo numeri interi",
"AccessControl": "Controllo accessi",
"DangerZone": "Zona pericolosa",
"ApiAccess": "Accesso API",
"ApiToken": "Token API",
"GenerateApiToken": "Genera token API"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "統合サービスに問題が発生しています。一部の機能が正しく動作しない可能性があります。",
"MinValue": "最小値",
"MaxValue": "最大値",
"IntegerOnly": "整数のみ"
"IntegerOnly": "整数のみ",
"AccessControl": "アクセス制御",
"DangerZone": "危険ゾーン",
"ApiAccess": "APIアクセス",
"ApiToken": "APIトークン",
"GenerateApiToken": "APIトークンを生成"
}
}
10 changes: 9 additions & 1 deletion plugins/setting-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@
"Disconnected": "Desconectado",
"Available": "Disponível",
"NotConnectedIntegration": "A conta {account} não está integrada com o espaço de trabalho",
"IntegrationIsUnstable": "O serviço de integração está enfrentando problemas. Algumas funcionalidades podem não funcionar corretamente."
"IntegrationIsUnstable": "O serviço de integração está enfrentando problemas. Algumas funcionalidades podem não funcionar corretamente.",
"MinValue": "Valor mínimo",
"MaxValue": "Valor máximo",
"IntegerOnly": "Apenas números inteiros",
"AccessControl": "Controle de acesso",
"DangerZone": "Zona de perigo",
"ApiAccess": "Acesso à API",
"ApiToken": "Token de API",
"GenerateApiToken": "Gerar token de API"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"Disconnected": "Отключено",
"Available": "Доступно",
"NotConnectedIntegration": "Учетная запись {account} не интегрирована с рабочим пространством",
"IntegrationIsUnstable": "Сервис интеграции испытывает проблемы. Некоторые функции могут работать некорректно."
"IntegrationIsUnstable": "Сервис интеграции испытывает проблемы. Некоторые функции могут работать некорректно.",
"AccessControl": "Контроль доступа",
"DangerZone": "Опасная зона",
"ApiAccess": "Доступ к API",
"ApiToken": "API токен",
"GenerateApiToken": "Создать API токен"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "Entegrasyon servisi sorunlar yaşıyor. Bazı özellikler düzgün çalışmayabilir.",
"MinValue": "Minimum değer",
"MaxValue": "Maksimum değer",
"IntegerOnly": "Sadece tam sayılar"
"IntegerOnly": "Sadece tam sayılar",
"AccessControl": "Erişim kontrolü",
"DangerZone": "Tehlike bölgesi",
"ApiAccess": "API erişimi",
"ApiToken": "API token",
"GenerateApiToken": "API token oluştur"
}
}
7 changes: 6 additions & 1 deletion plugins/setting-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"IntegrationIsUnstable": "集成服务出现问题。某些功能可能无法正常工作。",
"MinValue": "最小值",
"MaxValue": "最大值",
"IntegerOnly": "仅整数"
"IntegerOnly": "仅整数",
"AccessControl": "访问控制",
"DangerZone": "危险区域",
"ApiAccess": "API访问",
"ApiToken": "API令牌",
"GenerateApiToken": "生成API令牌"
}
}
104 changes: 104 additions & 0 deletions plugins/setting-resources/src/components/ApiTokenPopup.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!--
// Copyright © 2025 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the 'License');
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { Timestamp } from '@hcengineering/core'
import presentation, { copyTextToClipboard } from '@hcengineering/presentation'
import view from '@hcengineering/view'
import { Button, Label, ticker } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'

import settings from '../plugin'

export let token: string

const isSecureContext = window.isSecureContext
const dispatch = createEventDispatcher()

let copiedTime: Timestamp | undefined
let copied = false

$: if (copiedTime !== undefined && copied && $ticker - copiedTime > 1000) {
copied = false
}

async function copy (): Promise<void> {
if (!isSecureContext) return
if (token === undefined) return

await copyTextToClipboard(token)
copied = true
copiedTime = Date.now()
}
</script>

<div class="antiPopup popup" class:secure={isSecureContext}>
<div class="overflow-label fs-title mb-4">
<Label label={settings.string.ApiToken} />
</div>

<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="token" class:notSecure={!isSecureContext} class:over-underline={isSecureContext} on:click={copy}>
{token}
</div>

<div class="buttons">
<Button
label={presentation.string.Close}
size={'medium'}
kind={'primary'}
on:click={() => {
dispatch('close')
}}
/>
{#if isSecureContext}
<Button label={copied ? view.string.Copied : view.string.CopyToClipboard} size={'medium'} on:click={copy} />
{/if}
</div>
</div>

<style lang="scss">
.popup {
display: flex;
flex-direction: column;
padding: 1.75rem;
width: 30rem;
max-width: 40rem;
background: var(--popup-bg-color);
border-radius: 1.25rem;
user-select: none;
box-shadow: var(--popup-shadow);

.token {
margin: 1.75rem 0 0;
overflow-wrap: break-word;

&.notSecure {
user-select: text;
}
}

.buttons {
margin-top: 1.75rem;
flex-shrink: 0;
display: grid;
grid-auto-flow: column;
direction: rtl;
justify-content: flex-start;
align-items: center;
column-gap: 0.5rem;
}
}
</style>
2 changes: 1 addition & 1 deletion plugins/setting-resources/src/components/Backup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

<Scroller padding={'1.5rem'} noStretch>
{#if loading}
<Loading size={'small'} />
<Loading />
{:else if backupInfo == null}
<div class="no-backups">
<Label label={setting.string.BackupNoBackup} />
Expand Down
Loading