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

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,22 @@
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"
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
+ "%s has no eligible page": "%s has no eligible page",
1365
+ "Random allocation": "Random allocation",
1366
+ "Serve a random page, ignoring the eligible formula. Within a session, reloads will always deliver the same page. This is a basic requirement for A/B testing.": "Serve a random page, ignoring the eligible formula. Within a session, reloads will always deliver the same page. This is a basic requirement for A/B testing.",
1367
+ "Pagegroup %s not found": "Pagegroup %s not found",
1368
+ "Create trigger": "Create trigger"
1352
1369
  }
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.11",
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.11",
11
+ "@saltcorn/builder": "0.9.4-beta.11",
12
+ "@saltcorn/data": "0.9.4-beta.11",
13
+ "@saltcorn/admin-models": "0.9.4-beta.11",
14
+ "@saltcorn/filemanager": "0.9.4-beta.11",
15
+ "@saltcorn/markup": "0.9.4-beta.11",
16
+ "@saltcorn/sbadmin2": "0.9.4-beta.11",
17
17
  "@socket.io/cluster-adapter": "^0.2.1",
18
18
  "@socket.io/sticky": "^1.0.1",
19
19
  "adm-zip": "0.5.10",
@@ -13,6 +13,10 @@ div.settings-panel {
13
13
  min-height: 150px;
14
14
  }
15
15
 
16
+ div.settings-panel td {
17
+ vertical-align: top;
18
+ }
19
+
16
20
  span.is-builder-link {
17
21
  color: blue;
18
22
  text-decoration: underline;
@@ -54,16 +58,34 @@ div.builder-embed-view {
54
58
  rgba(0, 0, 0, 0) 100%
55
59
  );
56
60
  }
61
+
62
+ .builder-left-enlarged div.toolbox-card.componets-and-library-accordion {
63
+ width: 13.35rem;
64
+ padding-right: 1rem;
65
+ margin-bottom: 1rem;
66
+ }
67
+
57
68
  div.toolbox-card {
58
69
  width: 9.2rem;
59
70
  padding-right: 1rem;
60
71
  margin-bottom: 1rem;
61
72
  }
62
- div.wrap-builder-elem {
73
+
74
+ .builder-left-enlarged div.wrap-builder-elem {
75
+ width: 33%;
76
+ height: 4rem;
77
+ position: relative;
78
+ }
79
+ .builder-left-shrunk div.wrap-builder-elem {
63
80
  width: 50%;
64
81
  height: 4rem;
65
82
  position: relative;
66
83
  }
84
+
85
+ .builder-left-enlarged div.toolbox-card div.wrap-builder-elem:nth-child(2) {
86
+ border-right: 1px solid #bcbcbc;
87
+ }
88
+
67
89
  div.toolbox-card div.wrap-builder-elem:nth-child(1) {
68
90
  border-right: 1px solid #bcbcbc;
69
91
  }
@@ -172,10 +194,16 @@ div.settings-panel div.rfipbtn {
172
194
  }
173
195
 
174
196
  div.componets-and-library-accordion {
175
- min-height: 45vh;
176
197
  margin-top: -0.25rem;
177
198
  }
178
199
 
200
+ .builder-left-enlarged .componets-and-library-accordion {
201
+ min-height: 20vh;
202
+ }
203
+
204
+ .builder-left-shrunk .componets-and-library-accordion {
205
+ min-height: 35vh;
206
+ }
179
207
  .builder-layers {
180
208
  max-height: calc(45vh - 50px);
181
209
  overflow-y: scroll;
@@ -281,6 +309,13 @@ Copyright (c) 2017 Taha Paksu
281
309
  margin: 0px;
282
310
  padding: 1px;
283
311
  text-align: center;
312
+ cursor: pointer;
313
+ }
314
+ .boxmodel-container .boxmodel-input-container {
315
+ cursor: pointer;
316
+ }
317
+ .boxmodel-container .boxmodel-header {
318
+ cursor: pointer;
284
319
  }
285
320
  .boxmodel-container .dim-display {
286
321
  background: transparent;
@@ -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
+ }
@@ -154,7 +154,7 @@ $(function () {
154
154
  });
155
155
  });
156
156
 
157
- function reload_embedded_view(viewname) {
157
+ function reload_embedded_view(viewname, new_query_string) {
158
158
  if (window._sc_loglevel > 4)
159
159
  console.log(
160
160
  "reload_embedded_view",
@@ -164,15 +164,16 @@ function reload_embedded_view(viewname) {
164
164
  );
165
165
  $(`[data-sc-embed-viewname="${viewname}"]`).each(function () {
166
166
  const $e = $(this);
167
- const url =
168
- $e.attr("data-sc-local-state") || $e.attr("data-sc-view-source");
167
+ let url = $e.attr("data-sc-local-state") || $e.attr("data-sc-view-source");
169
168
  if (!url) return;
170
- const headers = {
171
- pjaxpageload: "true",
172
- localizedstate: "true", //no admin bar
173
- };
169
+ if (new_query_string) {
170
+ url = url.split("?")[0] + "?" + new_query_string;
171
+ }
174
172
  $.ajax(url, {
175
- headers,
173
+ headers: {
174
+ pjaxpageload: "true",
175
+ localizedstate: "true", //no admin bar
176
+ },
176
177
  success: function (res, textStatus, request) {
177
178
  $e.html(res);
178
179
  initialize_page();
@@ -376,6 +377,7 @@ function ajax_modal(url, opts = {}) {
376
377
  success: function (res, textStatus, request) {
377
378
  var title = request.getResponseHeader("Page-Title");
378
379
  var width = request.getResponseHeader("SaltcornModalWidth");
380
+ var minwidth = request.getResponseHeader("SaltcornModalMinWidth");
379
381
  var saveIndicate = !!request.getResponseHeader(
380
382
  "SaltcornModalSaveIndicator"
381
383
  );
@@ -386,6 +388,8 @@ function ajax_modal(url, opts = {}) {
386
388
  else $(".sc-modal-linkout").hide();
387
389
  if (width) $(".modal-dialog").css("max-width", width);
388
390
  else $(".modal-dialog").css("max-width", "");
391
+ if (minwidth) $(".modal-dialog").css("min-width", minwidth);
392
+ else $(".modal-dialog").css("min-width", "");
389
393
  if (title) $("#scmodal .modal-title").html(decodeURIComponent(title));
390
394
  $("#scmodal .modal-body").html(res);
391
395
  $("#scmodal").prop("data-modal-state", url);
@@ -687,7 +691,7 @@ function make_unique_field(
687
691
  );
688
692
  }
689
693
  function test_formula(tablename, stored) {
690
- var formula = $("input[name=expression]").val();
694
+ var formula = $("input[name=expression],textarea[name=expression]").val();
691
695
  ajax_post(`/field/test-formula`, {
692
696
  data: { formula, tablename, stored },
693
697
  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,8 +104,14 @@ router.get(
89
104
  type: "card",
90
105
  title: req.__("Triggers"),
91
106
  contents: div(
92
- getTriggerList(triggers, req),
93
- link("/actions/new", req.__("Add trigger"))
107
+ await getTriggerList(triggers, req, { filterOnTag }),
108
+ a(
109
+ {
110
+ href: "/actions/new",
111
+ class: "btn btn-primary",
112
+ },
113
+ req.__("Create trigger")
114
+ )
94
115
  ),
95
116
  },
96
117
  {