- {runningSteps.map((step, i) => (
+ const planState = executionPlan?.state;
+ const resultIsPending = String(result) === 'pending';
+
+ if (!runningSteps.length) {
+ if (planState === 'running' && resultIsPending) {
+ return (
- {step.cancellable && (
-
-
-
- )}
-
-
- {__('Action')}:
-
-
- {step.action_class}
-
- {__('State')}:
- {step.state}
-
- {__('Input')}:
-
- {step.input}
-
- {__('Output')}:
-
- {step.output}
-
+ {__('The task is still being processed. Please wait.')}
+ );
+ }
+
+ if (planState === 'planned' && resultIsPending) {
+ return (
+
+
+
+
+
+ }
+ />
+
+ {__('The task has not started yet.')}
+
+
+
+
+
+
+ );
+ }
+
+ return
{__('No running steps')};
+ }
+
+ return (
+
+ {runningSteps.map((step, i) => (
+
+
+
+ {step.cancellable && (
+
+
+
+
+
+
+
+ )}
+
+
+
+ {`${__('Action')}:`}
+
+ {step.action_class}
+
+
+
+
+
+ {`${__('State')}:`}
+
+ {step.state}
+
+
+
+ {step.input}
+
+
+ {step.output}
+
+
+
+
))}
-
+
);
};
RunningSteps.propTypes = {
+ executionPlan: PropTypes.shape({ state: PropTypes.string }),
+ result: PropTypes.string,
runningSteps: PropTypes.array,
id: PropTypes.string.isRequired,
cancelStep: PropTypes.func.isRequired,
@@ -72,6 +178,8 @@ RunningSteps.propTypes = {
RunningSteps.defaultProps = {
runningSteps: [],
+ executionPlan: {},
+ result: undefined,
};
export default RunningSteps;
diff --git a/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js b/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
index 75b00d851..453f22843 100644
--- a/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
+++ b/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
@@ -1,5 +1,19 @@
import React, { useState } from 'react';
import PropTypes from 'prop-types';
+import {
+ Flex,
+ FlexItem,
+ Split,
+ SplitItem,
+ Stack,
+ StackItem,
+ Title,
+} from '@patternfly/react-core';
+import {
+ CheckCircleIcon,
+ ExclamationTriangleIcon,
+ InProgressIcon,
+} from '@patternfly/react-icons';
import TaskInfo from './TaskInfo';
import {
ForceUnlockConfirmationModal,
@@ -7,6 +21,64 @@ import {
} from '../../common/ClickConfirmation';
import { TaskButtons } from './TaskButtons';
+const TitleIcon = ({ state, result }) => {
+ if (state === 'running') {
+ return