@saltcorn/server 0.9.4-beta.1 → 0.9.4-beta.10

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.
@@ -122,6 +122,7 @@ Example:
122
122
  ```
123
123
  return { download: {
124
124
  mimetype: "text/csv",
125
+ filename: "stock.csv",
125
126
  blob: filecontents
126
127
  }
127
128
  }
package/locales/en.json CHANGED
@@ -1348,5 +1348,17 @@
1348
1348
  "Pagegroup": "Pagegroup",
1349
1349
  "Pagegroup %s has no members": "Pagegroup %s has no members",
1350
1350
  "Remove border": "Remove border",
1351
- "No lines between tables": "No lines between tables"
1352
- }
1351
+ "No lines between tables": "No lines between tables",
1352
+ "Use this to restrict your field to a list of options (separated by commas). For instance, enter <kbd class=\"fst-normal\">Red, Green, Blue</kbd> here if the permissible values are Red, Green and Blue. Leave blank if the string can hold any value.": "Use this to restrict your field to a list of options (separated by commas). For instance, enter <kbd class=\"fst-normal\">Red, Green, Blue</kbd> here if the permissible values are Red, Green and Blue. Leave blank if the string can hold any value.",
1353
+ "Page description": "Page description",
1354
+ "Some view patterns accept interpolations. Ex: <code>{{ name }}</code> or <code>{{ row ? `Edit ${row.name}` : `New person` }}</code>": "Some view patterns accept interpolations. Ex: <code>{{ name }}</code> or <code>{{ row ? `Edit ${row.name}` : `New person` }}</code>",
1355
+ "For search engines. Some view patterns accept interpolations.": "For search engines. Some view patterns accept interpolations.",
1356
+ "Files cache TTL (minutes)": "Files cache TTL (minutes)",
1357
+ "Cache-control max-age for files.": "Cache-control max-age for files.",
1358
+ "Popup min width": "Popup min width",
1359
+ "Add %s to tag %s": "Add %s to tag %s",
1360
+ "Add entries to tag %s": "Add entries to tag %s",
1361
+ "Tag not found": "Tag not found",
1362
+ "Unable to save: No page or no layout": "Unable to save: No page or no layout",
1363
+ "Unable to save: No view": "Unable to save: No view"
1364
+ }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.4-beta.1",
3
+ "version": "0.9.4-beta.10",
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.4-beta.1",
11
- "@saltcorn/builder": "0.9.4-beta.1",
12
- "@saltcorn/data": "0.9.4-beta.1",
13
- "@saltcorn/admin-models": "0.9.4-beta.1",
14
- "@saltcorn/filemanager": "0.9.4-beta.1",
15
- "@saltcorn/markup": "0.9.4-beta.1",
16
- "@saltcorn/sbadmin2": "0.9.4-beta.1",
10
+ "@saltcorn/base-plugin": "0.9.4-beta.10",
11
+ "@saltcorn/builder": "0.9.4-beta.10",
12
+ "@saltcorn/data": "0.9.4-beta.10",
13
+ "@saltcorn/admin-models": "0.9.4-beta.10",
14
+ "@saltcorn/filemanager": "0.9.4-beta.10",
15
+ "@saltcorn/markup": "0.9.4-beta.10",
16
+ "@saltcorn/sbadmin2": "0.9.4-beta.10",
17
17
  "@socket.io/cluster-adapter": "^0.2.1",
18
18
  "@socket.io/sticky": "^1.0.1",
19
19
  "adm-zip": "0.5.10",
@@ -54,16 +54,34 @@ div.builder-embed-view {
54
54
  rgba(0, 0, 0, 0) 100%
55
55
  );
56
56
  }
57
+
58
+ .builder-left-enlarged div.toolbox-card.componets-and-library-accordion {
59
+ width: 13.35rem;
60
+ padding-right: 1rem;
61
+ margin-bottom: 1rem;
62
+ }
63
+
57
64
  div.toolbox-card {
58
65
  width: 9.2rem;
59
66
  padding-right: 1rem;
60
67
  margin-bottom: 1rem;
61
68
  }
62
- div.wrap-builder-elem {
69
+
70
+ .builder-left-enlarged div.wrap-builder-elem {
71
+ width: 33%;
72
+ height: 4rem;
73
+ position: relative;
74
+ }
75
+ .builder-left-shrunk div.wrap-builder-elem {
63
76
  width: 50%;
64
77
  height: 4rem;
65
78
  position: relative;
66
79
  }
80
+
81
+ .builder-left-enlarged div.toolbox-card div.wrap-builder-elem:nth-child(2) {
82
+ border-right: 1px solid #bcbcbc;
83
+ }
84
+
67
85
  div.toolbox-card div.wrap-builder-elem:nth-child(1) {
68
86
  border-right: 1px solid #bcbcbc;
69
87
  }
@@ -498,3 +498,7 @@ table.help-md th:nth-child(2) {
498
498
  tr[onclick] {
499
499
  cursor: pointer;
500
500
  }
501
+
502
+ .editStarRating i.fa-star {
503
+ color: unset;
504
+ }
@@ -376,6 +376,7 @@ function ajax_modal(url, opts = {}) {
376
376
  success: function (res, textStatus, request) {
377
377
  var title = request.getResponseHeader("Page-Title");
378
378
  var width = request.getResponseHeader("SaltcornModalWidth");
379
+ var minwidth = request.getResponseHeader("SaltcornModalMinWidth");
379
380
  var saveIndicate = !!request.getResponseHeader(
380
381
  "SaltcornModalSaveIndicator"
381
382
  );
@@ -386,6 +387,8 @@ function ajax_modal(url, opts = {}) {
386
387
  else $(".sc-modal-linkout").hide();
387
388
  if (width) $(".modal-dialog").css("max-width", width);
388
389
  else $(".modal-dialog").css("max-width", "");
390
+ if (minwidth) $(".modal-dialog").css("min-width", minwidth);
391
+ else $(".modal-dialog").css("min-width", "");
389
392
  if (title) $("#scmodal .modal-title").html(decodeURIComponent(title));
390
393
  $("#scmodal .modal-body").html(res);
391
394
  $("#scmodal").prop("data-modal-state", url);
@@ -687,7 +690,7 @@ function make_unique_field(
687
690
  );
688
691
  }
689
692
  function test_formula(tablename, stored) {
690
- var formula = $("input[name=expression]").val();
693
+ var formula = $("input[name=expression],textarea[name=expression]").val();
691
694
  ajax_post(`/field/test-formula`, {
692
695
  data: { formula, tablename, stored },
693
696
  success: (data) => {
@@ -15,6 +15,7 @@ const { eachTenant } = require("@saltcorn/admin-models/models/tenant");
15
15
  */
16
16
  const relevantPackages = [
17
17
  "db-common",
18
+ "common-code",
18
19
  "postgres",
19
20
  "saltcorn-data",
20
21
  "saltcorn-builder",
package/routes/actions.js CHANGED
@@ -14,6 +14,8 @@ const {
14
14
  const { getState } = require("@saltcorn/data/db/state");
15
15
  const Trigger = require("@saltcorn/data/models/trigger");
16
16
  const { getTriggerList } = require("./common_lists");
17
+ const TagEntry = require("@saltcorn/data/models/tag_entry");
18
+ const Tag = require("@saltcorn/data/models/tag");
17
19
 
18
20
  /**
19
21
  * @type {object}
@@ -77,7 +79,20 @@ router.get(
77
79
  "/",
78
80
  isAdmin,
79
81
  error_catcher(async (req, res) => {
80
- const triggers = await Trigger.findAllWithTableName();
82
+ let triggers = await Trigger.findAllWithTableName();
83
+ let filterOnTag;
84
+
85
+ if (req.query._tag) {
86
+ const tagEntries = await TagEntry.find({
87
+ tag_id: +req.query._tag,
88
+ not: { trigger_id: null },
89
+ });
90
+ const tagged_trigger_ids = new Set(
91
+ tagEntries.map((te) => te.trigger_id).filter(Boolean)
92
+ );
93
+ triggers = triggers.filter((t) => tagged_trigger_ids.has(t.id));
94
+ filterOnTag = await Tag.findOne({ id: +req.query._tag });
95
+ }
81
96
  const actions = await getActions();
82
97
  send_events_page({
83
98
  res,
@@ -89,7 +104,7 @@ router.get(
89
104
  type: "card",
90
105
  title: req.__("Triggers"),
91
106
  contents: div(
92
- getTriggerList(triggers, req),
107
+ await getTriggerList(triggers, req, { filterOnTag }),
93
108
  link("/actions/new", req.__("Add trigger"))
94
109
  ),
95
110
  },