Browse Source

fix(nc-gui): Fixed issue with comment not loadning and syncing with the grid comment count

pull/6574/head
Muhammed Mustafa 1 year ago
parent
commit
a8f96c70b4
  1. 6
      packages/nc-gui/components/smartsheet/expanded-form/Comments.vue
  2. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 8
      packages/nc-gui/composables/useExpandedFormStore.ts

6
packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

@ -8,9 +8,9 @@ const { loadCommentsAndLogs, commentsAndLogs, saveComment: _saveComment, comment
const commentsWrapperEl = ref<HTMLDivElement>()
onMounted(async () => {
await loadCommentsAndLogs()
})
const auditTabDomRef = (e: HTMLElement) => {
e.scrollTop = e.scrollHeight
}
const { user } = useGlobal()

2
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -221,11 +221,13 @@ onMounted(async () => {
isLoading.value = true
if (props.loadRow) {
await _loadRow()
await loadCommentsAndLogs()
}
if (props.rowId) {
try {
await _loadRow(props.rowId)
await loadCommentsAndLogs()
} catch (e: any) {
if (e.response?.status === 404) {
// todo: i18n

8
packages/nc-gui/composables/useExpandedFormStore.ts

@ -143,6 +143,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
comment.value = ''
reloadTrigger?.trigger()
await loadCommentsAndLogs()
} catch (e: any) {
message.error(e.message)
@ -269,12 +271,6 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
addOrEditStackRow(row.value, isNewRow)
}
// trim the display value if greater than 20chars
const trimmedDisplayValue =
displayValue.value && displayValue.value?.length > 20 ? `${displayValue.value?.substring(0, 20)}...` : displayValue.value
message.success(`${trimmedDisplayValue || 'Row'} updated successfully.`)
changedColumns.value = new Set()
} catch (e: any) {
message.error(`${t('msg.error.rowUpdateFailed')}: ${await extractSdkResponseErrorMsg(e)}`)

Loading…
Cancel
Save