open-nomad/ui/app/controllers/allocations/allocation/task/index.js
Buck Doyle 6447e61078 Remove prestart tasks table
My suggestion is that this table isn’t sufficiently useful to
keep around with the combinatoric explosion of other lifecycle
phases. The logic was that someone might wonder “why isn’t my
main task starting?” and this table would show that the prestart
tasks hadn’t yet completed. One might wonder the same about
any task that has prerequisites, so should a poststart task have
a table that shows main tasks? And so on.

Since the route hierarchy guarantees that one has already passed
through a template that shows the lifecycle chart before one
can reach the template where this table is displayed, I believe
this table is redundant. It also conveys information in a more
abstract way than the chart, which is dense and more easily
understood, to me.
2020-08-26 09:58:44 -05:00

30 lines
685 B
JavaScript

import Controller from '@ember/controller';
import { computed as overridable } from 'ember-overridable-computed';
import { task } from 'ember-concurrency';
import classic from 'ember-classic-decorator';
@classic
export default class IndexController extends Controller {
@overridable(() => {
// { title, description }
return null;
})
error;
onDismiss() {
this.set('error', null);
}
@task(function*() {
try {
yield this.model.restart();
} catch (err) {
this.set('error', {
title: 'Could Not Restart Task',
description: 'Your ACL token does not grant allocation lifecycle permissions.',
});
}
})
restartTask;
}