From da2a7ec9c65262cbd9ee9848ae3658b74688605c Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 26 Apr 2023 17:34:48 +0600 Subject: [PATCH] =?UTF-8?q?TSK-1017=20=D0=92=20activity=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B8=D1=82=D1=8C=20=D1=82=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D1=82=20=D1=81=20"=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BB(=D0=B0)?= =?UTF-8?q?=20=D1=82=D0=B5=D0=B3"=20=D0=BD=D0=B0=20"=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB(=D0=B0)=20=D1=82=D0=B5=D0=B3"=20(#3081?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Change activity label Signed-off-by: Denis Bykhov * TSK-1098: All issues related fixes (#3079) Signed-off-by: Andrey Sobolev Signed-off-by: Denis Bykhov --------- Signed-off-by: Denis Bykhov Signed-off-by: Andrey Sobolev Co-authored-by: Andrey Sobolev --- plugins/activity-assets/lang/en.json | 1 + plugins/activity-assets/lang/ru.json | 1 + plugins/activity-resources/src/plugin.ts | 1 + plugins/activity-resources/src/utils.ts | 7 ++++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/activity-assets/lang/en.json b/plugins/activity-assets/lang/en.json index e779b74237..67027cd741 100644 --- a/plugins/activity-assets/lang/en.json +++ b/plugins/activity-assets/lang/en.json @@ -4,6 +4,7 @@ "Edit": "Edit", "Edited": "edited", "DocCreated": "created {_class}", + "DocAdded": "added {_class}", "DocDeleted": "deleted {_class}", "Activity": "Activity", "Changed": "changed", diff --git a/plugins/activity-assets/lang/ru.json b/plugins/activity-assets/lang/ru.json index c5f55838b2..4d5bfb17cd 100644 --- a/plugins/activity-assets/lang/ru.json +++ b/plugins/activity-assets/lang/ru.json @@ -4,6 +4,7 @@ "Edit": "Редактировать", "Edited": "отредактировал(а)", "DocCreated": "создал(а) {_class}", + "DocAdded": "добавил(а) {_class}", "DocDeleted": "удалил(а) {_class}", "Activity": "Активность", "Changed": "изменил(а)", diff --git a/plugins/activity-resources/src/plugin.ts b/plugins/activity-resources/src/plugin.ts index d8a955c50d..f928bfa04c 100644 --- a/plugins/activity-resources/src/plugin.ts +++ b/plugins/activity-resources/src/plugin.ts @@ -20,6 +20,7 @@ import { mergeIds } from '@hcengineering/platform' export default mergeIds(activityId, activity, { string: { DocCreated: '' as IntlString, + DocAdded: '' as IntlString, DocDeleted: '' as IntlString, CollectionUpdated: '' as IntlString, All: '' as IntlString diff --git a/plugins/activity-resources/src/utils.ts b/plugins/activity-resources/src/utils.ts index acfd1c7833..2a491b525f 100644 --- a/plugins/activity-resources/src/utils.ts +++ b/plugins/activity-resources/src/utils.ts @@ -109,7 +109,7 @@ export async function updateViewlet ( let iconComponent: AnyComponent | undefined if (viewlet === undefined) { - ;({ viewlet, model } = await checkInlineViewlets(dtx, viewlet, client, model)) + ;({ viewlet, model } = await checkInlineViewlets(dtx, viewlet, client, model, dtx.isOwnTx)) if (model !== undefined) { // Check for State attribute for (const a of model) { @@ -133,14 +133,15 @@ async function checkInlineViewlets ( dtx: DisplayTx, viewlet: TxDisplayViewlet, client: TxOperations, - model: AttributeModel[] + model: AttributeModel[], + isOwn: boolean ): Promise<{ viewlet: TxDisplayViewlet, model: AttributeModel[] }> { if (dtx.collectionAttribute !== undefined && (dtx.txDocIds?.size ?? 0) > 1) { // Check if we have a class presenter we could have a pseudo viewlet based on class presenter. viewlet = await createPseudoViewlet(client, dtx, activity.string.CollectionUpdated, 'inline') } else if (dtx.tx._class === core.class.TxCreateDoc) { // Check if we have a class presenter we could have a pseudo viewlet based on class presenter. - viewlet = await createPseudoViewlet(client, dtx, activity.string.DocCreated) + viewlet = await createPseudoViewlet(client, dtx, isOwn ? activity.string.DocCreated : activity.string.DocAdded) } else if (dtx.tx._class === core.class.TxRemoveDoc) { viewlet = await createPseudoViewlet(client, dtx, activity.string.DocDeleted) } else if (dtx.tx._class === core.class.TxUpdateDoc || dtx.tx._class === core.class.TxMixin) {