From 81f57d56250ec0af6b575feb44aed18acdff1c58 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Tue, 1 Apr 2025 07:11:52 +0500 Subject: [PATCH] Change type warning (#8408) Signed-off-by: Denis Bykhov --- plugins/card-assets/lang/cs.json | 3 ++- plugins/card-assets/lang/de.json | 3 ++- plugins/card-assets/lang/en.json | 3 ++- plugins/card-assets/lang/es.json | 3 ++- plugins/card-assets/lang/fr.json | 3 ++- plugins/card-assets/lang/it.json | 3 ++- plugins/card-assets/lang/pt.json | 3 ++- plugins/card-assets/lang/ru.json | 3 ++- plugins/card-assets/lang/zh.json | 3 ++- .../card-resources/src/components/ChangeType.svelte | 13 +++++-------- .../settings/ManageMasterTagsContent.svelte | 2 ++ plugins/card-resources/src/plugin.ts | 3 ++- 12 files changed, 27 insertions(+), 18 deletions(-) diff --git a/plugins/card-assets/lang/cs.json b/plugins/card-assets/lang/cs.json index 8728cdd86b..87674213cd 100644 --- a/plugins/card-assets/lang/cs.json +++ b/plugins/card-assets/lang/cs.json @@ -29,6 +29,7 @@ "EditView": "Upravit zobrazení", "SelectViewType": "Vybrat typ zobrazení", "Document": "Dokument", - "ChangeType": "Změnit typ" + "ChangeType": "Změnit typ", + "ChangeTypeWarning": "Varování: Změna typu karty odstraní všechna data pro jakýkoliv atribut, který v cílovém typu neexistuje. Předchozí data atributu mohou být obnoveny změnou karty zpět na předchozí typ. Obsah karty nebude ovlivněn." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/de.json b/plugins/card-assets/lang/de.json index 50016342c6..6ac0062457 100644 --- a/plugins/card-assets/lang/de.json +++ b/plugins/card-assets/lang/de.json @@ -29,6 +29,7 @@ "EditView": "Ansicht bearbeiten", "SelectViewType": "Ansichtstyp auswählen", "Document": "Dokument", - "ChangeType": "Typ ändern" + "ChangeType": "Typ ändern", + "ChangeTypeWarning": "Warnung: Das Ändern des Typs einer Karte wird alle Daten für alle Attribute entfernen, die nicht auf dem Zieltyp vorhanden sind. Vorherige Attributdaten können wiederhergestellt werden, indem Sie die Karte auf einen früheren Typ zurücksetzen. Karteninhalt wird nicht betroffen." } } diff --git a/plugins/card-assets/lang/en.json b/plugins/card-assets/lang/en.json index e5fc6566cb..6b571d1f23 100644 --- a/plugins/card-assets/lang/en.json +++ b/plugins/card-assets/lang/en.json @@ -29,6 +29,7 @@ "EditView": "Edit View", "SelectViewType": "Select View Type", "Document": "Document", - "ChangeType": "Change type" + "ChangeType": "Change type", + "ChangeTypeWarning": "Warning: Changing the Type of a Card will remove all data for any attributes that do not exist on the target Type. Previous attribute data can be restored by changing the Card back to a previous Type. Card content will not be affected." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/es.json b/plugins/card-assets/lang/es.json index 7cb5c961be..924e0f41aa 100644 --- a/plugins/card-assets/lang/es.json +++ b/plugins/card-assets/lang/es.json @@ -29,6 +29,7 @@ "EditView": "Editar vista", "SelectViewType": "Seleccionar tipo de vista", "Document": "Documento", - "ChangeType": "Cambiar tipo" + "ChangeType": "Cambiar tipo", + "ChangeTypeWarning": "Advertencia: Cambiar el tipo de una tarjeta eliminará todos los datos para cualquier atributo que no exista en el tipo de destino. Los datos previos del atributo pueden ser restaurados cambiando la tarjeta de nuevo a un tipo anterior. El contenido de la tarjeta no será afectado." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/fr.json b/plugins/card-assets/lang/fr.json index 1996c820c4..fbe204337e 100644 --- a/plugins/card-assets/lang/fr.json +++ b/plugins/card-assets/lang/fr.json @@ -29,6 +29,7 @@ "EditView": "Modifier la vue", "SelectViewType": "Sélectionner le type de vue", "Document": "Document", - "ChangeType": "Changer de type" + "ChangeType": "Changer de type", + "ChangeTypeWarning": "Avertissement : Changer le type d'une carte supprimera toutes les données pour tous les attributs qui ne sont pas dans le type cible. Les données précédentes de l'attribut peuvent être restaurées en changeant la carte en arrière. Le contenu de la carte ne sera pas affecté." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/it.json b/plugins/card-assets/lang/it.json index 4d0b2dc152..9589d83716 100644 --- a/plugins/card-assets/lang/it.json +++ b/plugins/card-assets/lang/it.json @@ -29,6 +29,7 @@ "EditView": "Modifica vista", "SelectViewType": "Seleziona il tipo di vista", "Document": "Documento", - "ChangeType": "Cambia tipo" + "ChangeType": "Cambia tipo", + "ChangeTypeWarning": "Avviso: Cambiare il tipo di un'scheda rimuoverà tutti i dati per qualsiasi attributo che non esistono nel tipo di destinazione. I dati precedenti dell'attributo possono essere ripristinati modificando nuovamente il carta in un tipo precedente. Il contenuto della scheda non sarà influenzato." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/pt.json b/plugins/card-assets/lang/pt.json index e31e63047b..9c59843e07 100644 --- a/plugins/card-assets/lang/pt.json +++ b/plugins/card-assets/lang/pt.json @@ -29,6 +29,7 @@ "EditView": "Editar visualização", "SelectViewType": "Selecionar tipo de visualização", "Document": "Documento", - "ChangeType": "Alterar tipo" + "ChangeType": "Alterar tipo", + "ChangeTypeWarning": "Aviso: Alterar o tipo de um cartão irá remover todos os dados para quaisquer atributos que não existem no tipo de destino. Dados anteriores do atributo podem ser restaurados alterando o cartão de volta para um tipo anterior. O conteúdo do cartão não será afetado." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/ru.json b/plugins/card-assets/lang/ru.json index 948b6296b7..ca6616aca6 100644 --- a/plugins/card-assets/lang/ru.json +++ b/plugins/card-assets/lang/ru.json @@ -29,6 +29,7 @@ "EditView": "Редактировать представление", "SelectViewType": "Выбрать тип представления", "Document": "Документ", - "ChangeType": "Изменить тип" + "ChangeType": "Изменить тип", + "ChangeTypeWarning": "Внимание: Изменение типа удалит все данные для любых атрибутов, которые не существуют в целевом типе. Предыдущие данные атрибутов могут быть восстановлены, изменением на предыдущий тип. Содержимое не будет затронуто." } } \ No newline at end of file diff --git a/plugins/card-assets/lang/zh.json b/plugins/card-assets/lang/zh.json index 4877214848..ab9e3819f0 100644 --- a/plugins/card-assets/lang/zh.json +++ b/plugins/card-assets/lang/zh.json @@ -29,6 +29,7 @@ "EditView": "编辑视图", "SelectViewType": "选择视图类型", "Document": "文档", - "ChangeType": "更改类型" + "ChangeType": "更改类型", + "ChangeTypeWarning": "警告:更改卡片类型将删除任何不存在于目标类型中的任何属性的所有数据。之前的属性数据可以通过将卡片回到以前的类型来恢复。卡片内容将不会受到影响。" } } \ No newline at end of file diff --git a/plugins/card-resources/src/components/ChangeType.svelte b/plugins/card-resources/src/components/ChangeType.svelte index 6a7074541e..be351a81f0 100644 --- a/plugins/card-resources/src/components/ChangeType.svelte +++ b/plugins/card-resources/src/components/ChangeType.svelte @@ -16,8 +16,8 @@ import { Analytics } from '@hcengineering/analytics' import { Card, CardEvents, MasterTag } from '@hcengineering/card' import { AnyAttribute, Class, ClassifierKind, Doc, fillDefaults, Ref } from '@hcengineering/core' - import { Card as CardModal, createQuery, getClient } from '@hcengineering/presentation' - import { DropdownIntlItem, NestedDropdown } from '@hcengineering/ui' + import { Card as CardModal, getClient } from '@hcengineering/presentation' + import { DropdownIntlItem, Label, NestedDropdown } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import { deepEqual } from 'fast-equals' import card from '../plugin' @@ -73,12 +73,6 @@ return res } - const clQuery = createQuery() - - clQuery.query(card.class.MasterTag, { _class: card.class.MasterTag }, (res) => { - filterClasses() - }) - const dispatch = createEventDispatcher() function filterClasses (): [DropdownIntlItem, DropdownIntlItem[]][] { @@ -131,6 +125,9 @@ }} on:changeContent > +
+
{ diff --git a/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte b/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte index 7d111d2357..831c3cd84b 100644 --- a/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte +++ b/plugins/card-resources/src/components/settings/ManageMasterTagsContent.svelte @@ -59,10 +59,12 @@ .then((res) => (subEditor = res)) .catch((err) => { subEditor = undefined + subEditorTitle = undefined console.error(err) }) } else { selectedSubObjectId = undefined + subEditorTitle = undefined subEditor = undefined } } diff --git a/plugins/card-resources/src/plugin.ts b/plugins/card-resources/src/plugin.ts index 7ff2f1c2e7..e6da5f30dd 100644 --- a/plugins/card-resources/src/plugin.ts +++ b/plugins/card-resources/src/plugin.ts @@ -71,6 +71,7 @@ export default mergeIds(cardId, card, { CreateChild: '' as IntlString, Children: '' as IntlString, Document: '' as IntlString, - ChangeType: '' as IntlString + ChangeType: '' as IntlString, + ChangeTypeWarning: '' as IntlString } })