@saltcorn/mobile-app 0.8.0-beta.3 → 0.8.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/package.json +1 -1
- package/www/js/mocks/request.js +10 -1
- package/www/js/routes/auth.js +2 -0
- package/www/js/routes/common.js +2 -0
- package/www/js/routes/delete.js +2 -0
- package/www/js/routes/edit.js +2 -0
- package/www/js/routes/error.js +2 -0
- package/www/js/routes/init.js +3 -1
- package/www/js/routes/page.js +2 -0
- package/www/js/routes/view.js +2 -0
- package/www/js/utils/file_helpers.js +2 -0
- package/www/js/utils/global_utils.js +2 -0
- package/www/js/utils/iframe_view_utils.js +3 -0
- package/www/js/utils/table_utils.js +2 -0
package/package.json
CHANGED
package/www/js/mocks/request.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*global i18next, saltcorn*/
|
|
2
|
+
|
|
1
3
|
function MobileRequest({ xhr = false, files = undefined, query = undefined }) {
|
|
2
4
|
const roleId = saltcorn.data.state.getState().mobileConfig.role_id
|
|
3
5
|
? saltcorn.data.state.getState().mobileConfig.role_id
|
|
@@ -10,7 +12,14 @@ function MobileRequest({ xhr = false, files = undefined, query = undefined }) {
|
|
|
10
12
|
postProcess: "sprintf",
|
|
11
13
|
sprintf: params,
|
|
12
14
|
}),
|
|
13
|
-
|
|
15
|
+
isAuthenticated: () => {
|
|
16
|
+
const mobileCfg = saltcorn.data.state.getState().mobileConfig;
|
|
17
|
+
return mobileCfg && mobileCfg.jwt && !mobileCfg.isPublicUser;
|
|
18
|
+
},
|
|
19
|
+
getLocale: () => {
|
|
20
|
+
const mobileCfg = saltcorn.data.state.getState().mobileConfig;
|
|
21
|
+
return mobileCfg?.language ? mobileCfg.language : "en";
|
|
22
|
+
},
|
|
14
23
|
user: {
|
|
15
24
|
role_id: roleId,
|
|
16
25
|
},
|
package/www/js/routes/auth.js
CHANGED
package/www/js/routes/common.js
CHANGED
package/www/js/routes/delete.js
CHANGED
package/www/js/routes/edit.js
CHANGED
package/www/js/routes/error.js
CHANGED
package/www/js/routes/init.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*global postView, postViewRoute, getView, postToggleField, deleteRows, postPageAction, getPage, getLoginView, logoutAction, getSignupView, getErrorView, window*/
|
|
2
|
+
|
|
1
3
|
const initRoutes = async () => {
|
|
2
4
|
const routes = [
|
|
3
5
|
{
|
|
@@ -43,7 +45,7 @@ const initRoutes = async () => {
|
|
|
43
45
|
{
|
|
44
46
|
path: "get/error_page",
|
|
45
47
|
action: getErrorView,
|
|
46
|
-
}
|
|
48
|
+
},
|
|
47
49
|
];
|
|
48
50
|
window.router = new window.UniversalRouter(routes);
|
|
49
51
|
};
|
package/www/js/routes/page.js
CHANGED
package/www/js/routes/view.js
CHANGED