@saltcorn/server 1.0.0-beta.16 → 1.0.0-beta.18

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/app.js CHANGED
@@ -306,13 +306,7 @@ const getApp = async (opts = {}) => {
306
306
  ? new Date(u.last_mobile_login).valueOf()
307
307
  : u.last_mobile_login) <= jwt_payload.iat
308
308
  ) {
309
- return done(null, {
310
- email: u.email,
311
- id: u.id,
312
- role_id: u.role_id,
313
- language: u.language,
314
- tenant: db.getTenantSchema(),
315
- });
309
+ return done(null, u.session_object);
316
310
  } else {
317
311
  return done(null, { role_id: 100 });
318
312
  }
@@ -0,0 +1,11 @@
1
+ The where formula allows you to restrict the rows included in the aggregations.
2
+
3
+ The formula should take the form of a JavaScript boolean expression such as
4
+ `a === b` or `x>y && w==1` when is based on the row values in the rows in the target table for
5
+ inclusion in the aggregation. For instance, if you are displaying aggregations about
6
+ a row from a Projects table, and a Task table has a key to projects field and a Boolean
7
+ field called `completed`, you may want to show the number of not-completed tasks for the Project.
8
+ In this case use the where expression `completed == false`.
9
+
10
+ You cannot here use view state or values from the row about which you are displaying aggregations. However,
11
+ if a user is logged in, the `user` variable can be used to access user fields, such as `user.id`.
package/locales/en.json CHANGED
@@ -1473,5 +1473,6 @@
1473
1473
  "Select tag": "Select tag",
1474
1474
  "Invalid build directory path": "Invalid build directory path",
1475
1475
  "Invalid build directory name": "Invalid build directory name",
1476
- "clean node_modules": "clean node_modules"
1477
- }
1476
+ "clean node_modules": "clean node_modules",
1477
+ "After delete": "After delete"
1478
+ }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "1.0.0-beta.16",
3
+ "version": "1.0.0-beta.18",
4
4
  "description": "Server app for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "main": "index.js",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
9
  "@aws-sdk/client-s3": "^3.451.0",
10
- "@saltcorn/base-plugin": "1.0.0-beta.16",
11
- "@saltcorn/builder": "1.0.0-beta.16",
12
- "@saltcorn/data": "1.0.0-beta.16",
13
- "@saltcorn/admin-models": "1.0.0-beta.16",
14
- "@saltcorn/filemanager": "1.0.0-beta.16",
15
- "@saltcorn/markup": "1.0.0-beta.16",
16
- "@saltcorn/plugins-loader": "1.0.0-beta.16",
17
- "@saltcorn/sbadmin2": "1.0.0-beta.16",
10
+ "@saltcorn/base-plugin": "1.0.0-beta.18",
11
+ "@saltcorn/builder": "1.0.0-beta.18",
12
+ "@saltcorn/data": "1.0.0-beta.18",
13
+ "@saltcorn/admin-models": "1.0.0-beta.18",
14
+ "@saltcorn/filemanager": "1.0.0-beta.18",
15
+ "@saltcorn/markup": "1.0.0-beta.18",
16
+ "@saltcorn/plugins-loader": "1.0.0-beta.18",
17
+ "@saltcorn/sbadmin2": "1.0.0-beta.18",
18
18
  "@socket.io/cluster-adapter": "^0.2.1",
19
19
  "@socket.io/sticky": "^1.0.1",
20
20
  "adm-zip": "0.5.10",
@@ -55,7 +55,7 @@
55
55
  "pg": "^8.2.1",
56
56
  "pluralize": "^8.0.0",
57
57
  "qrcode": "1.5.1",
58
- "resize-with-sharp-or-jimp": "0.1.7",
58
+ "resize-with-sharp-or-jimp": "0.1.8",
59
59
  "semver": "^7.6.0",
60
60
  "socket.io": "4.6.0",
61
61
  "systeminformation": "^5.21.7",
@@ -1870,6 +1870,8 @@ function close_saltcorn_modal() {
1870
1870
  }
1871
1871
  }
1872
1872
 
1873
+ let _sc_currently_reloading;
1874
+
1873
1875
  function reload_embedded_view(viewname, new_query_string) {
1874
1876
  const isNode = getIsNode();
1875
1877
  const updater = ($e, res) => {
@@ -1897,15 +1899,19 @@ function reload_embedded_view(viewname, new_query_string) {
1897
1899
  url = url.split("?")[0] + "?" + new_query_string;
1898
1900
  }
1899
1901
  if (isNode) {
1902
+ if (url === _sc_currently_reloading) return;
1903
+ _sc_currently_reloading = url;
1900
1904
  $.ajax(url, {
1901
1905
  headers: {
1902
1906
  pjaxpageload: "true",
1903
1907
  localizedstate: "true", //no admin bar
1904
1908
  },
1905
1909
  success: function (res, textStatus, request) {
1910
+ _sc_currently_reloading = null;
1906
1911
  updater($e, res);
1907
1912
  },
1908
1913
  error: function (res) {
1914
+ _sc_currently_reloading = null;
1909
1915
  if (!checkNetworkError(res))
1910
1916
  notifyAlert({ type: "danger", text: res.responseText });
1911
1917
  },
@@ -629,6 +629,7 @@ function checkNetworkError(e) {
629
629
  setTimeout(() => {
630
630
  scNetworkErrorSignaled = false;
631
631
  }, 1000);
632
+ console.error("Network error", e);
632
633
  notifyAlert({
633
634
  type: "danger",
634
635
  text: "Network connection error",
package/routes/actions.js CHANGED
@@ -546,7 +546,10 @@ router.get(
546
546
  let trigger;
547
547
  let id = parseInt(idorname);
548
548
  if (id) trigger = await Trigger.findOne({ id });
549
- else trigger = await Trigger.findOne({ name: idorname });
549
+ else {
550
+ trigger = await Trigger.findOne({ name: idorname });
551
+ id = trigger.id;
552
+ }
550
553
 
551
554
  if (!trigger) {
552
555
  req.flash("warning", req.__("Action not found"));
package/routes/admin.js CHANGED
@@ -3224,8 +3224,8 @@ router.post(
3224
3224
  error_catcher(async (req, res) => {
3225
3225
  const state = getState();
3226
3226
  const child = spawn(
3227
- "docker",
3228
- ["image", "pull", "saltcorn/cordova-builder:latest"],
3227
+ `${process.env.DOCKER_BIN ? `${process.env.DOCKER_BIN}/` : ""}docker`,
3228
+ ["pull", "saltcorn/cordova-builder:latest"],
3229
3229
  {
3230
3230
  stdio: ["ignore", "pipe", "pipe"],
3231
3231
  cwd: ".",
package/routes/tables.js CHANGED
@@ -798,7 +798,7 @@ router.get(
798
798
  key: (r) => attribBadges(r),
799
799
  },
800
800
  { label: req.__("Variable name"), key: (t) => code(t.name) },
801
- ...(table.external || db.isSQLite
801
+ ...(table.external
802
802
  ? []
803
803
  : [
804
804
  {