@saltcorn/server 0.9.6-beta.3 → 0.9.6-beta.5

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/auth/admin.js CHANGED
@@ -531,7 +531,10 @@ router.post(
531
531
  if (restart_required)
532
532
  res.json({
533
533
  success: "ok",
534
- notify: req.__("Restart required for changes to take effect."),
534
+ notify:
535
+ req.__("Restart required for changes to take effect.") +
536
+ " " +
537
+ a({ href: "/admin/system" }, req.__("Restart here")),
535
538
  });
536
539
  else res.json({ success: "ok" });
537
540
  }
package/load_plugins.js CHANGED
@@ -141,7 +141,11 @@ const loadAndSaveNewPlugin = async (
141
141
  const existing = await Plugin.findOne({ location: loc });
142
142
  if (!existing && loc !== plugin.location) {
143
143
  await loadAndSaveNewPlugin(
144
- new Plugin({ name: loc, location: loc, source: "npm" }),
144
+ new Plugin({
145
+ name: loc.replace("@saltcorn/", ""),
146
+ location: loc,
147
+ source: "npm",
148
+ }),
145
149
  force,
146
150
  noSignalOrDB
147
151
  );
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.6-beta.3",
3
+ "version": "0.9.6-beta.5",
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": "0.9.6-beta.3",
11
- "@saltcorn/builder": "0.9.6-beta.3",
12
- "@saltcorn/data": "0.9.6-beta.3",
13
- "@saltcorn/admin-models": "0.9.6-beta.3",
14
- "@saltcorn/filemanager": "0.9.6-beta.3",
15
- "@saltcorn/markup": "0.9.6-beta.3",
16
- "@saltcorn/plugins-loader": "0.9.6-beta.3",
17
- "@saltcorn/sbadmin2": "0.9.6-beta.3",
10
+ "@saltcorn/base-plugin": "0.9.6-beta.5",
11
+ "@saltcorn/builder": "0.9.6-beta.5",
12
+ "@saltcorn/data": "0.9.6-beta.5",
13
+ "@saltcorn/admin-models": "0.9.6-beta.5",
14
+ "@saltcorn/filemanager": "0.9.6-beta.5",
15
+ "@saltcorn/markup": "0.9.6-beta.5",
16
+ "@saltcorn/plugins-loader": "0.9.6-beta.5",
17
+ "@saltcorn/sbadmin2": "0.9.6-beta.5",
18
18
  "@socket.io/cluster-adapter": "^0.2.1",
19
19
  "@socket.io/sticky": "^1.0.1",
20
20
  "adm-zip": "0.5.10",
@@ -1291,7 +1291,7 @@ async function common_done(res, viewnameOrElem, isWeb = true) {
1291
1291
  );
1292
1292
  if (res.set_fields && (viewname || res.set_fields._viewname)) {
1293
1293
  const form =
1294
- typeof viewnameOrElem === "string"
1294
+ typeof viewnameOrElem === "string" || res.set_fields._viewname
1295
1295
  ? $(`form[data-viewname="${res.set_fields._viewname || viewname}"]`)
1296
1296
  : $(viewnameOrElem).closest("form[data-viewname]");
1297
1297
  if (form.length === 0 && set_state_fields) {
@@ -1321,6 +1321,7 @@ async function common_done(res, viewnameOrElem, isWeb = true) {
1321
1321
  input.trigger("set_form_field");
1322
1322
  });
1323
1323
  }
1324
+ form.trigger("change");
1324
1325
  }
1325
1326
 
1326
1327
  if (res.download) {
package/routes/fields.js CHANGED
@@ -1157,7 +1157,7 @@ router.post(
1157
1157
  else res.send(fv.run(result, req, { row, ...configuration }));
1158
1158
  } catch (e) {
1159
1159
  console.error("show-calculated error", e);
1160
- return res.status(400).send(`Error: ${e.message}`);
1160
+ return res.status(200).send(``);
1161
1161
  }
1162
1162
  })
1163
1163
  );
package/routes/plugins.js CHANGED
@@ -1315,7 +1315,12 @@ router.get(
1315
1315
  await upgrade_all_tenants_plugins((p, f) =>
1316
1316
  load_plugins.loadPlugin(p, f)
1317
1317
  );
1318
- req.flash("success", req.__(`Modules up-to-date. Please restart server`));
1318
+ req.flash(
1319
+ "success",
1320
+ req.__(`Modules up-to-date. Please restart server`) +
1321
+ ". " +
1322
+ a({ href: "/admin/system" }, req.__("Restart here"))
1323
+ );
1319
1324
  } else {
1320
1325
  const installed_plugins = await Plugin.find({});
1321
1326
  for (const plugin of installed_plugins) {
package/routes/utils.js CHANGED
@@ -14,7 +14,7 @@ const {
14
14
  } = require("@saltcorn/data/db/state");
15
15
  const { get_base_url } = require("@saltcorn/data/models/config");
16
16
  const { hash } = require("@saltcorn/data/utils");
17
- const { input, script, domReady } = require("@saltcorn/markup/tags");
17
+ const { input, script, domReady, a } = require("@saltcorn/markup/tags");
18
18
  const session = require("express-session");
19
19
  const cookieSession = require("cookie-session");
20
20
  const is = require("contractis/is");
@@ -398,7 +398,10 @@ const admin_config_route = ({
398
398
  if (restart_required)
399
399
  res.json({
400
400
  success: "ok",
401
- notify: req.__("Restart required for changes to take effect."),
401
+ notify:
402
+ req.__("Restart required for changes to take effect.") +
403
+ " " +
404
+ a({ href: "/admin/system" }, req.__("Restart here")),
402
405
  });
403
406
  else res.json({ success: "ok" });
404
407
  }
package/routes/view.js CHANGED
@@ -127,7 +127,7 @@ router.get(
127
127
  else {
128
128
  const qs = "";
129
129
  const contents =
130
- typeof contents0 === "string" && !req.xhr
130
+ typeof contents0 === "string"
131
131
  ? div(
132
132
  {
133
133
  class: "d-inline",
@@ -137,8 +137,10 @@ describe("Plugin dependency resolution and upgrade", () => {
137
137
  .expect(toRedirect("/plugins"));
138
138
  const quill = await Plugin.findOne({ name: "quill-editor" });
139
139
  expect(quill.location).toBe("@saltcorn/quill-editor");
140
+ expect(quill.name).toBe("quill-editor");
140
141
  const html = await Plugin.findOne({ location: "@saltcorn/html" });
141
142
  expect(html.location).toBe("@saltcorn/html");
143
+ expect(html.name).toBe("html");
142
144
  const html_type = getState().types.HTML;
143
145
  expect(!!html_type.fieldviews.Quill).toBe(true);
144
146
  });