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

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

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

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

@ -405,7 +405,7 @@ export default class NcMetaMgr {
// check project already exist
if (await this.xcMeta.projectGetById(importProjectId)) {
// 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 {
// create the project if not found
await this.xcMeta.knex('nc_projects').insert(projectConfig);

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

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

Loading…
Cancel
Save