@saltcorn/mobile-app 1.5.0-beta.0 → 1.5.0-beta.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@saltcorn/mobile-app",
3
3
  "displayName": "Saltcorn mobile app",
4
- "version": "1.5.0-beta.0",
4
+ "version": "1.5.0-beta.1",
5
5
  "description": "Saltcorn mobile app for Android and iOS",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -78,7 +78,7 @@ export async function updateScPlugins(tablesJSON) {
78
78
 
79
79
  export async function updateUserDefinedTables() {
80
80
  const existingTables = await saltcorn.data.db.listUserDefinedTables();
81
- const tables = await saltcorn.data.models.Table.find();
81
+ const tables = await saltcorn.data.models.Table.find({}, { cached: true });
82
82
  for (const table of tables) {
83
83
  const sanitized = saltcorn.data.db.sqlsanitize(table.name);
84
84
  if (
@@ -74,6 +74,8 @@ const renderLoginView = async (entryPoint, versionTag, alerts = []) => {
74
74
  }
75
75
  }
76
76
 
77
+ const assets_by_role = state.assets_by_role || {};
78
+ const roleHeaders = assets_by_role[100];
77
79
  return layout.authWrap({
78
80
  title: "login",
79
81
  form: form,
@@ -82,6 +84,7 @@ const renderLoginView = async (entryPoint, versionTag, alerts = []) => {
82
84
  headers: [
83
85
  { css: `static_assets/${versionTag}/saltcorn.css` },
84
86
  { script: "js/iframe_view_utils.js" },
87
+ ...(roleHeaders ? roleHeaders : []),
85
88
  ],
86
89
  csrfToken: false,
87
90
  });
@@ -50,7 +50,9 @@ const getMenu = (req) => {
50
50
  const role = mobileCfg.user.role_id || 100;
51
51
  const extraMenu = saltcorn.data.web_mobile_commons.get_extra_menu(
52
52
  role,
53
- req.__
53
+ req.__,
54
+ undefined,
55
+ req
54
56
  );
55
57
  if (mobileCfg.inErrorState) {
56
58
  const entryLink = mobileCfg.entry_point?.startsWith("get")
@@ -124,6 +124,8 @@ async function formSubmit(e, urlSuffix, viewname, noSubmitCb, matchingState) {
124
124
  }
125
125
  }
126
126
 
127
+ function sc_form_submit_in_progress() {}
128
+
127
129
  async function ajaxSubmitForm(e, force_no_reload, event) {
128
130
  const form = $(e).closest("form");
129
131
  const action = form.attr("action");
@@ -405,8 +407,8 @@ async function pjax_to(href, query, e) {
405
407
  let $dest = localizer.length
406
408
  ? localizer
407
409
  : inModal
408
- ? $("#scmodal .modal-body")
409
- : $("#page-inner-content");
410
+ ? $("#scmodal .modal-body")
411
+ : $("#page-inner-content");
410
412
  if (!$dest.length)
411
413
  await parent.saltcorn.mobileApp.navigation.handleRoute(safeHref, query);
412
414
  else