From 2d8e9230190e3c2687aff0bb0575cc175f19cc7c Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 9 Aug 2024 06:55:23 -0400 Subject: [PATCH] refactor: login pages Signed-off-by: Adam Setch --- src/routes/LoginWithOAuthApp.tsx | 10 +- src/routes/LoginWithPersonalAccessToken.tsx | 31 ++-- .../LoginWithOAuthApp.test.tsx.snap | 12 +- ...LoginWithPersonalAccessToken.test.tsx.snap | 138 ++++++++++-------- 4 files changed, 107 insertions(+), 84 deletions(-) diff --git a/src/routes/LoginWithOAuthApp.tsx b/src/routes/LoginWithOAuthApp.tsx index 9d0e7df3e..34ce5179b 100644 --- a/src/routes/LoginWithOAuthApp.tsx +++ b/src/routes/LoginWithOAuthApp.tsx @@ -76,6 +76,7 @@ export const LoginWithOAuthApp: FC = () => { disabled={!values.hostname} icon={{ icon: PersonIcon, size: Size.XSMALL }} url={getNewOAuthAppURL(values.hostname)} + size="xs" > Create new OAuth App @@ -100,7 +101,10 @@ export const LoginWithOAuthApp: FC = () => { className="mt-2" icon={{ icon: BookIcon, size: Size.XSMALL }} url={Constants.GITHUB_DOCS.OAUTH_URL} - /> + size="xs" + > + Docs + ); diff --git a/src/routes/LoginWithPersonalAccessToken.tsx b/src/routes/LoginWithPersonalAccessToken.tsx index e792ef12b..d70a8d9a3 100644 --- a/src/routes/LoginWithPersonalAccessToken.tsx +++ b/src/routes/LoginWithPersonalAccessToken.tsx @@ -57,37 +57,39 @@ export const LoginWithPersonalAccessToken: FC = () => { name="hostname" label="Hostname" placeholder="github.company.com" - helpText={ -
- Change only if you are using GitHub Enterprise Server. -
- } - /> - - -
+
+ Change only if you are using GitHub Enterprise Server. +
+
- on GitHub and paste above. + + on GitHub then paste your{' '} + token below. +
- The required scopes will be selected for you. + The required scopes will be automatically selected for you.
} /> + + {!isValidToken && (
This token could not be validated with {values.hostname}. @@ -99,6 +101,7 @@ export const LoginWithPersonalAccessToken: FC = () => { label="GitHub Docs" icon={{ icon: BookIcon, size: Size.XSMALL }} url={Constants.GITHUB_DOCS.PAT_URL} + size="xs" > Docs diff --git a/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap b/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap index 5d4c7ad11..c2e298b38 100644 --- a/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap +++ b/src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap @@ -84,7 +84,7 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = ` >
@@ -287,7 +289,7 @@ exports[`routes/LoginWithOAuthApp.tsx renders correctly 1`] = ` > diff --git a/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap b/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap index dd3492692..9f0f8f807 100644 --- a/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap +++ b/src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap @@ -75,41 +75,21 @@ exports[`routes/LoginWithPersonalAccessToken.tsx renders correctly 1`] = ` type="text" value="github.com" /> -
-
- Change only if you are using GitHub Enterprise Server. -
-
- -
- -
-
+
+ Change only if you are using GitHub Enterprise Server. +
+
- The required scopes will be selected for you. + The required scopes will be automatically selected for you.
+
+ + +
-
- -
-
+
+ Change only if you are using GitHub Enterprise Server. +
+
- The required scopes will be selected for you. + The required scopes will be automatically selected for you.
+
+ + +