@saltcorn/server 1.1.0-beta.9 → 1.1.1-beta.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.
package/auth/admin.js CHANGED
@@ -1182,7 +1182,7 @@ router.post(
1182
1182
  isAdmin,
1183
1183
  error_catcher(async (req, res) => {
1184
1184
  const { id } = req.params;
1185
- const u = await User.findOne({ id });
1185
+ const u = await User.findForSession({ id });
1186
1186
  if (u) {
1187
1187
  await u.relogin(req);
1188
1188
  req.flash(
package/auth/roleadmin.js CHANGED
@@ -56,7 +56,11 @@ const editRoleLayoutForm = (role, layouts, layout_by_role, req) => {
56
56
  },
57
57
  csrfField(req),
58
58
  select(
59
- { name: "layout", onchange: "form.submit()" },
59
+ {
60
+ name: "layout",
61
+ onchange: "form.submit()",
62
+ class: "form-select form-select-sm w-unset d-inline",
63
+ },
60
64
  layouts.map((layout, ix) =>
61
65
  option(
62
66
  {
@@ -88,7 +92,11 @@ const editRole2FAPolicyForm = (role, twofa_policy_by_role, req) =>
88
92
  },
89
93
  csrfField(req),
90
94
  select(
91
- { name: "policy", onchange: "form.submit()" },
95
+ {
96
+ name: "policy",
97
+ onchange: "form.submit()",
98
+ class: "form-select form-select-sm w-unset d-inline",
99
+ },
92
100
  ["Optional", "Disabled", "Mandatory"].map((p) =>
93
101
  option({ selected: twofa_policy_by_role[role.id] === p }, p)
94
102
  )
@@ -1,4 +1,4 @@
1
- The Cordova builder is a docker image with all dependencies to build Android apps.
1
+ The Capacitor builder is a docker image with all dependencies to build Android apps.
2
2
  It can be pulled from dockerhub while installing Saltcorn, or you can use the pull button.
3
3
 
4
4
  Please make sure your server has a valid and accessible docker daemon running.
@@ -0,0 +1,5 @@
1
+ These are the available configuration keys:
2
+
3
+ {{# for (const [key, defn] of Object.entries(configTypes)) { }}
4
+ * `{{key}}`: {{defn.label||""}}
5
+ {{# } }}
package/help/index.js CHANGED
@@ -11,6 +11,7 @@ const { pre } = require("@saltcorn/markup/tags");
11
11
  const path = require("path");
12
12
  const { getState } = require("@saltcorn/data/db/state");
13
13
  const { oneOf } = require("@saltcorn/types/generators");
14
+ const { configTypes } = require("@saltcorn/data/models/config");
14
15
  const get_md_file = async (topic) => {
15
16
  try {
16
17
  const fp = File.normalise_in_base(__dirname, `${topic}.tmd`);
@@ -36,6 +37,7 @@ const get_help_markup = async (topic, query, req) => {
36
37
  query,
37
38
  oneOf,
38
39
  moment,
40
+ configTypes
39
41
  };
40
42
  const mdTemplate = await get_md_file(topic);
41
43
  if (!mdTemplate) return { markup: "Topic not found" };
package/load_plugins.js CHANGED
@@ -8,7 +8,7 @@
8
8
  const db = require("@saltcorn/data/db");
9
9
  const { getState, getRootState } = require("@saltcorn/data/db/state");
10
10
  const Plugin = require("@saltcorn/data/models/plugin");
11
- const { isRoot } = require("@saltcorn/data/utils");
11
+ const { isRoot, getFetchProxyOptions } = require("@saltcorn/data/utils");
12
12
  const { eachTenant } = require("@saltcorn/admin-models/models/tenant");
13
13
 
14
14
  const PluginInstaller = require("@saltcorn/plugins-loader/plugin_installer");
@@ -35,7 +35,8 @@ const getEngineInfos = async (plugin, forceFetch) => {
35
35
  } else {
36
36
  getState().log(5, `Fetching versions for '${plugin.location}'`);
37
37
  const pkgInfo = await npmFetch.json(
38
- `https://registry.npmjs.org/${plugin.location}`
38
+ `https://registry.npmjs.org/${plugin.location}`,
39
+ getFetchProxyOptions()
39
40
  );
40
41
  const versions = pkgInfo.versions;
41
42
  const newCached = {};
@@ -97,7 +98,10 @@ const loadPlugin = async (plugin, force, forceFetch) => {
97
98
  }
98
99
  }
99
100
  // load plugin
100
- const loader = new PluginInstaller(plugin);
101
+ const loader = new PluginInstaller(plugin, {
102
+ scVersion: packagejson.version,
103
+ envVars: { PUPPETEER_SKIP_DOWNLOAD: true },
104
+ });
101
105
  const res = await loader.install(force);
102
106
  const configuration =
103
107
  typeof plugin.configuration === "string"
@@ -162,7 +166,10 @@ const reloadAuthFromRoot = () => {
162
166
  * @returns {Promise<{plugin_module: *}|{plugin_module: any}>}
163
167
  */
164
168
  const requirePlugin = async (plugin, force) => {
165
- const loader = new PluginInstaller(plugin);
169
+ const loader = new PluginInstaller(plugin, {
170
+ scVersion: packagejson.version,
171
+ envVars: { PUPPETEER_SKIP_DOWNLOAD: true },
172
+ });
166
173
  return await loader.install(force);
167
174
  };
168
175
 
@@ -231,7 +238,7 @@ const loadAndSaveNewPlugin = async (
231
238
  const loadMsgs = [];
232
239
  const loader = new PluginInstaller(plugin, {
233
240
  scVersion: packagejson.version,
234
- envVars: { PUPPETEER_SKIP_DOWNLOAD: "1" },
241
+ envVars: { PUPPETEER_SKIP_DOWNLOAD: true },
235
242
  });
236
243
  const { version, plugin_module, location, loadedWithReload, msgs } =
237
244
  await loader.install(force);
package/locales/en.json CHANGED
@@ -1493,5 +1493,34 @@
1493
1493
  "You must be logged in to share": "You must be logged in to share",
1494
1494
  "Fluid layout": "Fluid layout",
1495
1495
  "Request fluid layout from theme for a wider display for this page": "Request fluid layout from theme for a wider display for this page",
1496
- "Location of view to create new row": "Location of view to create new row"
1496
+ "Location of view to create new row": "Location of view to create new row",
1497
+ "Capacitor builder": "Capacitor builder",
1498
+ "Pulling the capacitor-builder docker image...": "Pulling the capacitor-builder docker image...",
1499
+ "Pull done with code %s": "Pull done with code %s",
1500
+ "Default locale": "Default locale",
1501
+ "Next step": "Next step",
1502
+ "Step name": "Step name",
1503
+ "Step saved": "Step saved",
1504
+ "Initial step": "Initial step",
1505
+ "Confirm leaving unsaved": "Confirm leaving unsaved",
1506
+ "Ask the user to confirm if they close a tab with unsaved changes": "Ask the user to confirm if they close a tab with unsaved changes",
1507
+ "Workflow runs": "Workflow runs",
1508
+ "Workflow run": "Workflow run",
1509
+ "Share to enabled": "Share to enabled",
1510
+ "Enable the share to feature": "Enable the share to feature",
1511
+ "Allocate new row": "Allocate new row",
1512
+ "If the view is run without existing row, allocate a new row on load. Defaults must be set on all required fields.": "If the view is run without existing row, allocate a new row on load. Defaults must be set on all required fields.",
1513
+ "Step traces": "Step traces",
1514
+ "Please enter a version in the format 'x.y.z' (e.g. 0.0.1 with numbers from 0 to 999) or leave it empty.": "Please enter a version in the format 'x.y.z' (e.g. 0.0.1 with numbers from 0 to 999) or leave it empty.",
1515
+ "Delete unchanged": "Delete unchanged",
1516
+ "Delete allocated row if there are no changes.": "Delete allocated row if there are no changes.",
1517
+ "Triggers on table": "Triggers on table",
1518
+ "Please provide the keystore alias and password for the android build.": "Please provide the keystore alias and password for the android build.",
1519
+ "Submit": "Submit",
1520
+ "OK": "OK",
1521
+ "Step settings": "Step settings",
1522
+ "Action settings": "Action settings",
1523
+ "Workflow": "Workflow",
1524
+ "Previous runs": "Previous runs",
1525
+ "The workflow the user will be interacting with.": "The workflow the user will be interacting with."
1497
1526
  }
package/locales/pl.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "If you did not request this, please ignore this email.": "Jeżeli nie żądałeś tego, nie klikaj w poniższy link.",
58
58
  "Your password will not change until you access the link above and set a new one.": "Twoje hasło nie ulegnie zmianie dopóki nie klikniesz w powyższy link i nie ustawisz nowego hasła.",
59
59
  "Change my password": "Zmień moje hasło",
60
- "Must be admin": "Musi być adminem",
60
+ "Must be admin": "Musisz być adminem",
61
61
  "Site identity": "Tożsamość strony",
62
62
  "Authentication": "Uwierzytelnianie",
63
63
  "Development": "Development",
@@ -1491,5 +1491,22 @@
1491
1491
  "Login and signup views should be accessible by public users": "Widoki logowania i rejestracji powinny być dostępne dla użytkowników publicznych",
1492
1492
  "Shared: %s": "Udostępnione: %s",
1493
1493
  "Sharing not enabled": "Udostępnianie nie jest włączone",
1494
- "You must be logged in to share": "Musisz być zalogowany, aby udostępniać"
1494
+ "You must be logged in to share": "Musisz być zalogowany, aby udostępniać",
1495
+ "Fluid layout": "Układ elastyczny",
1496
+ "Request fluid layout from theme for a wider display for this page": "Poproś o elastyczny układ z motywu, aby zapewnić szerszy widok dla tej strony",
1497
+ "Location of view to create new row": "Lokalizacja widoku do utworzenia nowego wiersza",
1498
+ "Capacitor builder": "Capacitor builder",
1499
+ "Pulling the capacitor-builder docker image...": "Pobieranie obrazu Docker capacitor-builder...",
1500
+ "Pull done with code %s": "Pobieranie zakończone z kodem %s",
1501
+ "Default locale": "Domyślny język/region",
1502
+ "Next step": "Następny krok",
1503
+ "Step name": "Nazwa kroku",
1504
+ "Step saved": "Krok zapisany",
1505
+ "Initial step": "Początkowy krok",
1506
+ "Confirm leaving unsaved": "Potwierdzenie opuszczenia bez zapisania",
1507
+ "Ask the user to confirm if they close a tab with unsaved changes": "Poproś użytkownika o potwierdzenie, czy chce zamknąć kartę z niezapisanymi zmianami",
1508
+ "Workflow runs": "Przepływ pracy jest uruchomiony",
1509
+ "Workflow run": "Uruchomienie przepływu pracy",
1510
+ "Share to enabled": "Udostępnij włączone",
1511
+ "Enable the share to feature": "Włącz udostępnianie funkcji"
1495
1512
  }
package/markup/admin.js CHANGED
@@ -17,7 +17,7 @@ const {
17
17
  li,
18
18
  } = require("@saltcorn/markup/tags");
19
19
  const db = require("@saltcorn/data/db");
20
- const { configTypes, isFixedConfig } = require("@saltcorn/data/models/config");
20
+ const { configTypes } = require("@saltcorn/data/models/config");
21
21
  const { getState } = require("@saltcorn/data/db/state");
22
22
  const Form = require("@saltcorn/data/models/form");
23
23
  const Table = require("@saltcorn/data/models/table");
@@ -310,6 +310,7 @@ const send_events_page = (args) => {
310
310
  { text: "Custom", href: "/eventlog/custom" },
311
311
  { text: "Settings", href: "/eventlog/settings" },
312
312
  { text: "Event log", href: "/eventlog" },
313
+ { text: "Workflow runs", href: "/actions/runs" },
313
314
  ...(isRoot ? [{ text: "Crash log", href: "/crashlog" }] : []),
314
315
  ],
315
316
  ...args,
@@ -466,7 +467,7 @@ const config_fields_form = async ({
466
467
  ...configTypes[name],
467
468
  label: label ? req.__(label) : undefined,
468
469
  sublabel: sublabel ? req.__(sublabel) : undefined,
469
- disabled: isFixedConfig(name),
470
+ disabled: state.isFixedConfig(name),
470
471
  type:
471
472
  isView || isRole || isTenant
472
473
  ? "String"
@@ -475,6 +476,9 @@ const config_fields_form = async ({
475
476
  : configTypes[name].type,
476
477
  input_type: configTypes[name].input_type,
477
478
  showIf,
479
+ help: configTypes[name].helpTopic
480
+ ? { topic: configTypes[name].helpTopic }
481
+ : undefined,
478
482
  attributes: isView
479
483
  ? await viewAttributes(name)
480
484
  : isRole
@@ -505,7 +509,7 @@ const save_config_from_form = async (form) => {
505
509
  const state = getState();
506
510
 
507
511
  for (const [k, v] of Object.entries(form.values)) {
508
- if (!isFixedConfig(k) && typeof v !== "undefined") {
512
+ if (!state.isFixedConfig(k) && typeof v !== "undefined") {
509
513
  await state.setConfig(k, v);
510
514
  }
511
515
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "1.1.0-beta.9",
3
+ "version": "1.1.1-beta.0",
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.1.0-beta.9",
11
- "@saltcorn/builder": "1.1.0-beta.9",
12
- "@saltcorn/data": "1.1.0-beta.9",
13
- "@saltcorn/admin-models": "1.1.0-beta.9",
14
- "@saltcorn/filemanager": "1.1.0-beta.9",
15
- "@saltcorn/markup": "1.1.0-beta.9",
16
- "@saltcorn/plugins-loader": "1.1.0-beta.9",
17
- "@saltcorn/sbadmin2": "1.1.0-beta.9",
10
+ "@saltcorn/base-plugin": "1.1.1-beta.0",
11
+ "@saltcorn/builder": "1.1.1-beta.0",
12
+ "@saltcorn/data": "1.1.1-beta.0",
13
+ "@saltcorn/admin-models": "1.1.1-beta.0",
14
+ "@saltcorn/filemanager": "1.1.1-beta.0",
15
+ "@saltcorn/markup": "1.1.1-beta.0",
16
+ "@saltcorn/plugins-loader": "1.1.1-beta.0",
17
+ "@saltcorn/sbadmin2": "1.1.1-beta.0",
18
18
  "@socket.io/cluster-adapter": "^0.2.1",
19
19
  "@socket.io/sticky": "^1.0.1",
20
20
  "adm-zip": "0.5.10",
@@ -348,3 +348,36 @@ div.CodeMirror-dragcursors {
348
348
 
349
349
  /* Help users use markselection to safely style text background */
350
350
  span.CodeMirror-selectedtext { background: none; }
351
+
352
+ /* Port of TextMate's Blackboard theme */
353
+
354
+ .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
355
+ .cm-s-blackboard div.CodeMirror-selected { background: #253B76; }
356
+ .cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); }
357
+ .cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); }
358
+ .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
359
+ .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; }
360
+ .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; }
361
+ .cm-s-blackboard .CodeMirror-linenumber { color: #888; }
362
+ .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; }
363
+
364
+ .cm-s-blackboard .cm-keyword { color: #FBDE2D; }
365
+ .cm-s-blackboard .cm-atom { color: #D8FA3C; }
366
+ .cm-s-blackboard .cm-number { color: #D8FA3C; }
367
+ .cm-s-blackboard .cm-def { color: #8DA6CE; }
368
+ .cm-s-blackboard .cm-variable { color: #FF6400; }
369
+ .cm-s-blackboard .cm-operator { color: #FBDE2D; }
370
+ .cm-s-blackboard .cm-comment { color: #AEAEAE; }
371
+ .cm-s-blackboard .cm-string { color: #61CE3C; }
372
+ .cm-s-blackboard .cm-string-2 { color: #61CE3C; }
373
+ .cm-s-blackboard .cm-meta { color: #D8FA3C; }
374
+ .cm-s-blackboard .cm-builtin { color: #8DA6CE; }
375
+ .cm-s-blackboard .cm-tag { color: #8DA6CE; }
376
+ .cm-s-blackboard .cm-attribute { color: #8DA6CE; }
377
+ .cm-s-blackboard .cm-header { color: #FF6400; }
378
+ .cm-s-blackboard .cm-hr { color: #AEAEAE; }
379
+ .cm-s-blackboard .cm-link { color: #8DA6CE; }
380
+ .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; }
381
+
382
+ .cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; }
383
+ .cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; }