@budibase/frontend-core 2.28.6 → 2.28.7

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,18 +1,18 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.28.6",
3
+ "version": "2.28.7",
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.28.6",
10
- "@budibase/shared-core": "2.28.6",
11
- "@budibase/types": "2.28.6",
9
+ "@budibase/bbui": "2.28.7",
10
+ "@budibase/shared-core": "2.28.7",
11
+ "@budibase/types": "2.28.7",
12
12
  "dayjs": "^1.10.8",
13
13
  "lodash": "4.17.21",
14
14
  "shortid": "2.2.15",
15
15
  "socket.io-client": "^4.6.1"
16
16
  },
17
- "gitHead": "bc810319e03346048231738ec87f781e438e9554"
17
+ "gitHead": "b1ed4509cf54dc3e0e52f8968ffcc1d76b198061"
18
18
  }
@@ -13,7 +13,7 @@
13
13
  } from "@budibase/bbui"
14
14
  import { FieldType, SearchFilterOperator } from "@budibase/types"
15
15
  import { generate } from "shortid"
16
- import { LuceneUtils, Constants } from "@budibase/frontend-core"
16
+ import { QueryUtils, Constants } from "@budibase/frontend-core"
17
17
  import { getContext } from "svelte"
18
18
  import FilterUsers from "./FilterUsers.svelte"
19
19
  import { getFields } from "../utils/searchFields"
@@ -112,7 +112,7 @@
112
112
  return []
113
113
  }
114
114
 
115
- return LuceneUtils.getValidOperatorsForType(
115
+ return QueryUtils.getValidOperatorsForType(
116
116
  filter,
117
117
  filter.field || filter.name,
118
118
  datasource
@@ -1,18 +1,22 @@
1
1
  <script>
2
2
  export let isMigrationDone
3
3
  export let onMigrationDone
4
- export let timeoutSeconds = 10 // 3 minutes
4
+ export let timeoutSeconds = 60 // 1 minute
5
+ export let minTimeSeconds = 3
5
6
 
6
7
  const loadTime = Date.now()
8
+ const intervalMs = 1000
7
9
  let timedOut = false
10
+ let secondsWaited = 0
8
11
 
9
12
  async function checkMigrationsFinished() {
10
13
  setTimeout(async () => {
11
14
  const isMigrated = await isMigrationDone()
12
15
 
13
16
  const timeoutMs = timeoutSeconds * 1000
14
- if (!isMigrated) {
17
+ if (!isMigrated || secondsWaited <= minTimeSeconds) {
15
18
  if (loadTime + timeoutMs > Date.now()) {
19
+ secondsWaited += 1
16
20
  return checkMigrationsFinished()
17
21
  }
18
22
 
@@ -20,7 +24,7 @@
20
24
  }
21
25
 
22
26
  onMigrationDone()
23
- }, 1000)
27
+ }, intervalMs)
24
28
  }
25
29
 
26
30
  checkMigrationsFinished()
@@ -41,6 +45,11 @@
41
45
  <span class="subtext">
42
46
  {#if !timedOut}
43
47
  Please wait and we will be back in a second!
48
+ <br />
49
+ Checkout the
50
+ <a href="https://docs.budibase.com/docs/app-migrations" target="_blank"
51
+ >documentation</a
52
+ > on app migrations.
44
53
  {:else}
45
54
  An error occurred, please try again later.
46
55
  <br />
@@ -1,10 +1,9 @@
1
1
  import { writable, derived, get } from "svelte/store"
2
2
  import { cloneDeep } from "lodash/fp"
3
- import { LuceneUtils } from "../utils"
3
+ import { QueryUtils } from "../utils"
4
4
  import { convertJSONSchemaToTableSchema } from "../utils/json"
5
5
 
6
- const { buildLuceneQuery, luceneLimit, runLuceneQuery, luceneSort } =
7
- LuceneUtils
6
+ const { buildQuery, limit: queryLimit, runQuery, sort } = QueryUtils
8
7
 
9
8
  /**
10
9
  * Parent class which handles the implementation of fetching data from an
@@ -177,10 +176,10 @@ export default class DataFetch {
177
176
  }
178
177
  }
179
178
 
180
- // Build the lucene query
179
+ // Build the query
181
180
  let query = this.options.query
182
181
  if (!query) {
183
- query = buildLuceneQuery(filter)
182
+ query = buildQuery(filter)
184
183
  }
185
184
 
186
185
  // Update store
@@ -229,17 +228,17 @@ export default class DataFetch {
229
228
 
230
229
  // If we don't support searching, do a client search
231
230
  if (!this.features.supportsSearch && clientSideSearching) {
232
- rows = runLuceneQuery(rows, query)
231
+ rows = runQuery(rows, query)
233
232
  }
234
233
 
235
234
  // If we don't support sorting, do a client-side sort
236
235
  if (!this.features.supportsSort && clientSideSorting) {
237
- rows = luceneSort(rows, sortColumn, sortOrder, sortType)
236
+ rows = sort(rows, sortColumn, sortOrder, sortType)
238
237
  }
239
238
 
240
239
  // If we don't support pagination, do a client-side limit
241
240
  if (!this.features.supportsPagination && clientSideLimiting) {
242
- rows = luceneLimit(rows, limit)
241
+ rows = queryLimit(rows, limit)
243
242
  }
244
243
 
245
244
  return {
@@ -1,7 +1,7 @@
1
1
  import { get } from "svelte/store"
2
2
  import DataFetch from "./DataFetch.js"
3
3
  import { TableNames } from "../constants"
4
- import { LuceneUtils } from "../utils"
4
+ import { QueryUtils } from "../utils"
5
5
 
6
6
  export default class UserFetch extends DataFetch {
7
7
  constructor(opts) {
@@ -33,7 +33,7 @@ export default class UserFetch extends DataFetch {
33
33
  let finalQuery
34
34
  // convert old format to new one - we now allow use of the lucene format
35
35
  const { appId, paginated, ...rest } = query
36
- if (!LuceneUtils.hasFilters(query) && rest.email != null) {
36
+ if (!QueryUtils.hasFilters(query) && rest.email != null) {
37
37
  finalQuery = { string: { email: rest.email } }
38
38
  } else {
39
39
  finalQuery = rest
@@ -1,4 +1,4 @@
1
- export { dataFilters as LuceneUtils } from "@budibase/shared-core"
1
+ export { dataFilters as QueryUtils } from "@budibase/shared-core"
2
2
  export * as JSONUtils from "./json"
3
3
  export * as CookieUtils from "./cookies"
4
4
  export * as RoleUtils from "./roles"