@saltcorn/server 0.9.4-beta.13 → 0.9.4-beta.15
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/auth/admin.js +2 -1
- package/auth/routes.js +5 -0
- package/load_plugins.js +8 -2
- package/locales/en.json +3 -2
- package/package.json +8 -8
- package/public/saltcorn-builder.css +25 -1
- package/tests/viewedit.test.js +52 -8
package/auth/admin.js
CHANGED
|
@@ -187,7 +187,8 @@ const user_dropdown = (user, req, can_reset) =>
|
|
|
187
187
|
post_dropdown_item(
|
|
188
188
|
`/useradmin/set-random-password/${user.id}`,
|
|
189
189
|
'<i class="fas fa-random"></i> ' + req.__("Set random password"),
|
|
190
|
-
req
|
|
190
|
+
req,
|
|
191
|
+
true
|
|
191
192
|
),
|
|
192
193
|
can_reset &&
|
|
193
194
|
post_dropdown_item(
|
package/auth/routes.js
CHANGED
|
@@ -1783,6 +1783,7 @@ router.post(
|
|
|
1783
1783
|
res.redirect("/auth/twofa/setup/totp");
|
|
1784
1784
|
return;
|
|
1785
1785
|
}
|
|
1786
|
+
console.log("TOTP return ", rv);
|
|
1786
1787
|
user._attributes.totp_enabled = true;
|
|
1787
1788
|
await user.update({ _attributes: user._attributes });
|
|
1788
1789
|
req.flash(
|
|
@@ -1901,6 +1902,9 @@ router.get(
|
|
|
1901
1902
|
const form = new Form({
|
|
1902
1903
|
action: "/auth/twofa/login/totp",
|
|
1903
1904
|
submitLabel: "Verify",
|
|
1905
|
+
blurb: req.__(
|
|
1906
|
+
"Please enter the two-factor authetication code from your authenticator device"
|
|
1907
|
+
),
|
|
1904
1908
|
fields: [
|
|
1905
1909
|
{
|
|
1906
1910
|
name: "code",
|
|
@@ -1911,6 +1915,7 @@ router.get(
|
|
|
1911
1915
|
inputmode: "numeric",
|
|
1912
1916
|
pattern: "[0-9]*",
|
|
1913
1917
|
autocomplete: "one-time-code",
|
|
1918
|
+
autofocus: true,
|
|
1914
1919
|
},
|
|
1915
1920
|
required: true,
|
|
1916
1921
|
},
|
package/load_plugins.js
CHANGED
|
@@ -196,7 +196,10 @@ const loadAndSaveNewPlugin = async (plugin, force, noSignalOrDB, manager) => {
|
|
|
196
196
|
);
|
|
197
197
|
const isRoot = db.getTenantSchema() === db.connectObj.default_schema;
|
|
198
198
|
if (!isRoot && !tenants_unsafe_plugins) {
|
|
199
|
-
if (plugin.source !== "npm")
|
|
199
|
+
if (plugin.source !== "npm") {
|
|
200
|
+
console.error("\nWARNING: Skipping unsafe plugin ", plugin.name);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
200
203
|
//get allowed plugins
|
|
201
204
|
|
|
202
205
|
//refresh root store
|
|
@@ -207,7 +210,10 @@ const loadAndSaveNewPlugin = async (plugin, force, noSignalOrDB, manager) => {
|
|
|
207
210
|
|
|
208
211
|
const instore = getRootState().getConfig("available_plugins", []);
|
|
209
212
|
const safes = instore.filter((p) => !p.unsafe).map((p) => p.location);
|
|
210
|
-
if (!safes.includes(plugin.location))
|
|
213
|
+
if (!safes.includes(plugin.location)) {
|
|
214
|
+
console.error("\nWARNING: Skipping unsafe plugin ", plugin.name);
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
211
217
|
}
|
|
212
218
|
const { version, plugin_module, location } = await requirePlugin(
|
|
213
219
|
plugin,
|
package/locales/en.json
CHANGED
|
@@ -1375,5 +1375,6 @@
|
|
|
1375
1375
|
"open logs viewer": "open logs viewer",
|
|
1376
1376
|
"Server logs": "Server logs",
|
|
1377
1377
|
"Timestamp": "Timestamp",
|
|
1378
|
-
"Message": "Message"
|
|
1379
|
-
|
|
1378
|
+
"Message": "Message",
|
|
1379
|
+
"Please enter the two-factor authetication code from your authenticator device": "Please enter the two-factor authetication code from your authenticator device"
|
|
1380
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/server",
|
|
3
|
-
"version": "0.9.4-beta.
|
|
3
|
+
"version": "0.9.4-beta.15",
|
|
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.
|
|
11
|
-
"@saltcorn/builder": "0.9.4-beta.
|
|
12
|
-
"@saltcorn/data": "0.9.4-beta.
|
|
13
|
-
"@saltcorn/admin-models": "0.9.4-beta.
|
|
14
|
-
"@saltcorn/filemanager": "0.9.4-beta.
|
|
15
|
-
"@saltcorn/markup": "0.9.4-beta.
|
|
16
|
-
"@saltcorn/sbadmin2": "0.9.4-beta.
|
|
10
|
+
"@saltcorn/base-plugin": "0.9.4-beta.15",
|
|
11
|
+
"@saltcorn/builder": "0.9.4-beta.15",
|
|
12
|
+
"@saltcorn/data": "0.9.4-beta.15",
|
|
13
|
+
"@saltcorn/admin-models": "0.9.4-beta.15",
|
|
14
|
+
"@saltcorn/filemanager": "0.9.4-beta.15",
|
|
15
|
+
"@saltcorn/markup": "0.9.4-beta.15",
|
|
16
|
+
"@saltcorn/sbadmin2": "0.9.4-beta.15",
|
|
17
17
|
"@socket.io/cluster-adapter": "^0.2.1",
|
|
18
18
|
"@socket.io/sticky": "^1.0.1",
|
|
19
19
|
"adm-zip": "0.5.10",
|
|
@@ -147,13 +147,19 @@ div.wrap-builder-elem label {
|
|
|
147
147
|
padding: 2px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
#builder-main-canvas div.root-canvas:empty:before {
|
|
150
|
+
#builder-main-canvas.emptymsg div.root-canvas:empty:before {
|
|
151
151
|
font-size: 26px;
|
|
152
152
|
opacity: 0.5;
|
|
153
153
|
margin-left: 10px;
|
|
154
154
|
content: "Drag-and-drop components here";
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
#builder-main-canvas div.list-empty-msg:empty:before {
|
|
158
|
+
opacity: 0.5;
|
|
159
|
+
margin-left: 10px;
|
|
160
|
+
content: "Drag-and-drop components here";
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
#builder-main-canvas .image-widget {
|
|
158
164
|
min-width: 15px;
|
|
159
165
|
min-height: 15px;
|
|
@@ -485,3 +491,21 @@ Copyright (c) 2017 Taha Paksu
|
|
|
485
491
|
div.builder-config-field {
|
|
486
492
|
margin-top: 0.5rem;
|
|
487
493
|
}
|
|
494
|
+
|
|
495
|
+
.flex-50 {
|
|
496
|
+
flex: 50%;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
#builder-main-canvas .list-column {
|
|
500
|
+
min-height: 80px;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
#builder-main-canvas .list-col-canvas {
|
|
504
|
+
min-height: 70px;
|
|
505
|
+
margin: 5px;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
#builder-main-canvas .list-column-outer {
|
|
509
|
+
border: 1px solid black;
|
|
510
|
+
margin-top: 2px;
|
|
511
|
+
}
|
package/tests/viewedit.test.js
CHANGED
|
@@ -78,6 +78,37 @@ describe("viewedit edit endpoint", () => {
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
describe("viewedit new List", () => {
|
|
81
|
+
const columns = [
|
|
82
|
+
{ type: "Field", field_name: "author" },
|
|
83
|
+
{ type: "Field", field_name: "pages" },
|
|
84
|
+
];
|
|
85
|
+
const layout = {
|
|
86
|
+
besides: [
|
|
87
|
+
{
|
|
88
|
+
contents: {
|
|
89
|
+
type: "field",
|
|
90
|
+
fieldview: "as_text",
|
|
91
|
+
field_name: "author",
|
|
92
|
+
configuration: {},
|
|
93
|
+
},
|
|
94
|
+
alignment: "Default",
|
|
95
|
+
header_label: "Author",
|
|
96
|
+
col_width_units: "px",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
contents: {
|
|
100
|
+
type: "field",
|
|
101
|
+
fieldview: "show",
|
|
102
|
+
field_name: "pages",
|
|
103
|
+
configuration: {},
|
|
104
|
+
},
|
|
105
|
+
alignment: "Default",
|
|
106
|
+
header_label: "Pages",
|
|
107
|
+
col_width_units: "px",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
list_columns: true,
|
|
111
|
+
};
|
|
81
112
|
itShouldRedirectUnauthToLogin("/viewedit/new");
|
|
82
113
|
|
|
83
114
|
it("show new view", async () => {
|
|
@@ -117,11 +148,8 @@ describe("viewedit new List", () => {
|
|
|
117
148
|
.post("/viewedit/config/mybooklist")
|
|
118
149
|
.send("contextEnc=" + ctx)
|
|
119
150
|
.send("stepName=Columns")
|
|
120
|
-
.send("
|
|
121
|
-
.send("
|
|
122
|
-
.send("type_1=Field")
|
|
123
|
-
.send("field_name_1=pages")
|
|
124
|
-
.send("create_view_display=Link")
|
|
151
|
+
.send("columns=" + encodeURIComponent(JSON.stringify(columns)))
|
|
152
|
+
.send("layout=" + encodeURIComponent(JSON.stringify(layout)))
|
|
125
153
|
.set("Cookie", loginCookie)
|
|
126
154
|
.expect(toInclude("Default state"));
|
|
127
155
|
});
|
|
@@ -205,6 +233,23 @@ describe("viewedit new List", () => {
|
|
|
205
233
|
});
|
|
206
234
|
|
|
207
235
|
describe("viewedit new List with one field", () => {
|
|
236
|
+
const columns = [{ type: "Field", field_name: "author", state_field: "on" }];
|
|
237
|
+
const layout = {
|
|
238
|
+
besides: [
|
|
239
|
+
{
|
|
240
|
+
contents: {
|
|
241
|
+
type: "field",
|
|
242
|
+
fieldview: "as_text",
|
|
243
|
+
field_name: "author",
|
|
244
|
+
configuration: {},
|
|
245
|
+
},
|
|
246
|
+
alignment: "Default",
|
|
247
|
+
header_label: "Author",
|
|
248
|
+
col_width_units: "px",
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
list_columns: true,
|
|
252
|
+
};
|
|
208
253
|
it("submit new view", async () => {
|
|
209
254
|
const loginCookie = await getAdminLoginCookie();
|
|
210
255
|
|
|
@@ -234,9 +279,8 @@ describe("viewedit new List with one field", () => {
|
|
|
234
279
|
.post("/viewedit/config/mybooklist1")
|
|
235
280
|
.send("contextEnc=" + ctx)
|
|
236
281
|
.send("stepName=Columns")
|
|
237
|
-
.send("
|
|
238
|
-
.send("
|
|
239
|
-
.send("create_view_display=Link")
|
|
282
|
+
.send("columns=" + encodeURIComponent(JSON.stringify(columns)))
|
|
283
|
+
.send("layout=" + encodeURIComponent(JSON.stringify(layout)))
|
|
240
284
|
.set("Cookie", loginCookie)
|
|
241
285
|
.expect(toInclude("Default state"));
|
|
242
286
|
});
|