Browse Source

fix: keep view order on duplicate

Signed-off-by: mertmit <mertmit99@gmail.com>
feat/export-nest
mertmit 2 years ago
parent
commit
3365b083de
  1. 12
      packages/nocodb/src/modules/jobs/export-import/import.service.ts

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

@ -24,6 +24,7 @@ import { FormsService } from '../../../services/forms.service';
import { GalleriesService } from '../../../services/galleries.service';
import { KanbansService } from '../../../services/kanbans.service';
import { HooksService } from '../../../services/hooks.service';
import { ViewsService } from '../../../services/views.service';
import NcPluginMgrv2 from '../../../helpers/NcPluginMgrv2';
import { BulkDataAliasService } from '../../../services/bulk-data-alias.service';
import type { ViewCreateReqType } from 'nocodb-sdk';
@ -45,6 +46,7 @@ export class ImportService {
private kanbansService: KanbansService,
private bulkDataService: BulkDataAliasService,
private hooksService: HooksService,
private viewsService: ViewsService,
) {}
async importModels(param: {
@ -938,6 +940,16 @@ export class ImportService {
case ViewTypes.KANBAN:
break;
}
// fix view order (view insert will always put it at the end)
if (view.order !== vw.order) {
await this.viewsService.viewUpdate({
viewId: vw.id,
view: {
order: view.order,
},
});
}
}
}

Loading…
Cancel
Save