Skip to content

Commit a31db65

Browse files
Merge pull request #10363 from gitbutlerapp/remove-git-executable-page
Remove "Git Authentication" from onboarding flow
2 parents b866433 + 7c20b2b commit a31db65

File tree

6 files changed

+23
-74
lines changed

6 files changed

+23
-74
lines changed

apps/desktop/cypress/e2e/journey/onboarding.cy.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ describe('Onboarding Journey', () => {
6767
cy.getByTestId('project-setup-page-target-branch-select').should('be.visible');
6868
cy.getByTestId('set-base-branch').should('be.visible').click();
6969

70-
// Should see the keys form page
71-
cy.getByTestId('project-setup-git-auth-page').should('be.visible');
72-
cy.getByTestId('accept-git-auth').should('be.visible').should('be.enabled').click();
73-
74-
// Should load the project
70+
// Should load the project directly after setting base branch
7571
cy.urlMatches(`/${mockBackend.projectId}/workspace`);
7672
});
7773
});

apps/desktop/src/components/KeysForm.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import { PROJECTS_SERVICE } from '$lib/project/projectsService';
1010
import { debounce } from '$lib/utils/debounce';
1111
import { inject } from '@gitbutler/core/context';
12-
import { Link, RadioButton, SectionCard, TestId, Textbox } from '@gitbutler/ui';
12+
import { Link, RadioButton, SectionCard, Textbox } from '@gitbutler/ui';
1313
1414
import { onMount } from 'svelte';
1515
@@ -91,7 +91,7 @@
9191
});
9292
</script>
9393

94-
<div data-testid={TestId.ProjectSetupGitAuthPage}>
94+
<div>
9595
<ReduxResult {projectId} result={projectQuery.result}>
9696
{#snippet children(project)}
9797
<Section>
Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<script lang="ts">
22
import { goto } from '$app/navigation';
33
import DecorativeSplitView from '$components/DecorativeSplitView.svelte';
4-
import KeysForm from '$components/KeysForm.svelte';
54
import ProjectSetupTarget from '$components/ProjectSetupTarget.svelte';
65
import ReduxResult from '$components/ReduxResult.svelte';
76
import { OnboardingEvent, POSTHOG_WRAPPER } from '$lib/analytics/posthog';
87
import newProjectSvg from '$lib/assets/illustrations/new-project.svg?raw';
9-
import { BACKEND } from '$lib/backend';
108
import { BASE_BRANCH_SERVICE } from '$lib/baseBranch/baseBranchService.svelte';
119
import { PROJECTS_SERVICE } from '$lib/project/projectsService';
1210
import { inject } from '@gitbutler/core/context';
13-
import { Button, TestId } from '@gitbutler/ui';
11+
import { TestId } from '@gitbutler/ui';
1412
import type { RemoteBranchInfo } from '$lib/baseBranch/baseBranch';
1513
1614
interface Props {
@@ -23,20 +21,17 @@
2321
const projectsService = inject(PROJECTS_SERVICE);
2422
const baseService = inject(BASE_BRANCH_SERVICE);
2523
const posthog = inject(POSTHOG_WRAPPER);
26-
const backend = inject(BACKEND);
2724
const projectQuery = $derived(projectsService.getProject(projectId));
28-
const [setBaseBranchTarget, settingBranch] = baseService.setTarget;
25+
const [setBaseBranchTarget] = baseService.setTarget;
2926
30-
let selectedBranch = $state(['', '']);
31-
32-
async function setTarget() {
33-
if (!selectedBranch[0] || selectedBranch[0] === '') return;
27+
async function setTarget(branch: string[]) {
28+
if (!branch[0] || branch[0] === '') return;
3429
3530
try {
3631
await setBaseBranchTarget({
3732
projectId: projectId,
38-
branch: selectedBranch[0],
39-
pushRemote: selectedBranch[1]
33+
branch: branch[0],
34+
pushRemote: branch[1]
4035
});
4136
posthog.captureOnboarding(OnboardingEvent.SetTargetBranch);
4237
goto(`/${projectId}/`, { invalidateAll: true });
@@ -54,45 +49,16 @@
5449
</script>
5550

5651
<DecorativeSplitView img={newProjectSvg} testId={TestId.ProjectSetupPage}>
57-
{#if selectedBranch[0] && selectedBranch[0] !== '' && backend.platformName !== 'windows'}
58-
{@const [remoteName, branchName] = selectedBranch[0].split(/\/(.*)/s)}
59-
<KeysForm {projectId} {remoteName} {branchName} disabled={settingBranch.current.isLoading} />
60-
<div class="actions">
61-
<Button
62-
kind="outline"
63-
disabled={settingBranch.current.isLoading}
64-
onclick={() => (selectedBranch[0] = '')}
65-
>
66-
Back
67-
</Button>
68-
<Button
69-
style="pop"
70-
loading={settingBranch.current.isLoading}
71-
onclick={setTarget}
72-
testId={TestId.ProjectSetupGitAuthPageButton}>Let's go!</Button
73-
>
74-
</div>
75-
{:else}
76-
<ReduxResult {projectId} result={projectQuery.result}>
77-
{#snippet children(project)}
78-
<ProjectSetupTarget
79-
{projectId}
80-
projectName={project.title}
81-
{remoteBranches}
82-
onBranchSelected={async (branch) => {
83-
selectedBranch = branch;
84-
if (backend.platformName !== 'windows') return;
85-
setTarget();
86-
}}
87-
/>
88-
{/snippet}
89-
</ReduxResult>
90-
{/if}
52+
<ReduxResult {projectId} result={projectQuery.result}>
53+
{#snippet children(project)}
54+
<ProjectSetupTarget
55+
{projectId}
56+
projectName={project.title}
57+
{remoteBranches}
58+
onBranchSelected={async (branch) => {
59+
await setTarget(branch);
60+
}}
61+
/>
62+
{/snippet}
63+
</ReduxResult>
9164
</DecorativeSplitView>
92-
93-
<style lang="postcss">
94-
.actions {
95-
margin-top: 20px;
96-
text-align: right;
97-
}
98-
</style>

e2e/blackbox/tests/add-project.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('Project', () => {
1818
await findAndClick('button[data-testid="add-local-project"]');
1919
// TODO: Remove next click when v3 is default!
2020
await findAndClick('button[data-testid="set-base-branch"]');
21-
await findAndClick('button[data-testid="accept-git-auth"]');
2221

2322
const workspaceButton = await $(
2423
'button[data-testid="navigation-workspace-button"]'

e2e/playwright/tests/startTheApp.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ test('should start the application and be able to commit', async ({ page, contex
4747

4848
clickByTestId(page, 'set-base-branch');
4949

50-
// Should see the keys form page
51-
const gitAuthPage = getByTestId(page, 'project-setup-git-auth-page');
52-
await gitAuthPage.waitFor();
53-
clickByTestId(page, 'accept-git-auth');
54-
55-
// Should load the workspace
50+
// Should load the workspace directly after setting base branch
5651
await waitForTestId(page, 'workspace-view');
5752

5853
// Let's write some files
@@ -123,12 +118,7 @@ test('no author setup - should start the application and be able to commit', asy
123118

124119
clickByTestId(page, 'set-base-branch');
125120

126-
// Should see the keys form page
127-
const gitAuthPage = getByTestId(page, 'project-setup-git-auth-page');
128-
await gitAuthPage.waitFor();
129-
clickByTestId(page, 'accept-git-auth');
130-
131-
// Should load the workspace
121+
// Should load the workspace directly after setting base branch
132122
await waitForTestId(page, 'workspace-view');
133123

134124
// Should see the author missing modal

packages/ui/src/lib/utils/testIds.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ export enum TestId {
128128
ProjectSetupPage = 'project-setup-page',
129129
ProjectSetupPageTargetBranchSelect = 'project-setup-page-target-branch-select',
130130
ProjectSetupPageTargetContinueButton = 'set-base-branch',
131-
ProjectSetupGitAuthPage = 'project-setup-git-auth-page',
132-
ProjectSetupGitAuthPageButton = 'accept-git-auth',
133131
ProjectDeleteButton = 'project-delete-button',
134132
ProjectDeleteModalConfirm = 'project-delete-modal-confirm',
135133
AddProjectAlreadyExistsModal = 'add-project-already-exists-modal',

0 commit comments

Comments
 (0)