Skip to content

Commit aa5993c

Browse files
authored
Improve onboarding and pricing UI (#1772)
1 parent d228bbe commit aa5993c

File tree

15 files changed

+169
-142
lines changed

15 files changed

+169
-142
lines changed
169 KB
Loading

frontend/src/modules/integration/components/integration-list-item.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="s panel" :class="computedClass">
33
<div class="flex items-center justify-between">
4-
<img :alt="integration.name" :src="integration.image" class="h-6 mb-4" />
4+
<img :alt="integration.name" :src="integration.image" class="h-6 w-6 mb-4" />
55
<div>
66
<div class="mb-1 flex justify-end">
77
<span v-if="isDone" class="badge badge--green">Connected</span>

frontend/src/modules/onboard/components/onboard-integration-item.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
>
77
<div class="flex gap-16">
88
<div class="flex gap-3 items-start flex-grow">
9-
<img :alt="integration.name" :src="integration.image" class="h-5" />
9+
<img :alt="integration.name" :src="integration.image" class="h-5 w-5" />
1010
<div class="flex flex-col gap-1">
1111
<span class="text-black text-sm font-semibold">{{ integration.name }}</span>
1212
<span class="text-gray-500 text-xs">{{ integration.onboard?.description }}</span>

frontend/src/modules/onboard/components/onboard-sync-data-step.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<template>
22
<div class="relative">
3+
<div class="flex gap-3 mb-6 justify-start bg-gray-100 border border-gray-200 rounded-lg py-2.5 px-3 -mt-4">
4+
<div class="flex items-center justify-center h-5">
5+
<i class="ri-information-line text-gray-600 text-base" />
6+
</div>
7+
<div class="text-gray-600 text-xs">
8+
Sync your community data to get the most out of crowd.dev. Connect at least 1 integration in order to create your workspace.
9+
</div>
10+
</div>
311
<div
412
v-if="loading"
513
class="flex items-center justify-center"
@@ -55,8 +63,16 @@ import {
5563
5664
import { CrowdIntegrations } from '@/integrations/integrations-config';
5765
import AppOnboardIntegrationItem from '@/modules/onboard/components/onboard-integration-item.vue';
66+
import { minValue } from '@vuelidate/validators';
67+
import useVuelidate from '@vuelidate/core';
5868
5969
const emit = defineEmits(['allowRedirect', 'inviteColleagues']);
70+
const props = defineProps({
71+
modelValue: {
72+
type: Object,
73+
default: () => {},
74+
},
75+
});
6076
6177
const store = useStore();
6278
@@ -69,6 +85,12 @@ const highlightedIntegrationsArray = computed(() => CrowdIntegrations.mappedConf
6985
.filter((i) => i.onboard?.highlight && !!i.onboard));
7086
const showGithubDialog = ref(false);
7187
88+
useVuelidate({
89+
activeIntegrations: {
90+
minValue: minValue(1),
91+
},
92+
}, props.modelValue);
93+
7294
onMounted(async () => {
7395
const params = new URLSearchParams(window.location.search);
7496
// GitHub redirects back here. This might have to be changed.

frontend/src/modules/onboard/config/steps/invite-colleagues.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { RoleEnum } from '@/modules/user/types/Roles';
99
const inviteColleagues: OnboardStepConfig = {
1010
name: 'Invite colleagues',
1111
component: AppOnboardInviteColleaguesStep,
12-
hasValidation: true,
13-
cta: () => 'Finish setup',
12+
cta: 'Finish setup',
1413
textColor: (currentStep: number) => ({
1514
'text-gray-400': currentStep < 3,
1615
'text-brand-400': currentStep > 3,
@@ -71,14 +70,6 @@ const inviteColleagues: OnboardStepConfig = {
7170

7271
return store.dispatch('auth/doRefreshCurrentUser');
7372
})
74-
// Populate tenant with sample data if user hasn't connected any integrations
75-
.then(() => {
76-
if (activeIntegrations.length) {
77-
return Promise.resolve();
78-
}
79-
80-
return TenantService.populateSampleData(currentTenant.id);
81-
})
8273
// Redirect to Book a demo page
8374
.then(() => {
8475
router.push('/onboard/demo');

frontend/src/modules/onboard/config/steps/sync-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { OnboardStepConfig } from '@/modules/onboard/types/OnboardStepsConfig';
44
const syncData: OnboardStepConfig = {
55
name: 'Sync data',
66
component: AppOnboardSyncDataStep,
7-
hasValidation: false,
8-
cta: (touched: boolean) => (touched ? 'Continue' : 'I will set this up later'),
7+
cta: 'Continue',
8+
ctaTooltip: 'Connect at least 1 integration to proceed',
99
textColor: (currentStep: number) => ({
1010
'text-gray-400': currentStep < 2,
1111
'text-brand-400': currentStep > 2,

frontend/src/modules/onboard/config/steps/workspace-details.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import Errors from '@/shared/error/errors';
77
const workspaceDetails: OnboardStepConfig = {
88
name: 'Workspace details',
99
component: AppOnboardWorkspaceDetailsStep,
10-
hasValidation: true,
11-
cta: () => 'Continue',
10+
cta: 'Continue',
1211
textColor: (currentStep: number) => ({
1312
'text-gray-400': currentStep < 1,
1413
'text-brand-400': currentStep > 1,

frontend/src/modules/onboard/pages/onboard-book-a-demo-page.vue

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,54 +30,15 @@
3030
</template>
3131

3232
<script setup lang="ts">
33-
/* eslint-disable */
3433
import { onMounted } from 'vue';
3534
import { useRouter } from 'vue-router';
35+
import { renderCal } from '@/utils/cals';
3636
3737
const router = useRouter();
3838
3939
onMounted(() => {
40-
(function (C, A, L) {
41-
const p = function (a, ar) {
42-
a.q.push(ar);
43-
};
44-
const d = C.document;
45-
C.Cal = C.Cal
46-
|| function () {
47-
const cal = C.Cal;
48-
const ar = arguments;
49-
if (!cal.loaded) {
50-
cal.ns = {};
51-
cal.q = cal.q || [];
52-
d.head.appendChild(d.createElement('script')).src = A;
53-
cal.loaded = true;
54-
}
55-
if (ar[0] === L) {
56-
const api = function () {
57-
p(api, arguments);
58-
};
59-
const namespace = ar[1];
60-
api.q = api.q || [];
61-
typeof namespace === 'string'
62-
? (cal.ns[namespace] = api) && p(api, ar)
63-
: p(cal, ar);
64-
return;
65-
}
66-
p(cal, ar);
67-
};
68-
}(window, 'https://app.cal.com/embed/embed.js', 'init'));
69-
Cal('init', { origin: 'https://cal.com' });
70-
71-
Cal('inline', {
72-
elementOrSelector: '#embbeded-script',
40+
renderCal({
7341
calLink: 'team/crowddotdev/get-personalised-onboarding',
74-
layout: 'month_view',
75-
});
76-
77-
Cal('ui', {
78-
styles: { branding: { brandColor: '#E94F2E' } },
79-
hideEventTypeDetails: false,
80-
layout: 'month_view',
8142
});
8243
});
8344

frontend/src/modules/onboard/pages/onboard-page.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h3
1111
class="text-lg font-semibold leading-8"
1212
>
13-
Howdie<span v-if="currentUser">, {{ currentUser.fullName }}</span>
13+
Howdie<span v-if="currentUser?.fullName">, {{ currentUser.fullName }}</span>
1414
</h3>
1515
<p class="text-sm text-gray-600 leading-5">
1616
Let's setup your workspace.
@@ -20,7 +20,7 @@
2020
</div>
2121

2222
<div class="flex justify-center py-8 border-b border-gray-200 sticky top-0 bg-gray-50 z-10">
23-
<div class="flex justify-between items-center limit-width">
23+
<div class="flex gap-10 items-center limit-width">
2424
<div
2525
v-for="(step, index) in Object.values(onboardingSteps)"
2626
:key="step.name"
@@ -46,12 +46,7 @@
4646
<main class="limit-width">
4747
<component
4848
:is="stepConfig.component"
49-
v-if="stepConfig.hasValidation"
5049
v-model="form"
51-
/>
52-
<component
53-
:is="stepConfig.component"
54-
v-else
5550
@allow-redirect="onConnect"
5651
@invite-colleagues="onInviteColleagues"
5752
/>
@@ -60,14 +55,22 @@
6055

6156
<div class="fixed bottom-0 w-full bg-white flex justify-center py-4 px-8 border-t border-gray-200">
6257
<div class="limit-width">
63-
<el-button
64-
class="btn btn--primary btn--md btn--full"
65-
:disabled="$v.$invalid || loadingSubmitAction"
66-
@click="onBtnClick"
58+
<el-tooltip
59+
placement="top"
60+
:disabled="!stepConfig.ctaTooltip || !$v.$invalid"
61+
:content="stepConfig.ctaTooltip"
6762
>
68-
<span class="text-base">{{ stepConfig.cta(!!activeIntegrations?.length) }}</span>
69-
<i class="ri-arrow-right-line text-white text-lg ml-3" />
70-
</el-button>
63+
<div>
64+
<el-button
65+
class="btn btn--primary btn--lg btn--full"
66+
:disabled="$v.$invalid || loadingSubmitAction"
67+
@click="onBtnClick"
68+
>
69+
<span class="text-base">{{ stepConfig.cta }}</span>
70+
<i class="ri-arrow-right-line text-white text-lg ml-3" />
71+
</el-button>
72+
</div>
73+
</el-tooltip>
7174
</div>
7275
</div>
7376
</template>
@@ -95,6 +98,7 @@ const allowRedirect = ref(false);
9598
const currentStep = ref(1);
9699
const form = reactive({
97100
tenantName: currentTenant.value?.name,
101+
activeIntegrations: 0,
98102
invitedUsers: [{
99103
emails: [],
100104
roles: ['admin'],
@@ -149,6 +153,8 @@ watch(currentTenant, (tenant, oldTenant) => {
149153
150154
// If currentTenant and activeIntegrations, set second step as the active one
151155
watch(activeIntegrations, (integrations) => {
156+
form.activeIntegrations = integrations.length;
157+
152158
if (integrations.length && currentStep.value < 2) {
153159
currentStep.value = 2;
154160
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
export interface OnboardStepConfig {
22
name: string;
33
component: any;
4-
hasValidation: boolean;
54
textColor: (currentStep: number) => {
65
[key: string]: boolean
76
}
87
bgColor: (currentStep: number) => {
98
[key: string]: boolean
109
}
11-
cta: (touch?: boolean) => string;
10+
cta: string;
11+
ctaTooltip?: string;
1212
submitAction: (payload: any, activeIntegrations?: any[]) => Promise
1313
alert: () => string;
1414
}

0 commit comments

Comments
 (0)