Browse Source

fix: show missing fields in shared form view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/644/head
Pranav C 3 years ago
parent
commit
14950540c3
  1. 1
      packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
  2. 6
      packages/nc-gui/components/project/spreadsheet/public/xcForm.vue

1
packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue

@ -761,6 +761,7 @@ export default {
fields: Object.keys(this.showFields)
.filter(f => this.showFields[f])
.join(','),
showFields: this.showFields,
fieldsOrder: this.fieldsOrder,
extraViewParams: this.extraViewParams,
selectedViewId: this.selectedViewId

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

@ -274,7 +274,9 @@ export default {
this.dbAlias = dbAlias
this.metas = relatedTableMetas
const fields = this.query_params.fieldsOrder || []
const showFields = this.query_params.showFields || {}
let fields = this.query_params.fieldsOrder || []
if (!fields.length) { fields = Object.keys(showFields) }
// eslint-disable-next-line camelcase
let columns = this.meta.columns
@ -308,7 +310,7 @@ export default {
})
}
// this.modelName = model_name
this.columns = columns.filter(c => fields.includes(c.alias)).sort((a, b) => fields.indexOf(a.alias) - fields.indexOf(b.alias))
this.columns = columns.filter(c => showFields[c.alias]).sort((a, b) => fields.indexOf(a.alias) - fields.indexOf(b.alias))
this.localParams = (this.query_params.extraViewParams && this.query_params.extraViewParams.formParams) || {}
} catch (e) {

Loading…
Cancel
Save