@budibase/server 2.4.2 → 2.4.4-alpha.0

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.
@@ -18,7 +18,7 @@ const backend_core_1 = require("@budibase/backend-core");
18
18
  const environment_1 = __importDefault(require("../environment"));
19
19
  const pro_1 = require("@budibase/pro");
20
20
  function updateAppRole(user, { appId } = {}) {
21
- var _a, _b;
21
+ var _a;
22
22
  appId = appId || backend_core_1.context.getAppId();
23
23
  if (!user || !user.roles) {
24
24
  return user;
@@ -41,9 +41,6 @@ function updateAppRole(user, { appId } = {}) {
41
41
  else if (!user.roleId && !((_a = user === null || user === void 0 ? void 0 : user.userGroups) === null || _a === void 0 ? void 0 : _a.length)) {
42
42
  user.roleId = backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC;
43
43
  }
44
- else if ((_b = user === null || user === void 0 ? void 0 : user.userGroups) === null || _b === void 0 ? void 0 : _b.length) {
45
- user.roleId = undefined;
46
- }
47
44
  delete user.roles;
48
45
  return user;
49
46
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.4.2",
4
+ "version": "2.4.4-alpha.0",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -43,11 +43,11 @@
43
43
  "license": "GPL-3.0",
44
44
  "dependencies": {
45
45
  "@apidevtools/swagger-parser": "10.0.3",
46
- "@budibase/backend-core": "^2.4.2",
47
- "@budibase/client": "^2.4.2",
48
- "@budibase/pro": "2.4.1",
49
- "@budibase/string-templates": "^2.4.2",
50
- "@budibase/types": "^2.4.2",
46
+ "@budibase/backend-core": "2.4.4-alpha.0",
47
+ "@budibase/client": "2.4.4-alpha.0",
48
+ "@budibase/pro": "2.4.3",
49
+ "@budibase/string-templates": "2.4.4-alpha.0",
50
+ "@budibase/types": "2.4.4-alpha.0",
51
51
  "@bull-board/api": "3.7.0",
52
52
  "@bull-board/koa": "3.9.4",
53
53
  "@elastic/elasticsearch": "7.10.0",
@@ -174,5 +174,5 @@
174
174
  "optionalDependencies": {
175
175
  "oracledb": "5.3.0"
176
176
  },
177
- "gitHead": "bc783823db3978f1e29f3763109d44a918c515e4"
177
+ "gitHead": "ef51f832179efd94b804d8f5ec475ec1be46214e"
178
178
  }
@@ -223,14 +223,15 @@ function shouldCopySpecialColumn(
223
223
  column: { type: string },
224
224
  fetchedColumn: { type: string } | undefined
225
225
  ) {
226
+ const isFormula = column.type === FieldTypes.FORMULA
226
227
  const specialTypes = [
227
228
  FieldTypes.OPTIONS,
228
229
  FieldTypes.LONGFORM,
229
230
  FieldTypes.ARRAY,
230
231
  FieldTypes.FORMULA,
231
232
  ]
232
- // column has been deleted, remove
233
- if (column && !fetchedColumn) {
233
+ // column has been deleted, remove - formulas will never exist, always copy
234
+ if (!isFormula && column && !fetchedColumn) {
234
235
  return false
235
236
  }
236
237
  const fetchedIsNumber =
@@ -35,8 +35,6 @@ export function updateAppRole(
35
35
  user.roleId = roles.BUILTIN_ROLE_IDS.ADMIN
36
36
  } else if (!user.roleId && !user?.userGroups?.length) {
37
37
  user.roleId = roles.BUILTIN_ROLE_IDS.PUBLIC
38
- } else if (user?.userGroups?.length) {
39
- user.roleId = undefined
40
38
  }
41
39
 
42
40
  delete user.roles