diff --git a/packages/frontend-core/src/components/grid/stores/columns.js b/packages/frontend-core/src/components/grid/stores/columns.js index 36fb6659a9..4358deeb2c 100644 --- a/packages/frontend-core/src/components/grid/stores/columns.js +++ b/packages/frontend-core/src/components/grid/stores/columns.js @@ -164,7 +164,6 @@ export const initialise = context => { } // Override a few properties for primary display if (field === primaryDisplay) { - column.visible = true column.order = 0 column.primaryDisplay = true } diff --git a/packages/frontend-core/src/fetch/ViewV2Fetch.js b/packages/frontend-core/src/fetch/ViewV2Fetch.js index 40135746df..6bfef0927f 100644 --- a/packages/frontend-core/src/fetch/ViewV2Fetch.js +++ b/packages/frontend-core/src/fetch/ViewV2Fetch.js @@ -1,3 +1,4 @@ +import { ViewV2Type } from "@budibase/types" import DataFetch from "./DataFetch.js" import { get } from "svelte/store" @@ -39,6 +40,19 @@ export default class ViewV2Fetch extends DataFetch { this.options const { cursor, query, definition } = get(this.store) + // If this is a calculation view and we have no calculations, return nothing + if ( + definition.type === ViewV2Type.CALCULATION && + !Object.values(definition.schema || {}).some(x => x.calculationType) + ) { + return { + rows: [], + hasNextPage: false, + cursor: null, + error: null, + } + } + // If sort/filter params are not defined, update options to store the // params built in to this view. This ensures that we can accurately // compare old and new params and skip a redundant API call. @@ -67,6 +81,7 @@ export default class ViewV2Fetch extends DataFetch { return { rows: [], hasNextPage: false, + cursor: null, error, } }