Skip to content

Commit

Permalink
fixed force delete and stop
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Nov 20, 2023
1 parent 12571f0 commit a469614
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/app/deployments/pages/list/deployment-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
this.loadDeployments(false)
this.startPeriodicRefresh()
return of()
}),
catchError(err => {
this.errorService.handleError(DeploymentListComponent.name, "stopDeployments", err)
this.ready = true
return of()
})
)
}
Expand All @@ -178,7 +173,14 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
this.ready = false;
this.stopPeriodicRefresh()

this.moduleService.startDeployments(ids, true).pipe(
var obs
if(ids.length == 1) {
obs = this.moduleService.startDeployment(ids[0], true)
} else {
obs = this.moduleService.startDeployments(ids, true)
}

obs.pipe(
map(_ => {
this.loadDeployments(false)
this.startPeriodicRefresh()
Expand Down Expand Up @@ -271,7 +273,13 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
}

sendDelete(ids: string[], forceConfirmed: boolean) {
return this.moduleService.deleteDeployments(ids, forceConfirmed).pipe(
var obs
if (ids.length == 1) {
obs = this.moduleService.deleteDeployment(ids[0], forceConfirmed)
} else {
obs = this.moduleService.deleteDeployments(ids, forceConfirmed)
}
return obs.pipe(
concatMap(jobID => {
var message = "Delete deployments"
return this.utilsService.checkJobStatus(jobID, message)
Expand All @@ -283,11 +291,6 @@ export class DeploymentListComponent implements OnInit, OnDestroy {
this.loadDeployments(false)
this.startPeriodicRefresh()
return of()
}),
catchError(err => {
this.errorService.handleError(DeploymentListComponent.name, "sendDelete", err)
this.ready = true
return of()
})
)
}
Expand Down

0 comments on commit a469614

Please sign in to comment.