Skip to content

Commit

Permalink
Remove old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb-T-Owens committed Jan 9, 2025
1 parent 71717da commit 5772164
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 739 deletions.
7 changes: 1 addition & 6 deletions apps/desktop/src/lib/branch/SeriesHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
childBranch,
parentBranch
} from '$lib/vbranches/virtualBranch';
import { CloudBranchesService } from '@gitbutler/shared/cloud/stacks/service';
import { getContext, getContextStore } from '@gitbutler/shared/context';
import Button from '@gitbutler/ui/Button.svelte';
import Modal from '@gitbutler/ui/Modal.svelte';
Expand Down Expand Up @@ -147,12 +146,8 @@
}
const cloudBranchCreationService = getContext(CloudBranchCreationService);
const cloudBranchesService = getContext(CloudBranchesService);
const cloudBranch = $derived(cloudBranchesService.branchForBranchId(stack.id));
const showCreateCloudBranch = $derived(
$cloudReviewFunctionality &&
cloudBranchCreationService.canCreateBranch &&
$cloudBranch.state === 'not-found'
$cloudReviewFunctionality && cloudBranchCreationService.canCreateBranch
);
/**
Expand Down
19 changes: 9 additions & 10 deletions apps/desktop/src/lib/branch/cloudBranchCreationService.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { derived, type Readable } from 'svelte/store';
import type { SyncedSnapshotService } from '$lib/history/syncedSnapshotService';
import type { CloudBranch, CloudBranchesService } from '@gitbutler/shared/cloud/stacks/service';

/**
* This service is responsible for integrating the client side oplog
Expand All @@ -10,20 +9,20 @@ export class CloudBranchCreationService {
canCreateBranch: Readable<boolean>;

constructor(
private readonly syncedSnapshotService: SyncedSnapshotService,
private readonly cloudBranchesService: CloudBranchesService
private readonly syncedSnapshotService: SyncedSnapshotService
// private readonly cloudBranchesService: CloudBranchesService
) {
this.canCreateBranch = derived(
[this.syncedSnapshotService.canTakeSnapshot, this.cloudBranchesService.canCreateBranch],
([canTakeSnapshot, canCreateBranch]) => {
return canTakeSnapshot && canCreateBranch;
[this.syncedSnapshotService.canTakeSnapshot],
([canTakeSnapshot]) => {
return canTakeSnapshot;
}
);
}

async createBranch(branchId: string): Promise<CloudBranch> {
const oplogSha = await this.syncedSnapshotService.takeSyncedSnapshot();
const cloudBranch = await this.cloudBranchesService.createBranch(branchId, oplogSha);
return cloudBranch;
async createBranch(_branchId: string): Promise<void> {
const _oplogSha = await this.syncedSnapshotService.takeSyncedSnapshot();
// const cloudBranch = await this.cloudBranchesService.createBranch(branchId, oplogSha);
// return cloudBranch;
}
}
2 changes: 0 additions & 2 deletions apps/desktop/src/routes/[projectId]/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import { BranchController } from '$lib/vbranches/branchController';
import { UpstreamIntegrationService } from '$lib/vbranches/upstreamIntegrationService';
import { VirtualBranchService } from '$lib/vbranches/virtualBranch';
import { CloudBranchesService } from '@gitbutler/shared/cloud/stacks/service';
import { getContext } from '@gitbutler/shared/context';
import { HttpClient } from '@gitbutler/shared/network/httpClient';
import { ProjectService as CloudProjectService } from '@gitbutler/shared/organizations/projectService';
Expand Down Expand Up @@ -92,7 +91,6 @@
// Cloud related services
setContext(SyncedSnapshotService, data.syncedSnapshotService);
setContext(CloudBranchesService, data.cloudBranchesService);
setContext(CloudBranchCreationService, data.cloudBranchCreationService);
setContext(FileService, data.fileService);
});
Expand Down
16 changes: 2 additions & 14 deletions apps/desktop/src/routes/[projectId]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ import { UncommitedFilesWatcher } from '$lib/uncommitedFiles/watcher';
import { BranchController } from '$lib/vbranches/branchController';
import { UpstreamIntegrationService } from '$lib/vbranches/upstreamIntegrationService';
import { VirtualBranchService } from '$lib/vbranches/virtualBranch';
import { BranchesApiService, CloudBranchesService } from '@gitbutler/shared/cloud/stacks/service';
import { error } from '@sveltejs/kit';
import { derived } from 'svelte/store';
import type { LayoutLoad } from './$types';

export const prerender = false;

// eslint-disable-next-line
export const load: LayoutLoad = async ({ params, parent }) => {
const { authService, projectsService, cloud, commandService, userService, posthog } =
await parent();
const { authService, projectsService, commandService, userService, posthog } = await parent();

const projectId = params.projectId;
projectsService.setLastOpenedProject(projectId);
Expand Down Expand Up @@ -88,20 +85,12 @@ export const load: LayoutLoad = async ({ params, parent }) => {

const uncommitedFileWatcher = new UncommitedFilesWatcher(project);
const upstreamIntegrationService = new UpstreamIntegrationService(project, vbranchService);
const repositoryId = derived(projectsService.getProjectStore(projectId), (project) => {
return project?.api?.repository_id;
});
const syncedSnapshotService = new SyncedSnapshotService(
commandService,
userService.user,
projectsService.getProjectStore(projectId)
);
const branchesApiService = new BranchesApiService(cloud);
const cloudBranchesService = new CloudBranchesService(repositoryId, branchesApiService);
const cloudBranchCreationService = new CloudBranchCreationService(
syncedSnapshotService,
cloudBranchesService
);
const cloudBranchCreationService = new CloudBranchCreationService(syncedSnapshotService);

return {
authService,
Expand Down Expand Up @@ -129,7 +118,6 @@ export const load: LayoutLoad = async ({ params, parent }) => {

// Cloud-related services
syncedSnapshotService,
cloudBranchesService,
cloudBranchCreationService
};
};
2 changes: 0 additions & 2 deletions apps/desktop/src/routes/[projectId]/series/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<script lang="ts">
import CloudBranchIndex from '@gitbutler/shared/cloud/stacks/CloudBranchIndex.svelte';
</script>

<div class="series-container">
<h2 class="text-head-24 heading">Your branches:</h2>
<CloudBranchIndex />
</div>

<style lang="postcss">
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions apps/web/src/lib/components/Navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
const user = $derived(userService.user);
function login() {
window.location.href = `${env.PUBLIC_APP_HOST}cloud/login?callback=${window.location.href}`;
window.location.href = `${env.PUBLIC_APP_HOST}/cloud/login?callback=${window.location.href}`;
}
function logout() {
authService.clearToken();
window.location.href = `${env.PUBLIC_APP_HOST}cloud/logout`;
window.location.href = `${env.PUBLIC_APP_HOST}/cloud/logout`;
}
</script>

Expand Down
8 changes: 0 additions & 8 deletions apps/web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import { AuthService } from '$lib/auth/authService';
import Navigation from '$lib/components/Navigation.svelte';
import { UserService } from '$lib/user/userService';
import {
CloudRepositoriesService,
RepositoriesApiService
} from '@gitbutler/shared/cloud/repositories/service';
import { FeedService } from '@gitbutler/shared/feeds/service';
import { HttpClient } from '@gitbutler/shared/network/httpClient';
import { OrganizationService } from '@gitbutler/shared/organizations/organizationService';
Expand Down Expand Up @@ -39,10 +35,6 @@
const userService = new UserService(httpClient);
setContext(UserService, userService);
const repositoriesApiService = new RepositoriesApiService(httpClient);
const cloudRepositoriesService = new CloudRepositoriesService(repositoriesApiService);
setContext(CloudRepositoriesService, cloudRepositoriesService);
const appState = new AppState();
setContext(AppState, appState);
const feedService = new FeedService(httpClient, appState.appDispatch);
Expand Down
46 changes: 0 additions & 46 deletions apps/web/src/routes/repositories/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,53 +1,7 @@
<script lang="ts">
import { CloudRepositoriesService } from '@gitbutler/shared/cloud/repositories/service';
import { getContext } from '@gitbutler/shared/context';
import Button from '@gitbutler/ui/Button.svelte';
import { goto } from '$app/navigation';
const cloudRepositoriesService = getContext(CloudRepositoriesService);
const repositories = $derived(cloudRepositoriesService.repositories);
$inspect($repositories);
</script>

<h2>Your projects:</h2>

{#if !$repositories}
<p>Loading...</p>
{:else if $repositories.length === 0}
<p>
You've not got any projects added yet. Enable project syncing in GitButler in order to see
projects.
</p>
{:else}
<div class="card">
{#each $repositories as repository}
<div class="line-item">
<div>
<h5 class="text-head-22">{repository.name}</h5>
<p>{repository.name}</p>
</div>
<Button
style="pop"
kind="solid"
onclick={() => {
goto(`/repositories/${repository.repositoryId}`);
}}>Visit</Button
>
</div>
{/each}
</div>
{/if}

<style>
.line-item {
padding: 8px;
display: flex;
justify-content: space-between;
&:not(:last-child) {
border-bottom: 1px solid var(--clr-border-1);
}
}
</style>
21 changes: 0 additions & 21 deletions apps/web/src/routes/repositories/[repositoryId]/+layout.svelte

This file was deleted.

7 changes: 0 additions & 7 deletions apps/web/src/routes/repositories/[repositoryId]/+page.svelte

This file was deleted.

This file was deleted.

105 changes: 0 additions & 105 deletions packages/shared/src/lib/cloud/repositories/service.ts

This file was deleted.

Loading

0 comments on commit 5772164

Please sign in to comment.