From a37b053a4e8fbc3d57c7f1e6d32414ff0b16c954 Mon Sep 17 00:00:00 2001 From: Billy Surya <95603213+billsur@users.noreply.github.com> Date: Tue, 14 May 2024 16:22:14 +0700 Subject: [PATCH 1/2] feat(grace-period): update cta link redirect to extend membership url --- src/components.d.ts | 8 ++++++++ .../kompas-grace-period.tsx | 20 +++++++++++-------- src/components/kompas-grace-period/readme.md | 11 +++++----- src/index.html | 2 +- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/components.d.ts b/src/components.d.ts index ebcfd90..5e14216 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -129,6 +129,10 @@ export namespace Components { * prop isShowButton untuk nampilin button perbarui langganan */ "isShowButton": boolean; + /** + * prop subscriptionId untuk renewal subs. + */ + "subscriptionId": string; /** * prop totalGracePeriod untuk menghitung berapa hari grace period user. */ @@ -657,6 +661,10 @@ declare namespace LocalJSX { * prop isShowButton untuk nampilin button perbarui langganan */ "isShowButton"?: boolean; + /** + * prop subscriptionId untuk renewal subs. + */ + "subscriptionId"?: string; /** * prop totalGracePeriod untuk menghitung berapa hari grace period user. */ diff --git a/src/components/kompas-grace-period/kompas-grace-period.tsx b/src/components/kompas-grace-period/kompas-grace-period.tsx index 740d60b..fc2d5f3 100644 --- a/src/components/kompas-grace-period/kompas-grace-period.tsx +++ b/src/components/kompas-grace-period/kompas-grace-period.tsx @@ -22,7 +22,7 @@ export class KompasGracePeriod { /** * state updateSubscription untuk memberikan link user akan dialihkan ke halaman berlangganan. */ - @State() updateSubscription: string = 'https://www.kompas.id/berlangganan'; + @State() updateSubscription: string = 'https://checkoutv2.kompas.id'; /** * Props */ @@ -30,15 +30,19 @@ export class KompasGracePeriod { * prop totalGracePeriod untuk menghitung berapa hari grace period user. */ @Prop() totalGracePeriod: number = 0; - /** + /** * prop isColoumn untuk merubah flex-column pada header account profile */ @Prop() isColoumn: boolean = false; - /** + /** * prop isShowButton untuk nampilin button perbarui langganan */ @Prop() isShowButton: boolean = false; - + /** + * prop subscriptionId untuk renewal subs. + */ + @Prop() subscriptionId: string; + /** * TEMPLATING */ @@ -66,7 +70,7 @@ export class KompasGracePeriod { private redirectToBerlangganan = (): void => { this.dataLayeronPerbaruiLanggananButton(); - window.location.href = this.updateSubscription; + window.location.href = this.updateSubscription + `/kdp?productId=${this.subscriptionId}`; }; private dataLayeronPerbaruiLanggananButton = (): void => { @@ -88,11 +92,11 @@ export class KompasGracePeriod { }; private gracePeriodTemplate = (): void => ( -