Browse Source

Merge pull request #6574 from nocodb/nc-fix/expanded-form-bug-fix

Expanded form bug fix
pull/6575/head
Muhammed Mustafa 11 months ago committed by GitHub
parent
commit
9a06175a58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nc-gui/components/smartsheet/expanded-form/Comments.vue
  2. 2
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  4. 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

2
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -1358,7 +1358,7 @@ const handleCellClick = (event: MouseEvent, row: number, col: number) => {
<div class="items-center flex gap-1 min-w-[60px]">
<div
v-if="!readOnly || !isLocked || isMobileMode"
class="nc-row-no text-xs text-gray-500"
class="nc-row-no sm:min-w-4 text-xs text-gray-500"
:class="{ toggle: !readOnly, hidden: row.rowMeta.selected }"
>
{{ ((paginationDataRef?.page ?? 1) - 1) * (paginationDataRef?.pageSize ?? 25) + rowIndex + 1 }}

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