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>() const commentsWrapperEl = ref<HTMLDivElement>()
onMounted(async () => { const auditTabDomRef = (e: HTMLElement) => {
await loadCommentsAndLogs() e.scrollTop = e.scrollHeight
}) }
const { user } = useGlobal() const { user } = useGlobal()

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

@ -221,11 +221,13 @@ onMounted(async () => {
isLoading.value = true isLoading.value = true
if (props.loadRow) { if (props.loadRow) {
await _loadRow() await _loadRow()
await loadCommentsAndLogs()
} }
if (props.rowId) { if (props.rowId) {
try { try {
await _loadRow(props.rowId) await _loadRow(props.rowId)
await loadCommentsAndLogs()
} catch (e: any) { } catch (e: any) {
if (e.response?.status === 404) { if (e.response?.status === 404) {
// todo: i18n // 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 class="items-center flex gap-1 min-w-[60px]">
<div <div
v-if="!readOnly || !isLocked || isMobileMode" 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 }" :class="{ toggle: !readOnly, hidden: row.rowMeta.selected }"
> >
{{ ((paginationDataRef?.page ?? 1) - 1) * (paginationDataRef?.pageSize ?? 25) + rowIndex + 1 }} {{ ((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 = '' comment.value = ''
reloadTrigger?.trigger()
await loadCommentsAndLogs() await loadCommentsAndLogs()
} catch (e: any) { } catch (e: any) {
message.error(e.message) message.error(e.message)
@ -269,12 +271,6 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
addOrEditStackRow(row.value, isNewRow) 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() changedColumns.value = new Set()
} catch (e: any) { } catch (e: any) {
message.error(`${t('msg.error.rowUpdateFailed')}: ${await extractSdkResponseErrorMsg(e)}`) message.error(`${t('msg.error.rowUpdateFailed')}: ${await extractSdkResponseErrorMsg(e)}`)

Loading…
Cancel
Save