in components/base-workflow-ui/packages/base-workflow-ui/src/models/workflows/Workflow.js [140:186]
get steps() {
const selectedSteps = self.workflow.selectedSteps || [];
const getStep = index => _.nth(selectedSteps, index);
const strip = (pre, msg, color) => {
if (_.startsWith(msg, pre)) {
return {
match: true,
parsed: msg.substring(pre.length),
color,
};
}
return {
match: false,
parsed: msg,
};
};
const parse = msg => {
if (_.isEmpty(msg)) return {};
let item = strip('WARN|||', msg, 'orange');
if (!item.match) {
item = strip('ERR|||', msg, 'red');
if (!item.match) {
item = strip('INFO|||', msg, 'green');
}
}
return item;
};
const result = [];
_.forEach(self.stStatuses, (stepStatus, index) => {
const step = getStep(index) || {};
const msgObj = parse(stepStatus.msg);
result.push({
statusMsg: msgObj.parsed,
statusLabel: _.startCase(stepStatus.status),
statusColor: msgObj.color || statusColorMap[stepStatus.status],
stepTemplateId: step.stepTemplateId || 'unknown',
stepTemplateVer: step.stepTemplateVer,
title: step.title || 'Not available',
startTime: stepStatus.startTime,
endTime: stepStatus.endTime,
});
});
return result;
},