Skip to content

Commit 1094067

Browse files
authored
Merge pull request #6 from mendix/release/4.0.0
[UIA-790] Update module for react client compatibility
2 parents 7fcab0d + e492262 commit 1094067

438 files changed

Lines changed: 40959 additions & 31759 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.

Source/.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
#
3+
# The following was added while migrating this app from SVN to Git
4+
#
5+
/**/node_modules/
6+
!/javascriptsource/**/node_modules/
7+
/*.launch
8+
/.classpath
9+
/.mendix-cache/
10+
/.project
11+
/deployment/
12+
/javasource/*/proxies/
13+
/javasource/system/
14+
/modeler-merge-marker
15+
/nativemobile/builds
16+
/packages/
17+
/project-settings.user.json
18+
/releases/
19+
*.mpr.lock
20+
*.mpr.bak
21+
/vendorlib/temp/
22+
23+
# /
24+
/modeler-merge-marker
25+
/.mendix-cache
26+
/AdministrationModule.mpr.lock
27+
/*.launch
28+
/AdministrationModule.mpr.bak
29+
/.project
30+
/.classpath
31+
/deployment
32+
/project-settings.user.json
33+
34+
# /javasource/
35+
/javasource/system
36+
37+
# /javasource/administration/
38+
/javasource/administration/proxies
39+
40+
# /javasource/atlas_core/
41+
/javasource/atlas_core/proxies
42+
43+
# /javasource/datawidgets/
44+
/javasource/datawidgets/proxies
45+
46+
# /javasource/myfirstmodule/
47+
/javasource/myfirstmodule/proxies
48+
49+
# /modules/
50+
/modules/javasource
51+
/administrationmodule.mpr.bak
52+
/administrationmodule.mpr.lock
53+
/nativemobile/builds/

Source/AdministrationModule.mpr

-11.3 MB
Binary file not shown.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
return new Promise((resolve, reject) => {
30+
const stream =
31+
window[window.DATAGRID_DATA_EXPORT][datagridName].create();
32+
33+
let worksheet;
34+
let headers;
35+
const streamOptions = { limit: chunkSize };
36+
stream.process((msg) => {
37+
if (!msg) {
38+
return;
39+
}
40+
41+
switch (msg.type) {
42+
case "columns":
43+
headers = msg.payload.map(column => column.name);
44+
if (includeColumnHeaders) {
45+
worksheet = utils.aoa_to_sheet([headers]);
46+
}
47+
break;
48+
case "data":
49+
if (worksheet === undefined) {
50+
worksheet = utils.aoa_to_sheet(msg.payload)
51+
} else {
52+
utils.sheet_add_aoa(worksheet, msg.payload, { origin: -1 });
53+
}
54+
break;
55+
case "end":
56+
if (worksheet) {
57+
// Set character width for each column
58+
// https://docs.sheetjs.com/docs/csf/sheet#worksheet-object
59+
worksheet["!cols"] = headers.map(header => ({
60+
wch: header.length + 10
61+
}));
62+
const workbook = utils.book_new();
63+
utils.book_append_sheet(workbook, worksheet, sheetName === "" ? "Data" : sheetName);
64+
writeFileXLSX(workbook, `${fileName}.xlsx`);
65+
resolve(true);
66+
} else {
67+
resolve(false);
68+
}
69+
break;
70+
case "aborted":
71+
resolve(false);
72+
break;
73+
}
74+
}, streamOptions);
75+
76+
stream.start();
77+
});
78+
// END USER CODE
79+
}

Source/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.

Source/javasource/administration/proxies/Account.java

Lines changed: 0 additions & 238 deletions
This file was deleted.

0 commit comments

Comments
 (0)