Browse Source

simplify setup for open source launchers

pull/73/head
Jonathan Cobb 3 years ago
parent
commit
0224c40d49
5 changed files with 29 additions and 19 deletions
  1. +9
    -7
      src/_pages/Layout.vue
  2. +10
    -9
      src/_pages/auth/Register.vue
  3. +1
    -1
      src/_pages/auth/VerifyEmail.vue
  4. +8
    -2
      src/_store/account.module.js
  5. +1
    -0
      src/_store/system.module.js

+ 9
- 7
src/_pages/Layout.vue View File

@@ -139,7 +139,7 @@ export default {
this.verifiedContacts = this.hasVerifiedContact(p); this.verifiedContacts = this.hasVerifiedContact(p);
const currentUser = util.currentUser(); const currentUser = util.currentUser();
if (!currentUser) return; if (!currentUser) return;
if (!this.verifiedContacts && !currentUser.admin) {
if (!this.verifiedContacts && !currentUser.admin && !this.configs.localNetwork) {
this.navigateToVerifyEmail(); this.navigateToVerifyEmail();
if (this.verifiedContactRefresher === null) { if (this.verifiedContactRefresher === null) {
const vue = this; const vue = this;
@@ -153,12 +153,14 @@ export default {
}, 5000); }, 5000);
} }
} else { } else {
const currentUser = util.currentUser();
this.getAllAccountPaymentMethods({
userId: currentUser.uuid,
messages: this.messages,
errors: this.errors,
});
if (this.configs.paymentsEnabled && !this.configs.localNetwork) {
const currentUser = util.currentUser();
this.getAllAccountPaymentMethods({
userId: currentUser.uuid,
messages: this.messages,
errors: this.errors,
});
}
if (this.verifiedContactRefresher !== null) { if (this.verifiedContactRefresher !== null) {
window.clearInterval(this.verifiedContactRefresher); window.clearInterval(this.verifiedContactRefresher);
this.verifiedContactRefresher = null; this.verifiedContactRefresher = null;


+ 10
- 9
src/_pages/auth/Register.vue View File

@@ -68,7 +68,7 @@
{{ confirmPasswordErrors.join(', ') }} {{ confirmPasswordErrors.join(', ') }}
</span> </span>
</div> </div>
<div class="form-group">
<div class="form-group" v-show="configs.promoCodePolicy !== 'disabled'">
<Input <Input
class="form-control" class="form-control"
v-model="promoCode" v-model="promoCode"
@@ -87,7 +87,7 @@
{{ errors.first('promoCode') }} {{ errors.first('promoCode') }}
</div> </div>
</div> </div>
<a :href="messages.message_request_promoCode_link" target="_blank">
<a :href="messages.message_request_promoCode_link" target="_blank" v-if="configs.promoCodePolicy !== 'disabled'">
{{ messages.message_request_promoCode }} {{ messages.message_request_promoCode }}
</a> </a>


@@ -132,15 +132,15 @@
</div> </div>
</div> </div>


<div class="form-separator"></div>
<div class="form-separator" v-if="!configs.localNetwork"></div>


<div class="form-group my-3">
<div class="form-group my-3" v-if="!configs.localNetwork">
<Checkbox <Checkbox
v-model="receiveInformationalMessages" v-model="receiveInformationalMessages"
:label="messages.field_label_sendInformation" :label="messages.field_label_sendInformation"
/> />
</div> </div>
<div class="form-group my-3">
<div class="form-group my-3" v-if="!configs.localNetwork">
<Checkbox <Checkbox
v-model="receivePromotionalMessages" v-model="receivePromotionalMessages"
:label="messages.field_label_sendNews" :label="messages.field_label_sendNews"
@@ -188,7 +188,6 @@ export default {
Button, Button,
Input, Input,
Checkbox, Checkbox,

Features, Features,
}, },


@@ -199,9 +198,6 @@ export default {
confirmPassword: { confirmPassword: {
sameAsPassword: sameAs('password'), sameAsPassword: sameAs('password'),
}, },
promoCode: {
required,
},
agreeToTerms: { agreeToTerms: {
required, required,
}, },
@@ -264,6 +260,9 @@ export default {


promoCodeErrors() { promoCodeErrors() {
const errors = []; const errors = [];
if (typeof this.$v.promoCode === 'undefined') {
return errors;
}
if (!this.$v.promoCode.$dirty) return errors; if (!this.$v.promoCode.$dirty) return errors;
!this.$v.promoCode.required && !this.$v.promoCode.required &&
errors.push(this.messages['err_promoCode_required']); errors.push(this.messages['err_promoCode_required']);
@@ -317,6 +316,8 @@ export default {
promoCode: this.promoCode, promoCode: this.promoCode,
preferredPlan: this.preferredPlan, preferredPlan: this.preferredPlan,
}, },
local: this.configs.localNetwork,
payment: this.configs.paymentsEnabled,
messages: this.messages, messages: this.messages,
errors: this.errors, errors: this.errors,
}); });


+ 1
- 1
src/_pages/auth/VerifyEmail.vue View File

@@ -76,7 +76,7 @@ export default {
}, },


computed: { computed: {
...mapState('system', ['messages']),
...mapState('system', ['messages', 'configs']),
...mapState('users', ['policy']), ...mapState('users', ['policy']),
}, },




+ 8
- 2
src/_store/account.module.js View File

@@ -188,12 +188,18 @@ const actions = {
} }
); );
}, },
register({ dispatch, commit }, { user, messages, errors }) {
register({ dispatch, commit }, { user, local, payment, messages, errors }) {
commit('registerRequest', user); commit('registerRequest', user);
userService.register(user, messages, errors).then( userService.register(user, messages, errors).then(
(user) => { (user) => {
commit('registerSuccess', user); commit('registerSuccess', user);
router.push('/verifyEmail');
if (!local) {
router.push('/verifyEmail');
} else if (payment) {
router.push('/payment');
} else {
router.push('/');
}
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, {


+ 1
- 0
src/_store/system.module.js View File

@@ -16,6 +16,7 @@ const state = {
networkUuid: null, networkUuid: null,
allowRegistration: false, allowRegistration: false,
paymentsEnabled: false, paymentsEnabled: false,
localNetwork: false,
sageLauncher: false, sageLauncher: false,
bubbleNode: null, bubbleNode: null,
entityClasses: [], entityClasses: [],


Loading…
Cancel
Save