mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 04:55:03 +02:00
Initial meeting minutes (#7111)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
export let withActionMenu = true
|
||||
export let onOpen: () => void
|
||||
export let onClose: () => void
|
||||
export let onReply: ((message: ActivityMessage) => void) | undefined = undefined
|
||||
|
||||
const client = getClient()
|
||||
|
||||
@@ -76,22 +77,33 @@
|
||||
.filter((action) => action.inline)
|
||||
.filter((action) => !excludedAction.includes(action._id))
|
||||
}
|
||||
|
||||
async function handleAction (action: ViewAction, ev?: Event): Promise<void> {
|
||||
if (message === undefined) return
|
||||
|
||||
if (onReply !== undefined && action._id === activity.action.Reply) {
|
||||
onReply(message)
|
||||
handleActionMenuClosed()
|
||||
return
|
||||
}
|
||||
const fn = await getResource(action.action)
|
||||
|
||||
await fn(message, ev, { onOpen, onClose })
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if message}
|
||||
<div class="activityMessage-actionPopup">
|
||||
{#each inlineActions as inline}
|
||||
{#if inline.icon}
|
||||
{#await getResource(inline.action) then action}
|
||||
<ActivityMessageAction
|
||||
label={inline.label}
|
||||
size={inline.actionProps?.size ?? 'small'}
|
||||
icon={inline.icon}
|
||||
iconProps={inline.actionProps?.iconProps}
|
||||
dataId={inline._id}
|
||||
action={(ev) => action(message, ev, { onOpen, onClose })}
|
||||
/>
|
||||
{/await}
|
||||
<ActivityMessageAction
|
||||
label={inline.label}
|
||||
size={inline.actionProps?.size ?? 'small'}
|
||||
icon={inline.icon}
|
||||
iconProps={inline.actionProps?.iconProps}
|
||||
dataId={inline._id}
|
||||
action={(ev) => handleAction(inline, ev)}
|
||||
/>
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
export let object: ActivityMessage
|
||||
export let embedded = false
|
||||
export let onReply: ((message: ActivityMessage) => void) | undefined = undefined
|
||||
|
||||
const client = getClient()
|
||||
const maxDisplayPersons = 5
|
||||
@@ -82,6 +83,10 @@
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
|
||||
if (onReply) {
|
||||
onReply(object)
|
||||
}
|
||||
|
||||
if (replyProvider) {
|
||||
const fn = await getResource(replyProvider.function)
|
||||
await fn(object, e)
|
||||
|
||||
+4
-2
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { DisplayActivityMessage, ActivityMessageViewType } from '@hcengineering/activity'
|
||||
import { DisplayActivityMessage, ActivityMessageViewType, ActivityMessage } from '@hcengineering/activity'
|
||||
import view from '@hcengineering/view'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { Action, Component } from '@hcengineering/ui'
|
||||
@@ -41,6 +41,7 @@
|
||||
export let compact = false
|
||||
export let readonly = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: ((message: ActivityMessage) => void) | undefined = undefined
|
||||
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
@@ -74,7 +75,8 @@
|
||||
type,
|
||||
compact,
|
||||
readonly,
|
||||
onClick
|
||||
onClick,
|
||||
onReply
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
+13
-5
@@ -16,7 +16,8 @@
|
||||
import activity, {
|
||||
ActivityMessageViewlet,
|
||||
DisplayActivityMessage,
|
||||
ActivityMessageViewType
|
||||
ActivityMessageViewType,
|
||||
ActivityMessage
|
||||
} from '@hcengineering/activity'
|
||||
import { Person } from '@hcengineering/contact'
|
||||
import { Avatar, SystemAvatar } from '@hcengineering/contact-resources'
|
||||
@@ -63,6 +64,7 @@
|
||||
export let excludedActions: Ref<ViewAction>[] = []
|
||||
export let readonly: boolean = false
|
||||
export let onClick: (() => void) | undefined = undefined
|
||||
export let onReply: ((message: ActivityMessage) => void) | undefined = undefined
|
||||
|
||||
export let socialIcon: Asset | undefined = undefined
|
||||
|
||||
@@ -146,9 +148,14 @@
|
||||
if (readonly) return
|
||||
const showCustomPopup = !isTextClicked(event.target as HTMLElement, event.clientX, event.clientY)
|
||||
if (showCustomPopup) {
|
||||
showMenu(event, { object: message, baseMenuClass: activity.class.ActivityMessage, excludedActions }, () => {
|
||||
isActionsOpened = false
|
||||
})
|
||||
const overrides = onReply ? new Map([[activity.action.Reply, onReply]]) : []
|
||||
showMenu(
|
||||
event,
|
||||
{ object: message, baseMenuClass: activity.class.ActivityMessage, excludedActions, overrides },
|
||||
() => {
|
||||
isActionsOpened = false
|
||||
}
|
||||
)
|
||||
isActionsOpened = true
|
||||
}
|
||||
}
|
||||
@@ -247,7 +254,7 @@
|
||||
<slot name="content" {readonly} />
|
||||
|
||||
{#if !hideFooter}
|
||||
<Replies {embedded} object={message} />
|
||||
<Replies {embedded} object={message} {onReply} />
|
||||
{/if}
|
||||
<ReactionsPresenter object={message} {readonly} />
|
||||
{#if parentMessage && showEmbedded}
|
||||
@@ -263,6 +270,7 @@
|
||||
{actions}
|
||||
{withActionMenu}
|
||||
{excludedActions}
|
||||
{onReply}
|
||||
onOpen={handleActionsOpened}
|
||||
onClose={handleActionsClosed}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user