Skip to content

Commit

Permalink
fix(force cancel pipeline): Display force checkbox by default (#3548)
Browse files Browse the repository at this point in the history
ExecutionEngine 'v2' is now default, so the force checkbox should be displayed by default.
This commit also change the cancel pipeline endpoint, the previous one is deprecated (removed `/applications/{applicationName}`)
  • Loading branch information
jervi authored and danielpeach committed Apr 19, 2017
1 parent 8d78e24 commit f7b9620
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Expand Up @@ -166,7 +166,7 @@ export class Execution extends React.Component<IExecutionProps, IExecutionState>
cancelModalService.confirm({
header: `Really stop execution of ${this.props.execution.name}?`,
buttonText: `Stop running ${this.props.execution.name}`,
forceable: this.props.execution.executionEngine === 'v2',
forceable: this.props.execution.executionEngine !== 'v1',
body: hasDeployStage ? '<b>Note:</b> Any deployments that have begun will continue and need to be cleaned up manually.' : null,
submitMethod: (reason, force) => executionService.cancelExecution(this.props.application, this.props.execution.id, force, reason)
});
Expand Down
Expand Up @@ -41,7 +41,7 @@ describe('Service: executionService', function () {
it('should wait until pipeline is not running, then resolve', function () {
let completed = false;
let executionId = 'abc';
let cancelUrl = [ SETTINGS.gateUrl, 'applications', 'deck', 'pipelines', executionId, 'cancel' ].join('/');
let cancelUrl = [ SETTINGS.gateUrl, 'pipelines', executionId, 'cancel' ].join('/');
let checkUrl = [ SETTINGS.gateUrl, 'pipelines', executionId ].join('/');
let application = { name: 'deck', executions: { refresh: () => $q.when(null) } };

Expand All @@ -61,7 +61,7 @@ describe('Service: executionService', function () {
it('should propagate rejection from failed cancel', function () {
let failed = false;
let executionId = 'abc';
let cancelUrl = [ SETTINGS.gateUrl, 'applications', 'deck', 'pipelines', executionId, 'cancel' ].join('/');
let cancelUrl = [ SETTINGS.gateUrl, 'pipelines', executionId, 'cancel' ].join('/');
let application = { name: 'deck', executions: { refresh: () => $q.when(null) } };

$httpBackend.expectPUT(cancelUrl).respond(500, []);
Expand Down
Expand Up @@ -136,8 +136,6 @@ export class ExecutionService {
method: 'PUT',
url: [
SETTINGS.gateUrl,
'applications',
application.name,
'pipelines',
executionId,
'cancel',
Expand Down

0 comments on commit f7b9620

Please sign in to comment.