@saltcorn/server 0.8.0-beta.4 → 0.8.1-beta.0
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/app.js +7 -6
- package/auth/admin.js +260 -217
- package/auth/index.js +20 -20
- package/auth/roleadmin.js +2 -9
- package/auth/routes.js +193 -139
- package/auth/testhelp.js +62 -55
- package/fixture_persons.js +1 -1
- package/index.js +22 -22
- package/locales/en.json +13 -1
- package/locales/fr.json +14 -2
- package/locales/ru.json +25 -19
- package/markup/admin.js +22 -15
- package/markup/blockly.js +1 -1
- package/markup/expression_blurb.js +15 -15
- package/markup/forms.js +21 -22
- package/markup/index.js +20 -20
- package/markup/plugin-store.js +4 -4
- package/package.json +8 -8
- package/public/diagram_utils.js +22 -9
- package/public/saltcorn-common.js +128 -68
- package/public/saltcorn.css +6 -0
- package/public/saltcorn.js +68 -20
- package/restart_watcher.js +157 -157
- package/routes/actions.js +4 -11
- package/routes/admin.js +14 -6
- package/routes/api.js +11 -18
- package/routes/common_lists.js +127 -130
- package/routes/delete.js +2 -2
- package/routes/edit.js +1 -1
- package/routes/fields.js +48 -2
- package/routes/files.js +112 -94
- package/routes/homepage.js +1 -1
- package/routes/infoarch.js +1 -1
- package/routes/list.js +6 -5
- package/routes/packs.js +1 -2
- package/routes/pageedit.js +1 -1
- package/routes/tag_entries.js +1 -1
- package/routes/tenant.js +2 -1
- package/routes/utils.js +3 -1
- package/routes/view.js +14 -2
- package/routes/viewedit.js +35 -0
- package/s3storage.js +13 -11
- package/serve.js +35 -31
- package/systemd.js +23 -21
- package/tests/fields.test.js +23 -0
- package/wrapper.js +46 -45
package/auth/testhelp.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module auth/testhelp
|
|
4
4
|
* @subcategory auth
|
|
5
5
|
*/
|
|
6
|
+
/*global it, expect*/
|
|
6
7
|
const request = require("supertest");
|
|
7
8
|
const app = require("../app");
|
|
8
9
|
const getApp = require("../app");
|
|
@@ -10,8 +11,8 @@ const fixtures = require("@saltcorn/data/db/fixtures");
|
|
|
10
11
|
const reset = require("@saltcorn/data/db/reset_schema");
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {string} loc
|
|
14
|
+
*
|
|
15
|
+
* @param {string} loc
|
|
15
16
|
* @returns {void}
|
|
16
17
|
* @throws {Error}
|
|
17
18
|
*/
|
|
@@ -27,62 +28,68 @@ const toRedirect = (loc) => (res) => {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @param {number} txt
|
|
32
|
-
* @param {number} expCode
|
|
31
|
+
*
|
|
32
|
+
* @param {number} txt
|
|
33
|
+
* @param {number} expCode
|
|
33
34
|
* @returns {void}
|
|
34
35
|
* @throws {Error}
|
|
35
36
|
*/
|
|
36
|
-
const toInclude =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
37
|
+
const toInclude =
|
|
38
|
+
(txt, expCode = 200) =>
|
|
39
|
+
(res) => {
|
|
40
|
+
if (res.statusCode !== expCode) {
|
|
41
|
+
console.log(res.text);
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Expected status ${expCode} when lookinng for "${txt}", received ${res.statusCode}`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!res.text.includes(txt)) {
|
|
48
|
+
console.log(res.text);
|
|
49
|
+
throw new Error(`Expected text ${txt} not found`);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @param {number} expCode
|
|
54
|
+
*
|
|
55
|
+
* @param {number} expCode
|
|
53
56
|
* @returns {void}
|
|
54
57
|
* @throws {Error}
|
|
55
58
|
*/
|
|
56
|
-
const toSucceed =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
59
|
+
const toSucceed =
|
|
60
|
+
(expCode = 200) =>
|
|
61
|
+
(res) => {
|
|
62
|
+
if (res.statusCode !== expCode) {
|
|
63
|
+
console.log(res.text);
|
|
64
|
+
throw new Error(`Expected status ${expCode}, received ${res.statusCode}`);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
62
67
|
|
|
63
68
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @param {number} txt
|
|
66
|
-
* @param {number} expCode
|
|
69
|
+
*
|
|
70
|
+
* @param {number} txt
|
|
71
|
+
* @param {number} expCode
|
|
67
72
|
* @returns {void}
|
|
68
73
|
* @throws {Error}
|
|
69
|
-
*/
|
|
70
|
-
const toNotInclude =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
74
|
+
*/
|
|
75
|
+
const toNotInclude =
|
|
76
|
+
(txt, expCode = 200) =>
|
|
77
|
+
(res) => {
|
|
78
|
+
if (res.statusCode !== expCode) {
|
|
79
|
+
console.log(res.text);
|
|
80
|
+
throw new Error(
|
|
81
|
+
`Expected status ${expCode} when not lookinng for "${txt}", received ${res.statusCode}`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (res.text.includes(txt)) {
|
|
86
|
+
console.log(res.text);
|
|
87
|
+
throw new Error(`Expected text ${txt} to be absent, but was present`);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
83
90
|
|
|
84
91
|
/**
|
|
85
|
-
*
|
|
92
|
+
*
|
|
86
93
|
* @returns {Promise<void>}
|
|
87
94
|
*/
|
|
88
95
|
const getStaffLoginCookie = async () => {
|
|
@@ -96,7 +103,7 @@ const getStaffLoginCookie = async () => {
|
|
|
96
103
|
};
|
|
97
104
|
|
|
98
105
|
/**
|
|
99
|
-
*
|
|
106
|
+
*
|
|
100
107
|
* @returns {Promise<void>}
|
|
101
108
|
*/
|
|
102
109
|
const getAdminLoginCookie = async () => {
|
|
@@ -111,9 +118,9 @@ const getAdminLoginCookie = async () => {
|
|
|
111
118
|
};
|
|
112
119
|
|
|
113
120
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @param {string} path
|
|
116
|
-
* @param {string} dest
|
|
121
|
+
*
|
|
122
|
+
* @param {string} path
|
|
123
|
+
* @param {string} dest
|
|
117
124
|
* @returns {void}
|
|
118
125
|
*/
|
|
119
126
|
const itShouldRedirectUnauthToLogin = (path, dest) => {
|
|
@@ -137,8 +144,8 @@ const resetToFixtures = async () => {
|
|
|
137
144
|
};
|
|
138
145
|
|
|
139
146
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param {*} pred
|
|
147
|
+
*
|
|
148
|
+
* @param {*} pred
|
|
142
149
|
* @returns {void}
|
|
143
150
|
* @throws {Error}
|
|
144
151
|
*/
|
|
@@ -155,9 +162,9 @@ const succeedJsonWith = (pred) => (res) => {
|
|
|
155
162
|
};
|
|
156
163
|
|
|
157
164
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @param {number} code
|
|
160
|
-
* @param {number} pred
|
|
165
|
+
*
|
|
166
|
+
* @param {number} code
|
|
167
|
+
* @param {number} pred
|
|
161
168
|
* @returns {void}
|
|
162
169
|
* @throws {Error}
|
|
163
170
|
*/
|
|
@@ -174,8 +181,8 @@ const respondJsonWith = (code, pred) => (res) => {
|
|
|
174
181
|
};
|
|
175
182
|
|
|
176
183
|
/**
|
|
177
|
-
*
|
|
178
|
-
* @param {object} res
|
|
184
|
+
*
|
|
185
|
+
* @param {object} res
|
|
179
186
|
* @returns {void}
|
|
180
187
|
* @throws {Error}
|
|
181
188
|
*/
|
package/fixture_persons.js
CHANGED
|
@@ -13,7 +13,7 @@ const basePlugin = require("@saltcorn/base-plugin");
|
|
|
13
13
|
getState().registerPlugin("base", basePlugin);
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {object[]} vs
|
|
16
|
+
* @param {object[]} vs
|
|
17
17
|
* @returns {object}
|
|
18
18
|
*/
|
|
19
19
|
const rndElem = (vs) => vs[Math.floor(Math.random() * vs.length)];
|
package/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
// for the jsdoc documentation
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @category server
|
|
5
|
-
* @module server/index
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* All files and sub-modules in the saltcorn-markup package.
|
|
10
|
-
* @namespace server_overview
|
|
11
|
-
* @property {module:auth/index~auth_overview} auth
|
|
12
|
-
* @property {module:markup/index~markup_overview} markup
|
|
13
|
-
* @property {module:routes/index~routes_overview} routes
|
|
14
|
-
*
|
|
15
|
-
* @property {module:app} app
|
|
16
|
-
* @property {module:errors} errors
|
|
17
|
-
* @property {module:load_plugins} load_plugins
|
|
18
|
-
* @property {module:serve} serve
|
|
19
|
-
* @property {module:systemd} systemd
|
|
20
|
-
* @property {module:wrapper} wrapper
|
|
21
|
-
* @category server
|
|
22
|
-
*/
|
|
1
|
+
// for the jsdoc documentation
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @category server
|
|
5
|
+
* @module server/index
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* All files and sub-modules in the saltcorn-markup package.
|
|
10
|
+
* @namespace server_overview
|
|
11
|
+
* @property {module:auth/index~auth_overview} auth
|
|
12
|
+
* @property {module:markup/index~markup_overview} markup
|
|
13
|
+
* @property {module:routes/index~routes_overview} routes
|
|
14
|
+
*
|
|
15
|
+
* @property {module:app} app
|
|
16
|
+
* @property {module:errors} errors
|
|
17
|
+
* @property {module:load_plugins} load_plugins
|
|
18
|
+
* @property {module:serve} serve
|
|
19
|
+
* @property {module:systemd} systemd
|
|
20
|
+
* @property {module:wrapper} wrapper
|
|
21
|
+
* @category server
|
|
22
|
+
*/
|
package/locales/en.json
CHANGED
|
@@ -1055,5 +1055,17 @@
|
|
|
1055
1055
|
"Specifies a filter for what file types the user can pick from the file input dialog box. Example is `text/csv,audio/*,video/*,image/*`": "Specifies a filter for what file types the user can pick from the file input dialog box. Example is `text/csv,audio/*,video/*,image/*`",
|
|
1056
1056
|
"Default Files accept filter": "Default Files accept filter",
|
|
1057
1057
|
"Specifies a default filter for what file types the user can pick from the file input dialog box. Example is `.doc, text/csv,audio/*,video/*,image/*`": "Specifies a default filter for what file types the user can pick from the file input dialog box. Example is `.doc, text/csv,audio/*,video/*,image/*`",
|
|
1058
|
-
"Destination page": "Destination page"
|
|
1058
|
+
"Destination page": "Destination page",
|
|
1059
|
+
"Module Store endpoint": "Module Store endpoint",
|
|
1060
|
+
"Authentication settings updated": "Authentication settings updated",
|
|
1061
|
+
"Log client errors": "Log client errors",
|
|
1062
|
+
"Record all client errors in the crash log": "Record all client errors in the crash log",
|
|
1063
|
+
"Default File accept filter": "Default File accept filter",
|
|
1064
|
+
"File upload debug": "File upload debug",
|
|
1065
|
+
"Turn on to debug file upload in express-fileupload.": "Turn on to debug file upload in express-fileupload.",
|
|
1066
|
+
"Upload size limit (Kb)": "Upload size limit (Kb)",
|
|
1067
|
+
"Maximum upload file size in kilobytes": "Maximum upload file size in kilobytes",
|
|
1068
|
+
"File upload timeout": "File upload timeout",
|
|
1069
|
+
"Defines how long to wait for data before aborting file upload. Set to 0 if you want to turn off timeout checks. ": "Defines how long to wait for data before aborting file upload. Set to 0 if you want to turn off timeout checks. ",
|
|
1070
|
+
"Files settings": "Files settings"
|
|
1059
1071
|
}
|
package/locales/fr.json
CHANGED
|
@@ -274,5 +274,17 @@
|
|
|
274
274
|
"Field %s deleted": "Champ %s supprimé",
|
|
275
275
|
"Language: ": "Langage: ",
|
|
276
276
|
"Local": "Local",
|
|
277
|
-
"Language changed to %s": "Langage changé vers %s"
|
|
278
|
-
|
|
277
|
+
"Language changed to %s": "Langage changé vers %s",
|
|
278
|
+
"CSV upload": "CSV upload",
|
|
279
|
+
"Create page": "Create page",
|
|
280
|
+
"Action": "Action",
|
|
281
|
+
"Table or Channel": "Table or Channel",
|
|
282
|
+
"Add trigger": "Add trigger",
|
|
283
|
+
"Upload file(s)": "Upload file(s)",
|
|
284
|
+
"About application": "About application",
|
|
285
|
+
"Modules": "Modules",
|
|
286
|
+
"Users and security": "Users and security",
|
|
287
|
+
"Site structure": "Site structure",
|
|
288
|
+
"Events": "Events",
|
|
289
|
+
"Are you sure?": "Are you sure?"
|
|
290
|
+
}
|
package/locales/ru.json
CHANGED
|
@@ -920,28 +920,34 @@
|
|
|
920
920
|
"Permissions settings": "Настройки разрешений",
|
|
921
921
|
"Permissions": "Разрешения",
|
|
922
922
|
"Permissions settings updated": "Настройки разрешений обновлены",
|
|
923
|
-
"Upload file(s)": "
|
|
924
|
-
"Split paste": "
|
|
925
|
-
"Separate paste content into separate inputs": "
|
|
926
|
-
"Preview": "
|
|
927
|
-
"Create new row": "
|
|
928
|
-
"Descending?": "
|
|
929
|
-
"Only include rows where this formula is true. ": "
|
|
930
|
-
"Use %s to access current user ID": "
|
|
931
|
-
"Formula value": "
|
|
932
|
-
"Units": "
|
|
923
|
+
"Upload file(s)": "Загрузка файл(ов)",
|
|
924
|
+
"Split paste": "Раздельная вставка",
|
|
925
|
+
"Separate paste content into separate inputs": "Разделять выставляемый конент на отдельные элементы",
|
|
926
|
+
"Preview": "Превью",
|
|
927
|
+
"Create new row": "Создать новую строку",
|
|
928
|
+
"Descending?": "В обратном порядке?",
|
|
929
|
+
"Only include rows where this formula is true. ": "Включать только строки, для который формула возвращает true. ",
|
|
930
|
+
"Use %s to access current user ID": "Использовать %s для доступа к ID пользователя",
|
|
931
|
+
"Formula value": "Значение формулы",
|
|
932
|
+
"Units": "Единицы",
|
|
933
933
|
"%s view - %s on %s": "%s view - %s on %s",
|
|
934
|
-
"Password Repeat": "
|
|
935
|
-
"Remember me": "
|
|
936
|
-
"Files accept filter ": "Files accept filter ",
|
|
934
|
+
"Password Repeat": "Повторите пароль",
|
|
935
|
+
"Remember me": "Запомнить меня",
|
|
937
936
|
"Specifies a filter for what file types the user can pick from the file input dialog box. Example is `text/csv,audio/*,video/*,image/*`": "Specifies a filter for what file types the user can pick from the file input dialog box. Example is `text/csv,audio/*,video/*,image/*`",
|
|
938
|
-
"Home Page by Role": "
|
|
939
|
-
"Files accept filter": "
|
|
940
|
-
"Specify how to create a new row": "
|
|
941
|
-
"Cascade delete to file": "
|
|
937
|
+
"Home Page by Role": "Домашняя страница в соответствие с ролью",
|
|
938
|
+
"Files accept filter": "Фильтр типов файлов при загрузке",
|
|
939
|
+
"Specify how to create a new row": "Укажите как создавать новую строку",
|
|
940
|
+
"Cascade delete to file": "Каскадное удаление к файлу",
|
|
942
941
|
"Deleting a row will also delete the file referenced by this field": "Deleting a row will also delete the file referenced by this field",
|
|
943
942
|
"Specifies a filter for what file types the user can pick from the file input dialog box. Example is `.doc,audio/*,video/*,image/*`": "Specifies a filter for what file types the user can pick from the file input dialog box. Example is `.doc,audio/*,video/*,image/*`",
|
|
944
|
-
"Default Files accept filter": "Default Files accept filter",
|
|
945
943
|
"Specifies a default filter for what file types the user can pick from the file input dialog box. Example is `.doc, text/csv,audio/*,video/*,image/*`": "Specifies a default filter for what file types the user can pick from the file input dialog box. Example is `.doc, text/csv,audio/*,video/*,image/*`",
|
|
946
|
-
"No file found": "
|
|
944
|
+
"No file found": "Файл не найден",
|
|
945
|
+
"Default File accept filter": "Фильтр типов файлов для загрузки",
|
|
946
|
+
"File upload debug": "Флаг отладки загрузки файлов",
|
|
947
|
+
"Turn on to debug file upload in express-fileupload.": "Turn on to debug file upload in express-fileupload.",
|
|
948
|
+
"File upload size limit in bytes": "Ограничение на размер файла при загрузке (в байтах)",
|
|
949
|
+
"Defines in bytes limit for upload files in express-fileupload.": "Defines in bytes limit for upload files in express-fileupload.",
|
|
950
|
+
"File upload timeout": "Таймаут загрузки файлов",
|
|
951
|
+
"Defines how long to wait for data before aborting for express-fileupload. Set to 0 if you want to turn off timeout checks. ": "Defines how long to wait for data before aborting for express-fileupload. Set to 0 if you want to turn off timeout checks. ",
|
|
952
|
+
"Files settings": "Настройки Файлов"
|
|
947
953
|
}
|
package/markup/admin.js
CHANGED
|
@@ -93,15 +93,15 @@ const add_edit_bar = ({
|
|
|
93
93
|
{ class: "alert alert-light d-print-none admin-edit-bar" },
|
|
94
94
|
title,
|
|
95
95
|
what && span({ class: "ms-1 me-2 badge bg-primary" }, what),
|
|
96
|
-
viewSpec,
|
|
97
96
|
a({ class: "ms-2", href: url }, "Edit ", i({ class: "fas fa-edit" })),
|
|
98
97
|
cfgUrl
|
|
99
98
|
? a(
|
|
100
|
-
{ class: "ms-1", href: cfgUrl },
|
|
99
|
+
{ class: "ms-1 me-3", href: cfgUrl },
|
|
101
100
|
"Configure ",
|
|
102
101
|
i({ class: "fas fa-cog" })
|
|
103
102
|
)
|
|
104
|
-
: ""
|
|
103
|
+
: "",
|
|
104
|
+
viewSpec
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
if (contents.above) {
|
|
@@ -344,7 +344,7 @@ const viewAttributes = async (key) => {
|
|
|
344
344
|
const flash_restart_if_required = (cfgForm, req) => {
|
|
345
345
|
let restart = false;
|
|
346
346
|
cfgForm.fields.forEach((f) => {
|
|
347
|
-
if (configTypes[f.name]
|
|
347
|
+
if (configTypes[f.name]?.restart_required) {
|
|
348
348
|
const current = getState().getConfig(f.name);
|
|
349
349
|
if (current !== cfgForm.values[f.name]) restart = true;
|
|
350
350
|
}
|
|
@@ -384,8 +384,24 @@ const config_fields_form = async ({
|
|
|
384
384
|
const state = getState();
|
|
385
385
|
const fields = [];
|
|
386
386
|
const tenant = db.getTenantSchema();
|
|
387
|
-
|
|
387
|
+
const roleAttribs = {
|
|
388
|
+
options: (await User.get_roles()).map((r) => ({
|
|
389
|
+
label: r.role,
|
|
390
|
+
name: `${r.id}`,
|
|
391
|
+
})),
|
|
392
|
+
};
|
|
393
|
+
const getTenants = async () => {
|
|
394
|
+
const tens = await db.select("_sc_tenants");
|
|
395
|
+
return { options: tens.map((t) => t.subdomain) };
|
|
396
|
+
};
|
|
388
397
|
for (const name of field_names) {
|
|
398
|
+
if (typeof name === "object" && name.section_header) {
|
|
399
|
+
fields.push({
|
|
400
|
+
input_type: "section_header",
|
|
401
|
+
label: name.section_header,
|
|
402
|
+
});
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
389
405
|
values[name] = state.getConfig(name);
|
|
390
406
|
// console.log(`config field name: %s`,name);
|
|
391
407
|
if (configTypes[name].root_only && tenant !== db.connectObj.default_schema)
|
|
@@ -395,16 +411,7 @@ const config_fields_form = async ({
|
|
|
395
411
|
const isTenant = configTypes[name].type === "Tenant";
|
|
396
412
|
const label = configTypes[name].label || name;
|
|
397
413
|
const sublabel = configTypes[name].sublabel || configTypes[name].blurb;
|
|
398
|
-
|
|
399
|
-
options: (await User.get_roles()).map((r) => ({
|
|
400
|
-
label: r.role,
|
|
401
|
-
name: `${r.id}`,
|
|
402
|
-
})),
|
|
403
|
-
};
|
|
404
|
-
const getTenants = async () => {
|
|
405
|
-
const tens = await db.select("_sc_tenants");
|
|
406
|
-
return { options: tens.map((t) => t.subdomain) };
|
|
407
|
-
};
|
|
414
|
+
|
|
408
415
|
fields.push({
|
|
409
416
|
name,
|
|
410
417
|
...configTypes[name],
|
package/markup/blockly.js
CHANGED
|
@@ -9,7 +9,7 @@ const { contract, is } = require("contractis");
|
|
|
9
9
|
const { getState } = require("@saltcorn/data/db/state");
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* @param {*} type
|
|
12
|
+
* @param {*} type
|
|
13
13
|
* @returns {*}
|
|
14
14
|
*/
|
|
15
15
|
const toJsType = (type) =>
|
|
@@ -23,8 +23,8 @@ const toJsType = (type) =>
|
|
|
23
23
|
}[type] || type);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* @param {*} type
|
|
27
|
-
* @param {object[]} fields
|
|
26
|
+
* @param {*} type
|
|
27
|
+
* @param {object[]} fields
|
|
28
28
|
* @returns {string[]}
|
|
29
29
|
*/
|
|
30
30
|
const intExamples = (type, fields) => {
|
|
@@ -43,8 +43,8 @@ const intExamples = (type, fields) => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* @param {*} type
|
|
47
|
-
* @param {object[]} fields
|
|
46
|
+
* @param {*} type
|
|
47
|
+
* @param {object[]} fields
|
|
48
48
|
* @returns {string[]}
|
|
49
49
|
*/
|
|
50
50
|
const colorExamples = (type, fields) => {
|
|
@@ -58,8 +58,8 @@ const colorExamples = (type, fields) => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* @param {*} type
|
|
62
|
-
* @param {object[]} fields
|
|
61
|
+
* @param {*} type
|
|
62
|
+
* @param {object[]} fields
|
|
63
63
|
* @returns {string[]}
|
|
64
64
|
*/
|
|
65
65
|
const stringExamples = (type, fields) => {
|
|
@@ -78,8 +78,8 @@ const stringExamples = (type, fields) => {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* @param {*} type
|
|
82
|
-
* @param {object[]} fields
|
|
81
|
+
* @param {*} type
|
|
82
|
+
* @param {object[]} fields
|
|
83
83
|
* @returns {string[]}
|
|
84
84
|
*/
|
|
85
85
|
const floatExamples = (type, fields) => {
|
|
@@ -107,8 +107,8 @@ const floatExamples = (type, fields) => {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* @param {*} type
|
|
111
|
-
* @param {object[]} fields
|
|
110
|
+
* @param {*} type
|
|
111
|
+
* @param {object[]} fields
|
|
112
112
|
* @returns {string[]}
|
|
113
113
|
*/
|
|
114
114
|
const boolExamples = (type, fields) => {
|
|
@@ -139,10 +139,10 @@ const boolExamples = (type, fields) => {
|
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* @param {string} type
|
|
143
|
-
* @param {*} stored
|
|
144
|
-
* @param {object[]} allFields
|
|
145
|
-
* @param {object} req
|
|
142
|
+
* @param {string} type
|
|
143
|
+
* @param {*} stored
|
|
144
|
+
* @param {object[]} allFields
|
|
145
|
+
* @param {object} req
|
|
146
146
|
* @returns {p[]}
|
|
147
147
|
*/
|
|
148
148
|
const expressionBlurb = (type, stored, allFields, req) => {
|
package/markup/forms.js
CHANGED
|
@@ -50,33 +50,32 @@ const editRoleForm = ({ url, current_role, roles, req }) =>
|
|
|
50
50
|
* @param folder
|
|
51
51
|
* @returns {Form}
|
|
52
52
|
*/
|
|
53
|
-
const fileUploadForm = (req, folder
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return frm;
|
|
53
|
+
const fileUploadForm = (req, folder) => {
|
|
54
|
+
const frm = form(
|
|
55
|
+
{
|
|
56
|
+
action: "/files/upload",
|
|
57
|
+
method: "post",
|
|
58
|
+
enctype: "multipart/form-data",
|
|
59
|
+
},
|
|
60
|
+
csrfField(req),
|
|
61
|
+
label(req.__("Upload file(s)")),
|
|
62
|
+
input({
|
|
63
|
+
name: "file",
|
|
64
|
+
class: "form-control ms-1 w-unset d-inline",
|
|
65
|
+
type: "file",
|
|
66
|
+
onchange: "form.submit()",
|
|
67
|
+
multiple: true,
|
|
68
|
+
}),
|
|
69
|
+
folder && input({ type: "hidden", name: "folder", value: folder })
|
|
70
|
+
);
|
|
71
|
+
return frm;
|
|
73
72
|
};
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* Get Wizard Card Title
|
|
77
76
|
* @param {string} wizardTitle
|
|
78
|
-
* @param {*} wf
|
|
79
|
-
* @param {object} wfres
|
|
77
|
+
* @param {*} wf
|
|
78
|
+
* @param {object} wfres
|
|
80
79
|
* @returns {string}
|
|
81
80
|
*/
|
|
82
81
|
const wizardCardTitle = (wizardTitle, wf, wfres) =>
|
package/markup/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// for the jsdoc documentation
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @category server
|
|
5
|
-
* @module markup/index
|
|
6
|
-
* @subcategory markup
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* All files in the auth module.
|
|
11
|
-
* @namespace markup_overview
|
|
12
|
-
* @property {module:markup/admin} admin
|
|
13
|
-
* @property {module:markup/blockly} blockly
|
|
14
|
-
* @property {module:markup/expression_blurb} expression_blurb
|
|
15
|
-
* @property {module:markup/forms} forms
|
|
16
|
-
* @property {module:markup/plugin-store} plugin-store
|
|
17
|
-
*
|
|
18
|
-
* @category server
|
|
19
|
-
* @subcategory markup
|
|
20
|
-
*/
|
|
1
|
+
// for the jsdoc documentation
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @category server
|
|
5
|
+
* @module markup/index
|
|
6
|
+
* @subcategory markup
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* All files in the auth module.
|
|
11
|
+
* @namespace markup_overview
|
|
12
|
+
* @property {module:markup/admin} admin
|
|
13
|
+
* @property {module:markup/blockly} blockly
|
|
14
|
+
* @property {module:markup/expression_blurb} expression_blurb
|
|
15
|
+
* @property {module:markup/forms} forms
|
|
16
|
+
* @property {module:markup/plugin-store} plugin-store
|
|
17
|
+
*
|
|
18
|
+
* @category server
|
|
19
|
+
* @subcategory markup
|
|
20
|
+
*/
|
package/markup/plugin-store.js
CHANGED
|
@@ -101,10 +101,10 @@ const showRepository = (repo) =>
|
|
|
101
101
|
!repo
|
|
102
102
|
? repo
|
|
103
103
|
: repo.url
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
? link(repo.url, repo.url)
|
|
105
|
+
: repo.startsWith && repo.startsWith("github:")
|
|
106
|
+
? link(repo.replace("github:", "https://github.com/"), repo)
|
|
107
|
+
: repo;
|
|
108
108
|
|
|
109
109
|
module.exports = {
|
|
110
110
|
plugin_types_info_card,
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-beta.0",
|
|
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.8.
|
|
10
|
-
"@saltcorn/builder": "0.8.
|
|
11
|
-
"@saltcorn/data": "0.8.
|
|
12
|
-
"@saltcorn/admin-models": "0.8.
|
|
13
|
-
"@saltcorn/filemanager": "0.8.
|
|
14
|
-
"@saltcorn/markup": "0.8.
|
|
15
|
-
"@saltcorn/sbadmin2": "0.8.
|
|
9
|
+
"@saltcorn/base-plugin": "0.8.1-beta.0",
|
|
10
|
+
"@saltcorn/builder": "0.8.1-beta.0",
|
|
11
|
+
"@saltcorn/data": "0.8.1-beta.0",
|
|
12
|
+
"@saltcorn/admin-models": "0.8.1-beta.0",
|
|
13
|
+
"@saltcorn/filemanager": "0.8.1-beta.0",
|
|
14
|
+
"@saltcorn/markup": "0.8.1-beta.0",
|
|
15
|
+
"@saltcorn/sbadmin2": "0.8.1-beta.0",
|
|
16
16
|
"@socket.io/cluster-adapter": "^0.1.0",
|
|
17
17
|
"@socket.io/sticky": "^1.0.1",
|
|
18
18
|
"aws-sdk": "^2.1037.0",
|