meldium importer resolves #68

This commit is contained in:
Kyle Spearrin 2017-05-17 16:20:00 -04:00
parent 3f0b14e48a
commit 804f1f5610
2 changed files with 39 additions and 0 deletions

View File

@ -92,6 +92,9 @@
case 'splashidcsv': case 'splashidcsv':
importSplashIdCsv(file, success, error); importSplashIdCsv(file, success, error);
break; break;
case 'meldiumcsv':
importMeldiumCsv(file, success, error);
break;
default: default:
error(); error();
break; 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; return _service;
}); });

View File

@ -190,6 +190,12 @@
instructions: $sce.trustAsHtml('Using the Ascendo DataVault desktop application, navigate ' + 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)" ' + '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.') '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.')
} }
]; ];