- {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/TaskInfo.js b/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
index a206c1043..550b17af1 100644
--- a/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
+++ b/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
@@ -5,17 +5,12 @@ import {
GridItem,
Progress,
ProgressVariant,
- Icon,
} from '@patternfly/react-core';
-import {
- CheckCircleIcon,
- ExclamationCircleIcon,
- ExclamationTriangleIcon,
- QuestionCircleIcon,
-} from '@patternfly/react-icons';
import { translate as __ } from 'foremanReact/common/I18n';
import RelativeDateTime from 'foremanReact/components/common/dates/RelativeDateTime';
+import { taskResultIconEl } from '../../common/taskResultIcon';
+
const isDelayed = ({ startAt, startedAt }) => {
if (
startAt == null ||
@@ -35,41 +30,6 @@ const isDelayed = ({ startAt, startedAt }) => {
return a.getTime() !== b.getTime();
};
-const resultIconEl = (state, result) => {
- if (state !== 'stopped')
- return (
-