@saltcorn/server 1.1.2-beta.12 → 1.1.2-beta.14

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/locales/en.json CHANGED
@@ -1553,5 +1553,6 @@
1553
1553
  "Search syntax help": "Search syntax help",
1554
1554
  "Search syntax": "Search syntax",
1555
1555
  "Maximum role": "Maximum role",
1556
- "Module dependencies": "Module dependencies"
1556
+ "Module dependencies": "Module dependencies",
1557
+ "Prompt": "Prompt"
1557
1558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "1.1.2-beta.12",
3
+ "version": "1.1.2-beta.14",
4
4
  "description": "Server app for Saltcorn, open-source no-code platform",
5
5
  "homepage": "https://saltcorn.com",
6
6
  "main": "index.js",
@@ -8,14 +8,14 @@
8
8
  "dependencies": {
9
9
  "@aws-sdk/client-s3": "^3.735.0",
10
10
  "@dr.pogodin/csurf": "^1.14.1",
11
- "@saltcorn/base-plugin": "1.1.2-beta.12",
12
- "@saltcorn/builder": "1.1.2-beta.12",
13
- "@saltcorn/data": "1.1.2-beta.12",
14
- "@saltcorn/admin-models": "1.1.2-beta.12",
15
- "@saltcorn/filemanager": "1.1.2-beta.12",
16
- "@saltcorn/markup": "1.1.2-beta.12",
17
- "@saltcorn/plugins-loader": "1.1.2-beta.12",
18
- "@saltcorn/sbadmin2": "1.1.2-beta.12",
11
+ "@saltcorn/base-plugin": "1.1.2-beta.14",
12
+ "@saltcorn/builder": "1.1.2-beta.14",
13
+ "@saltcorn/data": "1.1.2-beta.14",
14
+ "@saltcorn/admin-models": "1.1.2-beta.14",
15
+ "@saltcorn/filemanager": "1.1.2-beta.14",
16
+ "@saltcorn/markup": "1.1.2-beta.14",
17
+ "@saltcorn/plugins-loader": "1.1.2-beta.14",
18
+ "@saltcorn/sbadmin2": "1.1.2-beta.14",
19
19
  "@socket.io/cluster-adapter": "^0.2.1",
20
20
  "@socket.io/sticky": "^1.0.1",
21
21
  "adm-zip": "0.5.16",
package/routes/tables.js CHANGED
@@ -67,6 +67,7 @@ const {
67
67
  InvalidConfiguration,
68
68
  removeAllWhiteSpace,
69
69
  comparingCaseInsensitive,
70
+ validSqlId,
70
71
  } = require("@saltcorn/data/utils");
71
72
  const { EOL } = require("os");
72
73
 
@@ -484,7 +485,10 @@ const buildTableMarkup = (table) => {
484
485
  const members = fields
485
486
  // .filter((f) => !f.reftable_name)
486
487
  .map((f) =>
487
- indentString(`${removeAllWhiteSpace(f.type_name)} ${f.name}`, 6)
488
+ indentString(
489
+ `${removeAllWhiteSpace(f.type_name)} ${validSqlId(f.name)}`,
490
+ 6
491
+ )
488
492
  )
489
493
  .join(EOL);
490
494
  const keys = table
@@ -717,8 +721,12 @@ const attribBadges = (f) => {
717
721
  let s = "";
718
722
  if (f.attributes) {
719
723
  Object.entries(f.attributes).forEach(([k, v]) => {
724
+ if (k === "summary_field") s += badge("secondary", "Summary", v);
725
+ if (k === "include_fts" && v)
726
+ s += badge("secondary", "FTS", "Include in full-text search");
720
727
  if (
721
728
  [
729
+ "include_fts",
722
730
  "summary_field",
723
731
  "importance",
724
732
  "on_delete_cascade",
@@ -790,7 +798,9 @@ router.get(
790
798
  const triggers = table.id ? Trigger.find({ table_id: table.id }) : [];
791
799
  triggers.sort(comparingCaseInsensitive("name"));
792
800
  let fieldCard;
793
- const nPrimaryKeys = fields.filter((f) => f.primary_key).length;
801
+ const primaryKeys = fields.filter((f) => f.primary_key);
802
+ const nPrimaryKeys = primaryKeys.length;
803
+ const nonSerialPKS = primaryKeys.some((f) => f.attributes?.NonSerial);
794
804
 
795
805
  if (fields.length === 0) {
796
806
  fieldCard = [
@@ -854,11 +864,11 @@ router.get(
854
864
  { hover: true }
855
865
  );
856
866
  fieldCard = [
857
- nPrimaryKeys > 1 &&
867
+ (nPrimaryKeys > 1 || nonSerialPKS) &&
858
868
  div(
859
869
  { class: "alert alert-danger", role: "alert" },
860
870
  i({ class: "fas fa-exclamation-triangle" }),
861
- "This table has composite primary keys which is not supported in Saltcorn. A procedure to introduce a single autoincrementing primary key is available.",
871
+ "This table has composite primary keys, or a non-incrementing integer primary key, which are not supported in Saltcorn. A procedure to introduce a single autoincrementing primary key is available.",
862
872
  post_btn(
863
873
  `/table/repair-composite-primary/${table.id}`,
864
874
  "Add autoincrementing primary key",