|
|
@ -30,8 +30,6 @@ const route = useRoute() |
|
|
|
|
|
|
|
|
|
|
|
const { dashboardUrl } = useDashboard() |
|
|
|
const { dashboardUrl } = useDashboard() |
|
|
|
|
|
|
|
|
|
|
|
const editRef = ref<any>() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { user, appInfo } = useGlobal() |
|
|
|
const { user, appInfo } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const isExpandedFormLoading = computed(() => props.loading) |
|
|
|
const isExpandedFormLoading = computed(() => props.loading) |
|
|
@ -108,6 +106,9 @@ onKeyStroke('Enter', (event) => { |
|
|
|
function editComments(comment: CommentType) { |
|
|
|
function editComments(comment: CommentType) { |
|
|
|
editComment.value = comment |
|
|
|
editComment.value = comment |
|
|
|
isEditing.value = true |
|
|
|
isEditing.value = true |
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
|
|
scrollToComment(comment.id) |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const value = computed({ |
|
|
|
const value = computed({ |
|
|
@ -225,6 +226,21 @@ const createdBy = ( |
|
|
|
return 'Shared source' |
|
|
|
return 'Shared source' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getUserRole = (email: string) => { |
|
|
|
|
|
|
|
const user = baseUsers.value.find((user) => user.email === email) |
|
|
|
|
|
|
|
if (!user) return ProjectRoles.NO_ACCESS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return user.roles || ProjectRoles.NO_ACCESS |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const editedAt = (comment: CommentType) => { |
|
|
|
|
|
|
|
if (comment.updated_at !== comment.created_at && comment.updated_at) { |
|
|
|
|
|
|
|
const str = timeAgo(comment.updated_at).replace(' ', '_') |
|
|
|
|
|
|
|
return `[(edited)](a~~~###~~~Edited_${str}) ` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return '' |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -286,10 +302,8 @@ const createdBy = ( |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex items-center gap-2"> |
|
|
|
<div class="flex items-center gap-2"> |
|
|
|
<NcDropdown |
|
|
|
<NcDropdown |
|
|
|
v-if="(comment.created_by_email === user!.email && !editComment )" |
|
|
|
v-if="!editCommentValue" |
|
|
|
:class="{ |
|
|
|
class="!hidden !group-hover:block" |
|
|
|
'opacity-0 group-hover:opacity-100': comment.created_by_email === user!.email && !editComment, |
|
|
|
|
|
|
|
}" |
|
|
|
|
|
|
|
overlay-class-name="!min-w-[160px]" |
|
|
|
overlay-class-name="!min-w-[160px]" |
|
|
|
placement="bottomRight" |
|
|
|
placement="bottomRight" |
|
|
|
> |
|
|
|
> |
|
|
@ -299,6 +313,7 @@ const createdBy = ( |
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
|
|
|
|
v-if="user && comment.created_by_email === user.email" |
|
|
|
v-e="['c:comment-expand:comment:edit']" |
|
|
|
v-e="['c:comment-expand:comment:edit']" |
|
|
|
class="text-gray-700" |
|
|
|
class="text-gray-700" |
|
|
|
@click="editComments(comment)" |
|
|
|
@click="editComments(comment)" |
|
|
@ -308,6 +323,18 @@ const createdBy = ( |
|
|
|
{{ $t('general.edit') }} |
|
|
|
{{ $t('general.edit') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
<NcMenuItem |
|
|
|
|
|
|
|
v-e="['c:comment-expand:comment:copy']" |
|
|
|
|
|
|
|
class="text-gray-700" |
|
|
|
|
|
|
|
@click="copyComment(comment)" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div class="flex gap-2 items-center"> |
|
|
|
|
|
|
|
<component :is="iconMap.copy" class="cursor-pointer" /> |
|
|
|
|
|
|
|
{{ $t('general.copy') }} URL |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
<template v-if="user && comment.created_by_email === user.email"> |
|
|
|
|
|
|
|
<NcDivider /> |
|
|
|
<NcMenuItem |
|
|
|
<NcMenuItem |
|
|
|
v-e="['c:row-expand:comment:delete']" |
|
|
|
v-e="['c:row-expand:comment:delete']" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
|
class="!text-red-500 !hover:bg-red-50" |
|
|
@ -318,6 +345,7 @@ const createdBy = ( |
|
|
|
{{ $t('general.delete') }} |
|
|
|
{{ $t('general.delete') }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
</template> |
|
|
|
</NcMenu> |
|
|
|
</NcMenu> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</NcDropdown> |
|
|
|
</NcDropdown> |
|
|
@ -352,8 +380,7 @@ const createdBy = ( |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex-1 flex flex-col gap-1 mt-1 max-w-[calc(100%)]"> |
|
|
|
<div class="flex-1 flex flex-col gap-1 mt-1 max-w-[calc(100%)]"> |
|
|
|
<SmartsheetExpandedFormRichComment |
|
|
|
<SmartsheetExpandedFormRichComment |
|
|
|
v-if="comment.id === editComment?.id" |
|
|
|
v-if="comment.id === editCommentValue?.id" |
|
|
|
ref="editRef" |
|
|
|
|
|
|
|
v-model:value="value" |
|
|
|
v-model:value="value" |
|
|
|
autofocus |
|
|
|
autofocus |
|
|
|
:hide-options="false" |
|
|
|
:hide-options="false" |
|
|
|