diff --git a/background/background-process.html b/background/background-process.html
index a125f893..822ec128 100644
--- a/background/background-process.html
+++ b/background/background-process.html
@@ -863,6 +863,17 @@
Background process
log.error(err)
sendLogToUI(task,'error', "Error occured while clearing the baseline reference. Check logs for details.");
}
+
+ //
+ try{
+ if(task === 'combine_csv_to_excel'){
+ const result = await utils.combinedCSVsIntoExcel(options.csvDirectory);
+ sendLogToUI(task, result.status, result.message);
+ }
+ }catch(err){
+ log.error(err)
+ sendLogToUI(task,'error', "Error occured while combining csv files. Check logs for details.");
+ }
}
diff --git a/background/background-utils.js b/background/background-utils.js
index 152a4c11..3f2ec656 100644
--- a/background/background-utils.js
+++ b/background/background-utils.js
@@ -18,6 +18,7 @@ const bgUtils = window.require('./bg-utils');
const { VENDOR_CM_FORMATS, VENDOR_PM_FORMATS, VENDOR_FM_FORMATS,
VENDOR_CM_PARSERS, VENDOR_PM_PARSERS, VENDOR_FM_PARSERS } = window.require('./vendor-formats');
const tems = window.require('./tems');
+const csvToExcelCombiner = window.require('./csv-to-excel-combiner');
//Fix PATH env variable on Mac OSX
if(process.platform === 'darwin'){
@@ -1575,6 +1576,18 @@ async function clearBaselineReference(){
}
}
+async function combinedCSVsIntoExcel(csvDirectory){
+ try{
+ const combinedExcelFile = path.join(app.getPath('downloads'), 'combined_csv.xlsx');
+ await csvToExcelCombiner.combine(csvDirectory, combinedExcelFile);
+ return {status: 'success', message: combinedExcelFile };
+ }catch(e){
+ log.error(e);
+ return {status: 'error', message: `Error occured while combining csv files. Check logs for details.`};
+ }
+}
+
+exports.combinedCSVsIntoExcel = combinedCSVsIntoExcel;
exports.clearBaselineReference = clearBaselineReference;
exports.importGISFile = importGISFile;
exports.addParamToBaselineRef = addParamToBaselineRef;
diff --git a/background/csv-to-excel-combiner.js b/background/csv-to-excel-combiner.js
new file mode 100644
index 00000000..dd495d9d
--- /dev/null
+++ b/background/csv-to-excel-combiner.js
@@ -0,0 +1,58 @@
+const csv = window.require('csvtojson');
+const Excel = window.require('exceljs');
+
+
+/*
+* Combine csv files in a folder
+*
+* @param string csvFolder
+*/
+async function combine(csvFolder, combineExcelFile){
+ files = fs.readdirSync(csvFolder, { withFileTypes: true }).filter(dirent => !dirent.isDirectory()).map(dirent => dirent.name);
+
+ var excelOptions = {
+ filename: combineExcelFile
+ };
+
+ //const workbook = new Excel.Workbook();
+ var workbook = new Excel.stream.xlsx.WorkbookWriter(excelOptions);
+
+ workbook.creator = 'Bodastage Solutions';
+
+ for(let i=0; i< files.length; i++) {
+ const fileName = files[i];
+ const filePath = path.join(csvFolder, files[i]);
+ const sheetName = fileName.replace(".csv", "");
+
+ const worksheet = workbook.addWorksheet(sheetName);
+
+ await new Promise((resolve, reject) => {
+ try{
+ csv({noheader:true, output: "csv"})
+ .fromFile(filePath)
+ .subscribe( (csvRow)=>{
+ worksheet.addRow(csvRow).commit();
+
+ },(err) => {//onError
+ log.error(`CSVToExcelCombiner.csvJoJson.onError: ${err.toString()}`);
+ reject();
+ },
+ ()=>{//onComplete
+ resolve(undefined);
+ });
+ }catch(e){
+ log.error(e);
+ }
+
+ });
+
+ await worksheet.commit();
+
+ }//eo-for
+
+ await workbook.commit();
+ //const res = await workbook.xlsx.writeFile(combineExcelFile);
+
+}
+
+exports.combine = combine;
\ No newline at end of file
diff --git a/package.json b/package.json
index 1c810a71..e647252f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "Boda-Lite",
- "version": "0.3.0-beta.4",
+ "version": "0.3.0-rc.1",
"description": "Boda-Lite is a telecommunication network management application",
"private": true,
"homepage": "./",
diff --git a/src/index.js b/src/index.js
index 5616e0cc..95523166 100644
--- a/src/index.js
+++ b/src/index.js
@@ -27,7 +27,8 @@ import { faLock, faAt, faSpinner, faHome, faPlug, faCog, faDownload,
faFolder, faFile, faStar, faChevronRight, faDotCircle, faFolderOpen,
faLink, faClock, faRss, faChartLine, faSquare, faTable, faInfoCircle
,faAsterisk, faFileAlt,faFrown,faDatabase, faFileExcel, faFileCsv,
- faBroadcastTower, faPencilRuler, faBook,faCloudUploadAlt
+ faBroadcastTower, faPencilRuler, faBook,faCloudUploadAlt,faTools,
+ faCandyCane
} from '@fortawesome/free-solid-svg-icons'
library.add(faLock, faAt, faSpinner, faHome, faPlug, faCog, faDownload,
@@ -37,7 +38,7 @@ faChartArea, faBrain, faGem, faUserMd, faGlobeAfrica, faPeopleCarry,
faFolder, faFile, faStar, faChevronRight, faDotCircle, faFolderOpen,
faLink, faClock, faRss, faChartLine, faSquare, faTable, faInfoCircle,
faAsterisk, faFileAlt,faFrown, faDatabase, faFileExcel, faFileCsv,
-faBroadcastTower, faPencilRuler, faBook, faCloudUploadAlt);
+faBroadcastTower, faPencilRuler, faBook, faCloudUploadAlt, faTools, faCandyCane);
const store = configureStore();
diff --git a/src/modules/dashboard/Dashboard.jsx b/src/modules/dashboard/Dashboard.jsx
index ccc62913..34152684 100644
--- a/src/modules/dashboard/Dashboard.jsx
+++ b/src/modules/dashboard/Dashboard.jsx
@@ -140,6 +140,40 @@ class Dashboard extends React.Component {
+
+
+