Browse Source

fix: snapshot fixes

pull/9879/head
DarkPhoenix2704 9 hours ago
parent
commit
a4545964f5
  1. 0
      packages/nc-gui/components/dashboard/settings/base/Snapshots.vue
  2. 0
      packages/nc-gui/components/dashboard/settings/base/Visibility.vue
  3. 4
      packages/nc-gui/components/dashboard/settings/base/index.vue
  4. 3
      packages/nc-gui/components/general/WorkspaceIcon.vue
  5. 2
      packages/nc-gui/components/project/View.vue
  6. 5
      packages/nc-gui/composables/useBaseSettings.ts
  7. 47
      packages/nocodb/src/models/Comment.ts
  8. 6
      packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

0
packages/nc-gui/components/dashboard/settings/BaseSettings/Snapshots.vue → packages/nc-gui/components/dashboard/settings/base/Snapshots.vue

0
packages/nc-gui/components/dashboard/settings/BaseSettings/Visibility.vue → packages/nc-gui/components/dashboard/settings/base/Visibility.vue

4
packages/nc-gui/components/dashboard/settings/BaseSettings.vue → packages/nc-gui/components/dashboard/settings/base/index.vue

@ -71,8 +71,8 @@ onMounted(() => {
<!-- Data Pane -->
<div class="flex flex-col w-[760px]">
<DashboardSettingsBaseSettingsSnapshots v-if="activeMenu === 'snapshots'" />
<DashboardSettingsBaseSettingsVisibility v-if="activeMenu === 'visibility'" />
<DashboardSettingsBaseSnapshots v-if="activeMenu === 'snapshots'" />
<DashboardSettingsBaseVisibility v-if="activeMenu === 'visibility'" />
</div>
</div>
</template>

3
packages/nc-gui/components/general/WorkspaceIcon.vue

@ -11,7 +11,7 @@ const props = defineProps<{
iconType: WorkspaceIconType | string
}
hideLabel?: boolean
size?: 'small' | 'medium' | 'large' | 'xlarge' | 'middle'
size?: 'small' | 'medium' | 'large' | 'xlarge'
isRounded?: boolean
}>()
@ -74,7 +74,6 @@ const size = computed(() => props.size || 'medium')
:class="{
'min-w-4 w-4 h-4 rounded': size === 'small',
'min-w-6 w-6 h-6 rounded-md': size === 'medium',
'min-w-8 w-6 h-8 rounded-md': size === 'middle',
'min-w-10 w-10 h-10 rounded-lg !text-base': size === 'large',
'min-w-16 w-16 h-16 rounded-lg !text-4xl': size === 'xlarge',
'!rounded-[50%]': props.isRounded,

2
packages/nc-gui/components/project/View.vue

@ -210,7 +210,7 @@ watch(
<div>{{ $t('activity.settings') }}</div>
</div>
</template>
<DashboardSettingsBaseSettings :base-id="base.id!" class="max-h-full" />
<DashboardSettingsBase :base-id="base.id!" class="max-h-full" />
</a-tab-pane>
</a-tabs>
</div>

5
packages/nc-gui/composables/useBaseSettings.ts

@ -1,5 +0,0 @@
import { createSharedComposable } from '@vueuse/core'
export const useBaseSettings = createSharedComposable(() => {
return {}
})

47
packages/nocodb/src/models/Comment.ts

@ -46,16 +46,45 @@ export default class Comment implements CommentType {
fk_model_id: string,
ncMeta = Noco.ncMeta,
): Promise<Comment[]> {
const commentList = await ncMeta
.knex(MetaTable.COMMENTS)
.select(`${MetaTable.COMMENTS}.*`)
.where('fk_model_id', fk_model_id)
.where(function () {
this.whereNull('is_deleted').orWhere('is_deleted', '!=', true);
})
.orderBy('created_at', 'asc');
const READ_BATCH_SIZE = 1000;
const allComments: Comment[] = [];
let fetchNextBatch = true;
for (let offset = 0; fetchNextBatch; offset += READ_BATCH_SIZE) {
const comments = await ncMeta.metaList2(
context.workspace_id,
context.base_id,
MetaTable.COMMENTS,
{
condition: {
fk_model_id,
},
orderBy: {
created_at: 'asc'
},
limit: READ_BATCH_SIZE + 1,
offset,
xcCondition: [
{
_or: [
{ is_deleted: null },
{ is_deleted: false },
]
}
]
}
);
return commentList.map((comment) => new Comment(comment));
const batchComments = comments
.slice(0, READ_BATCH_SIZE)
.map(comment => new Comment(comment));
allComments.push(...batchComments);
fetchNextBatch = comments.length > READ_BATCH_SIZE;
}
return allComments;
}
public static async list(

6
packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

@ -380,7 +380,7 @@ export class ExportService {
}
}
const searializedComments = [];
const serializedComments = [];
if (!excludeComments) {
const comments = await Comment.listByModel(context, model.id);
@ -388,7 +388,7 @@ export class ExportService {
for (const comment of comments) {
idMap.set(comment.id, `${idMap.get(model.id)}::${comment.id}`);
searializedComments.push({
serializedComments.push({
id: idMap.get(comment.id),
fk_model_id: idMap.get(comment.fk_model_id),
row_id: comment.row_id,
@ -470,7 +470,7 @@ export class ExportService {
view: view.view,
})),
hooks: serializedHooks,
comments: searializedComments,
comments: serializedComments,
});
}

Loading…
Cancel
Save