From 5f538b50364c3e58960aa37e03b22060e4a1d4d9 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 4 Jun 2021 15:34:27 +0530 Subject: [PATCH] Added portal option to default product for tiers UI refs https://github.com/TryGhost/Team/issues/715 By default, the first product/tier is available in Portal at the moment, this adds an attribute that can be used to denote which product is active in Portal in UI --- .../app/components/gh-membership-products-alpha.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/gh-membership-products-alpha.js b/ghost/admin/app/components/gh-membership-products-alpha.js index f95a6d9c54..350666fa28 100644 --- a/ghost/admin/app/components/gh-membership-products-alpha.js +++ b/ghost/admin/app/components/gh-membership-products-alpha.js @@ -14,7 +14,15 @@ export default class extends Component { @tracked productModel = null; get products() { - return this.args.products; + return this.args.products.map((product, idx) => { + if (idx === 0) { + return { + ...product.toJSON(), + portal: true + }; + } + return product; + }); } @action