@saltcorn/server 0.9.4-beta.21 → 0.9.4-beta.23

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
@@ -1381,5 +1381,6 @@
1381
1381
  "Allow self signed": "Allow self signed",
1382
1382
  "Open a connection to TLS server with self-signed or invalid TLS certificate": "Open a connection to TLS server with self-signed or invalid TLS certificate",
1383
1383
  "Allow self-signed": "Allow self-signed",
1384
- "Optionally associate a table with this trigger": "Optionally associate a table with this trigger"
1384
+ "Optionally associate a table with this trigger": "Optionally associate a table with this trigger",
1385
+ "Delete table": "Delete table"
1385
1386
  }
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.4-beta.21",
3
+ "version": "0.9.4-beta.23",
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.21",
11
- "@saltcorn/builder": "0.9.4-beta.21",
12
- "@saltcorn/data": "0.9.4-beta.21",
13
- "@saltcorn/admin-models": "0.9.4-beta.21",
14
- "@saltcorn/filemanager": "0.9.4-beta.21",
15
- "@saltcorn/markup": "0.9.4-beta.21",
16
- "@saltcorn/sbadmin2": "0.9.4-beta.21",
10
+ "@saltcorn/base-plugin": "0.9.4-beta.23",
11
+ "@saltcorn/builder": "0.9.4-beta.23",
12
+ "@saltcorn/data": "0.9.4-beta.23",
13
+ "@saltcorn/admin-models": "0.9.4-beta.23",
14
+ "@saltcorn/filemanager": "0.9.4-beta.23",
15
+ "@saltcorn/markup": "0.9.4-beta.23",
16
+ "@saltcorn/sbadmin2": "0.9.4-beta.23",
17
17
  "@socket.io/cluster-adapter": "^0.2.1",
18
18
  "@socket.io/sticky": "^1.0.1",
19
19
  "adm-zip": "0.5.10",
@@ -1154,27 +1154,6 @@ async function common_done(res, viewname, isWeb = true) {
1154
1154
  await handle(res.notify_success, (text) =>
1155
1155
  notifyAlert({ type: "success", text: text })
1156
1156
  );
1157
- if (res.eval_js) await handle(res.eval_js, eval_it);
1158
-
1159
- if (res.reload_page) {
1160
- (isWeb ? location : parent).reload(); //TODO notify to cookie if reload or goto
1161
- }
1162
- if (res.download) {
1163
- await handle(res.download, (download) => {
1164
- const dataurl = `data:${
1165
- download.mimetype || "application/octet-stream"
1166
- };base64,${download.blob}`;
1167
- fetch(dataurl)
1168
- .then((res) => res.blob())
1169
- .then((blob) => {
1170
- const link = document.createElement("a");
1171
- link.href = window.URL.createObjectURL(blob);
1172
- if (download.filename) link.download = download.filename;
1173
- else link.target = "_blank";
1174
- link.click();
1175
- });
1176
- });
1177
- }
1178
1157
  if (res.set_fields && viewname) {
1179
1158
  const form = $(`form[data-viewname="${viewname}"]`);
1180
1159
  if (form.length === 0 && set_state_fields) {
@@ -1203,6 +1182,35 @@ async function common_done(res, viewname, isWeb = true) {
1203
1182
  });
1204
1183
  }
1205
1184
  }
1185
+
1186
+ if (res.download) {
1187
+ await handle(res.download, (download) => {
1188
+ const dataurl = `data:${
1189
+ download.mimetype || "application/octet-stream"
1190
+ };base64,${download.blob}`;
1191
+ fetch(dataurl)
1192
+ .then((res) => res.blob())
1193
+ .then((blob) => {
1194
+ const link = document.createElement("a");
1195
+ link.href = window.URL.createObjectURL(blob);
1196
+ if (download.filename) link.download = download.filename;
1197
+ else link.target = "_blank";
1198
+ link.click();
1199
+ });
1200
+ });
1201
+ }
1202
+
1203
+ if (res.popup) {
1204
+ ajax_modal(res.popup);
1205
+ }
1206
+ if (res.suppressed) {
1207
+ notifyAlert({
1208
+ type: "warning",
1209
+ text: res.suppressed,
1210
+ });
1211
+ }
1212
+ if (res.eval_js) await handle(res.eval_js, eval_it);
1213
+
1206
1214
  if (res.goto && !isWeb)
1207
1215
  // TODO ch
1208
1216
  notifyAlert({
@@ -1224,14 +1232,8 @@ async function common_done(res, viewname, isWeb = true) {
1224
1232
  location.reload();
1225
1233
  }
1226
1234
  }
1227
- if (res.popup) {
1228
- ajax_modal(res.popup);
1229
- }
1230
- if (res.suppressed) {
1231
- notifyAlert({
1232
- type: "warning",
1233
- text: res.suppressed,
1234
- });
1235
+ if (res.reload_page) {
1236
+ (isWeb ? location : parent).reload(); //TODO notify to cookie if reload or goto
1235
1237
  }
1236
1238
  }
1237
1239
 
package/routes/tables.js CHANGED
@@ -995,6 +995,13 @@ router.get(
995
995
  req,
996
996
  true
997
997
  ),
998
+ table.name !== "users" &&
999
+ post_dropdown_item(
1000
+ `/table/delete/${table.id}`,
1001
+ '<i class="fas fa-trash"></i>&nbsp;' + req.__("Delete table"),
1002
+ req,
1003
+ true
1004
+ ),
998
1005
  ])
999
1006
  )
1000
1007
  );