Browse Source

feat: show not found if a view doesn't exist

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/644/head
Pranav C 3 years ago
parent
commit
6cc85d00f8
  1. 14
      packages/nc-gui/components/project/spreadsheet/public/xcForm.vue
  2. 8
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts

14
packages/nc-gui/components/project/spreadsheet/public/xcForm.vue

@ -1,6 +1,10 @@
<template>
<v-container class="h-100 j-excel-container">
<v-row :class="{'d-flex justify-center': submitted}">
<v-alert v-if="notFound" type="warning" class="mx-auto mt-10" outlined max-width="300">
Not found
</v-alert>
<v-row v-else :class="{'d-flex justify-center': submitted}">
<template v-if="submitted">
<v-col class="d-flex justify-center">
<div v-if="localParams && localParams.submit" style="min-width: 350px">
@ -226,7 +230,8 @@ export default {
dbAlias: '',
virtual: {},
metas: {},
secondsRemain: null
secondsRemain: null,
notFound: false
}
},
computed: {
@ -314,9 +319,12 @@ export default {
this.localParams = (this.query_params.extraViewParams && this.query_params.extraViewParams.formParams) || {}
} catch (e) {
console.log(e)
if (e.message === 'Not found') {
this.notFound = true
} else {
this.showPasswordModal = true
}
}
this.loadingData = false
},

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

@ -3537,7 +3537,6 @@ export default class NcMetaMgr {
}
protected async sharedViewGet(_req, args: any): Promise<any> {
try {
const viewMeta = await this.xcMeta
.knex('nc_shared_views')
.where({
@ -3545,6 +3544,10 @@ export default class NcMetaMgr {
})
.first();
if (!viewMeta) {
throw new Error('Not found');
}
// todo : filter out columns of related table
try {
const apiBuilder = this.app?.projectBuilders
@ -3576,9 +3579,6 @@ export default class NcMetaMgr {
}
return viewMeta;
} catch (e) {
throw e;
}
}
protected async xcAuthHookGet(args: any): Promise<any> {

Loading…
Cancel
Save