@@ -105,14 +113,27 @@ import jobProgress from '@baserow/modules/core/mixins/jobProgress'
export default {
components: { Toasts, CircleProgressBar },
mixins: [error, jobProgress],
- middleware: ['settings', 'authenticated'],
- asyncData({ store, redirect }) {
- // If the user has completed the onboarding, then redirect to the on-boarding page
- // so that the user can create their first one.
- const user = store.getters['auth/getUserObject']
- if (user.completed_onboarding) {
- return redirect({ name: 'dashboard' })
- }
+ setup() {
+ const { t } = useI18n()
+ useHead({
+ title: t('onboarding.title'),
+ })
+
+ definePageMeta({
+ middleware: [
+ 'settings',
+ 'authenticated',
+ () => {
+ const { $store } = useNuxtApp()
+ // If the user has completed the onboarding, then redirect to the dashboard
+ // page so that the user can create their first one.
+ const user = $store.getters['auth/getUserObject']
+ if (user.completed_onboarding) {
+ return navigateTo({ name: 'dashboard' })
+ }
+ },
+ ],
+ })
},
data() {
return {
@@ -122,11 +143,8 @@ export default {
creatingFailed: false,
cancelling: false,
reloading: false,
- }
- },
- head() {
- return {
- title: this.$t('onboarding.title'),
+ message: null,
+ component: null,
}
},
computed: {
@@ -186,16 +204,29 @@ export default {
const responses = {}
let route = { name: 'dashboard' }
+ const completeCallback = (message = null, component = null) => {
+ this.message = message
+ this.component = component
+ }
+
// Now that all the steps have been completed, we're looping over all of them and
// execute the `complete` method to actually create the configured workspace.
for (let i = 0; i < this.steps.length; i++) {
const step = this.steps[i]
try {
- responses[step.getType()] = await step.complete(this.data, responses)
+ responses[step.getType()] = await step.complete(
+ this.data,
+ responses,
+ completeCallback
+ )
} catch (error) {
+ console.error(error)
// Stop the creating process if any of the steps fail.
this.creatingFailed = true
return
+ } finally {
+ this.message = null
+ this.component = null
}
// Check if there is a job that must be polled after completion. If so, it will
// show a progressbar to the user, and it will set the job end result as
@@ -208,6 +239,7 @@ export default {
this.job = null
} catch (error) {
this.creatingFailed = true
+ console.error(error)
return
}
}
diff --git a/web-frontend/modules/core/plugin.js b/web-frontend/modules/core/plugin.js
index 9e751a26e5..2412de4509 100644
--- a/web-frontend/modules/core/plugin.js
+++ b/web-frontend/modules/core/plugin.js
@@ -60,12 +60,7 @@ import {
WorkspaceInvitationRejectedNotificationType,
BaserowVersionUpgradeNotificationType,
} from '@baserow/modules/core/notificationTypes'
-import {
- TeamOnboardingType,
- MoreOnboardingType,
- WorkspaceOnboardingType,
- InviteOnboardingType,
-} from '@baserow/modules/core/onboardingTypes'
+import { MoreOnboardingType } from '@baserow/modules/core/onboardingTypes'
import { SidebarGuidedTourType } from '@baserow/modules/core/guidedTourTypes'
import { TOTPAuthType } from '@baserow/modules/core/twoFactorAuthTypes'
@@ -363,10 +358,7 @@ export default defineNuxtPlugin({
registry.register('twoFactorAuth', new TOTPAuthType(context))
- registry.register('onboarding', new TeamOnboardingType(context))
registry.register('onboarding', new MoreOnboardingType(context))
- registry.register('onboarding', new WorkspaceOnboardingType(context))
- registry.register('onboarding', new InviteOnboardingType(context))
registry.register('guidedTour', new SidebarGuidedTourType(context))
},
diff --git a/web-frontend/modules/core/services/auth.js b/web-frontend/modules/core/services/auth.js
index 520c812f2c..b2237d3c03 100644
--- a/web-frontend/modules/core/services/auth.js
+++ b/web-frontend/modules/core/services/auth.js
@@ -91,12 +91,13 @@ export default (client) => {
deleteAccount() {
return client.post('/user/schedule-account-deletion/')
},
- shareOnboardingDetailsWithBaserow(team, role, size, country) {
+ shareOnboardingDetailsWithBaserow(team, role, size, country, how) {
return client.post('/user/share-onboarding-details-with-baserow/', {
team,
role,
size,
country,
+ how,
})
},
}
diff --git a/web-frontend/modules/database/components/onboarding/DatabaseAppLayoutPreview.vue b/web-frontend/modules/database/components/onboarding/DatabaseAppLayoutPreview.vue
index 9e3c455389..8ff16f3d16 100644
--- a/web-frontend/modules/database/components/onboarding/DatabaseAppLayoutPreview.vue
+++ b/web-frontend/modules/database/components/onboarding/DatabaseAppLayoutPreview.vue
@@ -1,18 +1,84 @@
+
+
+
+
diff --git a/web-frontend/modules/database/components/onboarding/DatabaseImportStep.vue b/web-frontend/modules/database/components/onboarding/DatabaseImportStep.vue
index 363d0b027c..098b03d598 100644
--- a/web-frontend/modules/database/components/onboarding/DatabaseImportStep.vue
+++ b/web-frontend/modules/database/components/onboarding/DatabaseImportStep.vue
@@ -16,7 +16,6 @@
size="large"
:error="v$.tableName.$error"
@input="updateValue"
- @blur="v$.tableName.$touch"
/>
@@ -75,10 +74,12 @@ export default {
return { v$: useVuelidate({ $lazy: true }) }
},
data() {
+ const { t } = useI18n()
+ const name = this.$store.getters['auth/getName']
const importers = Object.values(this.$registry.getAll('importer'))
return {
importer: importers[0].getType(),
- tableName: '',
+ tableName: t('databaseImportStep.tableNamePrefill', { name }),
header: [],
previewData: [],
getData: null,
@@ -117,6 +118,7 @@ export default {
},
mounted() {
this.updateValue()
+ this.v$.tableName.$touch()
},
methods: {
isValid() {
@@ -128,10 +130,12 @@ export default {
)
},
updateValue() {
- const tableName = this.tableName
- const getData = this.getData
- const header = this.header
- this.$emit('update-data', { tableName, getData, header })
+ this.$nextTick(() => {
+ const tableName = this.tableName
+ const getData = this.getData
+ const header = this.header
+ this.$emit('update-data', { tableName, getData, header })
+ })
},
onData({ header, previewData }) {
this.header = header
diff --git a/web-frontend/modules/database/components/onboarding/DatabaseScratchTrackStep.vue b/web-frontend/modules/database/components/onboarding/DatabaseScratchTrackStep.vue
index e7fef53a6b..a75f0daa2e 100644
--- a/web-frontend/modules/database/components/onboarding/DatabaseScratchTrackStep.vue
+++ b/web-frontend/modules/database/components/onboarding/DatabaseScratchTrackStep.vue
@@ -65,6 +65,7 @@