Skip to content

Commit a928678

Browse files
committed
feat: add popup for first build
1 parent 3f36d26 commit a928678

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+946
-150
lines changed

plugin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: VueFront
44
* Plugin URI: https://github.com/vuefront/wordpress
55
* Description: VueFront CMS Connect App for Wordpress.
6-
* Version: 1.2.0
6+
* Version: 2.0.0
77
* Author: VueFront
88
* Author URI: http://vuefront.com
99
*/
@@ -182,7 +182,7 @@ function VFA_vuefront_admin_general() {
182182

183183
function VFA_my_plugin_admin_scripts() {
184184
$pax_dist = plugin_dir_path(__FILE__).'view/javascript/d_vuefront/';
185-
185+
186186
if(!file_exists(ABSPATH.'wp-includes/js/dist/vendor/wp-polyfill.js')) {
187187
wp_enqueue_script('vf-polyfill', plugin_dir_url(__FILE__).'view/javascript/polyfill.js');
188188
}
+21
Loading

view/javascript/d_pax/assets/img/firstBuild.svg

+272
Loading
+11
Loading

view/javascript/d_pax/assets/scss/main.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import './modal';
2-
.vf-module-content {
2+
.vf-module-content.vf-module-content.vf-module-content {
33

44
@import './colors';
55
@import 'node_modules/bootstrap/scss/functions';
@@ -134,7 +134,7 @@
134134
*::after {
135135
box-sizing: border-box;
136136
}
137-
&__image {
137+
.vf-module-content__image {
138138
margin-bottom: 10px;
139139

140140
img {
@@ -162,7 +162,7 @@
162162
}
163163
}
164164

165-
&__form {
165+
.vf-module-content__form {
166166
max-width: 500px;
167167
margin: 0 auto;
168168
}

view/javascript/d_pax/components/activity.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default {
9191
}
9292
</script>
9393
<style lang="scss">
94-
.vf-activity {
94+
.vf-activity.vf-activity .vf-activity {
9595
margin-bottom: 60px;
9696
text-align: left;
9797
&__table {

view/javascript/d_pax/components/development.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,20 @@ export default {
204204
}
205205
</i18n>
206206
<style lang="scss">
207-
.development {
207+
.development.development.development .development {
208208
&__cms_connect {
209-
height: 54px;
209+
height: 54px !important;
210210
background-color: #efeff1!important;
211211
padding: 12px 24px!important;
212212
line-height: 30px!important;
213-
font-family: 'Open Sans', sans-serif;
214-
font-size: 24px;
213+
font-family: 'Open Sans', sans-serif !important;
214+
font-size: 24px !important;
215215
font-weight: 600;
216216
font-stretch: normal;
217217
font-style: normal;
218218
letter-spacing: 0.24px;
219219
text-align: left;
220-
color: $black;
220+
color: $black !important;
221221
border: none!important;
222222
flex: 1;
223223
@media (--phone-and-tablet) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<template>
2+
<modal
3+
:value="true"
4+
class="first-build"
5+
btn-close
6+
@cancel="handleClose"
7+
>
8+
<div class="text-center">
9+
<img
10+
:src="require('~/assets/img/firstBuild.svg')"
11+
class="first-build__image"
12+
width="200"
13+
alt=""
14+
>
15+
</div>
16+
<div class="first-build__title">
17+
{{ $t('popupTitle') }}
18+
</div>
19+
<div class="first-build__subtitle">
20+
{{ $t('subTitlePopup') }} <a
21+
@click.prevent.stop="handleSearch"
22+
>{{ $t('text_bellow') }}</a>.
23+
</div>
24+
<div
25+
class="first-build__footer_title"
26+
>
27+
{{ $t('footerTitlePopup') }}
28+
</div>
29+
<div
30+
v-if="information.apache"
31+
class="text-center"
32+
>
33+
<b-button
34+
:disabled="loading"
35+
variant="success"
36+
size="lg"
37+
@click="handleConfirm"
38+
>
39+
<b-spinner
40+
v-if="loading"
41+
type="grow"
42+
/>
43+
{{ $t('buttonConfirm') }}
44+
</b-button>
45+
</div>
46+
<div class="text-center">
47+
<div
48+
class="first-build__footer_link"
49+
@click="handleClose"
50+
>
51+
{{ $t('buttonAbort') }}
52+
</div>
53+
</div>
54+
<div class="text-center">
55+
<img
56+
:src="require('~/assets/img/footer-modal.svg')"
57+
class="first-build__footer_image"
58+
alt=""
59+
>
60+
</div>
61+
</modal>
62+
</template>
63+
<script>
64+
import Modal from '~/components/modal'
65+
import {mapGetters} from 'vuex'
66+
export default {
67+
components: {
68+
Modal
69+
},
70+
data() {
71+
return {
72+
loading: false
73+
}
74+
},
75+
computed: {
76+
...mapGetters({information: 'information/get', cms: 'cms/get'})
77+
},
78+
methods: {
79+
async handleSearch() {
80+
this.$store.commit('cms/setFirstBuild', false)
81+
this.$nextTick(() => {
82+
this.$scrollTo('#vf-apache-configure')
83+
})
84+
},
85+
async handleConfirm() {
86+
this.loading = true
87+
if(!this.information.status) {
88+
await this.$store.dispatch('information/activateVueFront', {url: this.cms.downloadUrl})
89+
} else {
90+
await this.$store.dispatch('information/deActivateVueFront', {url: this.cms.downloadUrl})
91+
}
92+
this.$store.commit('cms/setFirstBuild', false)
93+
this.loading = false
94+
},
95+
handleClose() {
96+
this.$store.commit('cms/setFirstBuild', false)
97+
}
98+
}
99+
}
100+
</script>
101+
<i18n locale="en">
102+
{
103+
"popupTitle": "Yay! Your Build is ready",
104+
"subTitlePopup": "We have generated your website and uploaded it into your root folder. To replace your current Frontend with the new VueFront Web App, you will need to configure your server settings by following these",
105+
"text_bellow": "instructions",
106+
"footerTitlePopup": "Would you like us to do this for you?",
107+
"buttonConfirm": "Activate",
108+
"buttonAbort": "Close"
109+
}
110+
</i18n>
111+
<style lang="scss">
112+
.first-build {
113+
.vf-modal {
114+
.vf-modal-dialog {
115+
.vf-modal-content {
116+
.vf-modal-body {
117+
padding-top: 50px!important;
118+
padding-bottom: 0;
119+
padding-left: 110px;
120+
padding-right: 110px;
121+
}
122+
}
123+
}
124+
}
125+
a {
126+
cursor: pointer;
127+
}
128+
&__image {
129+
margin-bottom: 30px;
130+
}
131+
&__title {
132+
font-family: 'Open Sans', sans-serif;
133+
font-size: 30px;
134+
font-weight: 600;
135+
font-stretch: normal;
136+
font-style: normal;
137+
line-height: 1.25;
138+
letter-spacing: 0.4px;
139+
text-align: center;
140+
color: $black;
141+
margin-bottom: 20px;
142+
}
143+
&__subtitle {
144+
margin-bottom: 20px;
145+
}
146+
&__description {
147+
margin-bottom: 20px;
148+
}
149+
&__footer_title {
150+
margin-bottom: 30px;
151+
font-weight: 600!important;
152+
color: #333!important;
153+
154+
}
155+
&__subtitle, &__description, &__footer_title {
156+
font-family: 'Open Sans', sans-serif;
157+
font-size: 16px;
158+
font-weight: normal;
159+
font-stretch: normal;
160+
font-style: normal;
161+
line-height: 1.56;
162+
letter-spacing: 0.18px;
163+
text-align: center;
164+
color: $warm-grey-two;
165+
}
166+
&__footer_link {
167+
font-family: 'Open Sans', sans-serif;
168+
font-size: 16px;
169+
font-weight: 600;
170+
font-stretch: normal;
171+
font-style: normal;
172+
line-height: 1.38;
173+
letter-spacing: 0.16px;
174+
color: $dark-mint;
175+
margin-top: 20px;
176+
cursor: pointer;
177+
display: inline-block;
178+
}
179+
&__footer_image {
180+
margin-top: 50px;
181+
}
182+
}
183+
</style>

view/javascript/d_pax/components/rebuild.vue

+4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ export default {
8484
</i18n>
8585
<style lang="scss">
8686
.vf-home__rebuild {
87+
&::before {
88+
display: none!important;
89+
}
8790
h2, h4 {
91+
font-family: 'Open Sans', sans-serif;
8892
margin-top: 0;
8993
font-size: 20px;
9094
}

view/javascript/d_pax/components/welcome.vue

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default {
5252
this.$apolloClient.defaultClient.clearStore()
5353
if(!this.cms.generating) {
5454
await this.$store.dispatch('information/updateVueFront', {url: this.cms.downloadUrl})
55+
this.$store.commit('cms/setFirstBuild', true)
5556
clearInterval(interval)
5657
}
5758
}, 3000)
@@ -66,6 +67,7 @@ export default {
6667
this.$apolloClient.defaultClient.clearStore()
6768
if(!this.cms.generating) {
6869
await this.$store.dispatch('information/updateVueFront', {url: this.cms.downloadUrl})
70+
this.$store.commit('cms/setFirstBuild', true)
6971
7072
this.loading = false
7173
clearInterval(interval)

view/javascript/d_pax/pages/index.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
<b-row>
44
<b-col md="9">
55
<re-build />
6-
<welcome v-if="cms.builds.length === 0" />
6+
<welcome
7+
v-if="cms.builds.length === 0"
8+
v-hide="cms.generating"
9+
/>
710
<activity v-if="cms.builds.length > 0 || cms.generating" />
11+
<first-build v-if="firstBuild" />
812
<development />
913
</b-col>
1014
<b-col md="3">
@@ -22,21 +26,23 @@ import Information from '~/components/information'
2226
import Activity from '~/components/activity'
2327
import Welcome from '~/components/welcome'
2428
import ReBuild from '~/components/rebuild'
29+
import FirstBuild from '~/components/firstBuild'
2530
export default {
2631
components: {
2732
Subscription,
2833
Information,
2934
Development,
3035
Activity,
3136
Welcome,
32-
ReBuild
37+
ReBuild,
38+
FirstBuild
3339
},
3440
async fetch(ctx) {
3541
await ctx.store.dispatch('information/load')
3642
},
3743
middleware: ['authenticated', 'confirmed', 'noBanned', 'noAlien'],
3844
computed: {
39-
...mapGetters({information: 'information/get', cms: 'cms/get'})
45+
...mapGetters({information: 'information/get', cms: 'cms/get', firstBuild: 'cms/firstBuild'})
4046
}
4147
}
4248
</script>

0 commit comments

Comments
 (0)