Saltcorn 0.8.5 - Table providers, inbound email and notifications

By Tom Nielsen
Published on 

Saltcorn 0.8.5 has been release with the following changes:

Table providers are a new way of bringing external data into Saltcorn. We have had external tables for some time, but the only way of providing configuration to external tables was to configure the module that provided the external tables in the module store. This made it particularly difficult to have a variable number of external tables in a module. Now, modules can declare table providers. When at least one table provider has been installed, when you create a new table, you have an option of selecting a table provider.

If you pick a table provider, you will then be able to configure the table according to the configuration parameters of the table provider. When this is done, you have a brand-new external table! This is useful if external tables can be replicated with different parameters. For example:

  • RSS Feeds. The RSS module which is already released will allow you to create a new table from a RSS feed. The configuration is simply the URL for the RSS feed
  • Google calendar: this module is not yet released but the idea is that you can create a table from a calendar and then access events as table rows.
  • External databases: this would allow you to choose a table in an external database and access those rows

The tables thus created are accessible in the usual manner in that you can create views based on them. They are currently read-only, although that may change in the future.

There is now also support for inbound email processing using the imap module available from the module store. We did not implement this as a table provider, because there is currently no support for caching in table providers or external tables and IMAP reads are quite slow. Instead, you get an action that can synchronise an IMAP account with a standard database table. In the future, we may develop the table provider facility in such a way that it can accommodate IMAP email access.

Notifications and progressive web applications: we have added a facility to send notifications to users. To use notifications, you first have to enable them in the settings. Then you can use the action notify_user to send a notification to a user. Users will see notifications in their user menu, and they will also be able to switch whether they want to receive notifications by email or not.

In the future we will also enable optional web push for desktop or mobile lock screen notifications. These notifications can be extremely annoying when used for marketing content, but very useful for productivity applications (e.g. in Gmail you can enable desktop notifications on new emails). There is also now a very basic facility to deliver your application as a progressive web application, which invites mobile uses to install them to the home screen.

Indices and formula constraints: in addition to the uniqueness constraints we have had for some time, we have now added indices and formula constraints. Adding an index to a table can speed up many queries and make the user interface much faster. In particular, if you have use with a lot of aggregations, you may want to add indices to those Key fields that are used for aggregation. Formula constraints serve a different purpose: they check that table rows satisfy certain properties. For instance, if you have an event table with start and end fields, you may want to ensure that the end date is after the start date. 

The system tab of the application settings now shows disk, memory and CPU usage and SSL certificate expiry date. This helps avoid scenarios where you suddenly lose access to the system.

Actions in the builder can now be set to run on page load, instead of being shown as a button. The user will see no button or link when loading the page, but the action will run. Sharp-eyed Saltcorn users have already reported that the return values of actions are ignored, which will be fixed in the next release.

Inline edits in List and Show views are now much more comprehensive: they can be used to edit key values with drop downs and JSON sub-fields.

Recent posts