Skip to content

Commit e5d7cb2

Browse files
committed
Merge pull request #9200 from kbrock/state_logos
Update Workflow State icons
2 parents 73a5ebc + bbf70d8 commit e5d7cb2

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

app/javascript/components/miq-data-table/miq-table-cell.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ const MiqTableCell = ({
9090
};
9191

9292
/** Function to render icon(s) in cell. */
93-
const renderIcon = (icon, style, showText) => {
93+
const renderIcon = (icon, style, showText, title = '') => {
9494
const hasBackground = Object.keys(style).includes('background');
9595
const styledIconClass = hasBackground ? 'styled_icon' : '';
9696
const longerTextClass = hasBackground && veryLongText ? 'styled_icon_margin' : '';
9797
return (
98-
<div className={cellClass}>
98+
<div className={cellClass} title={title}>
9999
{
100100
typeof (icon) === 'string'
101101
? returnIcon(icon, style, styledIconClass, longerTextClass)
@@ -111,7 +111,7 @@ const MiqTableCell = ({
111111
if (showText) {
112112
const color = item.props ? item.props.style : {};
113113
const iconStyle = item.background ? { background: item.background, color: '#FFF' } : color;
114-
return renderIcon(item.icon, iconStyle, showText);
114+
return renderIcon(item.icon, iconStyle, showText, item.title);
115115
}
116116
const { className, style } = item.props ? item.props : { className: item.icon, style: { color: '#000' } };
117117
return renderIcon(className, style, showText);

app/javascript/components/request-workflow-status/data.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,19 @@ const convertDuration = (duration) => {
6565
};
6666

6767
const getItemIcon = (item) => {
68-
if (item.RunnerContext && item.RunnerContext.success) {
69-
return { icon: 'carbon--CheckmarkOutline' };
70-
} if (item.RunnerContext && item.RunnerContext.Error) {
71-
return { icon: 'carbon--MisuseOutline' };
68+
if (item.FinishedTime) {
69+
if (item.Output && item.Output.Error) {
70+
if (item.RetryCount) {
71+
return { icon: 'carbon--RetryFailed' }
72+
} else {
73+
return { icon: 'carbon--MisuseOutline' }
74+
}
75+
} else {
76+
return { icon: 'carbon--CheckmarkOutline' }
77+
}
78+
} else {
79+
return { icon: 'carbon--PlayOutline' }
7280
}
73-
return { icon: 'carbon--PlayOutline' };
7481
};
7582

7683
/** Function to get the row data of workflow states table. */
@@ -97,7 +104,7 @@ export const workflowStatusData = (response) => {
97104

98105
rows.push({
99106
id: state.Guid.toString(),
100-
name: { text: state.Name, icon: 'carbon--PlayOutline' },
107+
name: { text: state.Name, ...getItemIcon(state) },
101108
enteredTime: convertDate(state.EnteredTime.toString()),
102109
finishedTime: '',
103110
duration: convertDuration(durationTime),

app/stylesheet/miq-data-table.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,4 +409,8 @@ table.miq_preview {
409409
.carbon--PlayOutline {
410410
color: var(--yellow)
411411
}
412+
413+
.carbon--RetryFailed {
414+
color: var(--red);
415+
}
412416
}

0 commit comments

Comments
 (0)