Skip to content

Commit

Permalink
Merge pull request #56 from mendix/release/3.8.0
Browse files Browse the repository at this point in the history
Workflow Commons 3.8.0
  • Loading branch information
ozgeMendix authored Aug 13, 2024
2 parents 3e965c7 + 221bb56 commit 1f4947d
Show file tree
Hide file tree
Showing 9 changed files with 414 additions and 401 deletions.
10 changes: 10 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Release 3.8.0

* We upgraded the module to Mendix 10.12.0
* We updated Data Widgets module compatibility to v2.21.2
* We added an option to select if you want to keep the target users or re-run user targeting when retrying a workflow that has a failed user task.
* We added a confirmation pop-up to all actions in the Workflow Admin page.
* We added the microflows ‘ACT_UserTask_AssignToUser’ and ‘ACT_UserTask_AssignToUsers' to the ‘Use me’ folder, that can be used to assign user(s) to a user task. The 'ACT_UserTask_AssignToUsers’ microflow is only applicable for multi-user tasks.

_______

## Release 3.7.0

* We added a scheduled event to clean-up expired audit trail logs. Refer to module documentation for more details and how to set it up.
Expand Down
Binary file added Releases/WorkflowCommons-3-8-0.mpk
Binary file not shown.
Binary file modified Source/ExpenseRequestStarterApp.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
}
2 changes: 1 addition & 1 deletion Source/themesource/datawidgets/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.20.0
2.21.2
Loading

0 comments on commit 1f4947d

Please sign in to comment.