diff --git a/packages/components/src/components/PipelineRun/PipelineRun.js b/packages/components/src/components/PipelineRun/PipelineRun.js
index d8dd8ab51..3904f5eba 100644
--- a/packages/components/src/components/PipelineRun/PipelineRun.js
+++ b/packages/components/src/components/PipelineRun/PipelineRun.js
@@ -216,7 +216,7 @@ export /* istanbul ignore next */ class PipelineRunContainer extends Component {
onViewChange,
pipelineRun,
pod,
- runaction,
+ runActions,
selectedStepId,
selectedTaskId,
showIO,
@@ -349,7 +349,7 @@ export /* istanbul ignore next */ class PipelineRunContainer extends Component {
status={pipelineRunStatus}
triggerHeader={triggerHeader}
>
- {runaction}
+ {runActions}
{customNotification}
{taskRuns.length > 0 && (
diff --git a/packages/components/src/components/RunAction/RunAction.js b/packages/components/src/components/RunAction/RunAction.js
deleted file mode 100644
index c438dd0fa..000000000
--- a/packages/components/src/components/RunAction/RunAction.js
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-Copyright 2019-2021 The Tekton Authors
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-import React, { Component } from 'react';
-import { injectIntl } from 'react-intl';
-import { Button } from 'carbon-components-react';
-import {
- PlayOutline32 as Play,
- Restart32 as Restart
-} from '@carbon/icons-react';
-
-class RunAction extends Component {
- handleAction = event => {
- event.preventDefault();
- const { action, getURL, intl, run, runaction, showNotification } =
- this.props;
- const { namespace } = run.metadata;
- let triggerMsg = null;
- switch (action) {
- case 'rerun':
- triggerMsg = intl.formatMessage({
- id: 'dashboard.rerun.triggered',
- defaultMessage: 'Triggered rerun'
- });
- break;
- case 'start':
- triggerMsg = intl.formatMessage({
- id: 'dashboard.start.triggered',
- defaultMessage: 'Triggered start'
- });
- break;
- default:
- break;
- }
-
- runaction(run)
- .then(newRun => {
- let finalURL = null;
- if (newRun) {
- finalURL = getURL({
- namespace,
- name: newRun.metadata.name
- });
- }
- showNotification({
- message: triggerMsg,
- kind: 'success',
- logsURL: finalURL
- });
- })
- .catch(error => {
- let msg = null;
- switch (action) {
- case 'rerun':
- msg = intl.formatMessage(
- {
- id: 'dashboard.rerun.error',
- defaultMessage:
- 'An error occurred when rerunning {runName}: check the dashboard logs for details. Status code: {statusCode}'
- },
- {
- action,
- runName: run.metadata.name,
- statusCode: error.response.status
- }
- );
- break;
- case 'start':
- msg = intl.formatMessage(
- {
- id: 'dashboard.start.error',
- defaultMessage:
- 'An error occurred when starting {runName}: check the dashboard logs for details. Status code: {statusCode}'
- },
- {
- action,
- runName: run.metadata.name,
- statusCode: error.response.status
- }
- );
- break;
- default:
- break;
- }
- showNotification({
- message: msg,
- kind: 'error'
- });
- });
- };
-
- render() {
- const { action, intl } = this.props;
-
- let icon = null;
- let msg = '';
- switch (action) {
- case 'rerun':
- icon = Restart;
- msg = intl.formatMessage({
- id: 'dashboard.rerun.button',
- defaultMessage: 'Rerun'
- });
- break;
- case 'start':
- icon = Play;
- msg = intl.formatMessage({
- id: 'dashboard.start.button',
- defaultMessage: 'Start'
- });
- break;
- default:
- break;
- }
-
- return (
-
- );
- }
-}
-
-export default injectIntl(RunAction);
diff --git a/packages/components/src/components/RunAction/RunAction.scss b/packages/components/src/components/RunAction/RunAction.scss
deleted file mode 100644
index 179a32a17..000000000
--- a/packages/components/src/components/RunAction/RunAction.scss
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
-Copyright 2019-2020 The Tekton Authors
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-.bx--btn.tkn--runaction-btn.bx--btn--ghost {
- border-width: 1px;
-}
diff --git a/packages/components/src/components/RunAction/RunAction.test.js b/packages/components/src/components/RunAction/RunAction.test.js
deleted file mode 100644
index a40a1447e..000000000
--- a/packages/components/src/components/RunAction/RunAction.test.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-Copyright 2019-2022 The Tekton Authors
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-import React from 'react';
-import { fireEvent, waitFor } from '@testing-library/react';
-import { renderWithRouter } from '../../utils/test';
-import RunAction from './RunAction';
-
-/* RunAction should sit on the PipelineRun page and display notifications there
-It would be useful to have tests at the container level too, but for now just do it at the component level */
-
-const logsURL = '/fake/url';
-const fakeRunName = 'fake_runName';
-const fakeNamespace = 'fake_namespace';
-const props = {
- getURL() {
- return logsURL;
- },
- run: {
- metadata: {
- namespace: fakeNamespace,
- name: fakeRunName
- },
- spec: {
- pipelineRef: {
- name: 'thepipeline'
- }
- }
- },
- showNotification() {}
-};
-
-it('Rerun button creates API call with correct parameters', async () => {
- const response = Promise.resolve({ metadata: { name: fakeRunName } });
- const rerunMock = jest.fn().mockImplementation(() => response);
- jest.spyOn(props, 'getURL');
- jest.spyOn(props, 'showNotification');
- const { getByText } = renderWithRouter(
-
+ {intl.formatMessage( + { + id: 'dashboard.cancelPipelineRun.body', + defaultMessage: + 'Are you sure you would like to stop PipelineRun {name}?' + }, + { name: resource.metadata.name } + )} +
++ {intl.formatMessage({ + id: 'dashboard.cancelPipelineRun.cancelled.description', + defaultMessage: + 'Interrupt any currently executing tasks and skip finally tasks' + })} +
++ {intl.formatMessage({ + id: 'dashboard.cancelPipelineRun.cancelledRunFinally.description', + defaultMessage: + 'Interrupt any currently executing non-finally tasks, then execute finally tasks' + })} +
++ {intl.formatMessage({ + id: 'dashboard.cancelPipelineRun.stoppedRunFinally.description', + defaultMessage: + 'Allow any currently executing tasks to complete but do not schedule any new non-finally tasks, then execute finally tasks' + })} +
+