feat: allow creating external repositories directly from git mount editor
- Add createExternalRepository API function - Update GitMountEditor with "+ Add new repository..." option - Show form to enter repo name and remote URL - Auto-create external repo and refresh list on success - Update config-profiles page to pass onCreateRepository handler
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
type ResolvedProfile,
|
||||
} from "../api/config_profiles";
|
||||
import { listProjects } from "../api/projects";
|
||||
import { listAllUserRepositories, type GitRepository } from "../api/git_repositories";
|
||||
import { listAllUserRepositories, createExternalRepository, type GitRepository } from "../api/git_repositories";
|
||||
import type { Project } from "../types";
|
||||
import { listToolTypes, type ToolType } from "../api/tool_types";
|
||||
import { GitMountEditor } from "../components/git-mount-editor";
|
||||
@@ -1259,6 +1259,14 @@ export const ConfigProfilesPage = () => {
|
||||
mounts={formData.git_mounts || []}
|
||||
repositories={repositories}
|
||||
onChange={(git_mounts) => updateFormField("git_mounts", git_mounts)}
|
||||
onCreateRepository={async (name, remoteUrl) => {
|
||||
const repo = await createExternalRepository({
|
||||
name,
|
||||
remote_url: remoteUrl,
|
||||
});
|
||||
setRepositories((prev) => [...prev, repo]);
|
||||
return repo;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user