@hulkapps/app-manager-vue 1.0.0 → 2.0.0

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 +41024 -3406
  3. package/dist/app-manager-vue.min.js +9 -1
  4. package/dist/app-manager-vue.ssr.js +39512 -3381
  5. package/dist/hulkapps-app-manager.css +13284 -0
  6. package/dist/hulkapps-app-manager.min.css +1 -0
  7. package/package.json +10 -5
  8. package/src/components/Marketing/Banners.vue +44 -44
  9. package/src/components/Plans/AppManagerPlan.vue +494 -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.0",
3
+ "version": "2.0.0",
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,13 +14,15 @@
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",
@@ -32,15 +34,18 @@
32
34
  "@rollup/plugin-replace": "^2.4.2",
33
35
  "@vue/cli-plugin-babel": "^4.5.13",
34
36
  "@vue/cli-service": "^4.5.13",
35
- "@hulkapps/polaris-vue": "^3.0.9",
36
37
  "cross-env": "^7.0.3",
37
38
  "minimist": "^1.2.5",
39
+ "node-sass": "^7.0.1",
38
40
  "rimraf": "^3.0.2",
39
41
  "rollup": "^2.52.8",
42
+ "rollup-plugin-node-polyfills": "^0.2.1",
40
43
  "rollup-plugin-terser": "^7.0.2",
41
44
  "rollup-plugin-vue": "^5.1.9",
45
+ "sass-loader": "^10.0.5",
42
46
  "vue": "^2.6.14",
43
- "vue-template-compiler": "^2.6.14"
47
+ "vue-template-compiler": "^2.6.14",
48
+ "vue-quill-editor": "^3.0.6"
44
49
  },
45
50
  "peerDependencies": {
46
51
  "vue": "^2.6.14"
@@ -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,494 @@
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="!plan.store_base_plan" :disabled="isCurrentPlan(plan)"
85
+ full-width
86
+ @click="plan ? getPlanUrl(plan):'javascript:void'"
87
+ :pressed="isCurrentPlan(plan)"
88
+ :primary="!isCurrentPlan(plan)" >
89
+ {{ (isCurrentPlan(plan)) ? ('Current Plan') : 'Choose Plan' }}
90
+ </PButton>
91
+ <PButton v-else-if="plan.shopify_plans.includes(shop.shopify_plan)" :disabled="isCurrentPlan(plan)"
92
+ full-width
93
+ @click="plan ? getPlanUrl(plan):'javascript:void'"
94
+ :pressed="isCurrentPlan(plan)"
95
+ :primary="!isCurrentPlan(plan)" >
96
+ {{ (isCurrentPlan(plan)) ? ('Current Plan') : 'Choose Plan' }}
97
+ </PButton>
98
+ <PButton v-else :disabled="true"
99
+ full-width
100
+ :pressed="true">
101
+ {{ ('Not applicable') }}
102
+ </PButton>
103
+ <PTextContainer v-if="plan.store_base_plan && shop.plan && plan.shopify_plans.includes(shop.shopify_plan) && !isCurrentPlan(plan)" class="footer-note-container">
104
+ <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>
105
+ </PTextContainer>
106
+ </PDataTableCol>
107
+ </PDataTableRow>
108
+ </template>
109
+ </PDataTable>
110
+ </template>
111
+ </template>
112
+ <PStack v-if="onboard && !shop.has_plan" class="choose-plan-btn" alignment="center" distribution="center" vertical>
113
+ <PStackItem fill>
114
+ <PButton plain @click="activePlan">{{ ('I will choose the plan later') }}</PButton>
115
+ </PStackItem>
116
+ </PStack>
117
+ </PLayoutSection>
118
+ <PlanBanners />
119
+ </PLayout>
120
+ <!--====================================================================-->
121
+ </PPage>
122
+ </template>
123
+
124
+ <script>
125
+
126
+ import axios from "axios";
127
+ import PlanBanners from "./PlanBanners";
128
+ import YearlyPlanPromotion from "./YearlyPlanPromotion";
129
+ import PPage from "../polaris-vue/src/components/PPage/PPage";
130
+ import PStack from "../polaris-vue/src/components/PStack/PStack";
131
+ import PStackItem from "../polaris-vue/src/components/PStack/components/PStackItem/PStackItem";
132
+ import {PButton} from "../polaris-vue/src/components/PButton";
133
+ import {PButtonGroup} from "../polaris-vue/src/components/PButtonGroup";
134
+ import {PHeading} from "../polaris-vue/src/components/PHeading";
135
+ import {PLayout} from "../polaris-vue/src/components/PLayout";
136
+ import {PLayoutSection} from "../polaris-vue/src/components/PLayout/components/PLayoutSection";
137
+ import {PTextContainer} from "../polaris-vue/src/components/PTextContainer";
138
+ import {PDataTable} from "../polaris-vue/src/components/PDataTable";
139
+ import {PDataTableCol} from "../polaris-vue/src/components/PDataTable/components/PDataTableCol";
140
+ import {PDataTableRow} from "../polaris-vue/src/components/PDataTable/components/PDataTableRow";
141
+ import {PIcon} from "../polaris-vue/src/components/PIcon";
142
+ import {PTextStyle} from "../polaris-vue/src/components/PTextStyle";
143
+
144
+ export default {
145
+ name: "AppManagerPlan",
146
+ components: { YearlyPlanPromotion, PlanBanners, PPage, PStack, PStackItem, PButton, PButtonGroup, PHeading, PLayout, PLayoutSection, PTextContainer, PDataTable, PDataTableCol, PDataTableRow, PIcon, PTextStyle },
147
+ props: ['shop_domain'],
148
+ data() {
149
+ return {
150
+ plan: {},
151
+ plans: [],
152
+ features: [],
153
+ shopify_plan: '',
154
+ default_plan_id: null,
155
+ onboard: true,
156
+ subtitleContent: '',
157
+ checkList: [
158
+ "60 days free trial",
159
+ ],
160
+ selectedPlan:'monthly',
161
+ monthlySelectedStyle:{
162
+ height: '60px',
163
+ backgroundColor:'#257f60',
164
+ color:'#fff',
165
+ position:'relative',
166
+ right:'-5px',
167
+ borderRadius:'8px',
168
+ zIndex: 1,
169
+ },
170
+ yearlySelectedStyle:{
171
+ height: '60px',
172
+ backgroundColor:'#257f60',
173
+ position:'relative',
174
+ left:'-5px',
175
+ borderRadius:'8px'
176
+ },
177
+ monthlyStyle:{
178
+ height: '55px',
179
+ backgroundColor:'#f0f8f5',
180
+ boxShadow: 'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px',
181
+ border:'none',
182
+ borderRadius:'8px',
183
+ ZIndex: 11,
184
+ },
185
+ yearlyStyle:{
186
+ color:'#258060',
187
+ height: '55px',
188
+ backgroundColor:'#f0f8f5',
189
+ boxShadow: 'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px',
190
+ border:'none',
191
+ borderRadius:'8px'
192
+ },
193
+ }
194
+ },
195
+ computed: {
196
+ shop() {
197
+ return {
198
+ "name": this.shop_domain,
199
+ "shopify_plan": this.shopify_plan,
200
+ "has_plan": !!this.plan,
201
+ "plan": this.plan,
202
+ "default_plan_id": this.default_plan_id,
203
+ };
204
+ },
205
+ headings() {
206
+ let headings = [('Plans & Features')];
207
+ this.plans.forEach(plan => {
208
+
209
+ let heading = (plan.name);
210
+ if (plan.price > 0) heading += ` ($${plan.price}/mo)`;
211
+ headings.push(heading);
212
+ });
213
+ return headings;
214
+ },
215
+ monthlyPlan() {
216
+ const plans = [];
217
+ for(let planKey in this.plans) {
218
+ if(this.plans[planKey].interval === 'EVERY_30_DAYS') {
219
+ plans.push(this.plans[planKey]);
220
+ }
221
+ }
222
+ return plans;
223
+ },
224
+ yearlyPlan() {
225
+ const plans = [];
226
+ for(let planKey in this.plans) {
227
+ if(this.plans[planKey].interval === 'ANNUAL') {
228
+ plans.push(this.plans[planKey]);
229
+ }
230
+ }
231
+ return plans;
232
+ }
233
+ },
234
+ methods: {
235
+
236
+ activePlanStyle(plan) {
237
+ return [plan.shopify_plans.includes(this.shop.shopify_plan) || !plan.store_base_plan ? {backgroundColor: '#f0f8f5', color: '#257f60'} : {}];
238
+ },
239
+ isCurrentPlan(plan) {
240
+ return this.shop.plan && (plan.id === this.shop.plan.id || (!plan.is_custom && plan.base_plan === this.shop.plan.id));
241
+ },
242
+ isSamePlanInOtherInterval(plan) {
243
+ return this.shop.plan && (plan.shopify_plans === this.shop.plan.shopify_plans)
244
+ },
245
+ format(feature) {
246
+ if (['double', 'integer'].includes(feature?.value_type)) {
247
+ if (feature.format === 'percentage') {
248
+ return `${feature.value}%`
249
+ } else if (feature.format === 'count') {
250
+ return (feature.value < 0 ? (`Unlimited`) : feature.value)
251
+ } else return feature.value
252
+ }
253
+ else if(['string', 'array'].includes(feature?.value_type)) {
254
+ return feature.value
255
+ }
256
+ },
257
+ async getPlanUrl(plan) {
258
+ let shopName = this.shop.name;
259
+ const response = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan/process/${plan.id}?shop=${shopName}`).catch(error => {
260
+ console.error(error)
261
+ });
262
+ let redirectUrl = response.data.redirect_url;
263
+ if (redirectUrl) {
264
+ window.location.replace(redirectUrl);
265
+ }
266
+ },
267
+ async activePlan() {
268
+ const response = await this.activeWithoutPlan()
269
+ if (response.data.status === true && this.onboard) {
270
+ // Create the event
271
+ this.$emit('continue-without-plan')
272
+ this.onboard = false;
273
+ }
274
+ },
275
+ async activeWithoutPlan() {
276
+ return await axios.post(`${this.app_manager_config.baseUrl}/api/app-manager/active-without-plan`, {
277
+ shop_domain: this.shop.name,
278
+ plan_id: this.shop.default_plan_id
279
+ }).catch(error => {
280
+ console.error(error)
281
+ });
282
+ },
283
+ async selectPlan(value){
284
+ this.selectedPlan= value;
285
+ },
286
+ headerClasses(firstColumn) {
287
+ return {
288
+ 'Polaris-DataTable__Cell': true,
289
+ 'Polaris-DataTable__Cell--header': true,
290
+ 'Polaris-DataTable__Cell--verticalAlignMiddle': true,
291
+ 'Polaris-DataTable__Cell--firstColumn': Boolean(firstColumn),
292
+ };
293
+ }
294
+ },
295
+ async mounted() {
296
+
297
+ const featuresData = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plan-features`).catch(error => {
298
+ console.error(error)
299
+ });
300
+ this.features = featuresData.data.features;
301
+ this.features = this.features.sort((featureA, featureB) => parseInt(featureA.display_order) - parseInt(featureB.display_order))
302
+
303
+ const plansData = await axios.get(`${this.app_manager_config.baseUrl}/api/app-manager/plans`, { params: { 'shop_domain': this.shop_domain } }).catch(error => {
304
+ console.error(error)
305
+ });
306
+ this.plans = plansData.data.plans;
307
+ this.plans = this.plans.sort((planA, planB) => parseFloat(planA.price) - parseFloat(planB.price));
308
+ if (this.plans && this.plans[0].store_base_plan) {
309
+ this.subtitleContent = 'App plans are based on your existing shopify plan';
310
+ }
311
+ this.shopify_plan = plansData.data.shopify_plan;
312
+ this.plan = plansData.data.plan;
313
+ this.default_plan_id = plansData.data.default_plan_id;
314
+ this.onboard = !this.plan
315
+ }
316
+ }
317
+ </script>
318
+
319
+ <style lang="scss">
320
+
321
+ @import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');
322
+
323
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-7d902277],
324
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-5a078dbb] {
325
+ float:none;
326
+ }
327
+ .app-manager-plan-page .active {
328
+ background: #f0f8f5;
329
+ }
330
+ .app-manager-plan-page .plan-table td:last-child>*[data-v-0d1b0d63] {
331
+ float:none;
332
+ }
333
+ .app-manager-plan-page .plan-table td {
334
+ border: 0.01px solid #ececee !important;
335
+ border-collapse: collapse !important;
336
+ }
337
+ .app-manager-plan-page .plan-table .Polaris-DataTable__ScrollContainer{
338
+ border-radius:12px;
339
+ overflow: visible;
340
+ }
341
+ .app-manager-plan-page .plan-table table {
342
+ border-collapse: collapse !important;
343
+ }
344
+ .app-manager-plan-page .custom-plan table {
345
+ border-collapse: collapse !important;
346
+ }
347
+ .app-manager-plan-page .custom-plan table thead .first-column {
348
+ border-radius: 12px 0 0 0;
349
+ border-top: 0px !important;
350
+ border-left: 0px !important;
351
+ }
352
+ .app-manager-plan-page .custom-plan table thead .plan-heading.last-column {
353
+ text-align: left !important;
354
+ border-radius: 0 12px 0 0;
355
+ border-top: 0px !important;
356
+ }
357
+ .app-manager-plan-page .custom-plan table thead .plan-heading {
358
+ background-color: rgb(255, 255, 255);
359
+ box-shadow: rgb(23 24 24 / 5%) 1px 0px 8px, rgb(0 0 0 / 15%) 0px 0px 2px;
360
+ }
361
+ .app-manager-plan-page .custom-plan table tbody tr:first-child {
362
+ background-color: #fff;
363
+ box-shadow: 0 0 5px rgb(23 24 24 / 5%), 0 1px 2px rgb(0 0 0 / 15%);
364
+ border-radius: 12px 0 0 0;
365
+ overflow: hidden;
366
+ }
367
+ .app-manager-plan-page .custom-plan table tbody tr:not(:first-child :last-child ) {
368
+ background-color: #fff;
369
+ overflow: hidden;
370
+ }
371
+ .app-manager-plan-page .custom-plan table tbody tr:not(:first-child :last-child) {
372
+ background-color: #fff;
373
+ box-shadow: 0 0 5px rgb(23 24 24 / 5%), 0 1px 2px rgb(0 0 0 / 15%);
374
+ overflow: hidden;
375
+ }
376
+ .app-manager-plan-page .custom-plan table tbody tr:not( :nth-last-child(2) ) {
377
+ background-color: #fff;
378
+ overflow: hidden;
379
+ }
380
+ .app-manager-plan-page .custom-plan table tbody tr:not( :nth-last-child(2) ) {
381
+ border-bottom: 0;
382
+ }
383
+ .app-manager-plan-page .custom-plan table tbody tr:last-child {
384
+ border-bottom: 0;
385
+ background-color: transparent;
386
+ }
387
+ .app-manager-plan-page .custom-plan table tbody tr:not(:last-child) {
388
+ pointer-events: none;
389
+ }
390
+ .app-manager-plan-page .custom-plan table thead tr td{
391
+ pointer-events: none;
392
+ }
393
+ .app-manager-plan-page .custom-plan table tbody tr:first-child td:first-child {
394
+ overflow: hidden;
395
+ border-radius: 12px 0 0 0;
396
+ }
397
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) {
398
+ overflow: hidden;
399
+ border-bottom-right-radius: 12px;
400
+ border-bottom-left-radius: 12px;
401
+ }
402
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:first-child {
403
+ overflow: hidden;
404
+ border-bottom: 0px !important;
405
+ border-radius: 0 0 0 12px;
406
+ }
407
+ .app-manager-plan-page .custom-plan table tbody tr:nth-last-child(2) td:last-child {
408
+ overflow: hidden;
409
+ border-radius: 0 0 12px;
410
+ }
411
+ .app-manager-plan-page .custom-plan table tbody tr td:first-child {
412
+ border-left: 0px !important;
413
+ border-top: 0px !important;
414
+ padding-left: 20px;
415
+ }
416
+ .app-manager-plan-page .custom-plan table tbody tr td:last-child {
417
+ border-right: 0px !important;
418
+ border-bottom: 0px !important;
419
+ text-align: center !important;
420
+ }
421
+ .app-manager-plan-page .custom-plan table thead tr td:last-child {
422
+ border-right: 0px !important;
423
+ border-bottom: 0px !important;
424
+ text-align: center !important;
425
+ }
426
+ .app-manager-plan-page .custom-plan table tbody td:not(:first-child) {
427
+ text-align: center !important;
428
+ }
429
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:last-child {
430
+ background: transparent;
431
+ border-radius: 0 0 12px 0;
432
+ }
433
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td {
434
+ border: 0 !important;
435
+ background: transparent;
436
+ }
437
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:hover {
438
+ border: 0 !important;
439
+ background: transparent;
440
+ }
441
+ .app-manager-plan-page .custom-plan tbody tr:last-child td.Polaris-DataTable__Cell--verticalAlignTop{
442
+ background: transparent !important;
443
+ }
444
+ .app-manager-plan-page .custom-plan table tbody tr:last-child {
445
+ background: transparent;
446
+ opacity:1.0;
447
+ }
448
+ .app-manager-plan-page .custom-plan table tbody tr:last-child td:first-child{
449
+ visibility: hidden;
450
+ }
451
+ .app-manager-plan-page .plan-heading {
452
+ padding-top: 30px;
453
+ }
454
+ .app-manager-plan-page .custom-plan .Polaris-Layout__Section{
455
+ max-width: calc(100% - 2rem) !important;
456
+ }
457
+ .app-manager-plan-page .later-link {
458
+ text-align: center;
459
+ clear: both;
460
+ padding-top: 15px;
461
+ }
462
+ .app-manager-plan-page .plan-badge ul {
463
+ text-align: center;
464
+ padding-top: 2rem;
465
+ border-top: 0.1rem solid #e1e3e5;
466
+ }
467
+ .app-manager-plan-page .plan-badge ul li {
468
+ list-style: none;
469
+ display: inline-block;
470
+ padding-right: 25px;
471
+ }
472
+ .app-manager-plan-page .plan-badge ul li img {
473
+ max-width: 133px;
474
+ }
475
+ .app-manager-plan-page .btn-group .Polaris-ButtonGroup__Item{
476
+ margin-left: 0px !important;
477
+ z-index: unset !important;
478
+ }
479
+ .app-manager-plan-page.custom-title .Polaris-HorizontalDivider{
480
+ background-color: #e2e3e4;
481
+ }
482
+ /*.app-manager-plan-page .annual_heading{
483
+ margin-top: 2px !important;
484
+ color: #E2C138;
485
+ border: 2px dotted #E2C138;
486
+ padding: 5px;
487
+ font-size: 16px !important;
488
+ font-weight: normal !important;
489
+ font-family: 'Satisfy', cursive;
490
+ }*/
491
+ .app-manager-plan-page .Polaris-Page__Content hr{
492
+ border: 1px solid #e2e3e4;
493
+ }
494
+ </style>