diff --git a/ui/src/settings/ConnectionCard.vue b/ui/src/settings/ConnectionCard.vue deleted file mode 100644 index d99f47c4d..000000000 --- a/ui/src/settings/ConnectionCard.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - diff --git a/ui/src/settings/connection.ts b/ui/src/settings/connection.ts deleted file mode 100644 index 5738cf488..000000000 --- a/ui/src/settings/connection.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** The operations the runtime can perform through a connection. */ -export const OPERATIONS = ["clone", "push", "pr"] as const; - -/** One organisation-owned forge connection, as the document writes it. */ -export interface Connection { - id: string; - name: string; - type: string; - host: string; - account: string; - token: { engine: string; key: string }; - commit_name?: string; - commit_email?: string; - /** OpenSSH private key that signs commits made through the connection. */ - signing_key?: { engine: string; key: string }; - /** Permitted operations per execution identity ID. */ - permits?: Record; -} - -/** permits renders the document's map as rows the page can edit. */ -export const permits = (c: Connection): [string, string[]][] => - Object.entries(c.permits ?? {}); - -// Each edit returns a new connection: the one passed in belongs to a settings -// form, and a write in place never reaches it. - -export function addPermit(c: Connection): Connection { - return { ...c, permits: { ...c.permits, "": ["clone"] } }; -} - -export function removePermit(c: Connection, id: string): Connection { - const { [id]: _, ...rest } = c.permits ?? {}; - return { ...c, permits: rest }; -} - -// Renaming rebuilds the entry: the identity reference is the map key. -export function renamePermit(c: Connection, from: string, to: string): Connection { - if (!c.permits || from === to) return c; - const { [from]: operations = [], ...rest } = c.permits; - return { ...c, permits: to ? { ...rest, [to]: operations } : rest }; -} - -export function toggleOperation( - c: Connection, - id: string, - operation: string, - on: boolean, -): Connection { - const current = new Set(c.permits?.[id] ?? []); - if (on) current.add(operation); - else current.delete(operation); - return { ...c, permits: { ...c.permits, [id]: OPERATIONS.filter((o) => current.has(o)) } }; -} - -/** Identities a permit row may pick: any not already permitted on another row. */ -export const choosableIdentities = (c: Connection, identities: T[], current: string): T[] => - identities.filter((a) => a.id === current || !(a.id in (c.permits ?? {}))); diff --git a/ui/src/stores/extensions.ts b/ui/src/stores/extensions.ts index 02c05037d..4a3b15b8b 100644 --- a/ui/src/stores/extensions.ts +++ b/ui/src/stores/extensions.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { computed, ref } from "vue"; +import { ref } from "vue"; import { errors } from "@/copy/errors"; import { api, describeError, type CatalogueEntry, type CatalogueSourceView, type Extension, type ExtensionGrantsInput, type Grants, type SettingField } from "@/lib/api"; @@ -35,13 +35,6 @@ export const useExtensionsStore = defineStore("extensions", () => { const catalogueLoaded = ref(false); const error = ref(""); const busy = ref(""); - // The binary carries no per-extension surface, so a connection cannot yet - // name an installed forge. - const forges = computed(() => []); - function forgeName(type: string): string { - return `${type} · not enabled`; - } - async function loadInstalled(): Promise { try { extensions.value = await api.allExtensions(); @@ -87,8 +80,6 @@ export const useExtensionsStore = defineStore("extensions", () => { } return { - forges, - forgeName, extensions, catalogue, source,