Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plugin detail rating #359

Merged
merged 3 commits into from
Feb 19, 2024
Merged

Conversation

Xpirix
Copy link
Collaborator

@Xpirix Xpirix commented Feb 13, 2024

Change summary

  • Use the decimal rating value in the plugin detail page
  • Add new images for ratings display: quarter, half, three-quarters
  • Change the rating star fill according to the rating value

image

image

image

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (998e0b5) 36.06% compared to head (cb31a20) 36.08%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #359      +/-   ##
==========================================
+ Coverage   36.06%   36.08%   +0.01%     
==========================================
  Files         111      111              
  Lines        4899     4900       +1     
==========================================
+ Hits         1767     1768       +1     
  Misses       3132     3132              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +45 to +59
// The last star will depend on the decimal left
if(starIdx < initialRating) {
star.addClass('jquery-ratings-full');
let ratingDiff = initialRating - starIdx
if (ratingDiff > 0 && ratingDiff <= 0.3) {
star.addClass('jquery-ratings-quarter');
}
else if (ratingDiff > 0.3 && ratingDiff <= 0.6) {
star.addClass('jquery-ratings-half');
}
else if (ratingDiff > 0.6 && ratingDiff <= 0.9) {
star.addClass('jquery-ratings-half-and-quarter');
}
else {
star.addClass('jquery-ratings-full');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks 👍 On a first sight I was wondering about the uneven distribution >0.3 <= 0.6 for the "half star", but how you implemented it, every "partial star" is displayed for a range of 0.3 which is fine. With the stars it's hard to spot how many decimals are represented anyway :-)

@dimasciput dimasciput merged commit d8871b1 into qgis:master Feb 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants