@saltcorn/server 1.0.0-beta.17 → 1.0.0-beta.19
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/help/Aggregation where formula.tmd +11 -0
- package/help/Calculated fields.tmd +28 -0
- package/help/Protected fields.tmd +4 -0
- package/help/Snapshots.tmd +19 -0
- package/help/Table history.tmd +42 -0
- package/load_plugins.js +9 -1
- package/locales/en.json +4 -2
- package/locales/pl.json +407 -85
- package/package.json +9 -9
- package/public/saltcorn-common.js +42 -0
- package/public/saltcorn.css +17 -0
- package/public/saltcorn.js +1 -0
- package/routes/admin.js +67 -5
- package/routes/fields.js +9 -0
- package/routes/plugins.js +8 -6
- package/routes/tables.js +4 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
The where formula allows you to restrict the rows included in the aggregations.
|
|
2
|
+
|
|
3
|
+
The formula should take the form of a JavaScript boolean expression such as
|
|
4
|
+
`a === b` or `x>y && w==1` when is based on the row values in the rows in the target table for
|
|
5
|
+
inclusion in the aggregation. For instance, if you are displaying aggregations about
|
|
6
|
+
a row from a Projects table, and a Task table has a key to projects field and a Boolean
|
|
7
|
+
field called `completed`, you may want to show the number of not-completed tasks for the Project.
|
|
8
|
+
In this case use the where expression `completed == false`.
|
|
9
|
+
|
|
10
|
+
You cannot here use view state or values from the row about which you are displaying aggregations. However,
|
|
11
|
+
if a user is logged in, the `user` variable can be used to access user fields, such as `user.id`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
A calculated field is a column that holds values that are not entered
|
|
2
|
+
or changed directly but are instead calculated automatically from other
|
|
3
|
+
values in that row of from rows in other tables related by a key field.
|
|
4
|
+
|
|
5
|
+
There are two types of calculated field values:
|
|
6
|
+
|
|
7
|
+
*Not stored*: calculated fields that are not stored in the database are
|
|
8
|
+
recalculated every time the row is accessed. They are defined by a
|
|
9
|
+
JavaScript expression where the values of the other fields are in scope.
|
|
10
|
+
They are suitable for quick calculations that depend only on other values
|
|
11
|
+
in the same row. Because they are recalculated they are guaranteed to be
|
|
12
|
+
up to date. Non-stored fields cannot access data in related rows by join
|
|
13
|
+
fields or aggregations and cannot use asynchronous functions provided by
|
|
14
|
+
modules. They can use synchronous functions.
|
|
15
|
+
|
|
16
|
+
*Stored*: the values of stored fields are stored in the database table.
|
|
17
|
+
They are more flexible in the way they can be defined. Stored fields can
|
|
18
|
+
be defined either by a JavaScript expression or by an aggregation. When
|
|
19
|
+
defined by a JavaScript expression, join fields can be accessed by the
|
|
20
|
+
dot notation. Stored fields may also use both synchronous and asynchronous f
|
|
21
|
+
unctions provided by modules. Asynchronous functions can in principle do
|
|
22
|
+
input/output including calling APIs. This expression will be evaluated
|
|
23
|
+
every time the row changes.
|
|
24
|
+
|
|
25
|
+
Stored fields that are defined by an aggregation are automatically updated
|
|
26
|
+
when one of the child rows is updated. Stored fields that are based on
|
|
27
|
+
JavaScript expressions involving join felds are not automatically updated.
|
|
28
|
+
You need to run the recalculate stored fields action to update them
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
A snapshot is a saved format of your application that includes all of
|
|
2
|
+
your application structure (table and fields definitions, views pages
|
|
3
|
+
and configuration settings) but excludes all of your data, that is,
|
|
4
|
+
table rows and files. A snapshot is the same format as a pack - a snapshot
|
|
5
|
+
is in fact merely a full pack of the application. (To create a partial
|
|
6
|
+
pack of the application, use tags or the pack export in the module store).
|
|
7
|
+
|
|
8
|
+
Snapshots have several possible uses:
|
|
9
|
+
|
|
10
|
+
* If you have two different servers one for production and one for development
|
|
11
|
+
then you can make changes to the development server and use a snapshot to
|
|
12
|
+
move those changes to the production instance
|
|
13
|
+
|
|
14
|
+
* By enabling periodic snapshots Saltcorn allows you to restore versions of
|
|
15
|
+
views, pages and triggers after you have made changes. This allows you to
|
|
16
|
+
undo mistakes that you have made in building.
|
|
17
|
+
|
|
18
|
+
* If your application contains a large amount of data that can quickly be
|
|
19
|
+
regenerated you may want to use snapshots instead of backups to save your application.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
When version history on a database table is enabled in Saltcorn,
|
|
2
|
+
changes to row values are recorded in a secondary, hidden table.
|
|
3
|
+
This allows you to restore previous versions of individual rows
|
|
4
|
+
and undelete deleted rows.
|
|
5
|
+
|
|
6
|
+
The downside to enabling version history on tables is that this
|
|
7
|
+
can lead to a lot of data being retained which may mean your
|
|
8
|
+
database disk requirements will grow. In addition it will impact
|
|
9
|
+
performance when making changes to rows. There should be no
|
|
10
|
+
performance impact on reading data from the database.
|
|
11
|
+
|
|
12
|
+
Note that when the history is first enabled the existing rows in
|
|
13
|
+
the table are not copied into the history table in their present
|
|
14
|
+
state. Only when a change is made to a row (or a row is created)
|
|
15
|
+
is the new row copied into the history table.
|
|
16
|
+
|
|
17
|
+
Enabling version history gives the administrator access to the
|
|
18
|
+
version history in the administrator's data edit facility (Edit
|
|
19
|
+
button on the table page). Each row will show the number of versions
|
|
20
|
+
recorded and by clicking this you will see the list of versions.
|
|
21
|
+
Each version shows the value for each field, the user who made the
|
|
22
|
+
change, the time at which the change was made and an option to
|
|
23
|
+
restore. This is the only facility for interacting with the version
|
|
24
|
+
history in core Saltcorn.
|
|
25
|
+
|
|
26
|
+
The history-control module provides additional facilities for
|
|
27
|
+
interacting with the history. The history-control module provides:
|
|
28
|
+
|
|
29
|
+
* Actions to undo and redo row changes that will move the current
|
|
30
|
+
row backwards and forwards in the table history
|
|
31
|
+
|
|
32
|
+
* A history field difference view pattern that allows users to
|
|
33
|
+
compare different versions of a field value
|
|
34
|
+
|
|
35
|
+
* A "History for database table" table provider that can be used to create a "virtual"
|
|
36
|
+
table based on the history of an existing table. This table will have
|
|
37
|
+
all the fields of the original table and fields for the user making
|
|
38
|
+
the change and the time of the change being made
|
|
39
|
+
|
|
40
|
+
* A restore_from_history action that can be used on a view of the table
|
|
41
|
+
history (on the provided table) to restore or undelete any version of
|
|
42
|
+
a specific row
|
package/load_plugins.js
CHANGED
|
@@ -55,7 +55,15 @@ const getEngineInfos = async (plugin, forceFetch) => {
|
|
|
55
55
|
* @param plugin plugin to load
|
|
56
56
|
*/
|
|
57
57
|
const ensurePluginSupport = async (plugin, forceFetch) => {
|
|
58
|
-
|
|
58
|
+
let versions = await getEngineInfos(plugin, forceFetch);
|
|
59
|
+
if (
|
|
60
|
+
plugin.version &&
|
|
61
|
+
plugin.version !== "latest" &&
|
|
62
|
+
!versions[plugin.version] &&
|
|
63
|
+
!forceFetch
|
|
64
|
+
) {
|
|
65
|
+
versions = await getEngineInfos(plugin, true);
|
|
66
|
+
}
|
|
59
67
|
const supported = supportedVersion(
|
|
60
68
|
plugin.version || "latest",
|
|
61
69
|
versions,
|
package/locales/en.json
CHANGED
|
@@ -1473,5 +1473,7 @@
|
|
|
1473
1473
|
"Select tag": "Select tag",
|
|
1474
1474
|
"Invalid build directory path": "Invalid build directory path",
|
|
1475
1475
|
"Invalid build directory name": "Invalid build directory name",
|
|
1476
|
-
"clean node_modules": "clean node_modules"
|
|
1477
|
-
|
|
1476
|
+
"clean node_modules": "clean node_modules",
|
|
1477
|
+
"After delete": "After delete",
|
|
1478
|
+
"Search only on exact match, not substring match. Useful for large tables": "Search only on exact match, not substring match. Useful for large tables"
|
|
1479
|
+
}
|