open-nomad/ui/app/components/job-page/periodic.js
Michael Lange 8541579722 Show an error message when forcing a periodic launch is forbidden
This will happen when ACLs allow for reading jobs but not submitting.
2018-03-21 12:12:17 -07:00

22 lines
452 B
JavaScript

import AbstractJobPage from './abstract';
import { inject as service } from '@ember/service';
export default AbstractJobPage.extend({
store: service(),
errorMessage: '',
actions: {
forceLaunch() {
this.get('job')
.forcePeriodic()
.catch(error => {
this.set('errorMessage', `Could not force launch: ${error}`);
});
},
clearErrorMessage() {
this.set('errorMessage', '');
},
},
});