Skip to content

Commit e95e42c

Browse files
authored
Merge pull request #7 from mendixlabs/Release-4.1.0
Updated Mendix to 11.9.0. Fixed startIndex JAVA compilation error, caused by using deprecated methods.
2 parents 4100495 + 0562000 commit e95e42c

1,066 files changed

Lines changed: 70122 additions & 520 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.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ Testing of this module can be done via the "Examples" pages or "Unit tests" page
6161
- 9.24.1
6262
- 9.24.13
6363
- 10.6.0
64-
- 10.24.9
6564
- 10.7.0
65+
- 10.24.9 (V. 4.0.0)
66+
- 11.8.0 (V. 4.0.0)
67+
- 11.9.0 (V. 4.1.0)
6668

6769
## Dependencies
6870

SortOrder.mpr

-12 KB
Binary file not shown.

javascriptsource/datawidgets/actions/Set_Filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Big } from "big.js";
1515
* @param {string} targetName - Name of the filter to set. Valid targets are: Number filter, Date filter, Text filter, Drop-down filter. You can find filter name in widget settings in the "Common" group (Properties>Common>Name).
1616
* @param {boolean} useDefaultValue - Determine the use of default value provided by the filter component itself.
1717
If true, "Value" section will be ignored
18-
* @param {"DataWidgets.Filter_Operators.contains"|"DataWidgets.Filter_Operators.startsWith"|"DataWidgets.Filter_Operators.endsWith"|"DataWidgets.Filter_Operators.between"|"DataWidgets.Filter_Operators.greater"|"DataWidgets.Filter_Operators.greaterEqual"|"DataWidgets.Filter_Operators.equal"|"DataWidgets.Filter_Operators.notEqual"|"DataWidgets.Filter_Operators.smaller"|"DataWidgets.Filter_Operators.smallerEqual"|"DataWidgets.Filter_Operators.empty"|"DataWidgets.Filter_Operators.notEmpty"} operators - Selected operators value. If filter has operators, this value will be applied.
18+
* @param {undefined|"contains"|"startsWith"|"endsWith"|"between"|"greater"|"greaterEqual"|"equal"|"notEqual"|"smaller"|"smallerEqual"|"empty"|"notEmpty"} operators - Selected operators value. If filter has operators, this value will be applied.
1919
* @param {string} stringValue - Value set for dropdown filter or text filter. Choose empty if not use.
2020
* @param {Big} numberValue - Number value for number filter. Choose empty if not use.
2121
* @param {Date} dateTimeValue - Date time value for date filter, can also be use as "start date". Choose empty if not use.

javascriptsource/nanoflowcommons/actions/Base64DecodeToImage.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Other code you write will be lost the next time you deploy the project.
88
import { Big } from "big.js";
99
import { Base64 } from 'js-base64';
10+
import RNBlobUtil from 'react-native-blob-util';
1011

1112
// BEGIN EXTRA CODE
1213
// END EXTRA CODE
@@ -24,6 +25,43 @@ export async function Base64DecodeToImage(base64, image) {
2425
if (!image) {
2526
throw new Error("image should not be null");
2627
}
28+
// Native platform
29+
if (navigator && navigator.product === "ReactNative") {
30+
try {
31+
// Remove data URI prefix if present (e.g., "data:image/png;base64,")
32+
let cleanBase64 = base64;
33+
if (base64.includes(",")) {
34+
cleanBase64 = base64.split(",")[1];
35+
}
36+
// Remove any whitespace/newlines
37+
cleanBase64 = cleanBase64.replace(/\s/g, "");
38+
// Validate base64 format
39+
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(cleanBase64)) {
40+
throw new Error("Invalid base64 format");
41+
}
42+
// Create a temporary file path
43+
const tempPath = `${RNBlobUtil.fs.dirs.CacheDir}/temp_image_${Date.now()}.png`;
44+
// Write Base64 data to a temporary file
45+
await RNBlobUtil.fs.writeFile(tempPath, cleanBase64, "base64");
46+
// Fetch the file as a blob
47+
const res = await fetch(`file://${tempPath}`);
48+
const blob = await res.blob();
49+
return new Promise((resolve, reject) => {
50+
mx.data.saveDocument(image.getGuid(), "camera image", {}, blob, () => {
51+
RNBlobUtil.fs.unlink(tempPath).catch(e => console.info("Temp file cleanup failed:", e));
52+
resolve(true);
53+
}, error => {
54+
RNBlobUtil.fs.unlink(tempPath).catch(e => console.info("Temp file cleanup failed:", e));
55+
reject(error);
56+
});
57+
});
58+
}
59+
catch (error) {
60+
console.error("Failed to decode base64 to image:", error);
61+
return false;
62+
}
63+
}
64+
// Other platforms
2765
const blob = new Blob([Base64.toUint8Array(base64)], { type: "image/png" });
2866
return new Promise((resolve, reject) => {
2967
mx.data.saveDocument(image.getGuid(), "camera image", {}, blob, () => resolve(true), reject);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"nativeDependencies": {
3+
"react-native-blob-util": "0.21.2"
4+
}
5+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 { Big } from "big.js";
9+
10+
// BEGIN EXTRA CODE
11+
// END EXTRA CODE
12+
13+
/**
14+
* @param {MxObject} file - File object which will be downloaded.
15+
* @param {boolean} showFileInBrowser - Set to True to let the browser open the file in a new tab.
16+
Set to False if the file only needs to be downloaded to the device storage.
17+
* @returns {Promise.<void>}
18+
*/
19+
export async function DownloadWebFile(file, showFileInBrowser) {
20+
// BEGIN USER CODE
21+
if (!file) {
22+
return Promise.reject(new Error("Input parameter 'file' is required"));
23+
}
24+
const target = showFileInBrowser ? "window" : "internal";
25+
return new Promise((resolve, reject) => {
26+
mx.ui
27+
.downloadFile({
28+
mxobject: file,
29+
target,
30+
error: (err) => reject(err)
31+
})
32+
.then(resolve)
33+
.catch(reject);
34+
});
35+
// END USER CODE
36+
}

javascriptsource/nanoflowcommons/actions/Geocode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Geodecoder from 'react-native-geocoder';
1414
/**
1515
* Geocoding is the process of converting addresses (like a street address) into geographic coordinates (latitude and longitude), which you can use to place markers on a map, or position the map.
1616
* @param {string} address - This field is required.
17-
* @param {"NanoflowCommons.GeocodingProvider.Google"|"NanoflowCommons.GeocodingProvider.Geocodio"|"NanoflowCommons.GeocodingProvider.LocationIQ"|"NanoflowCommons.GeocodingProvider.MapQuest"} geocodingProvider - This field is required for use on web.
17+
* @param {undefined|"Google"|"Geocodio"|"LocationIQ"|"MapQuest"} geocodingProvider - This field is required for use on web.
1818
* @param {string} providerApiKey - This field is required for use on web. Note that the keys are accessible by the end users and should be protected in other ways; for example restricted domain name.
1919
* @returns {Promise.<MxObject>}
2020
*/

javascriptsource/nanoflowcommons/actions/GetPlatform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { Big } from "big.js";
1212

1313
/**
1414
* Get the client platform (NanoflowCommons.Platform) where the action is running.
15-
* @returns {Promise.<"NanoflowCommons.Platform.Web"|"NanoflowCommons.Platform.Native_mobile"|"NanoflowCommons.Platform.Hybrid_mobile">}
15+
* @returns {Promise.<undefined|"Web"|"Native_mobile"|"Hybrid_mobile">}
1616
*/
1717
export async function GetPlatform() {
1818
// BEGIN USER CODE

javascriptsource/nanoflowcommons/actions/GetStraightLineDistance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function kmToNauticalMile(km) {
2424
* @param {Big} longitudePoint1
2525
* @param {Big} latitudePoint2
2626
* @param {Big} longitudePoint2
27-
* @param {"NanoflowCommons.Enum_DistanceUnit.KILOMETER"|"NanoflowCommons.Enum_DistanceUnit.STATUTE_MILE"|"NanoflowCommons.Enum_DistanceUnit.NAUTICAL_MILE"} unit
27+
* @param {undefined|"KILOMETER"|"STATUTE_MILE"|"NAUTICAL_MILE"} unit
2828
* @returns {Promise.<Big>}
2929
*/
3030
export async function GetStraightLineDistance(latitudePoint1, longitudePoint1, latitudePoint2, longitudePoint2, unit) {

javascriptsource/nanoflowcommons/actions/IsConnectedToServer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ import { Big } from "big.js";
1616
export async function IsConnectedToServer() {
1717
// BEGIN USER CODE
1818
try {
19-
const response = await fetch(mx.remoteUrl);
19+
const headers = new Headers();
20+
headers.append("Content-Type", "application/json");
21+
const body = JSON.stringify({ action: "info" });
22+
const requestOptions = {
23+
method: "POST",
24+
headers,
25+
body
26+
};
27+
// mx.remoteUrl always has / at the end, therefore we don't add it.
28+
const response = await fetch(`${mx.remoteUrl}xas/`, requestOptions);
2029
return response.ok;
2130
}
2231
catch (err) {

0 commit comments

Comments
 (0)