Skip to content

Commit 37de5f4

Browse files
authored
Merge pull request #70 from mendix/react-upgrade
[DAT-3908] React upgrade
2 parents 7db0c3e + 114955c commit 37de5f4

215 files changed

Lines changed: 22329 additions & 12852 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.

Audit trail.mpr

5.33 MB
Binary file not shown.

SiemensMendixAudittrail__10.2.0__READMEOSS.html

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'com.mendix.gradle.publish-module-plugin' version '1.16'
3+
id 'com.mendix.gradle.publish-module-plugin' version '1.17'
44
id 'net.researchgate.release' version '2.8.1'
55
}
66

@@ -16,6 +16,7 @@ mxMarketplace {
1616
appName = "Audittrail"
1717
filterWidgets = true
1818
appDirectory = "."
19+
includeFiles = List.of(ossClearanceFile)
1920
versionPathPrefix = "__Version " // the path prefix within the module to the version folder
2021
}
2122

environment.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ def mxInstallVersion = System.getenv('MODELER_VERSION') ?: System.getenv('MX_INS
66

77
project.ext.mxInstallPath = "${mxPath}/${mxInstallVersion}"
88
project.ext.mxRuntimeBundles = new File("${mxInstallPath}/runtime/bundles")
9+
project.ext.ossClearanceFile = file("SiemensMendixAudittrail__10.2.0__READMEOSS.html")

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=10.1.1
1+
version=10.2.0
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
import { utils, writeFileXLSX } from './xlsx-export-tools.js';
11+
12+
// BEGIN EXTRA CODE
13+
// END EXTRA CODE
14+
15+
/**
16+
* @param {string} datagridName
17+
* @param {string} fileName
18+
* @param {string} sheetName
19+
* @param {boolean} includeColumnHeaders
20+
* @param {Big} chunkSize - The number of items fetched and exported per request.
21+
* @returns {Promise.<boolean>}
22+
*/
23+
export async function Export_To_Excel(datagridName, fileName, sheetName, includeColumnHeaders, chunkSize) {
24+
// BEGIN USER CODE
25+
if (!fileName || !datagridName || !sheetName) {
26+
return false;
27+
}
28+
29+
const REGISTRY_NAME = "com.mendix.widgets.web.datagrid.export";
30+
const registry = window[REGISTRY_NAME];
31+
const controller = registry.get(datagridName);
32+
33+
if (controller === undefined) {
34+
return false;
35+
}
36+
37+
return new Promise((resolve) => {
38+
function handler(req) {
39+
let worksheet;
40+
let headers;
41+
42+
req.on("headers", (hds) => {
43+
headers = hds.map(header => header.name);
44+
if (includeColumnHeaders) {
45+
worksheet = utils.aoa_to_sheet([headers]);
46+
}
47+
});
48+
49+
req.on("data", (data) => {
50+
if (worksheet === undefined) {
51+
worksheet = utils.aoa_to_sheet(data)
52+
} else {
53+
utils.sheet_add_aoa(worksheet, data, { origin: -1 });
54+
}
55+
});
56+
57+
req.on("end", () => {
58+
if (worksheet) {
59+
// Set character width for each column
60+
// https://docs.sheetjs.com/docs/csf/sheet#worksheet-object
61+
worksheet["!cols"] = headers.map(header => ({
62+
wch: header.length + 10
63+
}));
64+
const workbook = utils.book_new();
65+
utils.book_append_sheet(workbook, worksheet, sheetName === "" ? "Data" : sheetName);
66+
writeFileXLSX(workbook, `${fileName}.xlsx`);
67+
resolve(true);
68+
} else {
69+
resolve(false);
70+
}
71+
});
72+
73+
req.on("abort", () => resolve(false));
74+
}
75+
76+
controller.exportData(handler, {
77+
withHeaders: true,
78+
limit: chunkSize.toNumber()
79+
})
80+
});
81+
// END USER CODE
82+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
import "mx-global";
10+
11+
// BEGIN EXTRA CODE
12+
// END EXTRA CODE
13+
14+
/**
15+
* @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).
16+
* @param {boolean} setToDefault - Set to default value. If true, filter will be set to its default value, otherwise it will be set to empty.
17+
* @returns {Promise.<void>}
18+
*/
19+
export async function Reset_All_Filters(targetName, setToDefault) {
20+
// BEGIN USER CODE
21+
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
22+
if (plugin) {
23+
plugin.emit(targetName, "reset.filters", setToDefault);
24+
}
25+
// END USER CODE
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
* @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).
16+
* @param {boolean} setToDefault - Set to default value. If true, filter will be set to its default value, otherwise it will be set to empty.
17+
* @returns {Promise.<void>}
18+
*/
19+
export async function Reset_Filter(targetName, setToDefault) {
20+
// BEGIN USER CODE
21+
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
22+
if (plugin) {
23+
plugin.emit(targetName, "reset.value", setToDefault);
24+
}
25+
// END USER CODE
26+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
* @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).
16+
* @param {boolean} useDefaultValue - Determine the use of default value provided by the filter component itself.
17+
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.
19+
* @param {string} stringValue - Value set for dropdown filter or text filter. Choose empty if not use.
20+
* @param {Big} numberValue - Number value for number filter. Choose empty if not use.
21+
* @param {Date} dateTimeValue - Date time value for date filter, can also be use as "start date". Choose empty if not use.
22+
* @param {Date} dateTimeValue_2 - End date time value for range filter. Choose empty if not use.
23+
* @returns {Promise.<void>}
24+
*/
25+
export async function Set_Filter(targetName, useDefaultValue, operators, stringValue, numberValue, dateTimeValue, dateTimeValue_2) {
26+
// BEGIN USER CODE
27+
const plugin = window["com.mendix.widgets.web.plugin.externalEvents"];
28+
if (plugin) {
29+
plugin.emit(targetName, "set.value", useDefaultValue, {
30+
operators, stringValue, numberValue, dateTimeValue, dateTimeValue2: dateTimeValue_2
31+
});
32+
}
33+
// END USER CODE
34+
}

javascriptsource/datawidgets/actions/xlsx-export-tools.js

Lines changed: 3 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)