each task (step) has its own id within a tutorial

This commit is contained in:
Delucse
2020-09-13 16:02:47 +02:00
parent 6f77b460cb
commit 7300cade5d
9 changed files with 59 additions and 23 deletions
+3 -4
View File
@@ -52,11 +52,10 @@ class StepperHorizontal extends Component {
render() {
var tutorialId = this.props.currentTutorialId;
var steps = this.props.steps;
var tasks = steps.filter(task => task.type === 'task');
var status = this.props.status.filter(status => status.id === tutorialId)[0];
var error = status.tasks.filter(task => task.type === 'error').length > 0;
var success = status.tasks.filter(task => task.type === 'success').length / tasks.length;
var tasks = status.tasks;
var error = tasks.filter(task => task.type === 'error').length > 0;
var success = tasks.filter(task => task.type === 'success').length / tasks.length;
var tutorialStatus = success === 1 ? 'Success' : error ? 'Error' : 'Other';
return (
<div style={{position: 'relative'}}>