Skip to content

Commit e402f0b

Browse files
authored
Merge pull request #46 from SourceCodeOER/tag_with_total
feat(Tag): tag with total and little changes
2 parents 5364e34 + 27fa07a commit e402f0b

File tree

27 files changed

+135
-57
lines changed

27 files changed

+135
-57
lines changed

assets/css/_symbols.scss

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,104 @@
22

33
.theme--default {
44
fill:$PRIMARY_COLOR;
5+
6+
&--stroke {
7+
stroke:$PRIMARY_COLOR;
8+
}
59
}
610

711
.theme--primary-color {
812
fill: $PRIMARY_COLOR;
13+
14+
&--stroke {
15+
stroke:$PRIMARY_COLOR;
16+
}
917
}
1018

1119
.theme--primary-color-light {
1220
fill: $PRIMARY_COLOR_LIGHT;
21+
22+
&--stroke {
23+
stroke:$PRIMARY_COLOR_LIGHT;
24+
}
1325
}
1426

1527
.theme--secondary-color {
1628
fill: darken($SECONDARY_COLOR, 12);
29+
30+
&--stroke {
31+
stroke:darken($SECONDARY_COLOR, 12);
32+
}
1733
}
1834

1935
.theme--ternary-color {
2036
fill: $TERNARY_COLOR;
37+
38+
&--stroke {
39+
stroke:$TERNARY_COLOR;
40+
}
2141
}
2242

2343
.theme--red {
2444
fill: $RED;
45+
46+
&--stroke {
47+
stroke:$RED;
48+
}
2549
}
2650

2751
.theme--green {
2852
fill: $GREEN;
53+
54+
&--stroke {
55+
stroke:$GREEN;
56+
}
2957
}
3058

3159
.theme--grey {
3260
fill: $GREY;
61+
62+
&--stroke {
63+
stroke:$GREY;
64+
}
3365
}
3466

3567
.theme--grey-light {
3668
fill:lighten($GREY, 20);
69+
70+
&--stroke {
71+
stroke:lighten($GREY, 20);
72+
}
3773
}
3874

3975
.theme--red-light {
4076
fill:$LIGHT_RED;
77+
78+
&--stroke {
79+
stroke:$LIGHT_RED;
80+
}
4181
}
4282

4383
.theme--orange {
44-
fill:$ORANGE
84+
fill:$ORANGE;
85+
86+
&--stroke {
87+
stroke:$ORANGE;
88+
}
4589
}
4690

4791
.theme--yellow {
48-
fill:$YELLOW
92+
fill:$YELLOW;
93+
94+
&--stroke {
95+
stroke:$YELLOW;
96+
}
4997
}
5098

5199
.theme--white {
52100
fill:white;
101+
102+
&--stroke {
103+
stroke:white;
104+
}
53105
}

components/Exercise/ExercisesPanel.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
state: ["VALIDATED"]
154154
}
155155
});
156+
157+
this.$emit('reset');
156158
}
157159
158160
handleIntersect(entries: IntersectionObserverEntry[]) {

components/Exercise/PreviewExercise.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,24 @@
5757
const orderedTextTags: string[] = [];
5858
5959
for (const tag of tags) {
60-
if (tag.category.category_text === 'difficulté' && orderedTextTags[0] === undefined) {
60+
if (tag.category.category_text === 'cours' && orderedTextTags[0] === undefined) {
6161
orderedTextTags[0] = tag.tag_text;
6262
counter++
6363
} else if (tag.category.category_text === 'langage' && orderedTextTags[1] === undefined) {
64-
orderedTextTags[1] = tag.tag_text;
65-
counter++
66-
} else if (tag.category.category_text === "type d'exercice" && orderedTextTags[2] === undefined) {
64+
orderedTextTags[1] = tag.tag_text;
65+
counter++
66+
} else if (tag.category.category_text === 'langage' && orderedTextTags[2] === undefined) {
6767
orderedTextTags[2] = tag.tag_text;
6868
counter++
69-
} else if (tag.category.category_text === 'thématique' && orderedTextTags[3] === undefined) {
69+
} else if (tag.category.category_text === "type d'exercice" && orderedTextTags[3] === undefined) {
7070
orderedTextTags[3] = tag.tag_text;
7171
counter++
72+
} else if (tag.category.category_text === 'thématique' && orderedTextTags[4] === undefined) {
73+
orderedTextTags[4] = tag.tag_text;
74+
counter++
7275
}
7376
74-
if (counter === 4) break
77+
if (counter === 5) break
7578
}
7679
7780
let formatted: string = '';

components/Menu.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
font-weight: bold;
182182
padding: 0 $PADDING_MENU;
183183
text-align: center;
184+
@include hyphens(true);
184185
185186
.connection-profile--login {
186187
text-decoration: underline;

components/Mixins/ExerciseFormMixins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export default class ExerciseFormMixins extends Vue {
265265
this.$accessor.exercises.RESET();
266266
this.$accessor.tags.CLEAR();
267267

268-
await this.$accessor.tags.fetch();
268+
await this.$accessor.tags.fetch({});
269269
await this.$accessor.tags.apply("strict");
270270
}
271271

components/Panel/Item/FavoritePanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
DataSearchExerciseRequest,
3030
SearchExerciseRequest,
3131
SelectedTag,
32-
TagExtended
32+
TagExtended, TagExtendedWithTotal
3333
} from "~/types";
3434
import Icon from "~/components/Symbols/Icon.vue";
3535
import {Prop} from "~/node_modules/vue-property-decorator";
@@ -120,7 +120,7 @@
120120
121121
searchCriterion.title = configuration.title ? configuration.title : "";
122122
123-
const confirmedTags: SelectedTag[] = configuration.tags.map((tag: TagExtended) => {
123+
const confirmedTags: SelectedTag[] = configuration.tags.map((tag: TagExtendedWithTotal) => {
124124
return {...tag, isSelected: true}
125125
});
126126

components/Panel/Item/FilterPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
get categoryWithSelectedTags(): { category: string, tags: CheckboxObject[] }[] {
229229
return this.$accessor.tags.tags.map((tag: CategoryWithSelectedTags) => {
230230
const tags: { title: string, state: boolean }[] = tag.tags.map(tagSelecter => {
231-
return {title: tagSelecter.tag_text, state: tagSelecter.isSelected}
231+
return {title: `${tagSelecter.tag_text} (${tagSelecter.total})`, state: tagSelecter.isSelected}
232232
});
233233
return {category: tag.category, tags}
234234
})

components/Panel/Item/HistoricalPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
/**
4949
* The default icon of this panel (see Icon component)
5050
*/
51-
@Prop({type: String, default: "search"}) icon!: string;
51+
@Prop({type: String, default: "clock"}) icon!: string;
5252
5353
/**
5454
* Get the historical of the user from the store

components/Symbols/Icon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
paper: () => import('./library/PaperSymbol.vue'),
4242
bookmark: () => import('./library/BookmarkSymbol.vue'),
4343
mail: () => import('./library/MailSymbol.vue'),
44+
clock: () => import('./library/ClockSymbol.vue'),
4445
book: () => import('./library/BookSymbol.vue')
4546
}
4647
})

components/Symbols/Symbol.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<script lang="ts">
2-
import {Component, Vue, Prop} from 'vue-property-decorator'
2+
import {Component, Vue, Prop} from 'vue-property-decorator'
33
4-
@Component({
5-
name: 'SymbolLogo'
6-
})
7-
export default class Symbol extends Vue {
8-
@Prop({type: String, default: "theme--default"}) readonly theme?: string;
4+
@Component({
5+
name: 'SymbolLogo'
6+
})
7+
export default class Symbol extends Vue {
8+
@Prop({type: String, default: "theme--default"}) readonly theme?: string;
9+
10+
get themeStroke() {
11+
return this.theme + '--stroke';
912
}
13+
}
1014
</script>

0 commit comments

Comments
 (0)