Skip to content

Commit

Permalink
Merge branch 'next-26290/fix-admin-review-stars' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-26290 - Fix admin review stars

See merge request shopware/6/product/platform!10651
  • Loading branch information
tobiasberge committed Apr 26, 2023
2 parents 86f36bf + 90418ce commit 75fab02
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Fix review stars in administration
issue: NEXT-26290
---
# Administration
* Changed template `app/administration/src/module/sw-product/view/sw-product-detail-reviews/sw-product-detail-reviews.html.twig` and replaced custom implemented stars with `sw-rating-stars` component
* Deprecated block `sw_product_detail_reviews_data_stars_filled`. Will be replaced by `sw-rating-stars` component. Use upper block `sw_product_detail_reviews_data_stars_content` instead.
* Deprecated block `sw_product_detail_reviews_data_stars_empty`. Will be replaced by `sw-rating-stars` component. Use upper block `sw_product_detail_reviews_data_stars_content` instead.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
v-for="currentStar in maxStars"
:key="`placeholder${currentStar}`"
class="sw-rating-stars__star star-empty"
name="default-review-star-full"
name="solid-star"
:size="iconSize.toString()"
/>
{% endblock %}
Expand All @@ -35,7 +35,7 @@
v-for="currentStar in Math.floor(cappedValue)"
:key="`full${currentStar}`"
class="sw-rating-stars__star star-full"
name="default-review-star-full"
name="solid-star"
:size="iconSize.toString()"
/>
{% endblock %}
Expand All @@ -46,7 +46,7 @@
v-if="(cappedValue % 1) > 0"
class="sw-rating-stars__star star-partial"
:style="partialStarCutStyle"
name="default-review-star-full"
name="solid-star"
:size="iconSize.toString()"
/>
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
top: 0;
font-size: 0;

.icon--default-review-star-full {
.sw-rating-stars__star {
color: $color-module-yellow-700;
}
}
Expand All @@ -30,7 +30,7 @@
top: 0;
font-size: 0;

.icon--default-review-star-full {
.sw-rating-stars__star {
color: $color-gray-300;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,17 @@
<template #column-points="{ item }">
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_reviews_data_stars_content %}
<div class="sw-product-detail-reviews__stars">
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_reviews_data_stars_filled %}
<sw-icon
v-for="(filledStar, index) in item.points"
:key="`filledStar-${index}`"
size="14"
name="default-review-star-full"
/>
{% endblock %}

<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_reviews_data_stars_empty %}
<sw-icon
v-for="(emptyStar, index) in (5-item.points)"
:key="`emptyStar-${index}`"
size="14"
name="regular-star"
/>
{% endblock %}
</div>

<sw-rating-stars v-model="item.points" />

{# @deprecated tag:v6.6.0 - Block will removed because it will be replaced by `sw-rating-stars` component. Use upper block `sw_product_detail_reviews_data_stars_content` instead. #}
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_reviews_data_stars_filled %}{% endblock %}

{# @deprecated tag:v6.6.0 - Block will removed because it will be replaced by `sw-rating-stars` component. Use upper block `sw_product_detail_reviews_data_stars_content` instead. #}
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_product_detail_reviews_data_stars_empty %}{% endblock %}

{% endblock %}
</template>
{% endblock %}
Expand Down

0 comments on commit 75fab02

Please sign in to comment.