Skip to content

Commit dc7ab50

Browse files
authored
Merge pull request #7291 from Countly/rating-export
[SER-2653] Fix rating export
2 parents 58fb768 + ea3aba9 commit dc7ab50

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Fixes:
33
- [core] Fix period calculation
44
- [dashboards] Update dialog button color when deleting dashboard/widget
5+
- [star-rating] Fix rating number when exporting data
56

67
Enterprise Fixes:
78
- [crash_symbolication] Use countlyfs for JavaScript symbolication

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

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

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: 2 additions & 2 deletions
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"></span> {{ rowScope.row.rating + 1 }}
7+
<span :class="'rating-color rating-color-' + rowScope.row.rating"></span> {{ rowScope.row.rating }}
88
</span>
99
</template>
1010
</el-table-column>
@@ -23,4 +23,4 @@
2323
</template>
2424
</el-table-column>
2525
</template>
26-
</cly-datatable-n>
26+
</cly-datatable-n>

0 commit comments

Comments
 (0)