Skip to content

Commit 4127ba1

Browse files
Merge branch 'master' into leti/experiment-add-source-in-signup
* master: 🪟 🎨 Adapt Osano banner to new UI (#19029) 🪟 🔧 Add a start:cloud command to the webapp (#19026) 🪟🧪 [Experiment] Move OAuth to top of signup page (#18899)
2 parents c3edfb7 + 3aacda4 commit 4127ba1

File tree

13 files changed

+122
-41
lines changed

13 files changed

+122
-41
lines changed

airbyte-webapp/package-lock.json

Lines changed: 25 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-webapp/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"prepare": "cd .. && husky install airbyte-webapp/.husky",
1010
"prestart": "npm run generate-client",
1111
"start": "craco start",
12+
"prestart:cloud": "npm run generate-client",
13+
"start:cloud": "AB_ENV=frontend-dev node -r ./scripts/environment.js ./node_modules/.bin/craco start",
1214
"prebuild": "npm run generate-client",
1315
"build": "BUILD_PATH='./build/app' craco build",
1416
"pretest": "npm run generate-client",
@@ -110,6 +112,7 @@
110112
"@types/unist": "^2.0.5",
111113
"@typescript-eslint/eslint-plugin": "^5.27.1",
112114
"@typescript-eslint/parser": "^5.27.1",
115+
"dotenv": "^16.0.3",
113116
"eslint-config-prettier": "^8.5.0",
114117
"eslint-config-react-app": "^7.0.1",
115118
"eslint-plugin-css-modules": "^2.11.0",

airbyte-webapp/scripts/environment.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const dotenv = require("dotenv");
5+
6+
if (!process.env.AB_ENV) {
7+
return;
8+
}
9+
10+
const envFile = path.resolve(
11+
__dirname,
12+
"../../../airbyte-cloud/cloud-webapp/development",
13+
`.env.${process.env.AB_ENV}`
14+
);
15+
16+
if (!fs.existsSync(envFile)) {
17+
console.error(
18+
`~~~ This mode is for Airbyte employees only. ~~~\n` +
19+
`Could not find .env file for environment ${process.env.AB_ENV} (looking at ${envFile}).\n` +
20+
`Make sure you have the latest airbyte-cloud repository checked out in a directory directly next to the airbyte OSS repository.\n`
21+
);
22+
process.exit(42);
23+
}
24+
25+
dotenv.config({ path: envFile });

airbyte-webapp/src/hooks/services/Experiment/experiments.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ export interface Experiments {
2020
"authPage.oauth.github.signUpPage": boolean;
2121
"onboarding.speedyConnection": boolean;
2222
"authPage.signup.sourceSelector": boolean;
23+
"authPage.oauth.position": "top" | "bottom";
2324
}

airbyte-webapp/src/packages/cloud/views/auth/LoginPage/LoginPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { BottomBlock, FieldItem, Form } from "packages/cloud/views/auth/componen
1717
import { FormTitle } from "packages/cloud/views/auth/components/FormTitle";
1818

1919
import { OAuthLogin } from "../OAuthLogin";
20+
import { Separator } from "../SignupPage/components/Separator";
2021
import { Disclaimer } from "../SignupPage/components/SignupForm";
2122
import styles from "./LoginPage.module.scss";
2223

@@ -112,6 +113,8 @@ const LoginPage: React.FC = () => {
112113
</Form>
113114
)}
114115
</Formik>
116+
117+
<Separator />
115118
<OAuthLogin />
116119
<Disclaimer />
117120
</div>

airbyte-webapp/src/packages/cloud/views/auth/OAuthLogin/OAuthLogin.module.scss

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,6 @@
11
@use "../../../../../scss/variables" as vars;
22
@use "../../../../../scss/colors";
33

4-
.separator {
5-
display: flex;
6-
margin: vars.$spacing-xl 0;
7-
font-size: 16px;
8-
text-align: center;
9-
font-weight: bold;
10-
color: colors.$grey-800;
11-
text-transform: uppercase;
12-
13-
&::before,
14-
&::after {
15-
content: "";
16-
flex: 1 1;
17-
border-bottom: 1px solid colors.$grey-300;
18-
margin: auto;
19-
}
20-
21-
&::before {
22-
margin-right: vars.$spacing-md;
23-
}
24-
25-
&::after {
26-
margin-left: vars.$spacing-md;
27-
}
28-
}
29-
304
.buttons {
315
display: grid;
326
grid-template-columns: 1fr;

airbyte-webapp/src/packages/cloud/views/auth/OAuthLogin/OAuthLogin.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ export const OAuthLogin: React.FC<OAuthLoginProps> = ({ isSignUpPage }) => {
100100

101101
return (
102102
<div>
103-
<div className={styles.separator}>
104-
<FormattedMessage id="login.oauth.or" />
105-
</div>
106103
{isLoading && (
107104
<div className={styles.spinner}>
108105
<Spinner />

airbyte-webapp/src/packages/cloud/views/auth/SignupPage/SignupPage.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
@use "../../../../../scss/colors";
22
@use "../../../../../scss/variables";
33

4+
.container {
5+
display: flex;
6+
flex-direction: column;
7+
gap: variables.$spacing-xl;
8+
}
9+
410
.title {
511
width: 250px;
612
margin-bottom: variables.$spacing-md;

airbyte-webapp/src/packages/cloud/views/auth/SignupPage/SignupPage.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import { HeadTitle } from "components/common/HeadTitle";
55
import { Heading } from "components/ui/Heading";
66

77
import { PageTrackingCodes, useTrackPage } from "hooks/services/Analytics";
8+
import { useExperiment } from "hooks/services/Experiment";
89

910
import { OAuthLogin } from "../OAuthLogin";
11+
import { Separator } from "./components/Separator";
1012
import { Disclaimer, SignupForm } from "./components/SignupForm";
1113
import SpecialBlock from "./components/SpecialBlock";
1214
import styles from "./SignupPage.module.scss";
@@ -17,8 +19,10 @@ interface SignupPageProps {
1719

1820
const SignupPage: React.FC<SignupPageProps> = ({ highlightStyle }) => {
1921
useTrackPage(PageTrackingCodes.SIGNUP);
22+
const oAuthPosition = useExperiment("authPage.oauth.position", "bottom");
23+
2024
return (
21-
<div>
25+
<div className={styles.container}>
2226
<HeadTitle titles={[{ id: "login.signup" }]} />
2327
<Heading as="h1" size="xl" className={styles.title}>
2428
<FormattedMessage
@@ -33,8 +37,19 @@ const SignupPage: React.FC<SignupPageProps> = ({ highlightStyle }) => {
3337
/>
3438
</Heading>
3539
<SpecialBlock />
40+
{oAuthPosition === "top" && (
41+
<>
42+
<OAuthLogin isSignUpPage />
43+
<Separator />
44+
</>
45+
)}
3646
<SignupForm />
37-
<OAuthLogin isSignUpPage />
47+
{oAuthPosition === "bottom" && (
48+
<>
49+
<Separator />
50+
<OAuthLogin isSignUpPage />
51+
</>
52+
)}
3853
<Disclaimer />
3954
</div>
4055
);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@use "../../../../../../scss/variables" as vars;
2+
@use "../../../../../../scss/colors";
3+
4+
.separator {
5+
display: flex;
6+
padding: vars.$spacing-md 0;
7+
font-size: 16px;
8+
text-align: center;
9+
font-weight: bold;
10+
color: colors.$grey-800;
11+
text-transform: uppercase;
12+
13+
&::before,
14+
&::after {
15+
content: "";
16+
flex: 1 1;
17+
border-bottom: 1px solid colors.$grey-300;
18+
margin: auto;
19+
}
20+
21+
&::before {
22+
margin-right: vars.$spacing-md;
23+
}
24+
25+
&::after {
26+
margin-left: vars.$spacing-md;
27+
}
28+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { FormattedMessage } from "react-intl";
2+
3+
import styles from "./Separator.module.scss";
4+
export const Separator: React.FC = () => {
5+
return (
6+
<div className={styles.separator}>
7+
<FormattedMessage id="login.oauth.or" />
8+
</div>
9+
);
10+
};

airbyte-webapp/src/packages/cloud/views/auth/SignupPage/components/SignupForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Field, FieldProps, Formik } from "formik";
1+
import { Field, FieldProps, Formik, Form } from "formik";
22
import React, { useMemo } from "react";
33
import { FormattedMessage, useIntl } from "react-intl";
44
import { useSearchParams } from "react-router-dom";
@@ -16,7 +16,7 @@ import { isGdprCountry } from "utils/dataPrivacy";
1616
import { links } from "utils/links";
1717

1818
import CheckBoxControl from "../../components/CheckBoxControl";
19-
import { BottomBlock, FieldItem, Form, RowFieldItem } from "../../components/FormComponents";
19+
import { BottomBlock, FieldItem, RowFieldItem } from "../../components/FormComponents";
2020
import styles from "./SignupForm.module.scss";
2121

2222
interface FormValues {

airbyte-webapp/src/utils/dataPrivacy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ export const loadOsano = (): void => {
6161
style.appendChild(
6262
document.createTextNode(`
6363
.osano-cm-widget { display: none; }
64+
.osano-cm-dialog__close { display: none; }
6465
.osano-cm-button--type_denyAll { display: none; }
65-
.osano-cm-button--type_manage { background-color: inherit; border: 1px inherit; font-weight: 200; }`)
66+
.osano-cm-button--type_manage { background-color: inherit; border: 1px #1a194d solid; color: #1a194d; font-weight: 200; }`)
6667
);
6768
document.head.appendChild(style);
6869

0 commit comments

Comments
 (0)