|
|
@ -3,9 +3,8 @@ import type { VNodeRef } from '@vue/runtime-core' |
|
|
|
import type { AuditType } from 'nocodb-sdk' |
|
|
|
import type { AuditType } from 'nocodb-sdk' |
|
|
|
import { Icon } from '@iconify/vue' |
|
|
|
import { Icon } from '@iconify/vue' |
|
|
|
import { ref, timeAgo, useExpandedFormStoreOrThrow, useGlobal, useRoles, watch } from '#imports' |
|
|
|
import { ref, timeAgo, useExpandedFormStoreOrThrow, useGlobal, useRoles, watch } from '#imports' |
|
|
|
import FileIcon from '~icons/nc-icons/file' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { loadCommentsAndLogs, commentsAndLogs, isYou, saveComment, comment, updateComment } = useExpandedFormStoreOrThrow() |
|
|
|
const { loadCommentsAndLogs, commentsAndLogs, saveComment, comment, updateComment } = useExpandedFormStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
const commentsWrapperEl = ref<HTMLDivElement>() |
|
|
|
const commentsWrapperEl = ref<HTMLDivElement>() |
|
|
|
|
|
|
|
|
|
|
@ -101,7 +100,7 @@ watch( |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="flex flex-col w-full h-[500px] bg-gray-50 rounded-lg"> |
|
|
|
<div class="flex flex-col w-full h-[540px] bg-gray-50 rounded-lg"> |
|
|
|
<div class="bg-white rounded-t-lg border-gray-200 border-b-1"> |
|
|
|
<div class="bg-white rounded-t-lg border-gray-200 border-b-1"> |
|
|
|
<div class="flex flex-row gap-2 m-2 p-1 bg-gray-100 rounded-lg"> |
|
|
|
<div class="flex flex-row gap-2 m-2 p-1 bg-gray-100 rounded-lg"> |
|
|
|
<div |
|
|
|
<div |
|
|
@ -111,8 +110,8 @@ watch( |
|
|
|
}" |
|
|
|
}" |
|
|
|
@click="tab = 'comments'" |
|
|
|
@click="tab = 'comments'" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="tab-title gap-1 nc-tab"> |
|
|
|
<div class="tab-title gap-2 nc-tab"> |
|
|
|
<MdiMessageOutline class="h-5 w-5" /> |
|
|
|
<MdiMessageOutline class="h-4 w-4" /> |
|
|
|
Comments |
|
|
|
Comments |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -123,8 +122,8 @@ watch( |
|
|
|
}" |
|
|
|
}" |
|
|
|
@click="tab = 'audits'" |
|
|
|
@click="tab = 'audits'" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="tab-title nc-tab"> |
|
|
|
<div class="tab-title gap-2 nc-tab"> |
|
|
|
<MdiFileDocumentOutline class="h-5 w-5" /> |
|
|
|
<MdiFileDocumentOutline class="h-4 w-4" /> |
|
|
|
Audits |
|
|
|
Audits |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -134,7 +133,7 @@ watch( |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-if="tab === 'comments'" |
|
|
|
v-if="tab === 'comments'" |
|
|
|
ref="commentsWrapperEl" |
|
|
|
ref="commentsWrapperEl" |
|
|
|
class="flex flex-col m-1 p-1 !h-[399px] overflow-y-scroll nc-scrollbar-md space-y-2" |
|
|
|
class="flex flex-col m-1 p-1 !h-[407px] overflow-y-scroll nc-scrollbar-md space-y-2" |
|
|
|
> |
|
|
|
> |
|
|
|
<template v-if="comments.length === 0"> |
|
|
|
<template v-if="comments.length === 0"> |
|
|
|
<div class="flex flex-col text-center justify-center h-full"> |
|
|
|
<div class="flex flex-col text-center justify-center h-full"> |
|
|
@ -180,7 +179,7 @@ watch( |
|
|
|
<NcButton type="secondary" size="sm" @click="onCancel"> Cancel </NcButton> |
|
|
|
<NcButton type="secondary" size="sm" @click="onCancel"> Cancel </NcButton> |
|
|
|
<NcButton size="sm" @click="onEditComment"> Save </NcButton> |
|
|
|
<NcButton size="sm" @click="onEditComment"> Save </NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="log.id !== editLog?.id" class="text-sm text-gray-500"> |
|
|
|
<div v-if="log.id !== editLog?.id" class="text-xs text-gray-500"> |
|
|
|
{{ log.created_at !== log.updated_at ? `Edited ${timeAgo(log.updated_at)}` : timeAgo(log.created_at) }} |
|
|
|
{{ log.created_at !== log.updated_at ? `Edited ${timeAgo(log.updated_at)}` : timeAgo(log.created_at) }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -188,9 +187,9 @@ watch( |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else ref="commentsWrapperEl" class="flex flex-col m-1 p-1 !h-[459px] overflow-y-scroll nc-scrollbar-md space-y-2"> |
|
|
|
<div v-else ref="commentsWrapperEl" class="flex flex-col m-1 p-1 !h-[465px] overflow-y-scroll nc-scrollbar-md space-y-2"> |
|
|
|
<template v-if="audits.length === 0"> |
|
|
|
<template v-if="audits.length === 0"> |
|
|
|
<div class="flex flex-col mb-14 text-center justify-center h-full"> |
|
|
|
<div class="flex flex-col text-center justify-center h-full"> |
|
|
|
<div class="text-center text-3xl text-gray-600"> |
|
|
|
<div class="text-center text-3xl text-gray-600"> |
|
|
|
<MdiHistory /> |
|
|
|
<MdiHistory /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -209,7 +208,7 @@ watch( |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="text-sm text-gray-700"> |
|
|
|
<div class="text-sm font-medium text-gray-700"> |
|
|
|
{{ log.description.split('.')[1] }} |
|
|
|
{{ log.description.split('.')[1] }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="log.id !== editLog?.id" class="text-xs text-gray-500"> |
|
|
|
<div v-if="log.id !== editLog?.id" class="text-xs text-gray-500"> |
|
|
@ -237,7 +236,7 @@ watch( |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
|
.tab .tab-title { |
|
|
|
.tab .tab-title { |
|
|
|
@apply min-w-0 flex justify-center gap-1 font-semibold items-center py-1; |
|
|
|
@apply min-w-0 flex justify-center gap-1 font-semibold items-center; |
|
|
|
word-break: 'keep-all'; |
|
|
|
word-break: 'keep-all'; |
|
|
|
white-space: 'nowrap'; |
|
|
|
white-space: 'nowrap'; |
|
|
|
display: 'inline'; |
|
|
|
display: 'inline'; |
|
|
|