Browse Source

fix: project import issues

Correction in error message and added import permission to user role

re #400

Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
pull/414/head
Pranav C 3 years ago
parent
commit
da94db14f8
  1. 10
      packages/nc-gui/components/project/settings/xcMeta.vue
  2. 6
      packages/nc-gui/pages/projects/index.vue
  3. 2
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts
  4. 8
      packages/nocodb/src/lib/utils/projectAcl.ts

10
packages/nc-gui/components/project/settings/xcMeta.vue

@ -180,7 +180,7 @@ export default {
]) ])
this.$toast.success('Successfully exported metadata').goAway(3000) this.$toast.success('Successfully exported metadata').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -217,7 +217,7 @@ export default {
link.click() link.click()
this.$toast.success('Successfully exported metadata').goAway(3000) this.$toast.success('Successfully exported metadata').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -242,7 +242,7 @@ export default {
]) ])
this.$toast.success('Metadata cleared successfully').goAway(3000) this.$toast.success('Metadata cleared successfully').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -268,7 +268,7 @@ export default {
this.$toast.success('Metadata imported successfully').goAway(3000) this.$toast.success('Metadata imported successfully').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -292,7 +292,7 @@ export default {
]) ])
this.$toast.success('Successfully imported metadata').goAway(3000) this.$toast.success('Successfully imported metadata').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null

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

@ -999,7 +999,7 @@ export default {
.success('Successfully exported metadata') .success('Successfully exported metadata')
.goAway(3000) .goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -1025,7 +1025,7 @@ export default {
]) ])
this.$toast.success('Metadata cleared successfully').goAway(3000) this.$toast.success('Metadata cleared successfully').goAway(3000)
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null
@ -1056,7 +1056,7 @@ export default {
this.$toast.success('Successfully imported metadata').goAway(3000) this.$toast.success('Successfully imported metadata').goAway(3000)
await this.projectsLoad() await this.projectsLoad()
} catch (e) { } catch (e) {
this.$toast.error('Some internal error occurred').goAway(3000) this.$toast.error(e.message).goAway(3000)
} }
this.dialogShow = false this.dialogShow = false
this.loading = null this.loading = null

2
packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts

@ -405,7 +405,7 @@ export default class NcMetaMgr {
// check project already exist // check project already exist
if (await this.xcMeta.projectGetById(importProjectId)) { if (await this.xcMeta.projectGetById(importProjectId)) {
// todo: // todo:
throw new Error(`Project with id '${importProjectId}' already exist`) throw new Error(`Project with id '${importProjectId}' already exist, it's not allowed at the moment`)
} else { } else {
// create the project if not found // create the project if not found
await this.xcMeta.knex('nc_projects').insert(projectConfig); await this.xcMeta.knex('nc_projects').insert(projectConfig);

8
packages/nocodb/src/lib/utils/projectAcl.ts

@ -4,7 +4,7 @@ export default {
guest: {}, guest: {},
editor: { editor: {
xcAuditCreate: true, xcAuditCreate: true,
xcAttachmentUpload:true, xcAttachmentUpload: true,
xcVirtualTableList: true, xcVirtualTableList: true,
xcMetaTablesImportZipToLocalFsAndDb: false, xcMetaTablesImportZipToLocalFsAndDb: false,
// testConnection:true, // testConnection:true,
@ -164,7 +164,7 @@ export default {
xcModelRowAuditAndCommentList: true, xcModelRowAuditAndCommentList: true,
xcAuditCommentInsert: true, xcAuditCommentInsert: true,
xcAuditModelCommentsCount:true xcAuditModelCommentsCount: true
}, },
commenter: { commenter: {
xcVirtualTableList: true, xcVirtualTableList: true,
@ -188,7 +188,7 @@ export default {
xcModelRowAuditAndCommentList: true, xcModelRowAuditAndCommentList: true,
xcAuditCommentInsert: true, xcAuditCommentInsert: true,
xcAuditModelCommentsCount:true xcAuditModelCommentsCount: true
}, viewer: { }, viewer: {
xcVirtualTableList: true, xcVirtualTableList: true,
projectList: true, projectList: true,
@ -219,6 +219,8 @@ export default {
projectDelete: false, projectDelete: false,
projectRestart: false, projectRestart: false,
projectStart: false, projectStart: false,
xcMetaTablesImportZipToLocalFsAndDb: true,
xcMetaTablesExportDbToZip: true
} }
} }

Loading…
Cancel
Save