Browse Source

Merge pull request #4495 from nocodb/fix/page-switch-bug

fix(nc-gui): page swtich bug + gallery display bug
pull/4497/head
Pranav C 2 years ago committed by GitHub
parent
commit
381577b328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/app.vue
  2. 7
      packages/nc-gui/components/smartsheet/Gallery.vue
  3. 7
      packages/nc-gui/components/smartsheet/Kanban.vue
  4. 5
      packages/nc-gui/pages/account/index/users.vue
  5. 2
      packages/nc-gui/pages/account/index/users/[[nestedPage]].vue
  6. 6
      packages/nc-gui/pages/index/index/index.vue
  7. 4
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

2
packages/nc-gui/app.vue

@ -36,7 +36,7 @@ if (typeof window !== 'undefined') {
<template>
<a-config-provider>
<NuxtLayout :name="disableBaseLayout ? false : 'base'">
<NuxtPage :key="key" />
<NuxtPage :transition="false" :key="key" />
</NuxtLayout>
</a-config-provider>
</template>

7
packages/nc-gui/components/smartsheet/Gallery.vue

@ -80,7 +80,12 @@ const isRowEmpty = (record: any, col: any) => {
const attachments = (record: any): Attachment[] => {
try {
return coverImageColumn?.title && record.row[coverImageColumn.title] ? JSON.parse(record.row[coverImageColumn.title]) : []
if (coverImageColumn?.title && record.row[coverImageColumn.title]) {
return typeof record.row[coverImageColumn.title] === 'string'
? JSON.parse(record.row[coverImageColumn.title])
: record.row[coverImageColumn.title]
}
return []
} catch (e) {
return []
}

7
packages/nc-gui/components/smartsheet/Kanban.vue

@ -116,7 +116,12 @@ reloadViewDataHook?.on(async () => {
const attachments = (record: any): Attachment[] => {
try {
return coverImageColumn?.title && record.row[coverImageColumn.title] ? JSON.parse(record.row[coverImageColumn.title]) : []
if (coverImageColumn?.title && record.row[coverImageColumn.title]) {
return typeof record.row[coverImageColumn.title] === 'string'
? JSON.parse(record.row[coverImageColumn.title])
: record.row[coverImageColumn.title]
}
return []
} catch (e) {
return []
}

5
packages/nc-gui/pages/account/index/users.vue

@ -1,5 +0,0 @@
<template>
<div class="h-full overflow-y-scroll scrollbar-thin-dull pt-2">
<NuxtPage />
</div>
</template>

2
packages/nc-gui/pages/account/index/users/[[nestedPage]].vue

@ -5,6 +5,7 @@ const { isUIAllowed } = useUIPermission()
</script>
<template>
<div class="h-full overflow-y-scroll scrollbar-thin-dull pt-2">
<template
v-if="
$route.params.nestedPage === 'password-reset' ||
@ -19,4 +20,5 @@ const { isUIAllowed } = useUIPermission()
<template v-else-if="isUIAllowed('superAdminUserManagement')">
<LazyAccountUserList />
</template>
</div>
</template>

6
packages/nc-gui/pages/index/index/index.vue

@ -212,7 +212,9 @@ const copyProjectMeta = async () => {
</a-dropdown>
</div>
<Transition name="layout" mode="out-in">
<!--
TODO: bring back transition after fixing the bug with navigation
<Transition name="layout" mode="out-in"> -->
<div v-if="isLoading">
<a-skeleton />
</div>
@ -297,7 +299,7 @@ const copyProjectMeta = async () => {
</template>
</a-table-column>
</a-table>
</Transition>
<!-- </Transition> -->
</div>
</template>

4
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -2617,7 +2617,9 @@ class BaseModelSqlv2 {
const proto = await this.getProto();
const result = (await groupedQb)?.map((d) => {
let data = await groupedQb;
data = this.convertAttachmentType(data);
const result = data?.map((d) => {
d.__proto__ = proto;
return d;
});

Loading…
Cancel
Save