@saltcorn/mobile-app 0.9.0-beta.1 → 0.9.0-beta.3
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
|
@@ -16,17 +16,22 @@ function combineFormAndQuery(form, query) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Pass View or Page source into the app internal router,
|
|
20
|
+
* links with an URL source are opened in the system browser.
|
|
21
|
+
* @param {string} url
|
|
22
|
+
* @param {string} linkSrc - URL, View or Page
|
|
21
23
|
*/
|
|
22
|
-
async function execLink(url) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
async function execLink(url, linkSrc) {
|
|
25
|
+
if (linkSrc === "URL") {
|
|
26
|
+
parent.cordova.InAppBrowser.open(url, "_system");
|
|
27
|
+
} else
|
|
28
|
+
try {
|
|
29
|
+
showLoadSpinner();
|
|
30
|
+
const { path, query } = parent.splitPathQuery(url);
|
|
31
|
+
await parent.handleRoute(`get${path}`, query);
|
|
32
|
+
} finally {
|
|
33
|
+
removeLoadSpinner();
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
async function execNavbarLink(url) {
|
|
@@ -248,7 +253,13 @@ async function publicLogin(entryPoint) {
|
|
|
248
253
|
alerts: [
|
|
249
254
|
{
|
|
250
255
|
type: "success",
|
|
251
|
-
msg: parent.i18next.t("Welcome to
|
|
256
|
+
msg: parent.i18next.t("Welcome to %s!", {
|
|
257
|
+
postProcess: "sprintf",
|
|
258
|
+
sprintf: [
|
|
259
|
+
parent.saltcorn.data.state.getState().getConfig("site_name") ||
|
|
260
|
+
"Saltcorn",
|
|
261
|
+
],
|
|
262
|
+
}),
|
|
252
263
|
},
|
|
253
264
|
],
|
|
254
265
|
});
|
|
@@ -260,6 +271,12 @@ async function publicLogin(entryPoint) {
|
|
|
260
271
|
}
|
|
261
272
|
} catch (error) {
|
|
262
273
|
console.log(error);
|
|
274
|
+
parent.showAlerts([
|
|
275
|
+
{
|
|
276
|
+
type: "error",
|
|
277
|
+
msg: error.message ? error.message : "An error occured.",
|
|
278
|
+
},
|
|
279
|
+
]);
|
|
263
280
|
throw error;
|
|
264
281
|
} finally {
|
|
265
282
|
removeLoadSpinner();
|