Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: login pages ui #1454

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/routes/LoginWithOAuthApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
</Button>
Expand All @@ -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
</Button>

<Button
name="Login"
Expand All @@ -109,7 +113,9 @@ export const LoginWithOAuthApp: FC = () => {
icon={{ icon: SignInIcon, size: Size.MEDIUM }}
disabled={submitting || pristine}
type="submit"
/>
>
Login
</Button>
</div>
</form>
);
Expand Down
31 changes: 17 additions & 14 deletions src/routes/LoginWithPersonalAccessToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,37 +57,39 @@ export const LoginWithPersonalAccessToken: FC = () => {
name="hostname"
label="Hostname"
placeholder="github.company.com"
helpText={
<div className="mt-1 italic">
Change only if you are using GitHub Enterprise Server.
</div>
}
/>

<FieldInput
name="token"
label="Token"
placeholder="The 40 characters token generated on GitHub"
helpText={
<div>
<div>
<div className="mt-1 italic">
Change only if you are using GitHub Enterprise Server.
</div>
<div className="mt-3">
<Button
label="Generate a PAT"
disabled={!values.hostname}
icon={{ icon: KeyIcon, size: Size.XSMALL }}
url={getNewTokenURL(values.hostname)}
size="xs"
>
Generate a PAT
</Button>
<span className="mx-1">on GitHub and paste above.</span>
<span className="mx-1">
on GitHub then paste your{' '}
<span className="italic">token</span> below.
</span>
</div>
<div className="mt-1 italic">
The required scopes will be selected for you.
The required scopes will be automatically selected for you.
</div>
</div>
}
/>

<FieldInput
name="token"
label="Token"
placeholder="The 40 characters token generated on GitHub"
/>

{!isValidToken && (
<div className="mt-4 text-sm font-medium text-red-500">
This token could not be validated with {values.hostname}.
Expand All @@ -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
</Button>
Expand Down
12 changes: 8 additions & 4 deletions src/routes/__snapshots__/LoginWithOAuthApp.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 74 additions & 64 deletions src/routes/__snapshots__/LoginWithPersonalAccessToken.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.