Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ import {
import { Input } from "@superset/ui/input";
import { Popover, PopoverContent, PopoverTrigger } from "@superset/ui/popover";
import { toast } from "@superset/ui/sonner";
import { useNavigate } from "@tanstack/react-router";
import { useEffect, useMemo, useRef, useState } from "react";
import { GoGitBranch } from "react-icons/go";
import { HiCheck, HiChevronDown, HiChevronUpDown } from "react-icons/hi2";
import {
HiCheck,
HiChevronDown,
HiChevronUpDown,
HiOutlinePencil,
} from "react-icons/hi2";
import { LuFolderOpen } from "react-icons/lu";
import { electronTrpc } from "renderer/lib/electron-trpc";
import { formatRelativeTime } from "renderer/lib/formatRelativeTime";
Expand All @@ -54,6 +60,7 @@ function generateSlugFromTitle(title: string): string {
type Mode = "existing" | "new" | "cloud";

export function NewWorkspaceModal() {
const navigate = useNavigate();
const isOpen = useNewWorkspaceModalOpen();
const closeModal = useCloseNewWorkspaceModal();
const preSelectedProjectId = usePreSelectedProjectId();
Expand Down Expand Up @@ -371,12 +378,25 @@ export function NewWorkspaceModal() {
</CollapsibleTrigger>
<CollapsibleContent className="pt-3 space-y-3">
<div className="space-y-1.5">
<label
htmlFor="branch"
className="text-xs text-muted-foreground"
>
Branch name
</label>
<div className="flex items-center justify-between">
<label
htmlFor="branch"
className="text-xs text-muted-foreground"
>
Branch name
</label>
<button
type="button"
onClick={() => {
handleClose();
navigate({ to: "/settings/behavior" });
}}
className="inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors"
>
<HiOutlinePencil className="size-3" />
<span>Edit prefix</span>
</button>
</div>
<Input
id="branch"
className="h-8 text-sm font-mono"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { BranchPrefixMode } from "@superset/local-db";

export const BRANCH_PREFIX_MODE_LABELS: Record<BranchPrefixMode, string> = {
none: "No prefix",
github: "GitHub username",
author: "Git author name",
custom: "Custom prefix",
none: "No prefix",
};

export const BRANCH_PREFIX_MODE_LABELS_WITH_DEFAULT: Record<
Expand Down
2 changes: 1 addition & 1 deletion packages/local-db/src/schema/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export type TerminalLinkBehavior = (typeof TERMINAL_LINK_BEHAVIORS)[number];
* Branch prefix modes for workspace branch naming
*/
export const BRANCH_PREFIX_MODES = [
"none",
"github",
"author",
"custom",
"none",
] as const;

export type BranchPrefixMode = (typeof BRANCH_PREFIX_MODES)[number];
Loading