Skip to content

Commit ea3aba9

Browse files
committed
[star-rating] Update rating color
1 parent fd01c7b commit ea3aba9

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

plugins/star-rating/frontend/public/javascripts/countly.views.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,10 @@
393393
computed: {
394394
preparedRows: function() {
395395
return this.ratings.map(function(rating) {
396-
rating.rating += 1;
397-
rating.percentage = parseFloat(rating.percent) || 0;
398-
return rating;
396+
return Object.assign({}, rating, {
397+
rating: (Number(rating.rating) || 0) + 1,
398+
percentage: Number.parseFloat(rating.percent) || 0,
399+
});
399400
});
400401
}
401402
},

plugins/star-rating/frontend/public/stylesheets/ratings.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,22 +478,22 @@
478478
margin-left: 8px;
479479
}
480480

481-
.rating-color-0 {
481+
.rating-color-1 {
482482
background-color: #d23f00;
483483
}
484484

485-
.rating-color-1 {
485+
.rating-color-2 {
486486
background-color: #f96300;
487487
}
488488

489-
.rating-color-2 {
489+
.rating-color-3 {
490490
background-color: #f5c900;
491491
}
492492

493-
.rating-color-3 {
493+
.rating-color-4 {
494494
background-color: #aabb5d;
495495
}
496496

497-
.rating-color-4 {
497+
.rating-color-5 {
498498
background-color: #10a14a;
499499
}

plugins/star-rating/frontend/public/templates/ratings-table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<el-table-column sortable="true" prop="rating" :label="i18n('feedback.rating')">
55
<template v-slot="rowScope">
66
<span :data-test-id="'ratings-data-table-rating-' + rowScope.$index" class="text-medium">
7-
<span :class="'rating-color rating-color-' + (rowScope.row.rating - 1)"></span> {{ rowScope.row.rating }}
7+
<span :class="'rating-color rating-color-' + rowScope.row.rating"></span> {{ rowScope.row.rating }}
88
</span>
99
</template>
1010
</el-table-column>

0 commit comments

Comments
 (0)