Skip to content

Commit

Permalink
Merge pull request #1425 from Quetzacoalt91/fix-product-status-aligment
Browse files Browse the repository at this point in the history
Fix alignment of data in product feed table when all destination do not have the same status
  • Loading branch information
Quetzacoalt91 authored Mar 27, 2023
2 parents 925508d + 7a77694 commit d9a8dab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<b-tr>
<b-td
class="align-top"
:rowspan="product.statuses.length"
:rowspan="numberOfDisapprovedDestinations"
v-if="!indexStatus"
>
{{ product.id }}{{ +product.attribute > 0 ? '&#8209;' + product.attribute : '' }}
</b-td>
<b-td
class="align-top b-table-sticky-column"
:rowspan="product.statuses.length"
:rowspan="numberOfDisapprovedDestinations"
v-if="!indexStatus"
>
<a
Expand All @@ -24,7 +24,7 @@
</b-td>
<b-td
class="align-top"
:rowspan="countriesAndStatusAreTheSame ? product.statuses.length : 0"
:rowspan="countriesAndStatusAreTheSame ? numberOfDisapprovedDestinations : 0"
v-if="!indexStatus || !countriesAndStatusAreTheSame"
>
<b-badge
Expand All @@ -38,7 +38,7 @@
</b-td>
<b-td
class="align-top"
:rowspan="countriesAndStatusAreTheSame ? product.statuses.length : 0"
:rowspan="countriesAndStatusAreTheSame ? numberOfDisapprovedDestinations : 0"
v-if="!indexStatus || !countriesAndStatusAreTheSame"
>
<span>
Expand All @@ -53,7 +53,7 @@

<b-td
class="align-top"
:rowspan="countriesAndStatusAreTheSame ? product.statuses.length : 0"
:rowspan="countriesAndStatusAreTheSame ? numberOfDisapprovedDestinations : 0"
v-if="!indexStatus || !countriesAndStatusAreTheSame"
>
<b-badge
Expand Down Expand Up @@ -154,6 +154,9 @@ export default defineComponent({
&& JSON.stringify(anotherStatus.countries) === JSON.stringify(this.status.countries),
);
},
numberOfDisapprovedDestinations(): number {
return this.product.statuses.filter((s) => s.status === ProductStatus.Disapproved).length;
},
merchantCenterWebsitePageUrl() {
const {id} = this.$store.state.accounts.googleMerchantAccount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ TableStatusDetails.parameters = {
statuses: [
{
destination: "Shopping",
status: "disapproved",
status: "approved",
countries: ["GB"],
},
{
Expand Down

0 comments on commit d9a8dab

Please sign in to comment.