@saltcorn/server 0.9.0-beta.3 → 0.9.0-beta.5

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/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@saltcorn/server",
3
- "version": "0.9.0-beta.3",
3
+ "version": "0.9.0-beta.5",
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
- "@saltcorn/base-plugin": "0.9.0-beta.3",
10
- "@saltcorn/builder": "0.9.0-beta.3",
11
- "@saltcorn/data": "0.9.0-beta.3",
12
- "@saltcorn/admin-models": "0.9.0-beta.3",
13
- "@saltcorn/filemanager": "0.9.0-beta.3",
14
- "@saltcorn/markup": "0.9.0-beta.3",
15
- "@saltcorn/sbadmin2": "0.9.0-beta.3",
9
+ "@saltcorn/base-plugin": "0.9.0-beta.5",
10
+ "@saltcorn/builder": "0.9.0-beta.5",
11
+ "@saltcorn/data": "0.9.0-beta.5",
12
+ "@saltcorn/admin-models": "0.9.0-beta.5",
13
+ "@saltcorn/filemanager": "0.9.0-beta.5",
14
+ "@saltcorn/markup": "0.9.0-beta.5",
15
+ "@saltcorn/sbadmin2": "0.9.0-beta.5",
16
16
  "@socket.io/cluster-adapter": "^0.2.1",
17
17
  "@socket.io/sticky": "^1.0.1",
18
18
  "adm-zip": "0.5.10",
@@ -381,6 +381,9 @@ function saveAndContinue(e, k) {
381
381
  if (res.notify) {
382
382
  notifyAlert(res.notify);
383
383
  }
384
+ if (res.reload_page) {
385
+ location.reload(); //TODO notify to cookie if reload or goto
386
+ }
384
387
  },
385
388
  error: function (request) {
386
389
  var ct = request.getResponseHeader("content-type") || "";
@@ -5,6 +5,9 @@ const {
5
5
  getAdminLoginCookie,
6
6
  resetToFixtures,
7
7
  respondJsonWith,
8
+ toRedirect,
9
+ toInclude,
10
+ toSucceed,
8
11
  } = require("../auth/testhelp");
9
12
  const db = require("@saltcorn/data/db");
10
13
  const { sleep } = require("@saltcorn/data/tests/mocks");
@@ -181,6 +184,52 @@ describe("load remote insert/updates", () => {
181
184
  }
182
185
  });
183
186
 
187
+ it("sync table with capitals", async () => {
188
+ const app = await getApp({ disableCsrf: true });
189
+ const loginCookie = await getAdminLoginCookie();
190
+ // create table
191
+ await request(app)
192
+ .post("/table")
193
+ .set("Cookie", loginCookie)
194
+ .send(`name=${encodeURIComponent("Table with capitals")}`)
195
+ .expect(toRedirect("/table/16"));
196
+ // add a field
197
+ await request(app)
198
+ .post("/field/")
199
+ .send("stepName=Basic properties")
200
+ .send("name=string_field")
201
+ .send("label=StringField")
202
+ .send("type=String")
203
+ .send(
204
+ `contextEnc=${encodeURIComponent(JSON.stringify({ table_id: 16 }))}`
205
+ )
206
+ .set("Cookie", loginCookie)
207
+ .expect(toInclude("options"));
208
+ // init sync_info table
209
+ await request(app)
210
+ .post("/table")
211
+ .send("id=16")
212
+ .send("has_sync_info=on")
213
+ .set("Cookie", loginCookie)
214
+ .expect(toRedirect("/table/16"));
215
+ const dbTime = await db.time();
216
+
217
+ // call load changes
218
+ await request(app)
219
+ .post("/sync/load_changes")
220
+ .set("Cookie", loginCookie)
221
+ .send({
222
+ loadUntil: (await db.time()).valueOf(),
223
+ syncInfos: {
224
+ "Table with capitals": {
225
+ maxLoadedId: 0,
226
+ syncFrom: dbTime.valueOf(),
227
+ },
228
+ },
229
+ })
230
+ .expect(toSucceed());
231
+ });
232
+
184
233
  it("load sync not authorized", async () => {
185
234
  const app = await getApp({ disableCsrf: true });
186
235
  const loginCookie = await getUserLoginCookie();