@budibase/frontend-core 2.7.26-alpha.1 → 2.7.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.7.26-alpha.1",
3
+ "version": "2.7.27",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
7
7
  "svelte": "src/index.js",
8
8
  "dependencies": {
9
- "@budibase/bbui": "2.7.26-alpha.1",
10
- "@budibase/shared-core": "2.7.26-alpha.1",
9
+ "@budibase/bbui": "2.7.27",
10
+ "@budibase/shared-core": "2.7.27",
11
11
  "dayjs": "^1.11.7",
12
12
  "lodash": "^4.17.21",
13
13
  "socket.io-client": "^4.6.1",
14
14
  "svelte": "^3.46.2"
15
15
  },
16
- "gitHead": "a89f0e874997657b1b417822525b14cadc44e89f"
16
+ "gitHead": "0453f123e28af481989ddd38b703fa8f6cac3e50"
17
17
  }
@@ -26,16 +26,13 @@ export const buildDatasourceEndpoints = API => ({
26
26
  * Creates a datasource
27
27
  * @param datasource the datasource to create
28
28
  * @param fetchSchema whether to fetch the schema or not
29
- * @param tablesFilter a list of tables to actually fetch rather than simply
30
- * all that are accessible.
31
29
  */
32
- createDatasource: async ({ datasource, fetchSchema, tablesFilter }) => {
30
+ createDatasource: async ({ datasource, fetchSchema }) => {
33
31
  return await API.post({
34
32
  url: "/api/datasources",
35
33
  body: {
36
34
  datasource,
37
35
  fetchSchema,
38
- tablesFilter,
39
36
  },
40
37
  })
41
38
  },
@@ -72,15 +69,4 @@ export const buildDatasourceEndpoints = API => ({
72
69
  body: { datasource },
73
70
  })
74
71
  },
75
-
76
- /**
77
- * Fetch table names available within the datasource, for filtering out undesired tables
78
- * @param datasource the datasource configuration to use for fetching tables
79
- */
80
- fetchInfoForDatasource: async datasource => {
81
- return await API.post({
82
- url: `/api/datasources/info`,
83
- body: { datasource },
84
- })
85
- },
86
72
  })
@@ -2,6 +2,7 @@ import { writable, derived, get } from "svelte/store"
2
2
  import { fetchData } from "../../../fetch/fetchData"
3
3
  import { notifications } from "@budibase/bbui"
4
4
  import { NewRowID, RowPageSize } from "../lib/constants"
5
+ import { tick } from "svelte"
5
6
 
6
7
  const initialSortState = {
7
8
  column: null,
@@ -124,13 +125,22 @@ export const deriveStores = context => {
124
125
  })
125
126
 
126
127
  // Subscribe to changes of this fetch model
127
- unsubscribe = newFetch.subscribe($fetch => {
128
+ unsubscribe = newFetch.subscribe(async $fetch => {
128
129
  if ($fetch.loaded && !$fetch.loading) {
129
130
  hasNextPage.set($fetch.hasNextPage)
130
131
  const $instanceLoaded = get(instanceLoaded)
131
132
  const resetRows = $fetch.resetKey !== lastResetKey
133
+ const previousResetKey = lastResetKey
132
134
  lastResetKey = $fetch.resetKey
133
135
 
136
+ // If resetting rows due to a table change, wipe data and wait for
137
+ // derived stores to compute. This prevents stale data being passed
138
+ // to cells when we save the new schema.
139
+ if (!$instanceLoaded && previousResetKey) {
140
+ rows.set([])
141
+ await tick()
142
+ }
143
+
134
144
  // Reset state properties when dataset changes
135
145
  if (!$instanceLoaded || resetRows) {
136
146
  table.set($fetch.definition)