Skip to content
Snippets Groups Projects
Commit be0c738a authored by Antoine Detailleur's avatar Antoine Detailleur Committed by Ugo Albanese
Browse files

Merged in NUIT-259-upload-a-model (pull request #318)

[NUIT-259] Fix Upload a model from Object Library with Model refactoring

Approved-by: Sandro Weber
Approved-by: Manos Angelidis
parent 706c5fcc
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@
'$rootScope',
'nrpConfirm',
'nrpModalService',
'modelsLibrariesService',
'nrpUser',
'uploadToKgService',
function(
......@@ -80,6 +81,7 @@
$rootScope,
nrpConfirm,
nrpModalService,
modelsLibrariesService,
nrpUser,
uploadToKgService
) {
......@@ -157,7 +159,7 @@
textReader.onload = e => resolve([zip.name, e.target.result]);
textReader.readAsArrayBuffer(zip);
}).then(([filename, filecontent]) => {
storageServer
modelsLibrariesService
.setCustomModel(filename, entityType, filecontent, false)
.catch(err => {
if (
......@@ -175,7 +177,7 @@
closable: true
})
.then(() =>
storageServer.setCustomModel(
modelsLibrariesService.setCustomModel(
filename,
entityType,
filecontent,
......@@ -195,7 +197,7 @@
scope.uploadModel = function(modelType /*i.e. Robot , Brain*/) {
var input = $(
'<input type="file" style="display:none;" accept:".zip">'
'<input type="file" style="display:none;" accept=".zip">'
);
document.body.appendChild(input[0]);
input.on('change', e =>
......
......@@ -204,7 +204,7 @@
}
uploadModel(modelType /*i.e. Robot , Brain*/) {
var input = $('<input type="file" style="display:none;" accept:".zip">');
var input = $('<input type="file" style="display:none;" accept=".zip">');
document.body.appendChild(input[0]);
input.click();
input.on('change', e => {
......
......@@ -94,7 +94,7 @@
}
uploadEnvironment() {
var input = $('<input type="file" style="display:none;" accept:".zip">');
var input = $('<input type="file" style="display:none;" accept=".zip">');
document.body.appendChild(input[0]);
input.on('change', e => this.uploadModelZip(e.target.files[0]));
input.click();
......
......@@ -139,7 +139,7 @@ describe('Controller: NewExperimentController', function() {
it('should check that upload file click function works ok', function() {
var fakeInput = $(
'<input type="file" style=" display:none;" accept:".zip">'
'<input type="file" style=" display:none;" accept=".zip">'
);
fakeInput.on = function(arg1, callback) {
try {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment