@hulkapps/app-manager-vue 1.0.1 → 2.0.1

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.
Files changed (76) hide show
  1. package/README.md +32 -0
  2. package/dist/app-manager-vue.esm.js +38978 -15111
  3. package/dist/app-manager-vue.min.js +9 -2
  4. package/dist/app-manager-vue.ssr.js +37401 -14919
  5. package/dist/hulkapps-app-manager.css +13284 -0
  6. package/dist/hulkapps-app-manager.min.css +1 -0
  7. package/package.json +9 -4
  8. package/src/components/Marketing/Banners.vue +44 -44
  9. package/src/components/Plans/AppManagerPlan.vue +492 -0
  10. package/src/components/Plans/PlanBanners.vue +50 -0
  11. package/src/components/Plans/YearlyPlanPromotion.vue +37 -0
  12. package/src/components/polaris-vue/src/components/PActionList/PActionList.vue +68 -0
  13. package/src/components/polaris-vue/src/components/PActionList/components/PActionListItem/PActionListItem.vue +91 -0
  14. package/src/components/polaris-vue/src/components/PActionList/components/PActionListSection/PActionListSection.vue +68 -0
  15. package/src/components/polaris-vue/src/components/PActionMenu/PActionMenu.vue +54 -0
  16. package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuActions/PActionMenuActions.vue +197 -0
  17. package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuAction/PActionMenuMenuAction.vue +97 -0
  18. package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuMenuGroup/PActionMenuMenuGroup.vue +54 -0
  19. package/src/components/polaris-vue/src/components/PActionMenu/components/PActionMenuRollupActions/PActionMenuRollupActions.vue +43 -0
  20. package/src/components/polaris-vue/src/components/PAvatar/PAvatar.vue +104 -0
  21. package/src/components/polaris-vue/src/components/PBadge/PBadge.vue +86 -0
  22. package/src/components/polaris-vue/src/components/PBanner/PBanner.vue +132 -0
  23. package/src/components/polaris-vue/src/components/PBreadcrumbs/PBreadcrumbs.vue +99 -0
  24. package/src/components/polaris-vue/src/components/PButton/PButton.vue +396 -0
  25. package/src/components/polaris-vue/src/components/PButton/components/PButtonsFrom/PButtonsFrom.vue +47 -0
  26. package/src/components/polaris-vue/src/components/PButton/components/PUnstyledButton/PUnstyledButton.vue +340 -0
  27. package/src/components/polaris-vue/src/components/PButtonGroup/PButtonGroup.vue +76 -0
  28. package/src/components/polaris-vue/src/components/PButtonGroup/components/PButtonGroupItem/PButtonGroupItem.vue +11 -0
  29. package/src/components/polaris-vue/src/components/PCaption/PCaption.vue +29 -0
  30. package/src/components/polaris-vue/src/components/PCard/PCard.vue +118 -0
  31. package/src/components/polaris-vue/src/components/PCard/components/PCardFooter/PCardFooter.vue +11 -0
  32. package/src/components/polaris-vue/src/components/PCard/components/PCardHeader/PCardHeader.vue +69 -0
  33. package/src/components/polaris-vue/src/components/PCard/components/PCardSection/PCardSection.vue +54 -0
  34. package/src/components/polaris-vue/src/components/PCard/components/PCardSubsection/PCardSubsection.vue +12 -0
  35. package/src/components/polaris-vue/src/components/PConnected/PConnected.vue +44 -0
  36. package/src/components/polaris-vue/src/components/PConnected/components/PConnectedItem/PConnectedItem.vue +41 -0
  37. package/src/components/polaris-vue/src/components/PDataTable/PDataTable.vue +541 -0
  38. package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCell/PDataTableCell.vue +213 -0
  39. package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCellNew/PDataTableCellNew.vue +162 -0
  40. package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableCol/PDataTableCol.vue +75 -0
  41. package/src/components/polaris-vue/src/components/PDataTable/components/PDataTableRow/PDataTableRow.vue +15 -0
  42. package/src/components/polaris-vue/src/components/PDisplayText/PDisplayText.vue +56 -0
  43. package/src/components/polaris-vue/src/components/PEmptyState/PEmptyState.vue +154 -0
  44. package/src/components/polaris-vue/src/components/PFieldError/PFieldError.vue +41 -0
  45. package/src/components/polaris-vue/src/components/PFilter/PFilter.vue +252 -0
  46. package/src/components/polaris-vue/src/components/PFilter/components/PFilterItem/PFilterItem.vue +11 -0
  47. package/src/components/polaris-vue/src/components/PFilter/components/PFilterItemWrapper/PFilterItemWrapper.vue +32 -0
  48. package/src/components/polaris-vue/src/components/PHeading/PHeading.vue +33 -0
  49. package/src/components/polaris-vue/src/components/PIcon/PIcon.vue +121 -0
  50. package/src/components/polaris-vue/src/components/PIcon/ShopifyIcons.vue +217 -0
  51. package/src/components/polaris-vue/src/components/PImage/PImage.vue +49 -0
  52. package/src/components/polaris-vue/src/components/PLayout/PLayout.vue +42 -0
  53. package/src/components/polaris-vue/src/components/PLayout/components/PLayoutSection/PLayoutSection.vue +55 -0
  54. package/src/components/polaris-vue/src/components/PLink/PLink.vue +90 -0
  55. package/src/components/polaris-vue/src/components/POptionalTag/POptionalTag.vue +23 -0
  56. package/src/components/polaris-vue/src/components/PPage/PPage.vue +136 -0
  57. package/src/components/polaris-vue/src/components/PPage/components/PPageHeader/PPageHeader.vue +191 -0
  58. package/src/components/polaris-vue/src/components/PPage/components/PPageHeaderTitle/PPageHeaderTitle.vue +63 -0
  59. package/src/components/polaris-vue/src/components/PPagination/PPagination.vue +119 -0
  60. package/src/components/polaris-vue/src/components/PPopover/PPopover.vue +298 -0
  61. package/src/components/polaris-vue/src/components/PPopover/components/PPopoverOverlay/PPopoverOverlay.vue +66 -0
  62. package/src/components/polaris-vue/src/components/PPopover/components/PPositionedOverlay/PPositionedOverlay.vue +289 -0
  63. package/src/components/polaris-vue/src/components/PSpinner/PSpinner.vue +60 -0
  64. package/src/components/polaris-vue/src/components/PStack/PStack.vue +84 -0
  65. package/src/components/polaris-vue/src/components/PStack/components/PStackItem/PStackItem.vue +49 -0
  66. package/src/components/polaris-vue/src/components/PSubheading/PSubheading.vue +36 -0
  67. package/src/components/polaris-vue/src/components/PTag/PTag.vue +89 -0
  68. package/src/components/polaris-vue/src/components/PTextContainer/PTextContainer.vue +41 -0
  69. package/src/components/polaris-vue/src/components/PTextField/PTextField.vue +229 -0
  70. package/src/components/polaris-vue/src/components/PTextField/components/PFieldResizer/PFieldResizer.vue +79 -0
  71. package/src/components/polaris-vue/src/components/PTextField/components/PInput/PInput.vue +473 -0
  72. package/src/components/polaris-vue/src/components/PTextField/components/PSpinner/PSpinner.vue +47 -0
  73. package/src/components/polaris-vue/src/components/PTextStyle/PTextStyle.vue +60 -0
  74. package/src/components/polaris-vue/src/components/PThumbnail/PThumbnail.vue +71 -0
  75. package/src/components/polaris-vue/src/components/PToggle/PToggle.vue +81 -0
  76. package/src/components/polaris-vue/src/components/PUnstyledLink/PUnstyledLink.vue +67 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hulkapps/app-manager-vue",
3
- "version": "1.0.1",
3
+ "version": "2.0.1",
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",
@@ -14,18 +14,19 @@
14
14
  "scripts": {
15
15
  "serve": "vue-cli-service serve dev/serve.js",
16
16
  "prebuild": "rimraf ./dist",
17
- "build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
17
+ "build:scss": "sass src/components/polaris-vue/src/scss/main.scss | node ./build/banner.js > dist/hulkapps-app-manager.css && cleancss --inline local -o dist/hulkapps-app-manager.min.css dist/hulkapps-app-manager.css",
18
+ "build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js && npm run build:scss",
18
19
  "build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
19
20
  "build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
20
21
  "build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife"
21
22
  },
22
23
  "dependencies": {
23
- "axios": "^0.26.1"
24
+ "axios": "^0.26.1",
25
+ "change-case": "^4.1.2"
24
26
  },
25
27
  "devDependencies": {
26
28
  "@babel/core": "^7.14.6",
27
29
  "@babel/preset-env": "^7.14.7",
28
- "@hulkapps/polaris-vue": "^3.0.9",
29
30
  "@rollup/plugin-alias": "^3.1.2",
30
31
  "@rollup/plugin-babel": "^5.3.0",
31
32
  "@rollup/plugin-commonjs": "^14.0.0",
@@ -33,14 +34,18 @@
33
34
  "@rollup/plugin-replace": "^2.4.2",
34
35
  "@vue/cli-plugin-babel": "^4.5.13",
35
36
  "@vue/cli-service": "^4.5.13",
37
+ "clean-css-cli": "^5.6.0",
36
38
  "cross-env": "^7.0.3",
37
39
  "minimist": "^1.2.5",
40
+ "node-sass": "^7.0.1",
38
41
  "rimraf": "^3.0.2",
39
42
  "rollup": "^2.52.8",
40
43
  "rollup-plugin-node-polyfills": "^0.2.1",
41
44
  "rollup-plugin-terser": "^7.0.2",
42
45
  "rollup-plugin-vue": "^5.1.9",
46
+ "sass-loader": "^10.0.5",
43
47
  "vue": "^2.6.14",
48
+ "vue-quill-editor": "^3.0.6",
44
49
  "vue-template-compiler": "^2.6.14"
45
50
  },
46
51
  "peerDependencies": {
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <PLayoutSection v-if="mappedStaticContentHeaders.length">
2
+ <PLayoutSection v-if="mappedStaticContentHeaders && mappedStaticContentHeaders.length">
3
3
  <PBanner
4
- v-for="(header, key) in mappedStaticContentHeaders" :key="key"
5
- :id="`static-content-header-${key}`"
6
- :status="header.status"
7
- @dismiss="() => dismissBanner(key)"
4
+ v-for="(header, key) in mappedStaticContentHeaders" :key="key"
5
+ :id="`static-content-header-${key}`"
6
+ :status="header.status"
7
+ @dismiss="() => dismissBanner(key)"
8
8
  >
9
9
  <span v-html="header.content"></span>
10
10
  </PBanner>
@@ -12,53 +12,53 @@
12
12
  </template>
13
13
 
14
14
  <script>
15
+ import {PLayoutSection} from "../polaris-vue/src/components/PLayout/components/PLayoutSection";
16
+ import {PBanner} from "../polaris-vue/src/components/PBanner";
15
17
 
16
- import axios from 'axios'
18
+ import axios from 'axios'
17
19
 
18
- export default {
19
- name: "Banners",
20
- props: {
21
- type: {
22
- type: String,
23
- validator(value) {
24
- return ['header', 'footer'].includes(value)
20
+ export default {
21
+ components: {PLayoutSection, PBanner},
22
+ name: "Banners",
23
+ props: {
24
+ type: {
25
+ type: String,
26
+ validator(value) {
27
+ return ['header', 'footer'].includes(value)
28
+ },
29
+ default() {
30
+ return 'header'
31
+ }
32
+ }
33
+ },
34
+ data() {
35
+ return {
36
+ dismissedBanners: [],
37
+ staticContent: {}
38
+ }
39
+ },
40
+ computed: {
41
+ mappedStaticContentHeaders() {
42
+ return this.staticContent[this.banner_type];
25
43
  },
26
- default() {
27
- return 'header'
44
+ banner_type() {
45
+ return this.type === 'header' ? 'headers' : 'footers'
28
46
  }
29
- }
30
- },
31
- data() {
32
- return {
33
- dismissedBanners: [],
34
- staticContent: {}
35
- }
36
- },
37
- computed: {
38
- mappedStaticContentHeaders: function() {
39
- const computed = [];
40
- const banner_type = this.type === 'header' ? 'headers' : 'footers'
41
-
42
- for(var key in this.staticContent[banner_type]) {
43
- if(!this.dismissedBanners.includes(parseInt(key))) {
44
- computed.push(this.staticContent[banner_type][key]);
45
- }
47
+ },
48
+ methods: {
49
+ dismissBanner(key) {
50
+ this.staticContent[this.banner_type].splice(key, 1);
46
51
  }
47
- return computed;
48
- }
49
- },
50
- methods: {
51
- dismissBanner(key) {
52
- this.dismissedBanners.push(key);
53
- }
54
- },
55
- async mounted() {
52
+ },
53
+ async mounted() {
56
54
 
57
- const {data} = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/marketing-banners`);
55
+ const { data } = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/marketing-banners`).catch(error => {
56
+ console.error(error)
57
+ });
58
58
 
59
- this.staticContent = data.banners
59
+ this.staticContent = data.banners
60
+ }
60
61
  }
61
- }
62
62
  </script>
63
63
 
64
64
  <style scoped>
@@ -0,0 +1,492 @@
1
+ <template>
2
+ <PPage
3
+ class="app-manager-plan-page custom-title"
4
+ title="Choose plan"
5
+ :subtitle = "subtitleContent"
6
+ >
7
+
8
+ <PStack slot="primaryAction">
9
+ <PStackItem style="margin-top: 20px">
10
+ <PButtonGroup class="btn-group" segmented>
11
+ <PButton v-if="monthlyPlan.length" :style="selectedPlan === 'monthly' ? monthlySelectedStyle : monthlyStyle " @click="selectPlan('monthly')">
12
+ <p style="font-size: 17px; font-weight: 500" slot="default">{{('Monthly')}}</p>
13
+ </PButton>
14
+
15
+ <PButton v-if="yearlyPlan.length" :style="selectedPlan === 'annually' ? yearlySelectedStyle : yearlyStyle " @click="selectPlan('annually')" :primary="selectedPlan === 'annually' " >
16
+ <YearlyPlanPromotion />
17
+ </PButton>
18
+ </PButtonGroup>
19
+ </PStackItem>
20
+ </PStack>
21
+ <hr style="width: 100%; margin-right: auto;margin-left: auto;margin-bottom: 20px;" />
22
+ <!--=======================================================-->
23
+
24
+ <PLayout class="custom-plan">
25
+ <PLayoutSection>
26
+ <template style="margin-bottom: 20px;">
27
+ <template>
28
+ <PDataTable class="plan-table">
29
+ <template slot="head">
30
+ <PDataTableRow v-if="selectedPlan === 'monthly'" style="box-shadow: none!important;">
31
+ <PDataTableCol style="opacity: 0;visibility: hidden;border: 0 !important;" class="plan-heading">
32
+ <b>{{('features')}}</b>
33
+ </PDataTableCol>
34
+ <template v-for="(plan, key) in monthlyPlan" >
35
+ <PDataTableCol :class="{'first-column': key === 0, 'plan-heading': true, 'last-column': (key+1) === monthlyPlan.length}" :style="activePlanStyle(plan)">
36
+ <b style="font-size: 16px">{{(plan.name)}}</b>
37
+ <p style="display: flex;margin-top: 10px">
38
+ <PHeading style="font-size: 25px;font-weight: 700;">${{parseFloat(plan.price).toFixed(2)}}</PHeading>
39
+ <b style="margin-top: 5px;font-size: 17px">/{{("mo")}}</b>
40
+ </p>
41
+ </PDataTableCol>
42
+ </template>
43
+ </PDataTableRow>
44
+ <PDataTableRow v-else>
45
+ <PDataTableCol style="opacity: 0;visibility: hidden; border: 0 !important;" class="plan-heading">
46
+ <b>{{('features')}}</b>
47
+ </PDataTableCol>
48
+ <template v-for="(plan,key) in yearlyPlan">
49
+ <PDataTableCol :class="{'first-column': key === 0, 'plan-heading': true, 'last-column': (key+1) === yearlyPlan.length}" :style="activePlanStyle(plan)">
50
+ <b style="font-size: 16px">{{(plan.name)}}</b>
51
+ <p style="display: flex;margin-top: 10px">
52
+ <PHeading style="font-size: 25px; font-weight: 700;">${{parseFloat(plan.price).toFixed(2)}}</PHeading>
53
+ <b style="margin-top: 5px;font-size: 17px">/{{("year")}}</b>
54
+ </p>
55
+ </PDataTableCol>
56
+ </template>
57
+ </PDataTableRow>
58
+ </template>
59
+ <template slot="body">
60
+ <PDataTableRow
61
+ v-for="(feature, rIndex) in features" :key="`row-${rIndex}`"
62
+ >
63
+ <PDataTableCol>{{ (feature.name) }}</PDataTableCol>
64
+ <PDataTableCol v-for="(plan, cIndex) in selectedPlan === 'monthly' ? monthlyPlan : yearlyPlan" :key="`cell-${cIndex}-row-${rIndex}`" :style="activePlanStyle(plan)">
65
+ <template v-if="plan.features">
66
+ <template v-if="feature.value_type === 'boolean'">
67
+ <PIcon v-if="plan.features[feature.uuid]" color="success"
68
+ source="TickMinor"/>
69
+ <PIcon v-else color="subdued" source="MinusMinor"/>
70
+ </template>
71
+ <template v-else>
72
+ <span v-if="plan.features[feature.uuid]">{{ format(plan.features[feature.uuid]) }}</span>
73
+ <PIcon v-else color="subdued" source="MinusMinor"/>
74
+ </template>
75
+ </template>
76
+ <template v-else>
77
+ <PIcon color="subdued" source="MinusMinor"/>
78
+ </template>
79
+ </PDataTableCol>
80
+ </PDataTableRow>
81
+ <PDataTableRow v-if="plans.length" class="row-alignment" >
82
+ <PDataTableCol></PDataTableCol>
83
+ <PDataTableCol v-for="(plan, cIndex) in selectedPlan === 'monthly' ? monthlyPlan : yearlyPlan" :key="`cell-${cIndex}-row-plan`" style="max-width: 0">
84
+ <PButton v-if="isCurrentPlan(plan)" :disabled="isCurrentPlan(plan)"
85
+ full-width
86
+ :pressed="isCurrentPlan(plan)">
87
+ {{ ('Current Plan') }}
88
+ </PButton>
89
+ <PButton v-else-if="!plan.store_base_plan || plan.shopify_plans.includes(shop.shopify_plan)"
90
+ full-width
91
+ @click="plan ? getPlanUrl(plan):'javascript:void'"
92
+ :primary="true" >
93
+ {{ ('Choose Plan') }}
94
+ </PButton>
95
+ <PButton v-else :disabled="true"
96
+ full-width
97
+ :pressed="true">
98
+ {{ ('Not applicable') }}
99
+ </PButton>
100
+ <PTextContainer v-if="plan.store_base_plan && shop.plan && plan.shopify_plans.includes(shop.shopify_plan) && !isCurrentPlan(plan)" class="footer-note-container">
101
+ <PTextStyle class="text-break" v-if="plan.store_base_plan && !plan.shopify_plans.includes(shop.shopify_plan) && !(isCurrentPlan(plan)) && !isSamePlanInOtherInterval(plan)">Note: On account of your recent Shopify plan upgrade, you should consider upgrading your current app plan</PTextStyle>
102
+ </PTextContainer>
103
+ </PDataTableCol>
104
+ </PDataTableRow>
105
+ </template>
106
+ </PDataTable>
107
+ </template>
108
+ </template>
109
+ <PStack v-if="onboard && !shop.has_plan" class="choose-plan-btn" alignment="center" distribution="center" vertical>
110
+ <PStackItem fill>
111
+ <PButton plain @click="activePlan">{{ ('I will choose the plan later') }}</PButton>
112
+ </PStackItem>
113
+ </PStack>
114
+ </PLayoutSection>
115
+ <PlanBanners />
116
+ </PLayout>
117
+ <!--====================================================================-->
118
+ </PPage>
119
+ </template>
120
+
121
+ <script>
122
+
123
+ import axios from "axios";
124
+ import PlanBanners from "./PlanBanners";
125
+ import YearlyPlanPromotion from "./YearlyPlanPromotion";
126
+ import PPage from "../polaris-vue/src/components/PPage/PPage";
127
+ import PStack from "../polaris-vue/src/components/PStack/PStack";
128
+ import PStackItem from "../polaris-vue/src/components/PStack/components/PStackItem/PStackItem";
129
+ import {PButton} from "../polaris-vue/src/components/PButton";
130
+ import {PButtonGroup} from "../polaris-vue/src/components/PButtonGroup";
131
+ import {PHeading} from "../polaris-vue/src/components/PHeading";
132
+ import {PLayout} from "../polaris-vue/src/components/PLayout";
133
+ import {PLayoutSection} from "../polaris-vue/src/components/PLayout/components/PLayoutSection";
134
+ import {PTextContainer} from "../polaris-vue/src/components/PTextContainer";
135
+ import {PDataTable} from "../polaris-vue/src/components/PDataTable";
136
+ import {PDataTableCol} from "../polaris-vue/src/components/PDataTable/components/PDataTableCol";
137
+ import {PDataTableRow} from "../polaris-vue/src/components/PDataTable/components/PDataTableRow";
138
+ import {PIcon} from "../polaris-vue/src/components/PIcon";
139
+ import {PTextStyle} from "../polaris-vue/src/components/PTextStyle";
140
+
141
+ export default {
142
+ name: "AppManagerPlan",
143
+ components: { YearlyPlanPromotion, PlanBanners, PPage, PStack, PStackItem, PButton, PButtonGroup, PHeading, PLayout, PLayoutSection, PTextContainer, PDataTable, PDataTableCol, PDataTableRow, PIcon, PTextStyle },
144
+ props: ['shop_domain'],
145
+ data() {
146
+ return {
147
+ plan: {},
148
+ plans: [],
149
+ features: [],
150
+ shopify_plan: '',
151
+ default_plan_id: null,
152
+ onboard: true,
153
+ subtitleContent: '',
154
+ checkList: [
155
+ "60 days free trial",
156
+ ],
157
+ selectedPlan:'monthly',
158
+ monthlySelectedStyle:{
159
+ height: '60px',
160
+ backgroundColor:'#257f60',
161
+ color:'#fff',
162
+ position:'relative',
163
+ right:'-5px',
164
+ borderRadius:'8px',
165
+ zIndex: 1,
166
+ },
167
+ yearlySelectedStyle:{
168
+ height: '60px',
169
+ backgroundColor:'#257f60',
170
+ position:'relative',
171
+ left:'-5px',
172
+ borderRadius:'8px'
173
+ },
174
+ monthlyStyle:{
175
+ height: '55px',
176
+ backgroundColor:'#f0f8f5',
177
+ boxShadow: 'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px',
178
+ border:'none',
179
+ borderRadius:'8px',
180
+ ZIndex: 11,
181
+ },
182
+ yearlyStyle:{
183
+ color:'#258060',
184
+ height: '55px',
185
+ backgroundColor:'#f0f8f5',
186
+ boxShadow: 'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px',
187
+ border:'none',
188
+ borderRadius:'8px'
189
+ },
190
+ }
191
+ },
192
+ computed: {
193
+ shop() {
194
+ return {
195
+ "name": this.shop_domain,
196
+ "shopify_plan": this.shopify_plan,
197
+ "has_plan": !!this.plan,
198
+ "plan": this.plan,
199
+ "default_plan_id": this.default_plan_id,
200
+ };
201
+ },
202
+ headings() {
203
+ let headings = [('Plans & Features')];
204
+ this.plans.forEach(plan => {
205
+
206
+ let heading = (plan.name);
207
+ if (plan.price > 0) heading += ` ($${plan.price}/mo)`;
208
+ headings.push(heading);
209
+ });
210
+ return headings;
211
+ },
212
+ monthlyPlan() {
213
+ const plans = [];
214
+ for(let planKey in this.plans) {
215
+ if(this.plans[planKey].interval === 'EVERY_30_DAYS') {
216
+ plans.push(this.plans[planKey]);
217
+ }
218
+ }
219
+ return plans;
220
+ },
221
+ yearlyPlan() {
222
+ const plans = [];
223
+ for(let planKey in this.plans) {
224
+ if(this.plans[planKey].interval === 'ANNUAL') {
225
+ plans.push(this.plans[planKey]);
226
+ }
227
+ }
228
+ return plans;
229
+ }
230
+ },
231
+ methods: {
232
+
233
+ activePlanStyle(plan) {
234
+ return [plan.shopify_plans.includes(this.shop.shopify_plan) || !plan.store_base_plan ? {backgroundColor: '#f0f8f5', color: '#257f60'} : {}];
235
+ },
236
+ isCurrentPlan(plan) {
237
+ return this.shop.plan && (plan.id === this.shop.plan.id || (!plan.is_custom && plan.base_plan === this.shop.plan.id));
238
+ },
239
+ isSamePlanInOtherInterval(plan) {
240
+ return this.shop.plan && (plan.shopify_plans === this.shop.plan.shopify_plans)
241
+ },
242
+ format(feature) {
243
+ if (['double', 'integer'].includes(feature?.value_type)) {
244
+ if (feature.format === 'percentage') {
245
+ return `${feature.value}%`
246
+ } else if (feature.format === 'count') {
247
+ return (feature.value < 0 ? (`Unlimited`) : feature.value)
248
+ } else return feature.value
249
+ }
250
+ else if(['string', 'array'].includes(feature?.value_type)) {
251
+ return feature.value
252
+ }
253
+ },
254
+ async getPlanUrl(plan) {
255
+ let shopName = this.shop.name;
256
+ const response = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan/process/${plan.id}?shop=${shopName}`).catch(error => {
257
+ console.error(error)
258
+ });
259
+ let redirectUrl = response.data.redirect_url;
260
+ if (redirectUrl) {
261
+ window.top.location.href = redirectUrl;
262
+ }
263
+ },
264
+ async activePlan() {
265
+ const response = await this.activeWithoutPlan()
266
+ if (response.data.status === true && this.onboard) {
267
+ // Create the event
268
+ this.$emit('handlePlanSelect', {chose_later: true})
269
+ this.onboard = false;
270
+ }
271
+ },
272
+ async activeWithoutPlan() {
273
+ return await axios.post(`${this.app_manager_config.baseUrl}/api/app-manager/active-without-plan`, {
274
+ shop_domain: this.shop.name,
275
+ plan_id: this.shop.default_plan_id
276
+ }).catch(error => {
277
+ console.error(error)
278
+ });
279
+ },
280
+ async selectPlan(value){
281
+ this.selectedPlan= value;
282
+ },
283
+ headerClasses(firstColumn) {
284
+ return {
285
+ 'Polaris-DataTable__Cell': true,
286
+ 'Polaris-DataTable__Cell--header': true,
287
+ 'Polaris-DataTable__Cell--verticalAlignMiddle': true,
288
+ 'Polaris-DataTable__Cell--firstColumn': Boolean(firstColumn),
289
+ };
290
+ }
291
+ },
292
+ async mounted() {
293
+
294
+ const featuresData = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan-features`).catch(error => {
295
+ console.error(error)
296
+ });
297
+ this.features = featuresData.data.features;
298
+ this.features = this.features.sort((featureA, featureB) => parseInt(featureA.display_order) - parseInt(featureB.display_order))
299
+
300
+ const plansData = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plans`, { params: { 'shop_domain': this.shop_domain } }).catch(error => {
301
+ console.error(error)
302
+ });
303
+ this.plans = plansData.data.plans;
304
+ this.plans = this.plans.sort((planA, planB) => parseFloat(planA.price) - parseFloat(planB.price));
305
+ if (this.plans && this.plans[0].store_base_plan) {
306
+ this.subtitleContent = 'App plans are based on your existing shopify plan';
307
+ }
308
+ this.shopify_plan = plansData.data.shopify_plan;
309
+ this.plan = plansData.data.plan;
310
+ this.default_plan_id = plansData.data.default_plan_id;
311
+ this.onboard = !this.plan
312
+ }
313
+ }
314
+ </script>
315
+
316
+ <style lang="scss">
317
+
318
+ @import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');
319
+
320
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-7d902277],
321
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-5a078dbb] {
322
+ float:none;
323
+ }
324
+ .app-manager-plan-page .active {
325
+ background: #f0f8f5;
326
+ }
327
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-0d1b0d63] {
328
+ float:none;
329
+ }
330
+ .app-manager-plan-page .plan-table td {
331
+ border: 0.01px solid #ececee !important;
332
+ border-collapse: collapse !important;
333
+ }
334
+ .app-manager-plan-page .plan-table .Polaris-DataTable__ScrollContainer{
335
+ border-radius:12px;
336
+ overflow: visible;
337
+ }
338
+ .app-manager-plan-page .plan-table table {
339
+ border-collapse: collapse !important;
340
+ }
341
+ .app-manager-plan-page .custom-plan table {
342
+ border-collapse: collapse !important;
343
+ }
344
+ .app-manager-plan-page .custom-plan table thead .first-column {
345
+ border-radius: 12px 0 0 0;
346
+ border-top: 0px !important;
347
+ border-left: 0px !important;
348
+ }
349
+ .app-manager-plan-page .custom-plan table thead .plan-heading.last-column {
350
+ text-align: left !important;
351
+ border-radius: 0 12px 0 0;
352
+ border-top: 0px !important;
353
+ }
354
+ .app-manager-plan-page .custom-plan table thead .plan-heading {
355
+ background-color: rgb(255, 255, 255);
356
+ box-shadow: rgb(23 24 24 / 5%) 1px 0px 8px, rgb(0 0 0 / 15%) 0px 0px 2px;
357
+ }
358
+ .app-manager-plan-page .custom-plan table tbody tr:first-child {
359
+ background-color: #fff;
360
+ box-shadow: 0 0 5px rgb(23 24 24 / 5%), 0 1px 2px rgb(0 0 0 / 15%);
361
+ border-radius: 12px 0 0 0;
362
+ overflow: hidden;
363
+ }
364
+ .app-manager-plan-page .custom-plan table tbody tr:not(:first-child :last-child ) {
365
+ background-color: #fff;
366
+ overflow: hidden;
367
+ }
368
+ .app-manager-plan-page .custom-plan table tbody tr:not(:first-child :last-child) {
369
+ background-color: #fff;
370
+ box-shadow: 0 0 5px rgb(23 24 24 / 5%), 0 1px 2px rgb(0 0 0 / 15%);
371
+ overflow: hidden;
372
+ }
373
+ .app-manager-plan-page .custom-plan table tbody tr:not( :nth-last-child(2) ) {
374
+ background-color: #fff;
375
+ overflow: hidden;
376
+ }
377
+ .app-manager-plan-page .custom-plan table tbody tr:not( :nth-last-child(2) ) {
378
+ border-bottom: 0;
379
+ }
380
+ .app-manager-plan-page .custom-plan table tbody tr:last-child {
381
+ border-bottom: 0;
382
+ background-color: transparent !important;
383
+ box-shadow: none !important;
384
+ }
385
+ .app-manager-plan-page .custom-plan table tbody tr:not(:last-child) {
386
+ pointer-events: none;
387
+ }
388
+ .app-manager-plan-page .custom-plan table thead tr td{
389
+ pointer-events: none;
390
+ }
391
+ .app-manager-plan-page .custom-plan table tbody tr:first-child td:first-child {
392
+ overflow: hidden;
393
+ border-radius: 12px 0 0 0;
394
+ }
395
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) {
396
+ overflow: hidden;
397
+ border-bottom-right-radius: 12px;
398
+ border-bottom-left-radius: 12px;
399
+ }
400
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:first-child {
401
+ overflow: hidden;
402
+ border-bottom: 0px !important;
403
+ border-radius: 0 0 0 12px;
404
+ }
405
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:last-child {
406
+ overflow: hidden;
407
+ border-radius: 0 0 12px;
408
+ }
409
+ .app-manager-plan-page .custom-plan table tbody tr td:first-child {
410
+ border-left: 0px !important;
411
+ border-top: 0px !important;
412
+ padding-left: 20px;
413
+ }
414
+ .app-manager-plan-page .custom-plan table tbody tr td:last-child {
415
+ border-right: 0px !important;
416
+ border-bottom: 0px !important;
417
+ text-align: center !important;
418
+ }
419
+ .app-manager-plan-page .custom-plan table thead tr td:last-child {
420
+ border-right: 0px !important;
421
+ border-bottom: 0px !important;
422
+ text-align: center !important;
423
+ }
424
+ .app-manager-plan-page .custom-plan table tbody td:not(:first-child) {
425
+ text-align: center !important;
426
+ }
427
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:last-child {
428
+ background: transparent;
429
+ border-radius: 0 0 12px 0;
430
+ }
431
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td {
432
+ border: 0 !important;
433
+ background: transparent;
434
+ }
435
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:hover {
436
+ border: 0 !important;
437
+ background: transparent;
438
+ }
439
+ .app-manager-plan-page .custom-plan tbody tr:last-child td.Polaris-DataTable__Cell--verticalAlignTop{
440
+ background: transparent !important;
441
+ }
442
+ .app-manager-plan-page .custom-plan table tbody tr:last-child {
443
+ background: transparent;
444
+ opacity:1.0;
445
+ }
446
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:first-child{
447
+ visibility: hidden;
448
+ }
449
+ .app-manager-plan-page .plan-heading {
450
+ padding-top: 30px;
451
+ }
452
+ .app-manager-plan-page .custom-plan .Polaris-Layout__Section{
453
+ max-width: calc(100% - 2rem) !important;
454
+ }
455
+ .app-manager-plan-page .later-link {
456
+ text-align: center;
457
+ clear: both;
458
+ padding-top: 15px;
459
+ }
460
+ .app-manager-plan-page .plan-badge ul {
461
+ text-align: center;
462
+ padding-top: 2rem;
463
+ border-top: 0.1rem solid #e1e3e5;
464
+ }
465
+ .app-manager-plan-page .plan-badge ul li {
466
+ list-style: none;
467
+ display: inline-block;
468
+ padding-right: 25px;
469
+ }
470
+ .app-manager-plan-page .plan-badge ul li img {
471
+ max-width: 133px;
472
+ }
473
+ .app-manager-plan-page .btn-group .Polaris-ButtonGroup__Item{
474
+ margin-left: 0px !important;
475
+ z-index: unset !important;
476
+ }
477
+ .app-manager-plan-page.custom-title .Polaris-HorizontalDivider{
478
+ background-color: #e2e3e4;
479
+ }
480
+ /*.app-manager-plan-page .annual_heading{
481
+ margin-top: 2px !important;
482
+ color: #E2C138;
483
+ border: 2px dotted #E2C138;
484
+ padding: 5px;
485
+ font-size: 16px !important;
486
+ font-weight: normal !important;
487
+ font-family: 'Satisfy', cursive;
488
+ }*/
489
+ .app-manager-plan-page .Polaris-Page__Content hr{
490
+ border: 1px solid #e2e3e4;
491
+ }
492
+ </style>