Skip to content

Commit

Permalink
Mendix 10.18
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroeneweg committed Dec 28, 2024
1 parent ec63d7c commit 4ebb2b1
Show file tree
Hide file tree
Showing 623 changed files with 6,445 additions and 6,561 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ node_modules/
.idea/
*DS_Store*

/test/.mendix-cache
/test/theme-cache
9,893 changes: 4,330 additions & 5,563 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativekeepawake",
"widgetName": "NativeKeepAwake",
"version": "2.0.0",
"version": "2.1.0",
"description": "Native keep awake widget",
"copyright": "ITvisors 2021",
"author": "Marcel Groeneweg",
Expand All @@ -22,7 +22,7 @@
"release": "pluggable-widgets-tools release:native"
},
"devDependencies": {
"@mendix/pluggable-widgets-tools": "^10.12.0"
"@mendix/pluggable-widgets-tools": "^10.18.0"
},
"dependencies": {
"@sayem314/react-native-keep-awake": "^1.2.4"
Expand Down
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="NativeKeepAwake" version="2.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="NativeKeepAwake" version="2.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="NativeKeepAwake.xml"/>
</widgetFiles>
Expand Down
Binary file modified test/TestKeepAwake.mpr
Binary file not shown.
91 changes: 47 additions & 44 deletions test/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
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function initializeCounter() {
}
async function getItem(key) {
if (navigator && navigator.product === "ReactNative") {
const AsyncStorage = (await import('@react-native-community/async-storage')).default;
const AsyncStorage = (await import('@react-native-async-storage/async-storage')).default;
return AsyncStorage.getItem(key);
}
if (window) {
Expand All @@ -29,7 +29,7 @@ async function getItem(key) {
}
async function setItem(key, value) {
if (navigator && navigator.product === "ReactNative") {
const AsyncStorage = (await import('@react-native-community/async-storage')).default;
const AsyncStorage = (await import('@react-native-async-storage/async-storage')).default;
return AsyncStorage.setItem(key, value);
}
if (window) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
10 changes: 8 additions & 2 deletions test/javascriptsource/nanoflowcommons/actions/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,23 @@ import { Big } from "big.js";
*
* @param {string} username - This field is required.
* @param {string} password - This field is required.
* @param {boolean} [useAuthToken] - This field is optional.
* @returns {Promise.<Big>}
*/
export async function SignIn(username, password) {
export async function SignIn(username, password, useAuthToken) {
// BEGIN USER CODE
if (!username || !password) {
return Promise.resolve(new Big(401));
}
return new Promise(resolve => {
const onSuccess = () => resolve(new Big(200));
const onError = (error) => resolve(new Big(error.status));
mx.login(username, password, onSuccess, onError);
if (typeof useAuthToken === "undefined") {
mx.login(username, password, onSuccess, onError);
}
else {
mx.login2(username, password, useAuthToken, onSuccess, onError);
}
});
// END USER CODE
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// - 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 AsyncStorage from '@react-native-community/async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

// BEGIN EXTRA CODE
// END EXTRA CODE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"nativeDependencies": {
"@react-native-community/async-storage": "1.12.1"
"@react-native-async-storage/async-storage": "2.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"react-native-geocoder":{"version":"0.5.0","transitive":false,"url":"https://github.com/devfd/react-native-geocoder"}},{"@react-native-community/geolocation":{"version":"2.0.2","transitive":false,"url":"https://github.com/react-native-community/react-native-geolocation#README.md"}},{"react-native-geolocation-service":{"version":"5.2.0","transitive":false,"url":"https://github.com/Agontuk/react-native-geolocation-service"}},{"@react-native-community/async-storage":{"version":"1.12.1","transitive":false,"url":"https://github.com/react-native-community/react-native-async-storage#readme"}},{"deep-assign":{"version":"3.0.0","transitive":true,"url":null}},{"is-obj":{"version":"1.0.1","transitive":true,"url":null}},{"js-base64":{"version":"3.7.2","transitive":false,"url":null}}]
[{"react-native-geocoder":{"version":"0.5.0","transitive":false,"url":"https://github.com/devfd/react-native-geocoder"}},{"@react-native-community/geolocation":{"version":"2.0.2","transitive":false,"url":"https://github.com/react-native-community/react-native-geolocation#README.md"}},{"react-native-geolocation-service":{"version":"5.2.0","transitive":false,"url":"https://github.com/Agontuk/react-native-geolocation-service"}},{"@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.2","transitive":false,"url":null}}]
Loading

0 comments on commit 4ebb2b1

Please sign in to comment.