Browse Source

Merge pull request #4831 from nocodb/fix/4830-broken-form-view

Fix:Broken shared form view
pull/4832/head
Pranav C 2 years ago committed by GitHub
parent
commit
1ed41fd24a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      packages/nc-gui/composables/useSharedFormViewStore.ts
  2. 2
      packages/nocodb-sdk/src/lib/Api.ts
  3. 3
      scripts/sdk/swagger.json

13
packages/nc-gui/composables/useSharedFormViewStore.ts

@ -43,7 +43,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const { metas, setMeta } = useMetas() const { metas, setMeta } = useMetas()
const { loadProject } = useProject() const { project } = useProject()
const { t } = useI18n() const { t } = useI18n()
@ -86,7 +86,16 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
await setMeta(viewMeta.model) await setMeta(viewMeta.model)
await loadProject(true, viewMeta.project_id) // if project is not defined then set it with an object containing base
if (!project.value?.bases)
project.value = {
bases: [
{
id: viewMeta.base_id,
type: viewMeta.client,
},
],
}
const relatedMetas = { ...viewMeta.relatedMetas } const relatedMetas = { ...viewMeta.relatedMetas }

2
packages/nocodb-sdk/src/lib/Api.ts

@ -4004,6 +4004,7 @@ export class Api<
* @response `200` `(ViewType & { * @response `200` `(ViewType & {
relatedMetas?: any, relatedMetas?: any,
client?: string, client?: string,
base_id?: string,
columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType),
model?: TableType, model?: TableType,
@ -4017,6 +4018,7 @@ export class Api<
ViewType & { ViewType & {
relatedMetas?: any; relatedMetas?: any;
client?: string; client?: string;
base_id?: string;
columns?: (GridColumnType | FormColumnType | GalleryColumnType) & columns?: (GridColumnType | FormColumnType | GalleryColumnType) &
ColumnType; ColumnType;
model?: TableType; model?: TableType;

3
scripts/sdk/swagger.json

@ -5529,6 +5529,9 @@
"client": { "client": {
"type": "string" "type": "string"
}, },
"base_id": {
"type": "string"
},
"columns": { "columns": {
"allOf": [ "allOf": [
{ {

Loading…
Cancel
Save