Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Source/.svn
Source/GPUCache
Source/modeler-merge-marker
Source/.mendix-cache
Source/*.mpr.lock
Source/*.mpr.bak
Source/*.mpr.left*
Source/*.mpr.right*
Source/.settings
Source/deployment
Source/theme-cache
proxies
target
*.launch
.classpath
.project
Source/.svn
Source/GPUCache
Source/modeler-merge-marker
Source/.mendix-cache
Source/*.mpr.lock
Source/*.mpr.bak
Source/*.mpr.left*
Source/*.mpr.right*
Source/.settings
Source/deployment
Source/theme-cache
proxies
target
*.launch
.classpath
.project
.vscode
16 changes: 8 additions & 8 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
MIT License

Copyright 2022 Mendix Technology B.V.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

MIT License
Copyright 2022 Mendix Technology B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please see [Administration](https://docs.mendix.com/appstore/modules/administration/) in the Mendix documentation for details.
Please see [Administration](https://docs.mendix.com/appstore/modules/administration/) in the Mendix documentation for details.
2 changes: 2 additions & 0 deletions Source/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@
/administrationmodule.mpr.bak
/administrationmodule.mpr.lock
/nativemobile/builds/
.DS_Store
/.svn/
Binary file modified Source/AdministrationModule.mpr
Binary file not shown.
91 changes: 47 additions & 44 deletions Source/javascriptsource/datawidgets/actions/Export_To_Excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,57 @@ export async function Export_To_Excel(datagridName, fileName, sheetName, include
return false;
}

return new Promise((resolve, reject) => {
const stream =
window[window.DATAGRID_DATA_EXPORT][datagridName].create();
const REGISTRY_NAME = "com.mendix.widgets.web.datagrid.export";
const registry = window[REGISTRY_NAME];
const controller = registry.get(datagridName);

let worksheet;
let headers;
const streamOptions = { limit: chunkSize };
stream.process((msg) => {
if (!msg) {
return;
}
if (controller === undefined) {
return false;
}

return new Promise((resolve) => {
function handler(req) {
let worksheet;
let headers;

switch (msg.type) {
case "columns":
headers = msg.payload.map(column => column.name);
if (includeColumnHeaders) {
worksheet = utils.aoa_to_sheet([headers]);
}
break;
case "data":
if (worksheet === undefined) {
worksheet = utils.aoa_to_sheet(msg.payload)
} else {
utils.sheet_add_aoa(worksheet, msg.payload, { origin: -1 });
}
break;
case "end":
if (worksheet) {
// Set character width for each column
// https://docs.sheetjs.com/docs/csf/sheet#worksheet-object
worksheet["!cols"] = headers.map(header => ({
wch: header.length + 10
}));
const workbook = utils.book_new();
utils.book_append_sheet(workbook, worksheet, sheetName === "" ? "Data" : sheetName);
writeFileXLSX(workbook, `${fileName}.xlsx`);
resolve(true);
} else {
resolve(false);
}
break;
case "aborted":
req.on("headers", (hds) => {
headers = hds.map(header => header.name);
if (includeColumnHeaders) {
worksheet = utils.aoa_to_sheet([headers]);
}
});

req.on("data", (data) => {
if (worksheet === undefined) {
worksheet = utils.aoa_to_sheet(data)
} else {
utils.sheet_add_aoa(worksheet, data, { origin: -1 });
}
});

req.on("end", () => {
if (worksheet) {
// Set character width for each column
// https://docs.sheetjs.com/docs/csf/sheet#worksheet-object
worksheet["!cols"] = headers.map(header => ({
wch: header.length + 10
}));
const workbook = utils.book_new();
utils.book_append_sheet(workbook, worksheet, sheetName === "" ? "Data" : sheetName);
writeFileXLSX(workbook, `${fileName}.xlsx`);
resolve(true);
} else {
resolve(false);
break;
}
}, streamOptions);
}
});

req.on("abort", () => resolve(false));
}

stream.start();
controller.exportData(handler, {
withHeaders: true,
limit: chunkSize.toNumber()
})
});
// END USER CODE
}
26 changes: 26 additions & 0 deletions Source/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 Source/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 Source/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.

22 changes: 22 additions & 0 deletions Source/javascriptsource/nanoflowcommons/actions/Base64Decode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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 { Base64 } from 'js-base64';

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @param {string} base64
* @returns {Promise.<string>}
*/
export async function Base64Decode(base64) {
// BEGIN USER CODE
return Base64.decode(base64);
// END USER CODE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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 { Base64 } from 'js-base64';

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @param {string} base64
* @param {MxObject} image
* @returns {Promise.<boolean>}
*/
export async function Base64DecodeToImage(base64, image) {
// BEGIN USER CODE
if (!base64) {
throw new Error("base64 String should not be empty");
}
if (!image) {
throw new Error("image should not be null");
}
const blob = new Blob([Base64.toUint8Array(base64)], { type: "image/png" });
return new Promise((resolve, reject) => {
mx.data.saveDocument(image.getGuid(), "camera image", {}, blob, () => resolve(true), reject);
});
// END USER CODE
}
22 changes: 22 additions & 0 deletions Source/javascriptsource/nanoflowcommons/actions/Base64Encode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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 { Base64 } from 'js-base64';

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* @param {string} stringToEncode
* @returns {Promise.<string>}
*/
export async function Base64Encode(stringToEncode) {
// BEGIN USER CODE
return Base64.encode(stringToEncode);
// END USER CODE
}
46 changes: 46 additions & 0 deletions Source/javascriptsource/nanoflowcommons/actions/CallPhoneNumber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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";

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
* This action can be used to launch a phone app on the devices and initiate dialing of the specified phone number. The user has to confirm to initate the actual call.
* @param {string} phoneNumber - This field is required.
* @returns {Promise.<boolean>}
*/
export async function CallPhoneNumber(phoneNumber) {
// BEGIN USER CODE
if (!phoneNumber) {
return Promise.reject(new Error("Input parameter 'Phone number' is required"));
}
const url = `tel:${encodeURI(phoneNumber)}`;
// Native platform
if (navigator && navigator.product === "ReactNative") {
const Linking = require("react-native").Linking;
return Linking.canOpenURL(url).then(supported => {
if (!supported) {
return false;
}
return Linking.openURL(url).then(() => true);
});
}
// Hybrid platform
if (window && window.cordova) {
window.open(url, "_system");
return Promise.resolve(true);
}
// Web platform
if (window) {
window.location.href = url;
return Promise.resolve(true);
}
return Promise.resolve(false);
// END USER CODE
}
Loading