Skip to content

Commit d22ac0f

Browse files
author
uicontent
committed
Automatic update of widgets, themes and modules
1 parent b052eb9 commit d22ac0f

261 files changed

Lines changed: 9190 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StarterApp_NativeMobile.mpr

304 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This file was generated by Mendix Studio Pro.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
import "mx-global";
9+
import { Big } from "big.js";
10+
11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
14+
/**
15+
* @returns {Promise.<void>}
16+
*/
17+
export async function ReloadWithState() {
18+
// BEGIN USER CODE
19+
window.mx.reloadWithState();
20+
// END USER CODE
21+
}

javascriptsource/nanoflowcommons/actions/RequestLocationPermission.js

Lines changed: 38 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import Geolocation from '@react-native-community/geolocation';
1+
import { request, PERMISSIONS, RESULTS, check, openSettings } from 'react-native-permissions';
2+
import { Platform, Alert, ToastAndroid } from 'react-native';
23

34
// This file was generated by Mendix Studio Pro.
45
//
@@ -15,107 +16,62 @@ import Geolocation from '@react-native-community/geolocation';
1516
*/
1617
async function RequestLocationPermission() {
1718
// BEGIN USER CODE
18-
var _a;
19-
let reactNativeModule;
20-
let geolocationModule;
2119
const hasPermissionIOS = async () => {
2220
const openSetting = () => {
23-
reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Linking.openSettings().catch(() => {
24-
reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Alert.alert("Unable to open settings.");
21+
openSettings().catch(() => {
22+
Alert.alert("Unable to open settings.");
2523
});
2624
};
27-
return geolocationModule
28-
.requestAuthorization("whenInUse")
29-
.then((status) => {
30-
if (status === "granted") {
31-
return true;
32-
}
33-
if (status === "denied") {
34-
reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Alert.alert("Location permission denied.");
35-
}
36-
if (status === "disabled") {
37-
reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Alert.alert("Location Services must be enabled to determine your location.", "", [
38-
{ text: "Go to Settings", onPress: openSetting },
39-
{
40-
text: "Don't Use Location"
41-
}
42-
]);
43-
}
44-
return false;
45-
});
25+
const status = await request(PERMISSIONS.IOS.LOCATION_WHEN_IN_USE);
26+
if (status === RESULTS.GRANTED) {
27+
return true;
28+
}
29+
if (status === RESULTS.DENIED || status === RESULTS.BLOCKED) {
30+
Alert.alert("Location permission denied.");
31+
}
32+
if (status === RESULTS.UNAVAILABLE) {
33+
Alert.alert("Location Services must be enabled to determine your location.", "", [
34+
{ text: "Go to Settings", onPress: openSetting },
35+
{
36+
text: "Don't Use Location"
37+
}
38+
]);
39+
}
40+
return false;
4641
};
4742
const hasPermissionAndroid = async () => {
48-
var _a, _b;
49-
if (typeof ((_a = reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Platform) === null || _a === void 0 ? void 0 : _a.Version) === "number" && ((_b = reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Platform) === null || _b === void 0 ? void 0 : _b.Version) < 23) {
43+
if (typeof Platform.Version === "number" && Platform.Version < 23) {
5044
return true;
5145
}
52-
const androidLocationPermission = reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION;
53-
if (!androidLocationPermission) {
54-
return false;
46+
const status = await check(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
47+
if (status === RESULTS.GRANTED) {
48+
return true;
49+
}
50+
const requestStatus = await request(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);
51+
if (requestStatus === RESULTS.GRANTED) {
52+
return true;
53+
}
54+
if (requestStatus === RESULTS.DENIED) {
55+
ToastAndroid.show("Location permission denied by user.", ToastAndroid.LONG);
56+
}
57+
else if (requestStatus === RESULTS.BLOCKED) {
58+
ToastAndroid.show("Location permission revoked by user.", ToastAndroid.LONG);
5559
}
56-
return reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.check(androidLocationPermission).then(hasPermission => {
57-
var _a;
58-
return hasPermission
59-
? true
60-
: (_a = reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid) === null || _a === void 0 ? void 0 : _a.request(androidLocationPermission).then(status => {
61-
if (status === (reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.RESULTS.GRANTED)) {
62-
return true;
63-
}
64-
if (status === (reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.RESULTS.DENIED)) {
65-
reactNativeModule.ToastAndroid.show("Location permission denied by user.", reactNativeModule.ToastAndroid.LONG);
66-
}
67-
else if (status === (reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN)) {
68-
reactNativeModule.ToastAndroid.show("Location permission revoked by user.", reactNativeModule.ToastAndroid.LONG);
69-
}
70-
return false;
71-
});
72-
});
60+
return false;
7361
};
7462
const hasLocationPermission = async () => {
75-
if ((reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Platform.OS) === "ios") {
63+
if (Platform.OS === "ios") {
7664
const hasPermission = await hasPermissionIOS();
7765
return hasPermission;
7866
}
79-
if ((reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Platform.OS) === "android") {
67+
if (Platform.OS === "android") {
8068
const hasPermission = await hasPermissionAndroid();
8169
return hasPermission !== null && hasPermission !== void 0 ? hasPermission : false;
8270
}
8371
return Promise.reject(new Error("Unsupported platform"));
8472
};
85-
const hasLocationPermissionForOldLibrary = async () => {
86-
if ((reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.Platform.OS) === "android") {
87-
const locationPermission = reactNativeModule.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION;
88-
return reactNativeModule.PermissionsAndroid.check(locationPermission).then(hasPermission => hasPermission
89-
? true
90-
: reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.request(locationPermission).then(status => status === (reactNativeModule === null || reactNativeModule === void 0 ? void 0 : reactNativeModule.PermissionsAndroid.RESULTS.GRANTED)));
91-
}
92-
else if (geolocationModule) {
93-
return new Promise(resolve => {
94-
geolocationModule.requestAuthorization(() => {
95-
resolve(true);
96-
}, () => {
97-
resolve(false);
98-
});
99-
});
100-
}
101-
return false;
102-
};
10373
if (navigator && navigator.product === "ReactNative") {
104-
reactNativeModule = require("react-native");
105-
if (!reactNativeModule) {
106-
return Promise.reject(new Error("React Native module could not be found"));
107-
}
108-
if (reactNativeModule.NativeModules.RNFusedLocation) {
109-
geolocationModule = (await import('@react-native-community/geolocation')).default;
110-
return hasLocationPermission();
111-
}
112-
else if (reactNativeModule.NativeModules.RNCGeolocation) {
113-
geolocationModule = Geolocation;
114-
return (_a = (await hasLocationPermissionForOldLibrary())) !== null && _a !== void 0 ? _a : false;
115-
}
116-
else {
117-
return Promise.reject(new Error("Geolocation module could not be found"));
118-
}
74+
return hasLocationPermission();
11975
}
12076
else if (navigator && navigator.geolocation) {
12177
return Promise.reject(new Error("No permission request for location is required for web/hybrid platform"));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"nativeDependencies": {
3-
"@react-native-community/geolocation": "3.4.0"
3+
"react-native-permissions": "5.4.2"
44
}
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"react-native-geocoder":{"version":"0.5.0","transitive":false,"url":"https://github.com/devfd/react-native-geocoder"}},{"@react-native-community/geolocation":{"version":"3.4.0","transitive":false,"url":"https://github.com/michalchudziak/react-native-geolocation#README.md"}},{"@react-native-async-storage/async-storage":{"version":"2.0.0","transitive":false,"url":"https://github.com/react-native-async-storage/async-storage#readme"}},{"merge-options":{"version":"3.0.4","transitive":true,"url":null}},{"is-plain-obj":{"version":"2.1.0","transitive":true,"url":null}},{"js-base64":{"version":"3.7.7","transitive":false,"url":null}}]
1+
[{"react-native-geocoder":{"version":"0.5.0","transitive":false,"url":"https://github.com/devfd/react-native-geocoder"}},{"@react-native-community/geolocation":{"version":"3.4.0","transitive":false,"url":"https://github.com/michalchudziak/react-native-geolocation#README.md"}},{"react-native-permissions":{"version":"5.4.2","transitive":false,"url":"https://github.com/zoontek/react-native-permissions#readme"}},{"@react-native-async-storage/async-storage":{"version":"2.0.0","transitive":false,"url":"https://github.com/react-native-async-storage/async-storage#readme"}},{"merge-options":{"version":"3.0.4","transitive":true,"url":null}},{"is-plain-obj":{"version":"2.1.0","transitive":true,"url":null}},{"js-base64":{"version":"3.7.7","transitive":false,"url":null}}]

javascriptsource/nanoflowcommons/actions/dependencies.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,41 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
6767
SOFTWARE.
6868

6969

70+
---
71+
72+
Name: react-native-permissions
73+
Version: 5.4.2
74+
License: MIT
75+
Private: false
76+
Description: An unified permissions API for React Native on iOS, Android and Windows
77+
Repository: https://github.com/zoontek/react-native-permissions.git
78+
Homepage: https://github.com/zoontek/react-native-permissions#readme
79+
License Copyright:
80+
===
81+
82+
MIT License
83+
84+
Copyright (c) 2019 Mathieu Acthernoene
85+
86+
Permission is hereby granted, free of charge, to any person obtaining a copy
87+
of this software and associated documentation files (the "Software"), to deal
88+
in the Software without restriction, including without limitation the rights
89+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
90+
copies of the Software, and to permit persons to whom the Software is
91+
furnished to do so, subject to the following conditions:
92+
93+
The above copyright notice and this permission notice shall be included in all
94+
copies or substantial portions of the Software.
95+
96+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
99+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
101+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
102+
SOFTWARE.
103+
104+
70105
---
71106

72107
Name: @react-native-async-storage/async-storage

javascriptsource/nanoflowcommons/actions/node_modules/react-native-permissions/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)