From ace5692b91ea6d3cc0a4345d1af46a56b93bccca Mon Sep 17 00:00:00 2001 From: Kristina Date: Mon, 25 Mar 2024 13:22:48 +0400 Subject: [PATCH] Return back comment editing, remove unused props (#5056) Signed-off-by: Kristina Fefelova --- .../components/ActivityMessageActions.svelte | 21 +++++++++---------- .../ActivityInfoMessagePresenter.svelte | 4 ---- .../ActivityMessagePresenter.svelte | 4 ---- .../ActivityMessageTemplate.svelte | 11 +++------- .../BaseMessagePreview.svelte | 1 + .../ActivityReferencePresenter.svelte | 4 ---- .../DocUpdateMessagePresenter.svelte | 4 ---- .../chat-message/ChatMessagePresenter.svelte | 4 ---- .../threads/ThreadMessagePresenter.svelte | 4 ---- 9 files changed, 14 insertions(+), 43 deletions(-) diff --git a/plugins/activity-resources/src/components/ActivityMessageActions.svelte b/plugins/activity-resources/src/components/ActivityMessageActions.svelte index 9ece5e1520..69cd50fa08 100644 --- a/plugins/activity-resources/src/components/ActivityMessageActions.svelte +++ b/plugins/activity-resources/src/components/ActivityMessageActions.svelte @@ -26,10 +26,8 @@ export let message: ActivityMessage | undefined export let extensions: ActivityMessageExtension[] = [] - export let excludedActions: string[] = [] export let actions: Action[] = [] export let withActionMenu = true - export let withFlatActions = true const dispatch = createEventDispatcher() @@ -50,9 +48,8 @@ Menu, { object: message, - baseMenuClass: activity.class.ActivityMessage, - excludedActions, - actions + actions, + baseMenuClass: activity.class.ActivityMessage }, ev.target as HTMLElement, handleActionMenuClosed @@ -61,13 +58,15 @@ } -{#if message && (withFlatActions || withActionMenu)} +{#if message}
- {#if withFlatActions} - - - - + + + + + + {#if withActionMenu} + {/if}
{/if} diff --git a/plugins/activity-resources/src/components/activity-info-message/ActivityInfoMessagePresenter.svelte b/plugins/activity-resources/src/components/activity-info-message/ActivityInfoMessagePresenter.svelte index 5e8f407fbb..bb56b29314 100644 --- a/plugins/activity-resources/src/components/activity-info-message/ActivityInfoMessagePresenter.svelte +++ b/plugins/activity-resources/src/components/activity-info-message/ActivityInfoMessagePresenter.svelte @@ -37,8 +37,6 @@ export let shouldScroll: boolean = false export let embedded: boolean = false export let withActions: boolean = true - export let withFlatActions: boolean = true - export let excludedActions: string[] = [] export let actions: Action[] = [] export let hoverable = true export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover' @@ -73,8 +71,6 @@ {embedded} {withActions} {actions} - {excludedActions} - {withFlatActions} {hoverable} {hoverStyles} viewlet={undefined} diff --git a/plugins/activity-resources/src/components/activity-message/ActivityMessagePresenter.svelte b/plugins/activity-resources/src/components/activity-message/ActivityMessagePresenter.svelte index 49acceab1b..e2b6eab9dd 100644 --- a/plugins/activity-resources/src/components/activity-message/ActivityMessagePresenter.svelte +++ b/plugins/activity-resources/src/components/activity-message/ActivityMessagePresenter.svelte @@ -30,8 +30,6 @@ export let hideFooter = false export let skipLabel = false export let actions: Action[] = [] - export let excludedActions: string[] = [] - export let withFlatActions: boolean = true export let hoverable = true export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover' export let withShowMore: boolean = true @@ -64,8 +62,6 @@ showEmbedded, hideFooter, actions, - excludedActions, - withFlatActions, hoverable, hoverStyles, withShowMore, diff --git a/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte b/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte index 7737a3f5a4..96fd7a8036 100644 --- a/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte +++ b/plugins/activity-resources/src/components/activity-message/ActivityMessageTemplate.svelte @@ -40,14 +40,12 @@ export let viewlet: ActivityMessageViewlet | undefined = undefined export let person: Person | undefined = undefined export let actions: Action[] = [] - export let excludedActions: string[] = [] export let showNotify: boolean = false export let isHighlighted: boolean = false export let isSelected: boolean = false export let shouldScroll: boolean = false export let embedded: boolean = false export let withActions: boolean = true - export let withFlatActions: boolean = true export let showEmbedded = false export let hideFooter = false export let skipLabel = false @@ -59,7 +57,7 @@ const client = getClient() - let allActionIds: string[] = [] + let menuActionIds: string[] = [] let element: HTMLDivElement | undefined = undefined let extensions: ActivityMessageExtension[] = [] @@ -73,7 +71,7 @@ $: withActions && getActions(client, message, activity.class.ActivityMessage).then((res) => { - allActionIds = res.map(({ _id }) => _id) + menuActionIds = res.map(({ _id }) => _id) }) function scrollToMessage (): void { @@ -104,8 +102,7 @@ $: key = parentMessage != null ? `${message._id}_${parentMessage._id}` : message._id $: isHidden = !!viewlet?.onlyWithParent && parentMessage === undefined - $: withActionMenu = - withActions && !embedded && (actions.length > 0 || allActionIds.some((id) => !excludedActions.includes(id))) + $: withActionMenu = withActions && !embedded && (actions.length > 0 || menuActionIds.length > 0) let readonly: boolean = false $: readonly = $restrictionStore.disableComments @@ -196,8 +193,6 @@ {extensions} {actions} {withActionMenu} - {withFlatActions} - {excludedActions} on:open={handleActionsOpened} on:close={handleActionsClosed} /> diff --git a/plugins/activity-resources/src/components/activity-message/BaseMessagePreview.svelte b/plugins/activity-resources/src/components/activity-message/BaseMessagePreview.svelte index 495e8ddcc2..0aac5f0f9c 100644 --- a/plugins/activity-resources/src/components/activity-message/BaseMessagePreview.svelte +++ b/plugins/activity-resources/src/components/activity-message/BaseMessagePreview.svelte @@ -62,6 +62,7 @@ {message} {extensions} {actions} + withActionMenu={false} on:open={previewElement.onActionsOpened} on:close={previewElement.onActionsClosed} /> diff --git a/plugins/activity-resources/src/components/activity-reference/ActivityReferencePresenter.svelte b/plugins/activity-resources/src/components/activity-reference/ActivityReferencePresenter.svelte index a0f858f0f9..6bf2ad9f6f 100644 --- a/plugins/activity-resources/src/components/activity-reference/ActivityReferencePresenter.svelte +++ b/plugins/activity-resources/src/components/activity-reference/ActivityReferencePresenter.svelte @@ -38,8 +38,6 @@ export let hideFooter = false export let actions: Action[] = [] export let skipLabel = false - export let withFlatActions: boolean = true - export let excludedActions: string[] = [] export let hoverable = true export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover' export let hideLink = false @@ -105,13 +103,11 @@ {isSelected} {shouldScroll} {embedded} - {excludedActions} {withActions} {showEmbedded} {hideFooter} {actions} {skipLabel} - {withFlatActions} {hoverable} {hoverStyles} {onClick} diff --git a/plugins/activity-resources/src/components/doc-update-message/DocUpdateMessagePresenter.svelte b/plugins/activity-resources/src/components/doc-update-message/DocUpdateMessagePresenter.svelte index 27c3cd6e53..f9c5df53d3 100644 --- a/plugins/activity-resources/src/components/doc-update-message/DocUpdateMessagePresenter.svelte +++ b/plugins/activity-resources/src/components/doc-update-message/DocUpdateMessagePresenter.svelte @@ -47,8 +47,6 @@ export let hideFooter = false export let actions: Action[] = [] export let skipLabel = false - export let withFlatActions: boolean = true - export let excludedActions: string[] = [] export let hoverable = true export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover' export let hideLink = false @@ -164,14 +162,12 @@ {isSelected} {shouldScroll} {embedded} - {excludedActions} {withActions} {viewlet} {showEmbedded} {hideFooter} {actions} {skipLabel} - {withFlatActions} {hoverable} {hoverStyles} showDatePreposition={hideLink} diff --git a/plugins/chunter-resources/src/components/chat-message/ChatMessagePresenter.svelte b/plugins/chunter-resources/src/components/chat-message/ChatMessagePresenter.svelte index 1e2f86a8bc..60df9f91e3 100644 --- a/plugins/chunter-resources/src/components/chat-message/ChatMessagePresenter.svelte +++ b/plugins/chunter-resources/src/components/chat-message/ChatMessagePresenter.svelte @@ -40,8 +40,6 @@ export let hideFooter = false export let skipLabel = false export let actions: Action[] = [] - export let excludedActions: string[] = [] - export let withFlatActions: boolean = true export let hoverable = true export let inline = false export let hoverStyles: 'borderedHover' | 'filledHover' = 'borderedHover' @@ -171,7 +169,6 @@ {viewlet} {parentMessage} {person} - {excludedActions} {showNotify} {isHighlighted} {isSelected} @@ -181,7 +178,6 @@ actions={additionalActions} {showEmbedded} {hideFooter} - {withFlatActions} {hoverable} {hoverStyles} {skipLabel} diff --git a/plugins/chunter-resources/src/components/threads/ThreadMessagePresenter.svelte b/plugins/chunter-resources/src/components/threads/ThreadMessagePresenter.svelte index 3b86041624..8c654ead91 100644 --- a/plugins/chunter-resources/src/components/threads/ThreadMessagePresenter.svelte +++ b/plugins/chunter-resources/src/components/threads/ThreadMessagePresenter.svelte @@ -32,9 +32,7 @@ export let withActions: boolean = true export let showEmbedded = false export let skipLabel = false - export let withFlatActions: boolean = true export let actions: Action[] = [] - export let excludedActions: string[] = [] export let hoverable = true export let inline = false export let withShowMore: boolean = true @@ -70,8 +68,6 @@ {showEmbedded} {embedded} {skipLabel} - {withFlatActions} - {excludedActions} {actions} {hoverable} {hoverStyles}