diff --git a/src/app/services/importService.js b/src/app/services/importService.js index 5e881e39a4..96fa1bd5f6 100644 --- a/src/app/services/importService.js +++ b/src/app/services/importService.js @@ -92,6 +92,9 @@ case 'splashidcsv': importSplashIdCsv(file, success, error); break; + case 'meldiumcsv': + importMeldiumCsv(file, success, error); + break; default: error(); break; @@ -2336,5 +2339,35 @@ }); } + function importMeldiumCsv(file, success, error) { + Papa.parse(file, { + header: true, + encoding: 'UTF-8', + complete: function (results) { + parseCsvErrors(results); + + var folders = [], + logins = [], + loginRelationships = []; + + for (var j = 0; j < results.data.length; j++) { + var row = results.data[j]; + var login = { + name: row.DisplayName && row.DisplayName !== '' ? row.DisplayName : '--', + favorite: false, + uri: row.Url && row.Url !== '' ? fixUri(row.Url) : null, + password: row.Password && row.Password !== '' ? row.Password : null, + username: row.UserName && row.UserName !== '' ? row.UserName : null, + notes: row.Notes && row.Notes !== '' ? row.Notes : null + }; + + logins.push(login); + } + + success(folders, logins, loginRelationships); + } + }); + } + return _service; }); diff --git a/src/app/tools/toolsImportController.js b/src/app/tools/toolsImportController.js index 2acdaf6e13..a44e98bd62 100644 --- a/src/app/tools/toolsImportController.js +++ b/src/app/tools/toolsImportController.js @@ -190,6 +190,12 @@ instructions: $sce.trustAsHtml('Using the Ascendo DataVault desktop application, navigate ' + 'to "Tools" > "Export". In the dialog that pops up, select the "All Items (DVX, CSV)" ' + 'option. Click the "Ok" button to save the CSV file.') + }, + { + id: 'meldiumcsv', + name: 'Meldium (csv)', + instructions: $sce.trustAsHtml('Using the Meldium web vault, navigate to "Settings". ' + + 'Locate the "Export data" function and click "Show me my data" to save the CSV file.') } ];