Skip to content

Commit 3f2606b

Browse files
authored
Qfix readonly improvements (#9621)
Signed-off-by: Anton Alexeyev <[email protected]>
1 parent 5129ed0 commit 3f2606b

File tree

27 files changed

+67
-67
lines changed

27 files changed

+67
-67
lines changed

plugins/card-resources/src/components/CardArrayEditor.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-->
1515
<script lang="ts">
1616
import { Card, MasterTag } from '@hcengineering/card'
17-
import { AnyAttribute, ArrOf, Ref, RefTo, Type } from '@hcengineering/core'
17+
import { AnyAttribute, ArrOf, Class, Ref, RefTo, Type } from '@hcengineering/core'
1818
import { IntlString } from '@hcengineering/platform'
1919
import { IconWithEmoji, createQuery, getClient } from '@hcengineering/presentation'
2020
import { Button, ButtonKind, ButtonSize, eventToHTMLElement, Label, showPopup } from '@hcengineering/ui'
@@ -23,6 +23,7 @@
2323
import card from '../plugin'
2424
import CardsPopup from './CardsPopup.svelte'
2525
26+
export let _class: Ref<Class<Card>> | undefined = undefined
2627
export let value: Ref<Card>[] | undefined
2728
export let readonly: boolean = false
2829
export let label: IntlString | undefined
@@ -40,10 +41,12 @@
4041
const client = getClient()
4142
const hierarchy = client.getHierarchy()
4243
43-
const _class =
44-
((attribute?.type as ArrOf<RefTo<Card>>)?.of as RefTo<Card>)?.to ??
45-
((type as ArrOf<RefTo<Card>>)?.of as RefTo<Card>)?.to ??
46-
card.class.Card
44+
if (_class === undefined) {
45+
_class =
46+
((attribute?.type as ArrOf<RefTo<Card>>)?.of as RefTo<Card>)?.to ??
47+
((type as ArrOf<RefTo<Card>>)?.of as RefTo<Card>)?.to ??
48+
card.class.Card
49+
}
4750
4851
const handleOpen = (event: MouseEvent): void => {
4952
if (onChange === undefined) {

plugins/communication-resources/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import { canDisplayLinkPreview, fetchLinkPreviewDetails, getCommunicationClient } from '@hcengineering/presentation'
1515
import { type Card } from '@hcengineering/card'
16-
import { AccountRole, getCurrentAccount, hasAccountRole, type Markup } from '@hcengineering/core'
16+
import { AccountRole, getCurrentAccount, type Markup } from '@hcengineering/core'
1717
import { getMetadata, translate } from '@hcengineering/platform'
1818
import { addNotification, languageStore, NotificationSeverity, showPopup } from '@hcengineering/ui'
1919
import { type LinkPreviewParams, type Message } from '@hcengineering/communication-types'
@@ -139,7 +139,7 @@ export async function loadLinkPreviewParams (url: string): Promise<LinkPreviewPa
139139
}
140140

141141
export async function isCardAllowedForCommunications (card: Card): Promise<boolean> {
142-
if (hasAccountRole(getCurrentAccount(), AccountRole.User)) return true
142+
if (getCurrentAccount().role !== AccountRole.Guest) return true
143143
const allowedCards = get(guestCommunicationAllowedCards)
144144
if (allowedCards.includes(card._id)) return true
145145
for (const parentInfoElement of card.parentInfo) {

plugins/setting-assets/lang/cs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "Anonymní hosté",
172172
"GuestAccessDescription": "Umožňuje anonymním uživatelům prohlížet pracovní prostor v režimu pouze pro čtení",
173173
"GuestSignUpDescription": "Umožňuje anonymním uživatelům připojit se k vašemu pracovnímu prostoru jako hosté s omezenými editačními právy",
174-
"GuestCardsDescription": "Karty, kde mohou hosté komunikovat po připojení k pracovnímu prostoru",
175-
"GuestCardsArrayLabel": "Vybrat karty pro komunikaci",
174+
"GuestChannelsDescription": "Kanály, kde hosté mohou psát zprávy po připojení",
175+
"GuestChannelsArrayLabel": "Vybrat kanály",
176176
"ManageIdentities": "Spravovat identity",
177177
"Release": "Uvolnění",
178178
"ReleaseSocialId": "Uvolnit sociální ID",

plugins/setting-assets/lang/de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "Anonyme Gäste",
172172
"GuestAccessDescription": "Ermöglicht anonymen Benutzern den schreibgeschützten Zugriff auf den Arbeitsbereich",
173173
"GuestSignUpDescription": "Ermöglicht anonymen Benutzern den Beitritt zu Ihrem Arbeitsbereich als Gäste mit eingeschränkten Bearbeitungsrechten",
174-
"GuestCardsDescription": "Karten, in denen Gäste nach dem Beitritt zum Arbeitsbereich kommunizieren können",
175-
"GuestCardsArrayLabel": "Karten für Kommunikation auswählen",
174+
"GuestChannelsDescription": "Kanäle, in denen Gäste nach dem Beitritt Nachrichten schreiben können",
175+
"GuestChannelsArrayLabel": "Kanäle auswählen",
176176
"ManageIdentities": "Identitäten verwalten",
177177
"Release": "Freigeben",
178178
"ReleaseSocialId": "Social ID freigeben",

plugins/setting-assets/lang/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "Anonymous guests",
172172
"GuestAccessDescription": "Allows anonymous users to visit your workspace in read-only mode",
173173
"GuestSignUpDescription": "Allows anonymous users to join your workspace as guests with limited editing rights",
174-
"GuestCardsDescription": "Cards where guests can communicate after joining the workspace",
175-
"GuestCardsArrayLabel": "Select cards for communication",
174+
"GuestChannelsDescription": "Channels where guests can write messages after joining",
175+
"GuestChannelsArrayLabel": "Select channels",
176176
"ManageIdentities": "Manage identities",
177177
"Release": "Release",
178178
"ReleaseSocialId": "Release social ID",

plugins/setting-assets/lang/es.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
"GuestAccess": "Invitados anónimos",
163163
"GuestAccessDescription": "Permite a usuarios anónimos visitar el espacio de trabajo en modo de solo lectura",
164164
"GuestSignUpDescription": "Permite a usuarios anónimos unirse a su espacio de trabajo como invitados con derechos de edición limitados",
165-
"GuestCardsDescription": "Tarjetas donde los invitados pueden comunicarse después de unirse al espacio de trabajo",
166-
"GuestCardsArrayLabel": "Seleccionar tarjetas para comunicación",
165+
"GuestChannelsDescription": "Canales donde los invitados pueden escribir mensajes después de unirse",
166+
"GuestChannelsArrayLabel": "Seleccionar canales",
167167
"ManageIdentities": "Gestionar identidades",
168168
"Release": "Liberar",
169169
"ReleaseSocialId": "Liberar ID social",

plugins/setting-assets/lang/fr.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "Invités anonymes",
172172
"GuestAccessDescription": "Autorise les utilisateurs anonymes à accéder à l'espace de travail en lecture seule",
173173
"GuestSignUpDescription": "Permet aux utilisateurs anonymes de rejoindre votre espace de travail en tant qu'invités avec des droits d'édition limités",
174-
"GuestCardsDescription": "Cartes où les invités peuvent communiquer après avoir rejoint l'espace de travail",
175-
"GuestCardsArrayLabel": "Sélectionnez les cartes pour la communication",
174+
"GuestChannelsDescription": "Canaux où les invités peuvent écrire des messages après leur adhésion",
175+
"GuestChannelsArrayLabel": "Sélectionner des canaux",
176176
"ManageIdentities": "Gérer les identités",
177177
"Release": "Libération",
178178
"ReleaseSocialId": "Libérer l'ID social",

plugins/setting-assets/lang/it.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "Ospiti anonimi",
172172
"GuestAccessDescription": "Consente agli utenti anonimi di accedere all'area di lavoro in modalità sola lettura",
173173
"GuestSignUpDescription": "Consente agli utenti anonimi di unirsi al tuo spazio di lavoro come ospiti con diritti di modifica limitati",
174-
"GuestCardsDescription": "Schede in cui gli ospiti possono comunicare dopo essersi uniti allo spazio di lavoro",
175-
"GuestCardsArrayLabel": "Seleziona schede per la comunicazione",
174+
"GuestChannelsDescription": "Canali in cui gli ospiti possono scrivere messaggi dopo essersi uniti",
175+
"GuestChannelsArrayLabel": "Seleziona canali",
176176
"ManageIdentities": "Gestisci identità",
177177
"Release": "Rilascio",
178178
"ReleaseSocialId": "Rilascia ID social",

plugins/setting-assets/lang/ja.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"GuestAccess": "匿名ゲスト",
172172
"GuestAccessDescription": "匿名ユーザーがワークスペースを読み取り専用モードで閲覧できます",
173173
"GuestSignUpDescription": "匿名ユーザーがゲストとしてワークスペースに参加し、制限された編集権限を得られるようにします",
174-
"GuestCardsDescription": "ゲストがワークスペース参加後にコミュニケーション可能なカード",
175-
"GuestCardsArrayLabel": "コミュニケーション用カードを選択",
174+
"GuestChannelsDescription": "参加後、ゲストがメッセージを書き込めるチャンネル",
175+
"GuestChannelsArrayLabel": "チャンネルを選択",
176176
"ManageIdentities": "IDを管理",
177177
"Release": "リリース",
178178
"ReleaseSocialId": "ソーシャルIDをリリース",

plugins/setting-assets/lang/pt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
"GuestAccess": "Convidados anônimos",
163163
"GuestAccessDescription": "Permite que usuários anônimos acessem seu espaço de trabalho em modo somente leitura",
164164
"GuestSignUpDescription": "Permite que usuários anônimos entrem em seu espaço de trabalho como convidados com direitos de edição limitados",
165-
"GuestCardsDescription": "Cartões onde convidados podem se comunicar após ingressar no espaço de trabalho",
166-
"GuestCardsArrayLabel": "Selecionar cartões para comunicação",
165+
"GuestChannelsDescription": "Canais onde convidados podem escrever mensagens após ingressar",
166+
"GuestChannelsArrayLabel": "Selecionar canais",
167167
"ManageIdentities": "Gerenciar identidades",
168168
"Release": "Libertação",
169169
"ReleaseSocialId": "Liberar ID social",

0 commit comments

Comments
 (0)