Skip to content

Commit b045a9e

Browse files
author
Tim Roes
authored
Add use-case links to onboarding (#10657)
* Add use-case links to onboarding * Add new onboarding links
1 parent df23699 commit b045a9e

File tree

5 files changed

+63
-32
lines changed

5 files changed

+63
-32
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[
2-
"replicateMySQL",
3-
"consolidateMarketing",
4-
"consolidatePayment",
5-
"buildDashboard",
6-
"zoomCalls"
7-
]
1+
{
2+
"singleCustomerView": "https://airbyte.com/recipes/single-customer-view",
3+
"buildDashboard": "https://airbyte.com/recipes/build-a-github-activity-dashboard-for-your-project",
4+
"replicatePostgres": "https://airbyte.com/recipes/postgres-replication",
5+
"syncMySQLKafka": "https://airbyte.com/recipes/mysql-cdc-to-kafka",
6+
"mailchimpSnowflake": "https://airbyte.com/recipes/data-ingestion-pipeline-mailchimp-snowflake"
7+
}

airbyte-webapp/src/hooks/services/Onboarding/OnboardingService.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import casesConfig from "config/casesConfig.json";
77
type Context = {
88
feedbackPassed?: boolean;
99
passFeedback: () => void;
10-
useCases?: string[];
10+
visibleUseCases?: string[];
11+
useCaseLinks: Record<string, string>;
1112
skipCase: (skipId: string) => void;
1213
};
1314

@@ -21,21 +22,24 @@ export const OnboardingServiceProvider: React.FC = ({ children }) => {
2122
`${workspace.workspaceId}/passFeedback`,
2223
false
2324
);
24-
const [useCases, setUseCases] = useLocalStorage<string[]>(
25-
`${workspace.workspaceId}/useCases`,
26-
casesConfig
25+
const [skippedUseCases, setSkippedUseCases] = useLocalStorage<string[]>(
26+
`${workspace.workspaceId}/skippedUseCases`,
27+
[]
2728
);
2829

2930
const ctx = useMemo<Context>(
3031
() => ({
3132
feedbackPassed,
3233
passFeedback: () => setFeedbackPassed(true),
33-
useCases,
34+
visibleUseCases: Object.keys(casesConfig).filter(
35+
(useCase) => !skippedUseCases?.includes(useCase)
36+
),
37+
useCaseLinks: casesConfig,
3438
skipCase: (skipId: string) =>
35-
setUseCases(useCases?.filter((item) => item !== skipId)),
39+
setSkippedUseCases([...(skippedUseCases ?? []), skipId]),
3640
}),
3741
// eslint-disable-next-line react-hooks/exhaustive-deps
38-
[feedbackPassed, useCases]
42+
[feedbackPassed, skippedUseCases]
3943
);
4044

4145
return (

airbyte-webapp/src/locales/en.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@
214214
"onboarding.createConnection.text": "Connections represent a sync between a source and a destination.",
215215
"onboarding.synchronizationProgress": "{source}{destination} = <sync>Synchronization</sync> in progress",
216216
"onboarding.useCases": "Enable <name>popular use cases</name>",
217-
"onboarding.replicateMySQL": "Replicate your MySQL database to Postgres with log-based CDC",
218-
"onboarding.consolidateMarketing": "Consolidate your marketing data to compute the CAC for your paid customers",
219-
"onboarding.consolidatePayment": "Consolidate your payment data to compute your LTV",
220-
"onboarding.buildDashboard": "Build an activity dashboard for your engineering project",
221-
"onboarding.zoomCalls": "Visualize the time spent by your team in Zoom calls ",
217+
"onboarding.useCase.singleCustomerView": "Build a single customer view",
218+
"onboarding.useCase.replicatePostgres": "Replicate your data between PostgreSQL databases",
219+
"onboarding.useCase.syncMySQLKafka": "Sync MySQL CDC to Kafka using Change Data Capture",
220+
"onboarding.useCase.mailchimpSnowflake": "Build a data ingestion pipeline from Mailchimp to Snowflake",
221+
"onboarding.useCase.buildDashboard": "Build an activity dashboard for your engineering project",
222222
"onboarding.skip": "Skip",
223223
"onboarding.closeOnboarding": "Close onboarding",
224224
"onboarding.syncCompleted": "Your first sync has been successfully completed!",

airbyte-webapp/src/pages/OnboardingPage/components/FinalStep.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const FinalStep: React.FC<FinalStepProps> = ({ connectionId, onSync }) => {
4141
const {
4242
feedbackPassed,
4343
passFeedback,
44-
useCases,
44+
visibleUseCases,
45+
useCaseLinks,
4546
skipCase,
4647
} = useOnboardingService();
4748
const connection = useResource(ConnectionResource.detailShape(), {
@@ -102,15 +103,15 @@ const FinalStep: React.FC<FinalStepProps> = ({ connectionId, onSync }) => {
102103
/>
103104
</Title>
104105

105-
{useCases &&
106-
useCases.map((item, key) => (
107-
<UseCaseBlock
108-
key={item}
109-
count={key + 1}
110-
onSkip={skipCase}
111-
id={item}
112-
/>
113-
))}
106+
{visibleUseCases?.map((item, key) => (
107+
<UseCaseBlock
108+
key={item}
109+
count={key + 1}
110+
href={useCaseLinks[item]}
111+
onSkip={skipCase}
112+
id={item}
113+
/>
114+
))}
114115

115116
{isOpen ? (
116117
<SyncCompletedModal

airbyte-webapp/src/pages/OnboardingPage/components/UseCaseBlock.tsx

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { FormattedMessage } from "react-intl";
77
type UseCaseBlockProps = {
88
count: number;
99
id: string;
10+
href: string;
1011
onSkip: (id: string) => void;
1112
};
1213

@@ -36,19 +37,44 @@ const Num = styled.div`
3637
text-align: center;
3738
`;
3839

39-
const SkipButton = styled.div`
40+
const SkipButton = styled.button`
41+
background: none;
42+
border: none;
4043
color: ${({ theme }) => theme.lightTextColor};
4144
font-size: 16px;
4245
line-height: 28px;
4346
cursor: pointer;
47+
transition: color 0.3s;
48+
49+
&:hover,
50+
&:focus-visible {
51+
color: ${({ theme }) => theme.blackColor};
52+
}
53+
`;
54+
55+
const Link = styled.a`
56+
color: inherit;
57+
text-decoration: none;
58+
59+
&:hover,
60+
&:focus-visible {
61+
text-decoration: underline;
62+
}
4463
`;
4564

46-
const UseCaseBlock: React.FC<UseCaseBlockProps> = ({ id, count, onSkip }) => {
65+
const UseCaseBlock: React.FC<UseCaseBlockProps> = ({
66+
id,
67+
count,
68+
onSkip,
69+
href,
70+
}) => {
4771
return (
4872
<Block>
4973
<div>
5074
<Num>{count}</Num>
51-
<FormattedMessage id={`onboarding.${id}`} />
75+
<Link href={href} target="_blank">
76+
<FormattedMessage id={`onboarding.useCase.${id}`} />
77+
</Link>
5278
</div>
5379
<SkipButton onClick={() => onSkip(id)}>
5480
<FormattedMessage id="onboarding.skip" />

0 commit comments

Comments
 (0)