-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add button to fail running deployments
As suggested in #9826. The placement is currently ridiculous.
- Loading branch information
Showing
8 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
import Component from '@ember/component'; | ||
import { classNames } from '@ember-decorators/component'; | ||
import classic from 'ember-classic-decorator'; | ||
import { task } from 'ember-concurrency'; | ||
import { ForbiddenError } from '@ember-data/adapter/error'; | ||
import messageFromAdapterError from 'nomad-ui/utils/message-from-adapter-error'; | ||
|
||
@classic | ||
@classNames('job-deployment', 'boxed-section') | ||
export default class JobDeployment extends Component { | ||
deployment = null; | ||
isOpen = false; | ||
|
||
handleError() {} | ||
|
||
@task(function*() { | ||
try { | ||
yield this.deployment.fail(); | ||
} catch (err) { | ||
console.log('err?', err); | ||
let message = messageFromAdapterError(err); | ||
|
||
if (err instanceof ForbiddenError) { | ||
message = 'Your ACL token does not grant permission to fail deployments.'; | ||
} | ||
|
||
this.handleError({ | ||
title: 'Could Not Fail Deployment', | ||
description: message, | ||
}); | ||
} | ||
}) | ||
fail; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters