Skip to content

Commit

Permalink
Regression: Marketplace app pricing plan description (#15076)
Browse files Browse the repository at this point in the history
Co-Authored-By: Diego Sampaio <chinello@gmail.com>
  • Loading branch information
2 people authored and d-gubert committed Aug 1, 2019
1 parent ecc1ba1 commit e4cd040
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/apps/client/admin/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,16 +364,16 @@ export const appStatusSpanProps = ({

export const formatPrice = (price) => `\$${ Number.parseFloat(price).toFixed(2) }`;

export const formatPricingPlan = (pricingPlan) => {
const perUser = pricingPlan.isPerSeat && pricingPlan.tiers && pricingPlan.tiers.length;
export const formatPricingPlan = ({ strategy, price, tiers }) => {
const { perUnit = false } = (Array.isArray(tiers) && tiers.find((tier) => tier.price === price)) || {};

const pricingPlanTranslationString = [
'Apps_Marketplace_pricingPlan',
pricingPlan.strategy,
perUser && 'perUser',
strategy,
perUnit && 'perUser',
].filter(Boolean).join('_');

return t(pricingPlanTranslationString, {
price: formatPrice(pricingPlan.price),
price: formatPrice(price),
});
};

0 comments on commit e4cd040

Please sign in to comment.