@budibase/frontend-core 2.6.8-alpha.7 → 2.6.9

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.6.8-alpha.7",
3
+ "version": "2.6.9",
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.6.8-alpha.7",
10
- "@budibase/shared-core": "2.6.8-alpha.7",
9
+ "@budibase/bbui": "^2.6.9",
10
+ "@budibase/shared-core": "^2.6.9",
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": "8dbc8a1e86558a8ce8cf1c2af931257eeed692eb"
16
+ "gitHead": "6f865d721e804c3112c15000908384b4f393b46f"
17
17
  }
package/src/api/groups.js CHANGED
@@ -52,20 +52,6 @@ export const buildGroupsEndpoints = API => {
52
52
  })
53
53
  },
54
54
 
55
- /**
56
- * Gets a group users by the group id
57
- */
58
- getGroupUsers: async ({ id, bookmark }) => {
59
- let url = `/api/global/groups/${id}/users?`
60
- if (bookmark) {
61
- url += `bookmark=${bookmark}`
62
- }
63
-
64
- return await API.get({
65
- url,
66
- })
67
- },
68
-
69
55
  /**
70
56
  * Adds users to a group
71
57
  * @param groupId The group to update
@@ -362,35 +362,13 @@ export default class DataFetch {
362
362
  return
363
363
  }
364
364
  this.store.update($store => ({ ...$store, loading: true }))
365
- const { rows, info, error, cursor } = await this.getPage()
366
-
367
- let { cursors } = get(this.store)
368
- const { pageNumber } = get(this.store)
369
-
370
- if (!rows.length && pageNumber > 0) {
371
- // If the full page is gone but we have previous pages, navigate to the previous page
372
- this.store.update($store => ({
373
- ...$store,
374
- loading: false,
375
- cursors: cursors.slice(0, pageNumber),
376
- }))
377
- return await this.prevPage()
378
- }
379
-
380
- const currentNextCursor = cursors[pageNumber + 1]
381
- if (currentNextCursor != cursor) {
382
- // If the current cursor changed, all the next pages need to be updated, so we mark them as stale
383
- cursors = cursors.slice(0, pageNumber + 1)
384
- cursors[pageNumber + 1] = cursor
385
- }
386
-
365
+ const { rows, info, error } = await this.getPage()
387
366
  this.store.update($store => ({
388
367
  ...$store,
389
368
  rows,
390
369
  info,
391
370
  loading: false,
392
371
  error,
393
- cursors,
394
372
  }))
395
373
  }
396
374
 
@@ -6,7 +6,6 @@ import NestedProviderFetch from "./NestedProviderFetch.js"
6
6
  import FieldFetch from "./FieldFetch.js"
7
7
  import JSONArrayFetch from "./JSONArrayFetch.js"
8
8
  import UserFetch from "./UserFetch.js"
9
- import GroupUserFetch from "./GroupUserFetch.js"
10
9
 
11
10
  const DataFetchMap = {
12
11
  table: TableFetch,
@@ -14,7 +13,6 @@ const DataFetchMap = {
14
13
  query: QueryFetch,
15
14
  link: RelationshipFetch,
16
15
  user: UserFetch,
17
- groupUser: GroupUserFetch,
18
16
 
19
17
  // Client specific datasource types
20
18
  provider: NestedProviderFetch,
@@ -1,50 +0,0 @@
1
- import { get } from "svelte/store"
2
- import DataFetch from "./DataFetch.js"
3
- import { TableNames } from "../constants"
4
-
5
- export default class GroupUserFetch extends DataFetch {
6
- constructor(opts) {
7
- super({
8
- ...opts,
9
- datasource: {
10
- tableId: TableNames.USERS,
11
- },
12
- })
13
- }
14
-
15
- determineFeatureFlags() {
16
- return {
17
- supportsSearch: true,
18
- supportsSort: false,
19
- supportsPagination: true,
20
- }
21
- }
22
-
23
- async getDefinition() {
24
- return {
25
- schema: {},
26
- }
27
- }
28
-
29
- async getData() {
30
- const { query, cursor } = get(this.store)
31
- try {
32
- const res = await this.API.getGroupUsers({
33
- id: query.groupId,
34
- bookmark: cursor,
35
- })
36
-
37
- return {
38
- rows: res?.users || [],
39
- hasNextPage: res?.hasNextPage || false,
40
- cursor: res?.bookmark || null,
41
- }
42
- } catch (error) {
43
- return {
44
- rows: [],
45
- hasNextPage: false,
46
- error,
47
- }
48
- }
49
- }
50
- }