@saltcorn/server 0.9.1-beta.17 → 0.9.1-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/auth/routes.js CHANGED
@@ -1623,12 +1623,24 @@ router.post(
1623
1623
  if (user_settings_form) {
1624
1624
  const view = await View.findOne({ name: user_settings_form });
1625
1625
  if (view) {
1626
+ const fakeRes = {
1627
+ status() {},
1628
+ sendWrap() {},
1629
+ json() {},
1630
+ redirect() {},
1631
+ };
1626
1632
  await view.runPost({ id: user.id }, req.body, {
1627
1633
  req,
1628
- res,
1634
+ res: fakeRes,
1629
1635
  redirect: "/auth/settings",
1630
1636
  });
1631
- req.flash("success", req.__("User settings changed"));
1637
+ const u = await User.findForSession({ id: user.id });
1638
+ req.login(u.session_object, function (err) {
1639
+ if (err) req.flash("danger", err);
1640
+ else req.flash("success", req.__("User settings changed"));
1641
+
1642
+ res.redirect("/auth/settings");
1643
+ });
1632
1644
  }
1633
1645
  } else {
1634
1646
  res.redirect("/auth/settings");
package/locales/en.json CHANGED
@@ -1284,5 +1284,6 @@
1284
1284
  "Set theme for each user role »": "Set theme for each user role »",
1285
1285
  "Available themes": "Available themes",
1286
1286
  "Install more themes »": "Install more themes »",
1287
- "Configure action": "Configure action"
1287
+ "Configure action": "Configure action",
1288
+ "No changes detected, snapshot skipped": "No changes detected, snapshot skipped"
1288
1289
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.1-beta.17",
3
+ "version": "0.9.1-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": "0.9.1-beta.17",
11
- "@saltcorn/builder": "0.9.1-beta.17",
12
- "@saltcorn/data": "0.9.1-beta.17",
13
- "@saltcorn/admin-models": "0.9.1-beta.17",
14
- "@saltcorn/filemanager": "0.9.1-beta.17",
15
- "@saltcorn/markup": "0.9.1-beta.17",
16
- "@saltcorn/sbadmin2": "0.9.1-beta.17",
10
+ "@saltcorn/base-plugin": "0.9.1-beta.18",
11
+ "@saltcorn/builder": "0.9.1-beta.18",
12
+ "@saltcorn/data": "0.9.1-beta.18",
13
+ "@saltcorn/admin-models": "0.9.1-beta.18",
14
+ "@saltcorn/filemanager": "0.9.1-beta.18",
15
+ "@saltcorn/markup": "0.9.1-beta.18",
16
+ "@saltcorn/sbadmin2": "0.9.1-beta.18",
17
17
  "@socket.io/cluster-adapter": "^0.2.1",
18
18
  "@socket.io/sticky": "^1.0.1",
19
19
  "adm-zip": "0.5.10",
@@ -1102,6 +1102,10 @@ function common_done(res, viewname, isWeb = true) {
1102
1102
  if (res.notify) handle(res.notify, notifyAlert);
1103
1103
  if (res.error)
1104
1104
  handle(res.error, (text) => notifyAlert({ type: "danger", text: text }));
1105
+ if (res.notify_success)
1106
+ handle(res.notify_success, (text) =>
1107
+ notifyAlert({ type: "success", text: text })
1108
+ );
1105
1109
  if (res.eval_js) handle(res.eval_js, eval_it);
1106
1110
 
1107
1111
  if (res.reload_page) {
@@ -422,6 +422,9 @@ function saveAndContinue(e, k) {
422
422
  if (res.notify) {
423
423
  notifyAlert(res.notify);
424
424
  }
425
+ if (res.notify_success) {
426
+ notifyAlert({ type: "success", text: res.notify });
427
+ }
425
428
  if (res.reload_page) {
426
429
  location.reload(); //TODO notify to cookie if reload or goto
427
430
  }
@@ -220,6 +220,7 @@ const pageBuilderData = async (req, context) => {
220
220
  library,
221
221
  min_role: context.min_role,
222
222
  actionConfigForms,
223
+ allowMultiStepAction: true,
223
224
  page_name: context.name,
224
225
  page_id: context.id,
225
226
  mode: "page",
package/routes/view.js CHANGED
@@ -10,7 +10,7 @@ const View = require("@saltcorn/data/models/view");
10
10
  const Table = require("@saltcorn/data/models/table");
11
11
  const Trigger = require("@saltcorn/data/models/trigger");
12
12
 
13
- const { text, style } = require("@saltcorn/markup/tags");
13
+ const { text, style, div } = require("@saltcorn/markup/tags");
14
14
  const {
15
15
  isAdmin,
16
16
  error_catcher,
@@ -70,11 +70,11 @@ router.get(
70
70
  }
71
71
  const isModal = req.headers?.saltcornmodalrequest;
72
72
 
73
- const contents = await view.run_possibly_on_page(query, req, res);
73
+ const contents0 = await view.run_possibly_on_page(query, req, res);
74
74
  const title =
75
75
  isModal && view.attributes?.popup_title
76
76
  ? view.attributes?.popup_title
77
- : scan_for_page_title(contents, view.name);
77
+ : scan_for_page_title(contents0, view.name);
78
78
  if (isModal && view.attributes?.popup_width)
79
79
  res.set(
80
80
  "SaltcornModalWidth",
@@ -95,9 +95,21 @@ router.get(
95
95
  name: viewname,
96
96
  render_time: ms,
97
97
  });
98
- if (typeof contents === "object" && contents.goto)
99
- res.redirect(contents.goto);
100
- else
98
+ if (typeof contents0 === "object" && contents0.goto)
99
+ res.redirect(contents0.goto);
100
+ else {
101
+ const qs = "";
102
+ const contents =
103
+ typeof contents0 === "string" && !req.xhr
104
+ ? div(
105
+ {
106
+ class: "d-inline",
107
+ "data-sc-embed-viewname": view.name,
108
+ "data-sc-view-source": req.originalUrl,
109
+ },
110
+ contents0
111
+ )
112
+ : contents0;
101
113
  res.sendWrap(
102
114
  title,
103
115
  add_edit_bar({
@@ -112,6 +124,7 @@ router.get(
112
124
  table: view.table_id || view.exttable_name,
113
125
  })
114
126
  );
127
+ }
115
128
  })
116
129
  );
117
130