From 2d5fa35eb24cb0a737e757a98c77309509b87af4 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Mon, 22 Sep 2025 14:40:04 +0700 Subject: [PATCH] qfix: hide large values from activity (#9894) Signed-off-by: Alexander Onnikov --- plugins/activity-assets/lang/cs.json | 3 ++- plugins/activity-assets/lang/de.json | 3 ++- plugins/activity-assets/lang/en.json | 3 ++- plugins/activity-assets/lang/es.json | 3 ++- plugins/activity-assets/lang/fr.json | 3 ++- plugins/activity-assets/lang/it.json | 3 ++- plugins/activity-assets/lang/ja.json | 3 ++- plugins/activity-assets/lang/pt.json | 3 ++- plugins/activity-assets/lang/ru.json | 3 ++- plugins/activity-assets/lang/zh.json | 3 ++- .../attributes/SetAttributesPresenter.svelte | 8 +++++- plugins/activity/src/index.ts | 3 ++- .../activity-resources/src/utils.ts | 26 ++++++++++++++++++- server/collaborator/src/storage/platform.ts | 13 +++++++--- 14 files changed, 63 insertions(+), 17 deletions(-) diff --git a/plugins/activity-assets/lang/cs.json b/plugins/activity-assets/lang/cs.json index a2c296e2fe..19ef963a02 100644 --- a/plugins/activity-assets/lang/cs.json +++ b/plugins/activity-assets/lang/cs.json @@ -55,6 +55,7 @@ "RemovedObjectType": "Odstraněný {type} : {title}", "AttributeSetTo": "{name} nastaveno na {value}", "AddedTag": "Přidaný štítek: {title}", - "RemovedTag": "Odebráný štítek: {title}" + "RemovedTag": "Odebráný štítek: {title}", + "ValueTooLarge": "Hodnota je příliš velká na zobrazení" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/de.json b/plugins/activity-assets/lang/de.json index 440a7e237e..2bdd15ee70 100644 --- a/plugins/activity-assets/lang/de.json +++ b/plugins/activity-assets/lang/de.json @@ -55,6 +55,7 @@ "RemovedObjectType": "{objectType} entfernt", "AttributeSetTo": "{attribute} auf {value} gesetzt", "AddedTag": "Tag hinzugefügt: {title}", - "RemovedTag": "Tag entfernt: {title}" + "RemovedTag": "Tag entfernt: {title}", + "ValueTooLarge": "Wert zu groß zum Anzeigen" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/en.json b/plugins/activity-assets/lang/en.json index e3181c7cae..c64251c31d 100644 --- a/plugins/activity-assets/lang/en.json +++ b/plugins/activity-assets/lang/en.json @@ -55,6 +55,7 @@ "RemovedObjectType": "Removed {type} : {title}", "AddedTag": "Added tag: {title}", "RemovedTag": "Removed tag: {title}", - "AttributeSetTo": "{name} set to {value}" + "AttributeSetTo": "{name} set to {value}", + "ValueTooLarge": "Value too large to display" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/es.json b/plugins/activity-assets/lang/es.json index fddad7133b..0621d47cf1 100644 --- a/plugins/activity-assets/lang/es.json +++ b/plugins/activity-assets/lang/es.json @@ -54,6 +54,7 @@ "RemovedObjectType": "Eliminado {type} : {title}", "AttributeSetTo": "{name} establecido en {value}", "AddedTag": "Etiqueta añadida: {title}", - "RemovedTag": "Etiqueta eliminada: {title}" + "RemovedTag": "Etiqueta eliminada: {title}", + "ValueTooLarge": "Valor demasiado grande para mostrar" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/fr.json b/plugins/activity-assets/lang/fr.json index 176cb6e628..b3ade63865 100644 --- a/plugins/activity-assets/lang/fr.json +++ b/plugins/activity-assets/lang/fr.json @@ -55,6 +55,7 @@ "RemovedObjectType": "Supprimé {type} : {title}", "AttributeSetTo": "{name} défini sur {value}", "AddedTag": "Tag ajouté: {title}", - "RemovedTag": "Tag supprimé: {title}" + "RemovedTag": "Tag supprimé: {title}", + "ValueTooLarge": "Valeur trop grande pour être affichée" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/it.json b/plugins/activity-assets/lang/it.json index 1099d1e8b6..af41d8e7a0 100644 --- a/plugins/activity-assets/lang/it.json +++ b/plugins/activity-assets/lang/it.json @@ -55,6 +55,7 @@ "RemovedObjectType": "{type} rimosso: {title}", "AttributeSetTo": "{name} impostato su {value}", "AddedTag": "Tag aggiunto: {title}", - "RemovedTag": "Tag rimosso: {title}" + "RemovedTag": "Tag rimosso: {title}", + "ValueTooLarge": "Valore troppo grande per essere visualizzato" } } diff --git a/plugins/activity-assets/lang/ja.json b/plugins/activity-assets/lang/ja.json index 7947e1e220..f577714659 100644 --- a/plugins/activity-assets/lang/ja.json +++ b/plugins/activity-assets/lang/ja.json @@ -55,7 +55,8 @@ "RemovedObjectType": "{type} を削除:{title}", "AttributeSetTo": "{name} を {value} に設定しました", "AddedTag": "タグを追加しました:{title}", - "RemovedTag": "タグを削除しました:{title}" + "RemovedTag": "タグを削除しました:{title}", + "ValueTooLarge": "表示するには値が大きすぎます" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/pt.json b/plugins/activity-assets/lang/pt.json index cc37b6f2f0..7cd2d7e266 100644 --- a/plugins/activity-assets/lang/pt.json +++ b/plugins/activity-assets/lang/pt.json @@ -54,6 +54,7 @@ "RemovedObjectType": "Removido {type} : {title}", "AttributeSetTo": "{name} definido para {value}", "AddedTag": "Tag adicionado: {title}", - "RemovedTag": "Tag removido: {title}" + "RemovedTag": "Tag removido: {title}", + "ValueTooLarge": "Valor demasiado grande para mostrar" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/ru.json b/plugins/activity-assets/lang/ru.json index fe8d330f44..751df9a565 100644 --- a/plugins/activity-assets/lang/ru.json +++ b/plugins/activity-assets/lang/ru.json @@ -55,6 +55,7 @@ "RemovedObjectType": "Удален(ы) {type} : {title}", "AttributeSetTo": "{name} установлен на {value}", "AddedTag": "Добавлен тег: {title}", - "RemovedTag": "Удален тег: {title}" + "RemovedTag": "Удален тег: {title}", + "ValueTooLarge": "Значение слишком велико для отображения" } } \ No newline at end of file diff --git a/plugins/activity-assets/lang/zh.json b/plugins/activity-assets/lang/zh.json index e3f17a5322..7b2f012c54 100644 --- a/plugins/activity-assets/lang/zh.json +++ b/plugins/activity-assets/lang/zh.json @@ -55,6 +55,7 @@ "RemovedObjectType": "移除 {type} : {title}", "AttributeSetTo": "{name} 设置为 {value}", "AddedTag": "添加标签: {title}", - "RemovedTag": "移除标签: {title}" + "RemovedTag": "移除标签: {title}", + "ValueTooLarge": "值过大,无法显示" } } diff --git a/plugins/activity-resources/src/components/doc-update-message/attributes/SetAttributesPresenter.svelte b/plugins/activity-resources/src/components/doc-update-message/attributes/SetAttributesPresenter.svelte index 222ec50551..5dc87f8c75 100644 --- a/plugins/activity-resources/src/components/doc-update-message/attributes/SetAttributesPresenter.svelte +++ b/plugins/activity-resources/src/components/doc-update-message/attributes/SetAttributesPresenter.svelte @@ -33,6 +33,8 @@ $: isUnset = values.length > 0 && !values.some((value) => value != null && value !== '') $: isTextType = getIsTextType(attributeModel) + $: isTooLarge = + isTextType && (values[0] === activity.string.ValueTooLarge || prevValue === activity.string.ValueTooLarge) let isDiffShown = false @@ -48,7 +50,11 @@ {:else if isTextType} - {#if preview} + {#if isTooLarge} +
+
+ {:else if preview}