From d0537ee5660d7c7d7e259ab875643eb9f2e0dd37 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 6 Aug 2022 01:52:23 +0530 Subject: [PATCH] feat(gui-v2): comment styling and functionality Signed-off-by: Pranav C --- .../smartsheet/expanded-form/Comments.vue | 115 +++++++----------- .../smartsheet/expanded-form/index.vue | 8 +- .../composables/useExpandedFormStore.ts | 6 +- packages/nc-gui-v2/package.json | 1 + packages/nc-gui-v2/plugins/domPurify.ts | 7 ++ .../spreadsheet/components/ExpandedForm.vue | 1 + 6 files changed, 63 insertions(+), 75 deletions(-) create mode 100644 packages/nc-gui-v2/plugins/domPurify.ts diff --git a/packages/nc-gui-v2/components/smartsheet/expanded-form/Comments.vue b/packages/nc-gui-v2/components/smartsheet/expanded-form/Comments.vue index 8ad66c7dcc..ac91a28c5e 100644 --- a/packages/nc-gui-v2/components/smartsheet/expanded-form/Comments.vue +++ b/packages/nc-gui-v2/components/smartsheet/expanded-form/Comments.vue @@ -3,9 +3,17 @@ import { useExpandedFormStoreOrThrow } from '#imports' import { timeAgo } from '~/utils' import MdiKeyboardReturnIcon from '~icons/mdi/keyboard-return' import MdiAccountIcon from '~icons/mdi/account-circle' -import {colors} +import { enumColor } from '~/utils' -const { loadCommentsAndLogs, commentsAndLogs, isCommentsLoading, commentsOnly, saveComment,isYou } = useExpandedFormStoreOrThrow() +const { + loadCommentsAndLogs, + commentsAndLogs, + isCommentsLoading, + commentsOnly, + saveComment, + isYou, + comment, +} = useExpandedFormStoreOrThrow() await loadCommentsAndLogs() @@ -15,83 +23,54 @@ await loadCommentsAndLogs()
-
+
- - -

- {{ isYou(log.user) ? 'You' : log.user == null ? 'Shared base' : log.user }} - {{ log.op_type === 'COMMENT' ? 'commented' : log.op_sub_type === 'INSERT' ? 'created' : 'edited' }} -

- -

- {{ log.description }} -

- -

- -

- {{ timeAgo(log.created_at) }} -

-
- +
+
+ Comments only + +
+ mdi-account-circle + + +
- - - -
- mdi-account-circle - - - -
- + diff --git a/packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue b/packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue index f14b08cd00..a76ec3cf42 100644 --- a/packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui-v2/components/smartsheet/expanded-form/index.vue @@ -37,7 +37,7 @@ const drawerToggleIcon = computed(() => (commentsDrawer.value ? MdiDoorOpen : Md