Browse Source

fix/missing-functionalities (#67)

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: unnecessary api calls and add missing functionalities on profile page

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: login

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: login and sign up stuff

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: page reloading stuff

fix: login stuff

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: sign up and payment check stuff

fix: launch bubble screen

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

fix: refreshing issue

feat: implement devices screen

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

feat: implement new layout

Merge branch 'master' of git.bubblev.org:bubblev/bubble-web into fix/missing-functionalities

feat: implement new layout

fix: header

fix: showing error on add ssh modal

fix: login by enter key

Co-authored-by: Tyler <everdev0923@gmail.com>
Reviewed-on: https://git.bubblev.org/bubblev/bubble-web/pulls/67
pull/68/head
Tyler Chen 4 years ago
committed by jonathan
parent
commit
c0fc1fee1e
5 changed files with 137 additions and 7 deletions
  1. +8
    -1
      src/_pages/Layout.vue
  2. +8
    -1
      src/_pages/auth/Payment.vue
  3. +68
    -3
      src/_pages/main/account/Policy.vue
  4. +52
    -1
      src/_pages/main/bubble/Network.vue
  5. +1
    -1
      src/_router/index.js

+ 8
- 1
src/_pages/Layout.vue View File

@@ -66,7 +66,11 @@ export default {
this.currentUser.locale !== null this.currentUser.locale !== null
? this.currentUser.locale ? this.currentUser.locale
: 'detect'; : 'detect';
if (this.currentUser && !this.currentUser.admin) {
if (
this.currentUser &&
!this.currentUser.admin &&
!this.verifiedContacts
) {
this.getPolicyByUserId({ this.getPolicyByUserId({
userId: this.currentUser.uuid, userId: this.currentUser.uuid,
messages: this.messages, messages: this.messages,
@@ -76,6 +80,7 @@ export default {


this.isPageAvailable = this.isPageAvailable =
!this.currentUser || !this.currentUser ||
this.$route.path === '/login' ||
this.$route.path === '/me/action' || this.$route.path === '/me/action' ||
this.$route.path === '/logout' || this.$route.path === '/logout' ||
this.$route.path === '/verifyEmail' || this.$route.path === '/verifyEmail' ||
@@ -106,6 +111,8 @@ export default {
navigateToPaymentPage() { navigateToPaymentPage() {
if (this.$route.path !== '/payment') { if (this.$route.path !== '/payment') {
this.$router.push('/payment'); this.$router.push('/payment');
} else {
this.initDefaults();
} }
}, },




+ 8
- 1
src/_pages/auth/Payment.vue View File

@@ -277,7 +277,14 @@ export default {
priceMinorUnits: this.plans[i].price % 100, priceMinorUnits: this.plans[i].price % 100,
}); });
} }
this.bubblePlan = this.plans[0].name;
const matchingPlan = this.plans.find(
(plan) => plan.uuid === this.user.preferredPlan
);
if (matchingPlan) {
this.bubblePlan = matchingPlan.name;
} else {
this.bubblePlan = this.plans[0].name;
}
} }
return plans_array; return plans_array;
}, },


+ 68
- 3
src/_pages/main/account/Policy.vue View File

@@ -938,9 +938,7 @@
<Checkbox <Checkbox
id="receiveLoginNotifications" id="receiveLoginNotifications"
v-model="newContact.receiveLoginNotifications" v-model="newContact.receiveLoginNotifications"
:label="
messages.field_label_policy_contact_receiveLoginNotifications
"
:label="messages.field_label_policy_contact_receiveLoginNotifications"
/> />
</div> </div>
<div <div
@@ -1008,6 +1006,52 @@
<img v-show="loading()" :src="loadingImgSrc" /> <img v-show="loading()" :src="loadingImgSrc" />
</div> </div>
</form> </form>

<hr />
<form
@submit.prevent="updateProfile"
v-if="configs.showBlockStatsSupported || currentUser.admin === true"
>
<div v-if="configs.showBlockStatsSupported" class="form-group">
<Checkbox
id="showBlockStats"
v-model="profile.showBlockStats"
:label="messages.field_label_show_block_stats"
/>
<div
v-if="submitted && errors.has('showBlockStats')"
class="invalid-feedback d-block"
>
{{ errors.first('showBlockStats') }}
</div>
</div>
<!-- sync password -->
<div v-if="currentUser.admin === true" class="form-group">
<Checkbox
id="sync"
v-model="profile.sync"
:label="messages.field_label_sync_account"
/>
<div
v-if="submitted && errors.has('sync')"
class="invalid-feedback d-block"
>
{{ errors.first('sync') }}
</div>
<p>{{ messages.field_label_sync_account_description }}</p>
</div>
<div class="form-group">
<Button
color="default"
type="submit"
class="btn btn-primary"
:disabled="loading()"
>
{{ messages.button_label_update_policy }}
</Button>
<img v-show="loading()" :src="loadingImgSrc" />
</div>
</form>
</div> </div>
</template> </template>


@@ -1082,11 +1126,18 @@ export default {
watchedPolicy: null, watchedPolicy: null,
showDownloadMessages: false, showDownloadMessages: false,
loadingImgSrc: loadingImgSrc, loadingImgSrc: loadingImgSrc,

profile: {
email: null,
sync: null,
showBlockStats: null,
},
}; };
}, },
computed: { computed: {
...mapState('account', ['actionStatus', 'status']), ...mapState('account', ['actionStatus', 'status']),
...mapState('system', [ ...mapState('system', [
'configs',
'messages', 'messages',
'accountDeletionOptions', 'accountDeletionOptions',
'timeDurationOptions', 'timeDurationOptions',
@@ -1140,6 +1191,7 @@ export default {
]), ]),
...mapActions('users', [ ...mapActions('users', [
'getUserById', 'getUserById',
'updateUser',
'getPolicyByUserId', 'getPolicyByUserId',
'updatePolicyByUserId', 'updatePolicyByUserId',
'addPolicyContactByUserId', 'addPolicyContactByUserId',
@@ -1176,6 +1228,15 @@ export default {
errors: this.errors, errors: this.errors,
}); });
}, },
updateProfile() {
this.errors.clear();
this.submitted = true;
this.updateUser({
user: this.profile,
messages: this.messages,
errors: this.errors,
});
},
addContact(e) { addContact(e) {
const contactToAdd = Object.assign({}, this.newContact); const contactToAdd = Object.assign({}, this.newContact);
if (contactToAdd.type === 'sms') { if (contactToAdd.type === 'sms') {
@@ -1456,6 +1517,10 @@ export default {
errors: this.errors, errors: this.errors,
}); });
} }

this.profile.email = this.currentUser.email;
this.profile.showBlockStats = this.currentUser.showBlockStats;
this.profile.sync = this.currentUser.sync;
}, },
}; };
</script> </script>

+ 52
- 1
src/_pages/main/bubble/Network.vue View File

@@ -336,6 +336,35 @@
</div> </div>
</div> </div>


<form @submit.prevent="updateProfile">
<h3>{{ messages.field_label_auto_update_policy }}</h3>

<Checkbox
v-if="user.admin"
class="mb-3"
id="autoUpdatePolicy.jarUpdates"
v-model="autoUpdatePolicy.jarUpdates"
:label="messages.field_label_auto_update_jar"
/>
<Checkbox
id="autoUpdatePolicy.appUpdates"
class="mb-3"
v-model="autoUpdatePolicy.appUpdates"
:label="messages.field_label_auto_update_apps"
/>
<div class="form-group">
<Button
color="default"
type="submit"
class="btn btn-primary"
:disabled="loadingUser()"
>
{{ messages.button_label_update_policy }}
</Button>
<img v-show="loadingUser()" :src="loadingImgSrc" />
</div>
</form>

<div v-if="configs.sageLauncher"> <div v-if="configs.sageLauncher">
<div class="text-danger"> <div class="text-danger">
<h4>{{ messages.title_network_danger_zone }}</h4> <h4>{{ messages.title_network_danger_zone }}</h4>
@@ -408,12 +437,13 @@ import { mapState, mapActions, mapGetters } from 'vuex';
import { util } from '~/_helpers'; import { util } from '~/_helpers';
import { loadingImgSrc } from '~/_store'; import { loadingImgSrc } from '~/_store';


import { Button, Input } from '~/_components/shared';
import { Button, Input, Checkbox } from '~/_components/shared';


export default { export default {
components: { components: {
Button, Button,
Input, Input,
Checkbox,
}, },
data() { data() {
return { return {
@@ -431,6 +461,10 @@ export default {
upgradeRefresher: null, upgradeRefresher: null,
logsExpirationDays: null, logsExpirationDays: null,
backupDownloadRefresher: null, backupDownloadRefresher: null,
autoUpdatePolicy: {
jarUpdates: true,
appUpdates: true,
},


lottie: null, lottie: null,
timerID: null, timerID: null,
@@ -588,6 +622,9 @@ export default {
'checkForUpgrade', 'checkForUpgrade',
'upgrade', 'upgrade',
]), ]),
...mapActions('users', ['updateUser']),
...mapGetters('users', { loadingUser: 'loading' }),

refreshStatus(userId) { refreshStatus(userId) {
if (!this.lottie && this.$refs.lottie) { if (!this.lottie && this.$refs.lottie) {
this.lottie = Lottie.loadAnimation({ this.lottie = Lottie.loadAnimation({
@@ -785,6 +822,18 @@ export default {
doUpgrade() { doUpgrade() {
this.upgrade(); this.upgrade();
}, },
updateProfile() {
this.errors.clear();
this.submitted = true;
this.updateUser({
user: {
email: this.user.email,
autoUpdatePolicy: this.autoUpdatePolicy,
},
messages: this.messages,
errors: this.errors,
});
},
}, },


created() { created() {
@@ -794,6 +843,8 @@ export default {
this.restoreKeyCode = this.$route.query.keys_code; this.restoreKeyCode = this.$route.query.keys_code;
this.getAppLinks(user.locale); this.getAppLinks(user.locale);
this.loadSystemConfigs(); this.loadSystemConfigs();

this.autoUpdatePolicy = user.autoUpdatePolicy;
}, },


beforeDestroy() { beforeDestroy() {


+ 1
- 1
src/_router/index.js View File

@@ -56,7 +56,7 @@ export const router = new Router({
// { path: '/legal', component: LegalPage }, // { path: '/legal', component: LegalPage },
// { path: '/support', component: SupportPage }, // { path: '/support', component: SupportPage },


// { path: '/me/old', component: ProfilePage },
{ path: '/me/old', component: ProfilePage },
// { path: '/me/policy', component: PolicyPage }, // { path: '/me/policy', component: PolicyPage },
// { path: '/me/changePassword/old', component: ChangePasswordPage }, // { path: '/me/changePassword/old', component: ChangePasswordPage },
// { path: '/me/setPassword/:code', component: SetPasswordPage }, // { path: '/me/setPassword/:code', component: SetPasswordPage },


Loading…
Cancel
Save