web/satellite: onboarding tour adapted to multiple project state

Change-Id: I853772bf2a05c3fe9ef8dea0d1e290e6074fbfec
This commit is contained in:
VitaliiShpital 2020-05-15 15:38:00 +03:00 committed by Vitalii Shpital
parent f0619c6db7
commit 45ccf59067
6 changed files with 5 additions and 29 deletions

View File

@ -104,12 +104,6 @@ export default class BillingArea extends Vue {
* Fetches billing history and project limits.
*/
public async beforeMount(): Promise<void> {
if (this.noProjectOrApiKeys) {
await this.$router.push(RouteConfig.OnboardingTour.path);
return;
}
try {
await this.$store.dispatch(PAYMENTS_ACTIONS.GET_BILLING_HISTORY);
if (this.$store.getters.canUserCreateFirstProject && !this.userHasOwnProject) {
@ -307,13 +301,6 @@ export default class BillingArea extends Vue {
}
}
/**
* Indicates if user has no project nor api keys.
*/
private get noProjectOrApiKeys(): boolean {
return !this.$store.getters.selectedProject.id || this.$store.state.apiKeysModule.page.apiKeys.length === 0;
}
/**
* Changes buttons styling depends on selected status.
* @param event holds click event

View File

@ -76,10 +76,6 @@ export default class AddCardForm extends Vue {
this.$emit('toggleIsLoading');
this.$emit('toggleIsLoaded');
if (!this.userHasOwnProject) {
await this.$store.dispatch(APP_STATE_ACTIONS.SHOW_CREATE_PROJECT_BUTTON);
}
setTimeout(() => {
this.$emit('cancel');
this.$emit('toggleIsLoaded');
@ -87,6 +83,7 @@ export default class AddCardForm extends Vue {
setTimeout(() => {
if (!this.userHasOwnProject) {
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_NEW_PROJ);
this.$store.dispatch(APP_STATE_ACTIONS.SHOW_CREATE_PROJECT_BUTTON);
}
}, 500);
}, 2000);

View File

@ -388,6 +388,7 @@ export default class PaymentMethods extends Vue {
border-radius: 0 0 8px 8px;
&__info {
margin-left: 5px;
font-size: 15px;
line-height: 18px;
color: #34bf89;

View File

@ -4,7 +4,7 @@
<template>
<div class="new-project-container">
<div
v-if="isButtonShown"
v-if="isButtonShown && !isOnboardingTour"
class="new-project-button-container"
@click="toggleSelection"
id="newProjectButton"
@ -47,16 +47,6 @@ export default class NewProjectArea extends Vue {
this.$store.dispatch(APP_STATE_ACTIONS.SHOW_CREATE_PROJECT_BUTTON);
}
/**
* Life cycle hook after initial render.
* Hides new project button visibility if user is on onboarding tour.
*/
public mounted(): void {
if (this.isOnboardingTour) {
this.$store.dispatch(APP_STATE_ACTIONS.HIDE_CREATE_PROJECT_BUTTON);
}
}
/**
* Opens new project creation popup.
*/

View File

@ -174,6 +174,7 @@ export default class DashboardArea extends Vue {
return;
}
await this.$store.dispatch(PM_ACTIONS.SET_SEARCH_QUERY, '');
try {
await this.$store.dispatch(PM_ACTIONS.FETCH, 1);
} catch (error) {

View File

@ -110,7 +110,7 @@ export default class Login extends Vue {
await this.$store.dispatch(APP_STATE_ACTIONS.CHANGE_STATE, AppState.LOADING);
this.isLoading = false;
await this.$router.push(RouteConfig.Account.with(RouteConfig.Billing).path);
await this.$router.push(RouteConfig.ProjectDashboard.path);
}
private validateFields(): boolean {