@hulkapps/app-manager-vue 3.1.8 → 3.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hulkapps/app-manager-vue",
3
- "version": "3.1.8",
3
+ "version": "3.1.10",
4
4
  "description": "Vue SDK to render app manager contents",
5
5
  "main": "dist/app-manager-vue.ssr.js",
6
6
  "browser": "dist/app-manager-vue.esm.js",
@@ -98,6 +98,7 @@
98
98
  :plans="plans"
99
99
  :features="features"
100
100
  :currentPlan="plan"
101
+ :hasActiveCharge="has_active_charge"
101
102
  :shopifyPlan="shopify_plan"
102
103
  :promotionalDiscount="promotional_discount"
103
104
  :selectedInterval="selectedPlan"
@@ -110,6 +111,7 @@
110
111
  <PlanTable
111
112
  :plans="plans"
112
113
  :currentPlan="plan"
114
+ :hasActiveCharge="has_active_charge"
113
115
  :shopifyPlan="shopify_plan"
114
116
  :promotionalDiscount="promotional_discount"
115
117
  :selectedInterval="selectedPlan"
@@ -190,7 +192,7 @@ import GetCustomBlock from "../PolarisNew/GetCustomBlock.vue";
190
192
  import PlanTable from "../PolarisNew/PlanTable.vue";
191
193
  import BundlePlanCard from "../PolarisNew/BundlePlanCard.vue";
192
194
  import CustomizationModal from "@/components/PolarisNew/CustomizationModal.vue";
193
- import { calculatePlanPriceWithDiscounts } from "@/helpers";
195
+ import {calculatePlanPriceWithDiscounts} from "@/helpers";
194
196
  import PlanBanners from "@/components/Plans/PlanBanners.vue";
195
197
 
196
198
  export default {
@@ -406,6 +408,12 @@ export default {
406
408
  this.plans = data.plans;
407
409
  this.plans = this.plans?.sort((planA, planB) => parseFloat(planA.price) - parseFloat(planB.price));
408
410
 
411
+ if (this.plans?.length > 0 && data.most_popular_plan_ids?.length > 0) {
412
+ this.plans.forEach(plan => {
413
+ plan.most_popular = data.most_popular_plan_ids.includes(plan.id);
414
+ });
415
+ }
416
+
409
417
  if (this.plans[0].store_base_plan) {
410
418
  this.subtitleContent = this.translateMe('App plans are based on your existing shopify plan');
411
419
  }
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import VariantButton from "./VariantButton";
3
3
  import Swiper, {Navigation, Pagination} from "swiper";
4
- import {calculatePlanPriceWithDiscounts, isPlanButtonDisabled, formatFeature, getPlanButtonText} from "@/helpers";
4
+ import {calculatePlanPriceWithDiscounts, isPlanButtonDisabled, formatFeature, getPlanButtonText, isPlanNote} from "@/helpers";
5
5
 
6
6
  export default {
7
7
  name: "PlanCardsHighlights",
@@ -17,6 +17,10 @@ export default {
17
17
  type: Object,
18
18
  required: false,
19
19
  },
20
+ hasActiveCharge: {
21
+ type: Boolean,
22
+ required: false,
23
+ },
20
24
  shopifyPlan: {
21
25
  type: String,
22
26
  required: false,
@@ -51,6 +55,8 @@ export default {
51
55
  },
52
56
  anyMonthlyPlanHasDiscount: false,
53
57
  anyAnnuallyPlanHasDiscount: false,
58
+ anyMonthlyPlanHasNote: false,
59
+ anyAnnuallyPlanHasNote: false,
54
60
  loadingPlanId: null
55
61
  };
56
62
  },
@@ -63,6 +69,13 @@ export default {
63
69
  if (planDetails.has_discount && !this.anyMonthlyPlanHasDiscount) {
64
70
  this.anyMonthlyPlanHasDiscount = true;
65
71
  }
72
+ if (
73
+ plan.store_base_plan
74
+ && this.anyMonthlyPlanHasNote === false
75
+ && isPlanNote(this.shopifyPlan, plan, this.currentPlan, this.hasActiveCharge)
76
+ ) {
77
+ this.anyMonthlyPlanHasNote = true;
78
+ }
66
79
  return planDetails;
67
80
  });
68
81
  },
@@ -74,6 +87,13 @@ export default {
74
87
  if (planDetails.has_discount && !this.anyAnnuallyPlanHasDiscount) {
75
88
  this.anyAnnuallyPlanHasDiscount = true;
76
89
  }
90
+ if (
91
+ plan.store_base_plan
92
+ && this.anyAnnuallyPlanHasNote === false
93
+ && isPlanNote(this.shopifyPlan, plan, this.currentPlan, this.hasActiveCharge)
94
+ ) {
95
+ this.anyAnnuallyPlanHasNote = true;
96
+ }
77
97
  return planDetails;
78
98
  });
79
99
  },
@@ -113,6 +133,7 @@ export default {
113
133
  },
114
134
  methods: {
115
135
  getPlanButtonText,
136
+ isPlanNote,
116
137
  isPlanButtonDisabled,
117
138
  formatFeature,
118
139
  async handlePlanClick(plan) {
@@ -385,7 +406,7 @@ export default {
385
406
  index === (monthlyPlans.length - 1) ? 'last-card' : '',
386
407
  ]"
387
408
  >
388
- <div class="most-popular" v-if="plan.choose_later_plan">
409
+ <div class="most-popular" v-if="plan.most_popular">
389
410
  <div class="most-popular-label">
390
411
  {{ translateMe("Most popular") }}
391
412
  </div>
@@ -428,10 +449,10 @@ export default {
428
449
  </h6>
429
450
  <VariantButton
430
451
  :variant="'secondary'"
431
- :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan)"
452
+ :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan, hasActiveCharge)"
432
453
  :loading="loadingPlanId === plan.id"
433
454
  @click="handlePlanClick(plan)"
434
- >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan) }}
455
+ >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, false, hasActiveCharge) }}
435
456
  </VariantButton>
436
457
  <h6
437
458
  class="trial_days"
@@ -474,6 +495,19 @@ export default {
474
495
  </li>
475
496
  </ul>
476
497
  </div>
498
+ <p
499
+ class="plan-note"
500
+ v-if="anyMonthlyPlanHasNote"
501
+ :style="{
502
+ visibility:
503
+ selectedInterval === 'monthly'
504
+ && isPlanNote(shopifyPlan, plan, currentPlan, hasActiveCharge)
505
+ ? 'visible'
506
+ : 'hidden',
507
+ }"
508
+ >
509
+ {{ translateMe('Note: On account of your recent Shopify plan upgrade, you should consider upgrading your current app plan') }}
510
+ </p>
477
511
  </div>
478
512
  </div>
479
513
  </div>
@@ -503,7 +537,7 @@ export default {
503
537
  index === (annualPlans.length - 1) ? 'last-card' : '',
504
538
  ]"
505
539
  >
506
- <div class="most-popular" v-if="plan.choose_later_plan">
540
+ <div class="most-popular" v-if="plan.most_popular">
507
541
  <div class="most-popular-label">
508
542
  {{ translateMe("Most popular") }}
509
543
  </div>
@@ -546,10 +580,10 @@ export default {
546
580
  </h6>
547
581
  <VariantButton
548
582
  :variant="'secondary'"
549
- :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan)"
583
+ :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan, hasActiveCharge)"
550
584
  :loading="loadingPlanId === plan.id"
551
585
  @click="handlePlanClick(plan)"
552
- >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan) }}
586
+ >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, false, hasActiveCharge) }}
553
587
  </VariantButton>
554
588
  <h6
555
589
  class="trial_days"
@@ -592,6 +626,19 @@ export default {
592
626
  </li>
593
627
  </ul>
594
628
  </div>
629
+ <p
630
+ class="plan-note"
631
+ v-if="anyAnnuallyPlanHasNote"
632
+ :style="{
633
+ visibility:
634
+ selectedInterval === 'annually'
635
+ && isPlanNote(shopifyPlan, plan, currentPlan, hasActiveCharge)
636
+ ? 'visible'
637
+ : 'hidden',
638
+ }"
639
+ >
640
+ {{ translateMe('Note: On account of your recent Shopify plan upgrade, you should consider upgrading your current app plan') }}
641
+ </p>
595
642
  </div>
596
643
  </div>
597
644
  </div>
@@ -688,12 +735,18 @@ export default {
688
735
  }
689
736
 
690
737
  .card .trial_days,
691
- .card .description {
738
+ .card .description,
739
+ .card .plan-note {
692
740
  font-size: 13px;
693
741
  font-weight: 400;
694
742
  color: #4A4A4A;
695
743
  }
696
744
 
745
+ .card .plan-note {
746
+ margin-top: 8px;
747
+ text-align: center;
748
+ }
749
+
697
750
  .button {
698
751
  display: flex;
699
752
  justify-content: center;
@@ -35,6 +35,10 @@ export default {
35
35
  type: Object,
36
36
  required: false,
37
37
  },
38
+ hasActiveCharge: {
39
+ type: Boolean,
40
+ required: false,
41
+ },
38
42
  shopifyPlan: {
39
43
  type: String,
40
44
  required: false,
@@ -574,11 +578,11 @@ export default {
574
578
  </div>
575
579
  <VariantButton
576
580
  :variant="'secondary'"
577
- :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan)"
581
+ :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan, hasActiveCharge)"
578
582
  :loading="loadingPlanId === plan.id"
579
583
  @click="handlePlanClick(plan)"
580
584
  class="button"
581
- >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, true) }}</VariantButton>
585
+ >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, true, hasActiveCharge) }}</VariantButton>
582
586
  </div>
583
587
  <template v-for="group in monthlyPlansFeatures">
584
588
  <div v-if="group.name" class="feature-group-header plan-feature plan-feature-monthly">
@@ -687,11 +691,11 @@ export default {
687
691
  </div>
688
692
  <VariantButton
689
693
  :variant="'secondary'"
690
- :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan)"
694
+ :disabled="isPlanButtonDisabled(shopifyPlan, plan, currentPlan, hasActiveCharge)"
691
695
  :loading="loadingPlanId === plan.id"
692
696
  @click="handlePlanClick(plan)"
693
697
  class="button"
694
- >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, true) }}</VariantButton>
698
+ >{{ getPlanButtonText(shopifyPlan, plan, translateMe, currentPlan, true, hasActiveCharge) }}</VariantButton>
695
699
  </div>
696
700
  <template v-for="group in annualPlansFeatures">
697
701
  <div v-if="group.name" class="feature-group-header plan-feature plan-feature-annually">