Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Melodic
melodic-frontend
Commits
ac78c4da
Commit
ac78c4da
authored
Sep 30, 2019
by
Alicja Reniewicz
Browse files
fix removing model from list after upload all
parent
68fc332c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/app/application/vm-list/vm-list.component.ts
View file @
ac78c4da
...
...
@@ -42,15 +42,15 @@ export class VmListComponent implements OnInit {
this
.
locationList
=
locationResponse
;
this
.
applicationService
.
getVmNodeList
().
subscribe
(
vmNodesResponse
=>
{
this
.
vms
=
vmNodesResponse
;
this
.
loadingVmListInProgress
=
false
;
this
.
updateTableData
();
console
.
log
(
'
Successfully getting VM list
'
);
this
.
loadingVmListInProgress
=
false
;
this
.
updateTableData
();
console
.
log
(
'
Successfully getting VM list
'
);
},
error1
=>
{
this
.
vms
=
[];
this
.
loadingVmListInProgress
=
false
;
this
.
updateTableData
();
this
.
snackBar
.
open
(
`Problem by getting VMs list:
${
error1
.
error
.
message
}
`
,
'
Close
'
);
this
.
vms
=
[];
this
.
loadingVmListInProgress
=
false
;
this
.
updateTableData
();
this
.
snackBar
.
open
(
`Problem by getting VMs list:
${
error1
.
error
.
message
}
`
,
'
Close
'
);
});
},
error1
=>
{
...
...
src/app/file-uploader/files-queue/files-queue.component.html
View file @
ac78c4da
<ng-content></ng-content>
<button
mat-raised-button
color=
"primary"
*ngIf=
"files.length > 0"
(click)=
"uploadAll()"
>
Upload
</button>
<button
mat-raised-button
color=
"primary"
*ngIf=
"files.length > 0"
(click)=
"removeAll()"
>
Remove All
</button>
<button
mat-raised-button
color=
"primary"
*ngIf=
"files.length > 0"
(click)=
"uploadAll()"
[disabled]=
""
>
Upload
</button>
<button
mat-raised-button
color=
"primary"
*ngIf=
"files.length > 0"
(click)=
"removeAll()"
[disabled]=
""
>
Remove All
</button>
src/app/file-uploader/files-queue/files-queue.component.ts
View file @
ac78c4da
...
...
@@ -26,6 +26,7 @@ export class FilesQueueComponent implements OnDestroy, AfterViewInit {
}
files
:
Array
<
any
>
=
[];
uploadingInProgress
=
false
;
@
Input
()
fileExtension
=
'
xmi
'
;
...
...
@@ -69,14 +70,17 @@ export class FilesQueueComponent implements OnDestroy, AfterViewInit {
public
uploadAll
()
{
this
.
fileUploads
.
forEach
(
item
=>
item
.
setUploadingInProgress
());
this
.
uploadingInProgress
=
true
;
this
.
deploymentService
.
uploadMultipleModels
(
this
.
fileUploads
).
subscribe
(
value
=>
{
let
successfullyUploadedFilesNames
=
''
;
console
.
log
(
'
Files uploaded successfully
'
);
this
.
uploadingInProgress
=
false
;
const
numberOfModels
=
this
.
fileUploads
.
length
;
this
.
fileUploads
.
forEach
(
item
=>
{
item
.
setUploadingAsFinished
();
console
.
log
(
`Removing file from list:
${
item
.
file
.
name
}
`
);
item
.
remove
();
item
.
removeEvent
.
emit
(
item
);
for
(
let
i
=
0
;
i
<
numberOfModels
;
i
++
)
{
item
.
remove
();
}
});
let
uploadXmiResponseWithSecureVariable
:
UploadXmiResponse
;
value
.
forEach
(
uploadedXmiFileResponse
=>
{
...
...
@@ -104,6 +108,7 @@ export class FilesQueueComponent implements OnDestroy, AfterViewInit {
}
},
error1
=>
{
this
.
uploadingInProgress
=
false
;
this
.
fileUploads
.
first
.
setUploadingAsFinished
();
this
.
snackBar
.
open
(
'
Error by uploading files list
'
,
'
Close
'
);
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment