mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
[ui] When a job is deleted in the background, wait until redirect before cache unload (#23492)
* Wait until the job page is moved-off before unloading the job from ember data cache * handle transitionAborted error
This commit is contained in:
3
.changelog/23492.txt
Normal file
3
.changelog/23492.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Fix an issue where a remotely purged job would prevent redirect from taking place in the web UI
|
||||
```
|
||||
@@ -23,11 +23,12 @@ export default class JobController extends Controller {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
@action notFoundJobHandler() {
|
||||
@action async notFoundJobHandler() {
|
||||
if (
|
||||
this.watchers.job.isError &&
|
||||
this.watchers.job.error?.errors?.some((e) => e.status === '404')
|
||||
) {
|
||||
try {
|
||||
this.notifications.add({
|
||||
title: `Job "${this.job.name}" has been deleted`,
|
||||
message:
|
||||
@@ -35,8 +36,14 @@ export default class JobController extends Controller {
|
||||
color: 'critical',
|
||||
sticky: true,
|
||||
});
|
||||
await this.router.transitionTo('jobs');
|
||||
this.store.unloadRecord(this.job);
|
||||
this.router.transitionTo('jobs');
|
||||
} catch (err) {
|
||||
if (err.code === 'TRANSITION_ABORTED') {
|
||||
return;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user