Browse Source

fix: shared form pagination related issues (#8451)

pull/8470/head
Pranav C 6 months ago committed by GitHub
parent
commit
5e1dd6231d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nc-gui/components/smartsheet/Form.vue
  2. 5
      packages/nc-gui/components/smartsheet/Pagination.vue
  3. 2
      packages/nc-gui/composables/useSharedView.ts
  4. 6
      packages/nc-gui/composables/useViewData.ts

4
packages/nc-gui/components/smartsheet/Form.vue

@ -1263,7 +1263,9 @@ useEventListener(
</div>
<!-- Field text -->
<div class="nc-form-field-text p-4 flex flex-col gap-4 border-b border-gray-200">
<div class="text-base font-bold text-gray-600">{{ $t('objects.field') }} {{ $t('general.text').toLowerCase() }}</div>
<div class="text-base font-bold text-gray-600">
{{ $t('objects.field') }} {{ $t('general.text').toLowerCase() }}
</div>
<a-textarea
ref="focusLabel"

5
packages/nc-gui/components/smartsheet/Pagination.vue

@ -62,6 +62,11 @@ const size = computed({
get: () => vPaginationData.value?.pageSize ?? 25,
set: (size: number) => {
if (vPaginationData.value) {
// if there is no change in size then return
if (vPaginationData.value?.pageSize && vPaginationData.value?.pageSize === size) {
return
}
vPaginationData.value.pageSize = size
if (vPaginationData.value.totalRows && page.value * size < vPaginationData.value.totalRows) {

2
packages/nc-gui/composables/useSharedView.ts

@ -129,12 +129,12 @@ export function useSharedView() {
const page = paginationData.value.page || 1
const pageSize = paginationData.value.pageSize || appInfoDefaultLimit
param.offset = (page - 1) * pageSize
param.limit = sharedView.value?.type === ViewTypes.MAP ? 1000 : pageSize
}
return await $api.public.dataList(
sharedView.value.uuid!,
{
limit: sharedView.value?.type === ViewTypes.MAP ? 1000 : undefined,
...param,
filterArrJson: JSON.stringify(param.filtersArr ?? nestedFilters.value),
sortArrJson: JSON.stringify(param.sortsArr ?? sorts.value),

6
packages/nc-gui/composables/useViewData.ts

@ -200,6 +200,12 @@ export function useViewData(
}
formattedData.value = formatData(response.list)
paginationData.value = response.pageInfo || paginationData.value || {}
// if public then update sharedPaginationData
if (isPublic.value) {
sharedPaginationData.value = paginationData.value
}
excludePageInfo.value = !response.pageInfo
isPaginationLoading.value = false

Loading…
Cancel
Save