Skip to content

Commit

Permalink
Mendix 10.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroeneweg committed Jun 27, 2024
1 parent 4d7ff72 commit bd42875
Show file tree
Hide file tree
Showing 139 changed files with 5,647 additions and 5,896 deletions.
6,007 changes: 2,659 additions & 3,348 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativeresponsivelistview",
"widgetName": "NativeResponsiveListview",
"version": "3.1.0",
"version": "3.2.0",
"description": "Native responsive listview",
"copyright": "ITvisors 2020",
"author": "Marcel Groeneweg",
Expand All @@ -22,16 +22,20 @@
"release": "pluggable-widgets-tools release:native"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^9.24.0",
"@mendix/pluggable-widgets-tools": "^10.12.0",
"@types/big.js": "^6.0.2"
},
"dependencies": {},
"resolutions": {
"react": "18.2.0",
"react-native": "0.70.7"
"react-native": "0.72.7",
"@types/react": "18.2.0",
"@types/react-native": "0.72.7"
},
"overrides": {
"react": "18.2.0",
"react-native": "0.70.7"
"react-native": "0.72.7",
"@types/react": "18.2.0",
"@types/react-native": "0.72.7"
}
}
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="NativeResponsiveListview" version="3.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="NativeResponsiveListview" version="3.2.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="NativeResponsiveListview.xml"/>
</widgetFiles>
Expand Down
Binary file added test/.mendix-cache/backup/AppBackup.mpr
Binary file not shown.
Binary file modified test/TestNativeResponsiveListview.mpr
Binary file not shown.
26 changes: 26 additions & 0 deletions test/javascriptsource/datawidgets/actions/Reset_All_Filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import { Big } from "big.js";
import "mx-global";

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @param {string} targetName - Name of the widget for which filters should be reset. Valid targets are: Data grid 2, Gallery. You can find filter name in widget settings in the "Common" group (Properties>Common>Name).
* @param {boolean} setToDefault - Set to default value. If true, filter will be set to its default value, otherwise it will be set to empty.
* @returns {Promise.<void>}
*/
export async function Reset_All_Filters(targetName, setToDefault) {
// BEGIN USER CODE
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
if (plugin) {
plugin.emit(targetName, "reset.filters", setToDefault);
}
// END USER CODE
}
26 changes: 26 additions & 0 deletions test/javascriptsource/datawidgets/actions/Reset_Filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import "mx-global";
import { Big } from "big.js";

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @param {string} targetName - Name of the filter to reset. 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).
* @param {boolean} setToDefault - Set to default value. If true, filter will be set to its default value, otherwise it will be set to empty.
* @returns {Promise.<void>}
*/
export async function Reset_Filter(targetName, setToDefault) {
// BEGIN USER CODE
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
if (plugin) {
plugin.emit(targetName, "reset.value", setToDefault);
}
// END USER CODE
}
34 changes: 34 additions & 0 deletions test/javascriptsource/datawidgets/actions/Set_Filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import "mx-global";
import { Big } from "big.js";

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @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).
* @param {boolean} useDefaultValue - Determine the use of default value provided by the filter component itself.
If true, "Value" section will be ignored
* @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.
* @param {string} stringValue - Value set for dropdown filter or text filter. Choose empty if not use.
* @param {Big} numberValue - Number value for number filter. Choose empty if not use.
* @param {Date} dateTimeValue - Date time value for date filter, can also be use as "start date". Choose empty if not use.
* @param {Date} dateTimeValue_2 - End date time value for range filter. Choose empty if not use.
* @returns {Promise.<void>}
*/
export async function Set_Filter(targetName, useDefaultValue, operators, stringValue, numberValue, dateTimeValue, dateTimeValue_2) {
// BEGIN USER CODE
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
if (plugin) {
plugin.emit(targetName, "set.value", useDefaultValue, {
operators, stringValue, numberValue, dateTimeValue, dateTimeValue2: dateTimeValue_2
});
}
// END USER CODE
}

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/javascriptsource/nanoflowcommons/actions/Base64Encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { Base64 } from 'js-base64';
// END EXTRA CODE

/**
* @param {string} string
* @param {string} stringToEncode
* @returns {Promise.<string>}
*/
export async function Base64Encode(string) {
export async function Base64Encode(stringToEncode) {
// BEGIN USER CODE
return Base64.encode(base64);
return Base64.encode(stringToEncode);
// END USER CODE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import "mx-global";
import { Big } from "big.js";
import { Platform, NativeModules } from 'react-native';
import { PERMISSIONS as PERMISSIONS$1, check } from 'react-native-permissions';

// BEGIN EXTRA CODE
const PERMISSIONS = {
ANDROID: {
...PERMISSIONS$1.ANDROID,
SCHEDULE_EXACT_ALARM: "android.permission.SCHEDULE_EXACT_ALARM"
},
IOS: PERMISSIONS$1.IOS
};
function mapPermissionName(permissionName) {
if (Platform.OS === "ios") {
const nameWithoutSuffix = permissionName.replace("_IOS", "");
return PERMISSIONS.IOS[nameWithoutSuffix];
}
const nameWithoutSuffix = permissionName.replace("_ANDROID", "");
return PERMISSIONS.ANDROID[nameWithoutSuffix];
}
async function checkScheduleAlarm() {
if (NativeModules && !NativeModules.ScheduleEA) {
return Promise.reject(new Error("ScheduleEA module is not available in your app"));
}
if (Platform.OS !== "android") {
return Promise.resolve("granted");
}
const checkPermissionPromise = new Promise(resolve => {
NativeModules.ScheduleEA.checkPermission((isEnabled) => {
resolve(isEnabled);
});
});
return checkPermissionPromise.then(result => {
return Promise.resolve(result ? "granted" : "blocked");
});
}
// END EXTRA CODE

/**
* @param {"NativeMobileResources.Enum_Permissions.APP_TRACKING_TRANSPARENCY_IOS"|"NativeMobileResources.Enum_Permissions.BLUETOOTH_PERIPHERAL_IOS"|"NativeMobileResources.Enum_Permissions.CAMERA_IOS"|"NativeMobileResources.Enum_Permissions.CALENDARS_IOS"|"NativeMobileResources.Enum_Permissions.CONTACTS_IOS"|"NativeMobileResources.Enum_Permissions.FACE_ID_IOS"|"NativeMobileResources.Enum_Permissions.LOCATION_ALWAYS_IOS"|"NativeMobileResources.Enum_Permissions.LOCATION_WHEN_IN_USE_IOS"|"NativeMobileResources.Enum_Permissions.MEDIA_LIBRARY_IOS"|"NativeMobileResources.Enum_Permissions.MICROPHONE_IOS"|"NativeMobileResources.Enum_Permissions.MOTION_IOS"|"NativeMobileResources.Enum_Permissions.PHOTO_LIBRARY_IOS"|"NativeMobileResources.Enum_Permissions.PHOTO_LIBRARY_ADD_ONLY_IOS"|"NativeMobileResources.Enum_Permissions.REMINDERS_IOS"|"NativeMobileResources.Enum_Permissions.SIRI_IOS"|"NativeMobileResources.Enum_Permissions.SPEECH_RECOGNITION_IOS"|"NativeMobileResources.Enum_Permissions.STOREKIT_IOS"|"NativeMobileResources.Enum_Permissions.ACCEPT_HANDOVER_ANDROID"|"NativeMobileResources.Enum_Permissions.ACCESS_BACKGROUND_LOCATION_ANDROID"|"NativeMobileResources.Enum_Permissions.ACCESS_COARSE_LOCATION_ANDROID"|"NativeMobileResources.Enum_Permissions.ACCESS_FINE_LOCATION_ANDROID"|"NativeMobileResources.Enum_Permissions.ACCESS_MEDIA_LOCATION_ANDROID"|"NativeMobileResources.Enum_Permissions.ACTIVITY_RECOGNITION_ANDROID"|"NativeMobileResources.Enum_Permissions.ADD_VOICEMAIL_ANDROID"|"NativeMobileResources.Enum_Permissions.ANSWER_PHONE_CALLS_ANDROID"|"NativeMobileResources.Enum_Permissions.BLUETOOTH_ADVERTISE_ANDROID"|"NativeMobileResources.Enum_Permissions.BLUETOOTH_CONNECT_ANDROID"|"NativeMobileResources.Enum_Permissions.BLUETOOTH_SCAN_ANDROID"|"NativeMobileResources.Enum_Permissions.BODY_SENSORS_ANDROID"|"NativeMobileResources.Enum_Permissions.CALL_PHONE_ANDROID"|"NativeMobileResources.Enum_Permissions.CAMERA_ANDROID"|"NativeMobileResources.Enum_Permissions.GET_ACCOUNTS_ANDROID"|"NativeMobileResources.Enum_Permissions.PROCESS_OUTGOING_CALLS_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_CALENDAR_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_CALL_LOG_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_CONTACTS_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_EXTERNAL_STORAGE_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_PHONE_NUMBERS_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_PHONE_STATE_ANDROID"|"NativeMobileResources.Enum_Permissions.READ_SMS_ANDROID"|"NativeMobileResources.Enum_Permissions.RECEIVE_MMS_ANDROID"|"NativeMobileResources.Enum_Permissions.RECEIVE_SMS_ANDROID"|"NativeMobileResources.Enum_Permissions.RECEIVE_WAP_PUSH_ANDROID"|"NativeMobileResources.Enum_Permissions.RECORD_AUDIO_ANDROID"|"NativeMobileResources.Enum_Permissions.SEND_SMS_ANDROID"|"NativeMobileResources.Enum_Permissions.USE_SIP_ANDROID"|"NativeMobileResources.Enum_Permissions.WRITE_CALENDAR_ANDROID"|"NativeMobileResources.Enum_Permissions.WRITE_CALL_LOG_ANDROID"|"NativeMobileResources.Enum_Permissions.WRITE_CONTACTS_ANDROID"|"NativeMobileResources.Enum_Permissions.WRITE_EXTERNAL_STORAGE_ANDROID"|"NativeMobileResources.Enum_Permissions.SCHEDULE_EXACT_ALARM_ANDROID"} permission - This field is required.
* @returns {Promise.<"NativeMobileResources.Enum_PermissionStatus.unavailable"|"NativeMobileResources.Enum_PermissionStatus.denied"|"NativeMobileResources.Enum_PermissionStatus.limited"|"NativeMobileResources.Enum_PermissionStatus.granted"|"NativeMobileResources.Enum_PermissionStatus.blocked">}
*/
export async function CheckGenericPermission(permission) {
// BEGIN USER CODE
if (!permission) {
return Promise.reject(new Error("Input parameter 'permission' is required"));
}
const mappedPermissionName = mapPermissionName(permission);
if (!mappedPermissionName) {
console.error(`${permission} permission is not found`);
return Promise.resolve("unavailable");
}
return mappedPermissionName === PERMISSIONS.ANDROID.SCHEDULE_EXACT_ALARM
? checkScheduleAlarm()
: check(mappedPermissionName);
// END USER CODE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"nativeDependencies": {
"react-native-permissions": "3.3.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import "mx-global";
import { Big } from "big.js";
import { Platform } from 'react-native';
import RNBlobUtil from 'react-native-blob-util';
Expand All @@ -30,6 +31,13 @@ async function getUniqueFilePath(path, fileName) {
}
return uniqueFilePath;
}
function createCopyToMediaStoreFunction(fileName, mimeType) {
return (filePath) => RNBlobUtil.MediaCollection.copyToMediaStore({
name: fileName,
mimeType: mimeType !== null && mimeType !== void 0 ? mimeType : "*",
parentFolder: ""
}, "Download", filePath);
}
// END EXTRA CODE

/**
Expand All @@ -45,7 +53,7 @@ export async function DownloadFile(file, openWithOS) {
}
const dirs = RNBlobUtil.fs.dirs;
const fileName = file.get("Name");
const mimeType = mimeTypes.getType(fileName);
console.error(fileName)
const sanitizedFileName = sanitizeFileName(fileName);
const baseDir = Platform.OS === "ios" ? dirs.DocumentDir : dirs.DownloadDir;
const filePath = mx.data.getDocumentUrl(file.getGuid(), Number(file.get("changedDate")));
Expand All @@ -55,11 +63,20 @@ export async function DownloadFile(file, openWithOS) {
await RNBlobUtil.fs.cp(filePath, accessiblePath);
}
else {
accessiblePath = await RNBlobUtil.MediaCollection.copyToMediaStore({
name: sanitizedFileName,
mimeType: mimeType !== null && mimeType !== void 0 ? mimeType : "*",
parentFolder: ""
}, "Download", filePath);
const mimeType = mimeTypes.getType(fileName);
const copyToMediaStore = createCopyToMediaStoreFunction(sanitizedFileName, mimeType);
if (typeof mx.readFileBlob === "function") {
const tempPath = await getUniqueFilePath(baseDir, sanitizedFileName);
const base64Data = await mx.readFileBlob(filePath);
const base64Content = base64Data === null || base64Data === void 0 ? void 0 : base64Data.split(",")[1];
await RNBlobUtil.fs.createFile(tempPath, base64Content, "base64");
accessiblePath = await copyToMediaStore(tempPath);
RNBlobUtil.fs.unlink(tempPath);
}
else {
// this code block is for backward compatibility
accessiblePath = await copyToMediaStore(filePath);
}
}
if (openWithOS) {
await FileViewer.open(accessiblePath, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"nativeDependencies": {
"react-native-file-viewer": "2.1.5",
"react-native-blob-util": "0.16.2"
"react-native-blob-util": "0.16.2",
"react-native-file-viewer": "2.1.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Linking } from 'react-native';
* Please note that the name of the input parameter is case sensitive and should all upper cases.
*
* This requires a custom build of the Mendix Native Shell app to register a schema and host to the OS. See read me. Please note that this will not work on the Make it Native app.
* @param {Nanoflow} urlHandler
* @param {Nanoflow} [urlHandler]
* @returns {Promise.<void>}
*/
export async function RegisterDeepLink(urlHandler) {
Expand Down
Loading

0 comments on commit bd42875

Please sign in to comment.