fix/missing-functionalities
から master
へマージ 4年前
@@ -2524,6 +2524,11 @@ | |||||
"entities": "^1.1.1" | "entities": "^1.1.1" | ||||
} | } | ||||
}, | }, | ||||
"dom-walk": { | |||||
"version": "0.1.2", | |||||
"resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", | |||||
"integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" | |||||
}, | |||||
"domain-browser": { | "domain-browser": { | ||||
"version": "1.2.0", | "version": "1.2.0", | ||||
"resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", | "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", | ||||
@@ -3432,6 +3437,15 @@ | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"global": { | |||||
"version": "4.4.0", | |||||
"resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", | |||||
"integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", | |||||
"requires": { | |||||
"min-document": "^2.19.0", | |||||
"process": "^0.11.10" | |||||
} | |||||
}, | |||||
"global-modules": { | "global-modules": { | ||||
"version": "2.0.0", | "version": "2.0.0", | ||||
"resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", | "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", | ||||
@@ -4550,6 +4564,14 @@ | |||||
"mime-db": "1.44.0" | "mime-db": "1.44.0" | ||||
} | } | ||||
}, | }, | ||||
"min-document": { | |||||
"version": "2.19.0", | |||||
"resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", | |||||
"integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", | |||||
"requires": { | |||||
"dom-walk": "^0.1.0" | |||||
} | |||||
}, | |||||
"minimalistic-assert": { | "minimalistic-assert": { | ||||
"version": "1.0.1", | "version": "1.0.1", | ||||
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", | "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", | ||||
@@ -5504,8 +5526,7 @@ | |||||
"process": { | "process": { | ||||
"version": "0.11.10", | "version": "0.11.10", | ||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", | "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", | ||||
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", | |||||
"dev": true | |||||
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" | |||||
}, | }, | ||||
"process-nextick-args": { | "process-nextick-args": { | ||||
"version": "2.0.1", | "version": "2.0.1", | ||||
@@ -7665,6 +7686,23 @@ | |||||
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", | "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", | ||||
"integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" | "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" | ||||
}, | }, | ||||
"vue-carousel": { | |||||
"version": "0.18.0", | |||||
"resolved": "https://registry.npmjs.org/vue-carousel/-/vue-carousel-0.18.0.tgz", | |||||
"integrity": "sha512-a2zxh7QJioDxNMguqcuJ7TPbfgK5bGDaAXIia7NWxPAWsEvNE4ZtHgsGu40L5Aha4uyjmNKXvleB14QAXFoKig==", | |||||
"requires": { | |||||
"global": "^4.3.2", | |||||
"regenerator-runtime": "^0.12.1", | |||||
"vue": "^2.5.17" | |||||
}, | |||||
"dependencies": { | |||||
"regenerator-runtime": { | |||||
"version": "0.12.1", | |||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", | |||||
"integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" | |||||
} | |||||
} | |||||
}, | |||||
"vue-click-outside": { | "vue-click-outside": { | ||||
"version": "1.1.0", | "version": "1.1.0", | ||||
"resolved": "https://registry.npmjs.org/vue-click-outside/-/vue-click-outside-1.1.0.tgz", | "resolved": "https://registry.npmjs.org/vue-click-outside/-/vue-click-outside-1.1.0.tgz", | ||||
@@ -33,6 +33,7 @@ export default { | |||||
sendMetrics: true, | sendMetrics: true, | ||||
}, | }, | ||||
payMethods: null, | payMethods: null, | ||||
hasPaymentMethod: false, | |||||
}), | }), | ||||
computed: { | computed: { | ||||
@@ -41,8 +42,16 @@ export default { | |||||
...mapState('system', ['configs', 'messages']), | ...mapState('system', ['configs', 'messages']), | ||||
isPageAvailable() { | isPageAvailable() { | ||||
console.log('current user', this.currentUser); | |||||
return ( | return ( | ||||
!this.currentUser || (this.verifiedContacts || this.currentUser.admin) | |||||
!this.currentUser || | |||||
((this.verifiedContacts || | |||||
this.currentUser.admin || | |||||
this.$route.path === '/verifyEmail' || | |||||
this.$route.path === '/me/action') && | |||||
(!this.configs.paymentsEnabled || | |||||
this.hasPaymentMethod === true || | |||||
this.$route.path === '/payment')) | |||||
); | ); | ||||
}, | }, | ||||
}, | }, | ||||
@@ -162,6 +171,7 @@ export default { | |||||
this.accountPlan.paymentMethodObject.uuid === null && | this.accountPlan.paymentMethodObject.uuid === null && | ||||
payMethods.length > 0 | payMethods.length > 0 | ||||
) { | ) { | ||||
this.hasPaymentMethod = true; | |||||
this.navigateToDashboard(); | this.navigateToDashboard(); | ||||
} else { | } else { | ||||
this.navigateToPaymentPage(); | this.navigateToPaymentPage(); | ||||
@@ -1,6 +1,6 @@ | |||||
<!-- Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ --> | <!-- Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/ --> | ||||
<template> | <template> | ||||
<div class="container-fluid" v-if="isPageAvailable"> | |||||
<div class="container-fluid"> | |||||
<img src="/bubble_bkgrnd.png" alt="" class="background-image" /> | <img src="/bubble_bkgrnd.png" alt="" class="background-image" /> | ||||
<div class="content"> | <div class="content"> | ||||
<Sidebar /> | <Sidebar /> | ||||
@@ -91,47 +91,18 @@ export default { | |||||
data: () => ({ | data: () => ({ | ||||
currentUser: null, | currentUser: null, | ||||
hasPaymentMethod: false, | |||||
}), | }), | ||||
computed: { | computed: { | ||||
...mapState('system', ['configs', 'messages']), | ...mapState('system', ['configs', 'messages']), | ||||
isPageAvailable() { | |||||
return !this.configs.paymentsEnabled || this.hasPaymentMethod; | |||||
}, | |||||
}, | }, | ||||
created() { | created() { | ||||
this.currentUser = util.currentUser(); | this.currentUser = util.currentUser(); | ||||
}, | }, | ||||
mounted() { | |||||
if (this.configs.paymentsEnabled) { | |||||
this.hasPaymentMethod = true; | |||||
} | |||||
if (this.accountPaymentMethods && this.configs.paymentsEnabled) { | |||||
const payMethods = []; | |||||
Array.from(this.accountPaymentMethods).forEach((pm) => { | |||||
if ( | |||||
(typeof pm.promotion === 'undefined' || | |||||
pm.promotion === null || | |||||
!pm.promotion) && | |||||
(typeof pm.deleted === 'undefined' || pm.deleted === null) | |||||
) { | |||||
payMethods.push(pm); | |||||
} | |||||
}); | |||||
mounted() {}, | |||||
if (payMethods.length > 0) { | |||||
this.hasPaymentMethod = true; | |||||
} | |||||
} | |||||
}, | |||||
methods: { | |||||
...mapActions('paymentMethods', ['getAllAccountPaymentMethods']), | |||||
...mapState('paymentMethods', ['accountPaymentMethods']), | |||||
}, | |||||
methods: {}, | |||||
}; | }; | ||||
</script> | </script> |
@@ -102,9 +102,7 @@ export default { | |||||
watch: { | watch: { | ||||
networks(nets) { | networks(nets) { | ||||
if (nets && nets.length) { | if (nets && nets.length) { | ||||
if (nets.length === 0) { | |||||
this.$router.replace({ path: '/new_bubble' }); | |||||
} else if (nets.length === 1 && util.currentUser().admin !== true) { | |||||
if (nets.length === 1 && util.currentUser().admin !== true) { | |||||
this.$router.replace({ path: '/bubble/' + nets[0].name }); | this.$router.replace({ path: '/bubble/' + nets[0].name }); | ||||
} | } | ||||
} | } | ||||
@@ -189,6 +189,15 @@ export const router = new Router({ | |||||
query: { download: r.params.uuid }, | query: { download: r.params.uuid }, | ||||
}), | }), | ||||
}, | }, | ||||
{ path: 'login', component: () => import('~/_pages/auth/Login') }, | |||||
{ | |||||
path: 'forgotPassword', | |||||
component: () => import('~/_pages/auth/ForgotPassword'), | |||||
}, | |||||
{ | |||||
path: 'register', | |||||
component: () => import('~/_pages/auth/Register'), | |||||
}, | |||||
{ path: 'me/action', component: ActionPage }, | { path: 'me/action', component: ActionPage }, | ||||
{ path: 'apps', component: AppsPage }, | { path: 'apps', component: AppsPage }, | ||||
{ path: 'app/:app', component: AppPage }, | { path: 'app/:app', component: AppPage }, | ||||
@@ -219,37 +228,6 @@ export const router = new Router({ | |||||
{ path: 'logout', component: () => import('~/auth/LogoutPage') }, | { path: 'logout', component: () => import('~/auth/LogoutPage') }, | ||||
], | ], | ||||
}, | }, | ||||
{ | |||||
path: '', | |||||
component: () => import('~/_pages/auth/Layout'), | |||||
children: [ | |||||
{ | |||||
path: 'login', | |||||
component: () => import('~/_pages/auth/Login'), | |||||
}, | |||||
{ | |||||
path: 'forgotPassword', | |||||
component: () => import('~/_pages/auth/ForgotPassword'), | |||||
}, | |||||
{ | |||||
path: 'register', | |||||
component: () => import('~/_pages/auth/Register'), | |||||
}, | |||||
{ | |||||
path: 'appLogin', | |||||
component: () => import('~/_pages/auth/AppLogin'), | |||||
}, | |||||
{ | |||||
path: 'verifyEmail', | |||||
component: () => import('~/_pages/auth/VerifyEmail'), | |||||
}, | |||||
{ | |||||
path: 'payment', | |||||
component: () => import('~/_pages/auth/Payment'), | |||||
}, | |||||
{ path: 'logout', component: () => import('~/auth/LogoutPage') }, | |||||
], | |||||
}, | |||||
], | ], | ||||
}, | }, | ||||
@@ -164,11 +164,17 @@ const actions = { | |||||
(error) => commit('restoreFailure', systemConfigs, error) | (error) => commit('restoreFailure', systemConfigs, error) | ||||
); | ); | ||||
}, | }, | ||||
restoreFromPackage({ commit }, { shortKey, backupFileRef, password, systemConfigs, messages, errors }) { | |||||
restoreFromPackage( | |||||
{ commit }, | |||||
{ shortKey, backupFileRef, password, systemConfigs, messages, errors } | |||||
) { | |||||
commit('restoreRequest', systemConfigs); | commit('restoreRequest', systemConfigs); | ||||
userService.restoreFromPackage(shortKey, backupFileRef, password, messages, errors) | |||||
.then(ok => commit('restoreSuccess', systemConfigs), | |||||
error => commit('restoreFailure', systemConfigs, error)); | |||||
userService | |||||
.restoreFromPackage(shortKey, backupFileRef, password, messages, errors) | |||||
.then( | |||||
(ok) => commit('restoreSuccess', systemConfigs), | |||||
(error) => commit('restoreFailure', systemConfigs, error) | |||||
); | |||||
}, | }, | ||||
forgotPassword({ commit }, { username, messages, errors }) { | forgotPassword({ commit }, { username, messages, errors }) { | ||||
commit('forgotPasswordRequest'); | commit('forgotPasswordRequest'); | ||||
@@ -187,7 +193,7 @@ const actions = { | |||||
userService.register(user, messages, errors).then( | userService.register(user, messages, errors).then( | ||||
(user) => { | (user) => { | ||||
commit('registerSuccess', user); | commit('registerSuccess', user); | ||||
router.push('/new_bubble'); | |||||
router.push('/bubble'); | |||||
setTimeout(() => { | setTimeout(() => { | ||||
// display success message after route change completes | // display success message after route change completes | ||||
dispatch('alert/success', messages.alert_registration_success, { | dispatch('alert/success', messages.alert_registration_success, { | ||||
@@ -315,7 +321,11 @@ const mutations = { | |||||
}, | }, | ||||
checkSessionRequest(state) {}, | checkSessionRequest(state) {}, | ||||
checkSessionSuccess(state, user) { | checkSessionSuccess(state, user) { | ||||
console.log('checkSessionSuccess', state.user.preferredPlan, user.preferredPlan); | |||||
console.log( | |||||
'checkSessionSuccess', | |||||
state.user.preferredPlan, | |||||
user.preferredPlan | |||||
); | |||||
if (user.token) { | if (user.token) { | ||||
if (util.currentUser() === null) { | if (util.currentUser() === null) { | ||||
// we must have logged out while this request was in flight... do nothing | // we must have logged out while this request was in flight... do nothing | ||||
@@ -410,15 +420,21 @@ const mutations = { | |||||
}, | }, | ||||
restoreRequest(state, systemConfigs) { | restoreRequest(state, systemConfigs) { | ||||
state.status = Object.assign({}, state.status, { uploadingRestoreRequestData: true }); | |||||
state.status = Object.assign({}, state.status, { | |||||
uploadingRestoreRequestData: true, | |||||
}); | |||||
}, | }, | ||||
restoreSuccess(state, systemConfigs) { | restoreSuccess(state, systemConfigs) { | ||||
state.status = Object.assign({}, state.status, { uploadingRestoreRequestData: false }); | |||||
state.status = Object.assign({}, state.status, { | |||||
uploadingRestoreRequestData: false, | |||||
}); | |||||
systemConfigs.restoreInProgress = true; | systemConfigs.restoreInProgress = true; | ||||
systemConfigs.awaitingRestore = false; | systemConfigs.awaitingRestore = false; | ||||
}, | }, | ||||
restoreFailure(state, systemConfigs, error) { | restoreFailure(state, systemConfigs, error) { | ||||
state.status = Object.assign({}, state.status, { uploadingRestoreRequestData: false }); | |||||
state.status = Object.assign({}, state.status, { | |||||
uploadingRestoreRequestData: false, | |||||
}); | |||||
systemConfigs.restoreInProgress = false; | systemConfigs.restoreInProgress = false; | ||||
console.log('restore failed: ' + JSON.stringify(error)); | console.log('restore failed: ' + JSON.stringify(error)); | ||||
}, | }, | ||||