Skip to content

Commit

Permalink
INTLY-473: Walkthrough progress can be more than 100 percent (#519)
Browse files Browse the repository at this point in the history
* force progress to 100 if steps completed

* fix merge conflicts

* fix merge issues

* bump version
  • Loading branch information
mfrances17 authored and dlabaj committed Oct 14, 2019
1 parent c1e889a commit badeea6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "integreatly-web-app",
"version": "2.18.9",
"version": "2.18.10",
"private": true,
"proxy": "http://localhost:5001/",
"dependencies": {
Expand Down
6 changes: 4 additions & 2 deletions src/components/tutorialDashboard/tutorialDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ const TutorialDashboard = props => {
const currentProgress = userProgress[walkthrough.id];
let startedText;
if (currentProgress === undefined) startedText = 'Get Started';
else if (currentProgress.progress === 100) startedText = 'Completed';
else startedText = 'Resume';
else if (currentProgress.progress >= 100) {
currentProgress.progress = 100;
startedText = 'Completed';
} else startedText = 'Resume';

return (
<GalleryItem id={walkthrough.id} key={walkthrough.id}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tutorial/task/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class TaskPage extends React.Component {
const totalSteps = this.getTotalSteps(data);
if (totalSteps > 0) {
const completedSteps = this.getCompletedSteps(oldProgress[id]);
oldProgress[id].progress = Math.floor((completedSteps / totalSteps) * 100);
oldProgress[id].progress = Math.min(Math.floor((completedSteps / totalSteps) * 100), 100);
oldProgress[id].task = task;
}

Expand Down

0 comments on commit badeea6

Please sign in to comment.