Skip to content
This repository was archived by the owner on Jul 27, 2024. It is now read-only.

Commit 25c069b

Browse files
committed
managed to properly connect the progress bar to the data
1 parent f38d3da commit 25c069b

File tree

3 files changed

+163
-103
lines changed

3 files changed

+163
-103
lines changed

Closure_Front_End/package-lock.json

Lines changed: 140 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Closure_Front_End/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"axios": "^0.21.1",
1616
"core-js": "^3.6.5",
1717
"vue": "^3.0.0",
18-
"vue-router": "^4.0.0-0"
18+
"vue-router": "^4.0.0-0",
19+
"vue3-chart-v2": "^0.8.2"
1920
},
2021
"devDependencies": {
2122
"@vue/cli-plugin-babel": "~4.5.0",

Closure_Front_End/src/components/ProgressBox.vue

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<br />
44
<div class="sub">
55
סך הכל:
6-
<progress class="progress total" v-bind:value="total" max="100">
6+
<progress class="progress total" v-bind:value="len(allcourses,1)+len(allcourses,2)+len(allcourses,3)" max="100">
77
15%
88
</progress>
99
</div>
1010

1111
<div class="sub">
1212
חובה:
13-
<progress class="progress must" v-bind:value="mustValue" max="80">
13+
<progress class="progress must" v-bind:value="len(allcourses,1)" max="80">
1414
15%
1515
</progress>
1616
</div>
@@ -19,7 +19,7 @@
1919
חובת בחירה:
2020
<progress
2121
class="progress choose_from_list"
22-
v-bind:value="chooseListValue"
22+
v-bind:value="len(allcourses,2)"
2323
max="15"
2424
>
2525
15%
@@ -28,7 +28,7 @@
2828

2929
<div class="sub">
3030
בחירה:
31-
<progress class="progress choice" v-bind:value="choiceValue" max="30">
31+
<progress class="progress choice" v-bind:value="len(allcourses,3)" max="30">
3232
15%
3333
</progress>
3434
</div>
@@ -44,10 +44,10 @@ export default {
4444
mandatory: 30,
4545
mand_choice: 20,
4646
choice: 15,
47-
coursesByType: null,
48-
mustValue: null,
49-
chooseListValue: null,
50-
choiceValue: null,
47+
coursesByType: this.groupBy(this.allcourses, "type"),
48+
// mustValue: this.len(coursesByType,1),
49+
// chooseListValue: this.coursesByType[2].length,
50+
// choiceValue: this.coursesByType[3].length,
5151
};
5252
},
5353
@@ -58,22 +58,25 @@ export default {
5858
return rv;
5959
}, {});
6060
},
61+
len: function(allcourses, index){
62+
return this.groupBy(this.allcourses, "type")[index].length;
63+
}
6164
},
6265
6366
mounted() {
64-
this.coursesByType = this.groupBy(this.allcourses, "type");
65-
this.mustValue = this.coursesByType[1].length;
66-
this.chooseListValue = this.coursesByType[2].length;
67-
this.choiceValue = this.coursesByType[3].length;
68-
console.log(this.coursesByType);
67+
// this.coursesByType = this.groupBy(this.allcourses, "type");
68+
// this.mustValue = this.coursesByType[1].length;
69+
// this.chooseListValue = this.coursesByType[2].length;
70+
// this.choiceValue = this.coursesByType[3].length;
71+
// console.log(this.coursesByType);
6972
},
7073
7174
updated() {
72-
this.coursesByType = this.groupBy(this.allcourses, "type");
73-
this.mustValue = this.coursesByType[1].length;
74-
this.chooseListValue = this.coursesByType[2].length;
75-
this.choiceValue = this.coursesByType[3].length;
76-
console.log(this.coursesByType);
75+
// this.coursesByType = this.groupBy(this.allcourses, "type");
76+
// this.mustValue = this.coursesByType[1].length;
77+
// this.chooseListValue = this.coursesByType[2].length;
78+
// this.choiceValue = this.coursesByType[3].length;
79+
// console.log(this.coursesByType);
7780
},
7881
};
7982
</script>

0 commit comments

Comments
 (0)