Browse Source

feat: public grid view height adjustment

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/679/head
Pranav C 3 years ago
parent
commit
9d4d7a0434
  1. 30
      packages/nc-gui/components/project/spreadsheet/public/xcTable.vue
  2. 2
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts
  3. 4
      packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

30
packages/nc-gui/components/project/spreadsheet/public/xcTable.vue

@ -121,12 +121,12 @@
<div
v-if="meta"
class="nc-grid-wrapper d-flex"
:class="`cell-height-${cellHeight}`"
style="overflow:auto;transition: width 500ms "
class="d-flex"
>
<div class="flex-grow-1 h-100" style="overflow-y: auto">
<div ref="table" style=" overflow: auto;width:100%">
<div ref="table" class="nc-grid" style=" overflow: auto;width:100%">
<v-skeleton-loader v-if="loadingData" type="table" />
<xc-grid-view
@ -375,24 +375,6 @@ export default {
} catch (e) {
console.log(e)
}
if (this.data.length) {
// eslint-disable-next-line no-unused-vars
const options = {
...this.options,
columns: [...this.meta.columns.map((col) => {
return {
readOnly: col.ai,
type: typeof this.data[0][col._cn],
title: col._cn,
width: '150px'
}
}), {
type: 'hidden',
key: ''
}]
}
}
this.searchField = this.primaryValueColumn
},
created() {
@ -706,6 +688,14 @@ export default {
justify-content: center;
}
.nc-grid-wrapper{
height:calc(100vh - 120px)
}
.nc-grid{
height: calc(100% - 34px)
}
</style>
<!--

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

@ -3796,7 +3796,7 @@ export default class NcMetaMgr {
} catch (e) {
console.log(e);
}
viewMeta.query_params = JSON.parse(viewMeta.query_params);
viewMeta.query_params = JSON.parse(viewMeta.query_params) || {};
viewMeta.meta = {
...viewMeta.meta,

4
packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

@ -152,7 +152,7 @@ export default class NcMetaMgrEE extends NcMetaMgr {
if (!model) {
throw new Error('Meta not found');
}
const queryParams = JSON.parse(viewMeta.query_params);
const queryParams = JSON.parse(viewMeta.query_params) || {};
if (!meta) {
throw new Error('Meta not found');
@ -172,7 +172,7 @@ export default class NcMetaMgrEE extends NcMetaMgr {
// todo: move this logic to a common library
// todo: replace with condition prop
const privateViewWhere = queryParams.filters?.reduce?.(
const privateViewWhere = queryParams?.filters?.reduce?.(
(condition, filt, i) => {
if (!i && !filt.logicOp) {
return condition;

Loading…
Cancel
Save