This commit is contained in:
Jonathan Summers-Muir committed 2024-06-25 16:40:52 +08:00
1 parent a61a388f5a
commit fa5e7be117
13 files changed
+375 -142

No files matched your search

@@ -20,6 +20,7 @@ import {
Popover_Shadcn_,
cn,
} from 'ui'
import EnableBranchingDialog from './enable-branching-dialog'
export function BranchMenu() {
const [config] = useConfig()
@@ -40,12 +41,15 @@ export function BranchMenu() {
selectedOrg?.key,
selectedProject?.key
)
const hideProjectsDropdown = resolveHideProjectsDropdown(
pathName,
selectedOrg?.key,
selectedProject?.key
)
console.log('hideProjectsDropdown', hideProjectsDropdown)
const branchBasedSettings =
!hideBranchesDropdown && pathName.startsWith(`/${selectedOrg?.key}/settings/project`)
@@ -155,55 +159,55 @@ const IconHandler = (props: { icon: string }) => {
d="M9.97796 18.9666L12.3138 14.9208C12.416 14.7433 12.4698 14.5421 12.4697 14.3373C12.4696 14.1325 12.4156 13.9313 12.3132 13.7539L9.94105 9.68715C9.83854 9.5096 9.69111 9.36217 9.51356 9.25966C9.33601 9.15715 9.13461 9.10319 8.9296 9.10319L4.2216 9.08223C4.01679 9.08223 3.81558 9.13608 3.63816 9.2384C3.46074 9.34071 3.31334 9.48788 3.21075 9.66515L0.874907 13.711C0.772684 13.8884 0.718929 14.0897 0.719034 14.2945C0.719139 14.4993 0.773101 14.7005 0.875506 14.8778L3.24766 18.9446C3.35017 19.1221 3.4976 19.2696 3.67515 19.3721C3.85269 19.4746 4.0541 19.5286 4.25911 19.5286L8.96711 19.5495C9.17192 19.5495 9.37313 19.4957 9.55055 19.3934C9.72797 19.291 9.87537 19.1439 9.97796 18.9666Z"
fill="#282828"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M3.64966 9.24414L6.59462 14.3159L12.4594 14.3304" fill="#282828" />
<path
d="M3.64966 9.24414L6.59462 14.3159L12.4594 14.3304"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M3.67443 19.3737L6.59424 14.3164"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M14.3846 11.3348L16.7204 7.28896C16.8226 7.11149 16.8764 6.91025 16.8763 6.70544C16.8762 6.50063 16.8222 6.29945 16.7198 6.12208L14.3477 2.05531C14.2452 1.87777 14.0977 1.73033 13.9202 1.62782C13.7426 1.52532 13.5412 1.47135 13.3362 1.47135L8.62822 1.45039C8.42341 1.45039 8.2222 1.50425 8.04478 1.60656C7.86735 1.70888 7.71995 1.85605 7.61737 2.03331L5.28152 6.07911C5.1793 6.25659 5.12555 6.45783 5.12565 6.66264C5.12576 6.86745 5.17972 7.06863 5.28212 7.246L7.65428 11.3128C7.75678 11.4903 7.90422 11.6377 8.08176 11.7403C8.25931 11.8428 8.46071 11.8967 8.66573 11.8967L13.3737 11.9177C13.5785 11.9177 13.7797 11.8638 13.9572 11.7615C14.1346 11.6592 14.282 11.512 14.3846 11.3348Z"
fill="#282828"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M8.05737 1.61133L11.0023 6.6831L16.8671 6.69763" fill="#282828" />
<path
d="M8.05737 1.61133L11.0023 6.6831L16.8671 6.69763"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M18.7891 18.9646L21.125 14.9188C21.2272 14.7414 21.2809 14.5401 21.2808 14.3353C21.2807 14.1305 21.2268 13.9293 21.1244 13.752L18.7522 9.6852C18.6497 9.50765 18.5023 9.36021 18.3247 9.25771C18.1472 9.1552 17.9458 9.10124 17.7408 9.10124L13.0328 9.08027C12.828 9.08027 12.6267 9.13413 12.4493 9.23644C12.2719 9.33876 12.1245 9.48593 12.0219 9.6632L9.68606 13.709C9.58384 13.8865 9.53009 14.0877 9.53019 14.2925C9.5303 14.4973 9.58426 14.6985 9.68666 14.8759L12.0588 18.9426C12.1613 19.1202 12.3088 19.2676 12.4863 19.3701C12.6639 19.4726 12.8653 19.5266 13.0703 19.5266L17.7783 19.5476C17.9831 19.5476 18.1843 19.4937 18.3617 19.3914C18.5391 19.2891 18.6865 19.1419 18.7891 18.9646Z"
fill="#282828"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12.4866 19.3707L15.4064 14.3135"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path d="M12.4619 9.24219L15.4069 14.314L21.2716 14.3285" fill="#282828" />
<path
d="M12.4619 9.24219L15.4069 14.314L21.2716 14.3285"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M10.9515 12.2796L9.40422 12.3352C9.08131 12.6071 9.24551 13.1598 9.20538 13.1745C9.16525 13.1893 7.99516 16.7534 7.41513 18.5336L9.32951 19.228L9.87709 18.6354L11.8117 15.3667L12.2858 14.1075L10.9515 12.2796Z"
@@ -212,20 +216,20 @@ const IconHandler = (props: { icon: string }) => {
<path
d="M8.96709 19.5489C9.1719 19.5489 9.37311 19.4951 9.55053 19.3928C9.72795 19.2904 9.87536 19.1433 9.97794 18.966L12.3138 14.9202C12.416 14.7427 12.4698 14.5415 12.4697 14.3367C12.4696 14.1319 12.4156 13.9307 12.3132 13.7533L11.0907 11.6387"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M3.64966 9.24414L3.74587 9.39626L6.59462 14.3159L12.4594 14.3304"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M8.08105 11.7399L11.0009 6.68262"
stroke="inherit"
stroke-linecap="round"
stroke-linejoin="round"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
)
@@ -242,7 +246,7 @@ const BranchMenuPopoverContent = (props: {
branchBasedSettings?: boolean
}) => {
const [config, setConfig] = useConfig()
const { selectedOrg, selectedProject } = config
const { selectedOrg, selectedProject, selectedEnv } = config
// data
const projects = selectedOrg?.projects || []
@@ -256,9 +260,12 @@ const BranchMenuPopoverContent = (props: {
const projectInputRef = React.useRef<HTMLInputElement>(null)
const branchInputRef = React.useRef<HTMLInputElement>(null)
const _projectFocus = projectFocus || selectedProject?.key // dumb variable needed
const _projectFocus = selectedProject?.key // dumb variable needed
const projectMeta = projects.find((proj) => proj.key === _projectFocus)
console.log(branches)
console.log(projectMeta)
// pick up stray unfocussed state with left and right keys
useHotkeys(
'right',
@@ -342,7 +349,7 @@ const BranchMenuPopoverContent = (props: {
className={cn(
'w-4 h-4 bg-foreground rounded-full',
'flex items-center justify-center',
project.key === config.project ? 'opacity-100' : 'opacity-0'
selectedProject?.key === project.key ? 'opacity-100' : 'opacity-0'
)}
>
<Check className={cn('h-2 w-2 text-background')} strokeWidth={5} />
@@ -367,11 +374,8 @@ const BranchMenuPopoverContent = (props: {
) : !projectMeta?.branching ? (
<div className="flex flex-col items-center justify-center mt-10 px-5 text-center">
<p className="text-xs text-foreground">Branching not yet enabled</p>
<p className="text-xs text-foreground-light">Use for safe database migrations</p>
<Button type="default" className="mt-3">
Enable Branching
</Button>
<p className="text-xs text-foreground-light mb-3">Use for safe database migrations</p>
<EnableBranchingDialog />
</div>
) : (
<>
@@ -421,7 +425,7 @@ const BranchMenuPopoverContent = (props: {
className={cn(
'w-4 h-4 bg-foreground rounded-full',
'flex items-center justify-center',
config?.env?.name === branch.key ? 'opacity-100' : 'opacity-0'
selectedEnv?.key === branch.key ? 'opacity-100' : 'opacity-0'
)}
>
<Check className={cn('h-2 w-2 text-background')} strokeWidth={5} />
@@ -0,0 +1,132 @@
'use client'
import { useConfig } from '@/src/hooks/use-config'
import { X } from 'lucide-react'
import { useState } from 'react'
import {
Button,
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogSection,
DialogSectionSeparator,
DialogTitle,
DialogTrigger,
} from 'ui'
export default function EnableBranchingDialog() {
const [config, setConfig] = useConfig()
const [open, setOpenState] = useState(false)
const { selectedEnv, selectedOrg, selectedProject } = config
return (
<Dialog open={open} onOpenChange={setOpenState}>
<DialogTrigger asChild>
<Button type="default">Enable Branching</Button>
</DialogTrigger>
<DialogContent size="small">
<DialogHeader>
<DialogTitle>Enable branching</DialogTitle>
<DialogDescription>Some description</DialogDescription>
</DialogHeader>
<DialogSectionSeparator />
<DialogSection>
<p className="text-foreground-light text-sm">Turn on Github</p>
<p className="text-foreground-light text-sm">Turn on Github</p>
</DialogSection>
<DialogSectionSeparator />
<DialogSection>
<p className="text-foreground-light text-sm">Turn on Vercel</p>
<p className="text-foreground-light text-sm">Turn on Vercel</p>
</DialogSection>
<DialogFooter>
<Button
size="medium"
block
onClick={() => {
console.log('Branching enabled')
/**
* HACKY LOCAL DB STORE STUFF
*/
let updatedDbValues = config.db
// update db with new values for project
updatedDbValues = {
...updatedDbValues,
orgs: updatedDbValues.orgs.map((org) => {
if (org.key === selectedOrg?.key) {
return {
...org,
projects: org.projects.map((project) => {
if (project.key === selectedProject?.key) {
return {
...project,
branching: true,
branches: [
{
name: 'main',
type: 'prod',
key: 'main',
},
],
}
}
return project
}),
}
}
return org
}),
}
setConfig({
...config,
// @ts-expect-error
selectedProject: {
...config.selectedProject,
branching: true,
branches: [
{
name: 'main',
type: 'prod',
key: 'main',
},
],
},
selectedOrg: {
...selectedOrg,
projects: selectedOrg?.projects.map((project) => {
if (project.key === selectedProject?.key) {
return {
...project,
branching: true,
branches: [
{
name: 'main',
type: 'prod',
key: 'main',
},
],
}
}
return project
}),
},
selectedEnv: {
name: 'main',
type: 'prod',
key: 'main',
},
db: { ...updatedDbValues },
})
}}
>
Enable Branching
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
@@ -1,3 +1,4 @@
import RedirectCatcher from './redirect-catcher'
import SettingsMenuPanel from './settings-menu-panel'
import SideNav from './side-nav'
import TopHeader from './top-header'
@@ -15,6 +16,7 @@ export default function OrgLayout({
<TopHeader />
{children}
</div>
<RedirectCatcher />
</div>
)
}
@@ -0,0 +1,31 @@
'use client'
import { useParams, usePathname, useRouter } from 'next/navigation'
import { useEffect } from 'react'
import { useConfig } from '@/src/hooks/use-config'
export default function RedirectCatcher() {
const asPath = usePathname()
const router = useRouter()
const [config, setConfig] = useConfig()
const { selectedOrg, selectedProject } = config
const { org, project } = useParams()
useEffect(() => {
if (
selectedOrg?.key &&
selectedProject?.key &&
(selectedOrg.key !== org || selectedProject.key !== project)
) {
// Construct the new URL with the updated parameters
const newUrl = asPath
.replace(`/${org}`, `/${selectedOrg.key}`)
.replace(`/${project}`, `/${selectedProject.key}`)
// Navigate to the new URL
router.push(newUrl)
}
}, [selectedOrg?.key, selectedProject?.key, org, project, asPath, router])
return <></>
}
@@ -1,15 +1,15 @@
'use client'
import React from 'react'
import { usePathname } from 'next/navigation'
import settingsData from '@/src/config/settings.json'
import { ScrollArea, ScrollBar, cn } from 'ui'
import { useConfig } from '@/src/hooks/use-config'
import { usePathname } from 'next/navigation'
import { ScrollArea, ScrollBar } from 'ui'
import { ClickCounter } from './click-counter'
import Link from 'next/link'
import { SettingsGroup } from './settings-menu-group'
// Define types for the settings data items
interface SettingsItemProps {
export interface SettingsItemProps {
item: {
key: string
label: string
@@ -18,111 +18,62 @@ interface SettingsItemProps {
}
basePath: string
}
interface SettingsGroupProps {
group: string
export interface SettingsGroupProps {
group: 'Project settings' | 'Environment settings' | 'Organization settings' | 'Account settings'
items: SettingsItemProps['item'][]
basePath: string
hasBranchingEnabled?: boolean
}
const SettingsMenuChildren = () => {
const [config] = useConfig()
const pathname = usePathname()
const { organization, project } = config
const { selectedOrg, selectedProject } = config
const getBasePath = (section: string): string => {
switch (section) {
case 'PROJECT_SETTINGS':
return `/${organization}/settings/project/${project}`
return `/${selectedOrg?.key}/settings/project/${selectedProject?.key}`
case 'ENV_SETTINGS':
return `/${selectedOrg?.key}/settings/project/${selectedProject?.key}`
case 'ORGANIZATION_SETTINGS':
return `/${organization}/settings`
return `/${selectedOrg?.key}/settings`
case 'ACCOUNT_SETTINGS':
return `/${organization}/settings/account`
return `/${selectedOrg?.key}/settings/account`
default:
return ''
}
}
const SettingsItem = React.memo(
({ item, basePath }: SettingsItemProps) => {
const fullPath = `${basePath}${item.href}`
const isActive = pathname.startsWith(fullPath)
return (
<li key={item.key}>
{/* <ClickCounter /> */}
<Link
href={fullPath}
className={`pl-5 group/nav-item-anchor relative hover:text-foreground text-sm ${isActive ? 'text-foreground' : 'text-foreground-lighter'}`}
>
{item.label}
<div
className={cn(
'absolute top-1/2 transform -translate-y-1/2 h-2 w-[3px] rounded-r-full duration-500',
'group-hover/nav-item-anchor:bg-foreground-muted group-hover/nav-item-anchor:left-0',
isActive ? '!bg-foreground left-0 w-[5px] duration-100' : '-left-1',
'transition-all'
)}
></div>
</Link>
{item.items && (
<ul role="menu" className="pl-5">
{item.items.map((childItem) => (
<SettingsItem key={childItem.key} item={childItem} basePath={basePath} />
))}
</ul>
)}
</li>
)
},
(prevProps, nextProps) => {
return prevProps.item === nextProps.item && prevProps.basePath === nextProps.basePath
}
)
SettingsItem.displayName = 'SettingsItem'
const SettingsGroup = React.memo(
({ group, items, basePath }: SettingsGroupProps) => (
<div className="mb-8">
{/* <ClickCounter /> */}
<h2 className="text-sm font-mono text-foreground-lighter/75 uppercase tracking-wide px-5">
{group}
</h2>
<ul role="menu" className="mt-2">
{items.map((item) => (
<SettingsItem key={item.key} item={item} basePath={basePath} />
))}
</ul>
</div>
),
(prevProps, nextProps) => {
return (
prevProps.group === nextProps.group &&
prevProps.items === nextProps.items &&
prevProps.basePath === nextProps.basePath
)
}
)
SettingsGroup.displayName = 'SettingsGroup'
const hasBranchingEnabled = selectedProject?.branching
return (
<ScrollArea className="h-full w-full overflow-hidden">
{/* <ClickCounter /> */}
<nav aria-label="Settings Navigation" className="text-foreground-light h-full py-3">
<SettingsGroup
group="Project Settings"
key={'project-settings'}
group="Project settings"
items={settingsData.PROJECT_SETTINGS.items}
basePath={getBasePath('PROJECT_SETTINGS')}
hasBranchingEnabled={hasBranchingEnabled}
/>
<SettingsGroup
group="Organization Settings"
key={'environment-settings'}
group="Environment settings"
items={settingsData.ENV_SETTINGS.items}
basePath={getBasePath('PROJECT_SETTINGS')}
hasBranchingEnabled={hasBranchingEnabled}
/>
<SettingsGroup
key={'organization-settings'}
group="Organization settings"
items={settingsData.ORGANIZATION_SETTINGS.items}
basePath={getBasePath('ORGANIZATION_SETTINGS')}
/>
<SettingsGroup
group="Account Settings"
key={'account-settings'}
group="Account settings"
items={settingsData.ACCOUNT_SETTINGS.items}
basePath={getBasePath('ACCOUNT_SETTINGS')}
/>
@@ -0,0 +1,86 @@
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { cn } from 'ui'
import { ClickCounter } from './click-counter'
import { SettingsGroupProps, SettingsItemProps } from './settings-menu-children'
export const SettingsGroup = ({
group,
items,
basePath,
hasBranchingEnabled,
}: SettingsGroupProps) => {
return (
<div
className={cn(
'',
group === 'Project settings' && !hasBranchingEnabled ? 'mb-0' : 'mb-8',
'transition-all',
'duration-300',
'delay-500'
)}
>
{/* <ClickCounter /> */}
<h2
className={cn(
'text-sm font-mono text-foreground-lighter/75 uppercase tracking-wide px-5',
!hasBranchingEnabled && group === 'Environment settings'
? 'opacity-0 h-[0px]'
: 'opacity-100 h-[18px]',
'transition-all',
'duration-300',
'delay-500'
)}
>
{group}
</h2>
<ul
role="menu"
className={cn(
'mt-2',
!hasBranchingEnabled && group === 'Environment settings' ? '!mt-0' : '',
'transition-all',
'duration-300',
'delay-500'
)}
>
{items.map((item) => (
<SettingsItem key={item.key} item={item} basePath={basePath} />
))}
</ul>
</div>
)
}
export const SettingsItem = ({ item, basePath }: SettingsItemProps) => {
const fullPath = `${basePath}${item.href}`
const pathname = usePathname()
const isActive = pathname.startsWith(fullPath)
return (
<li key={item.key}>
{/* <ClickCounter /> */}
<Link
href={fullPath}
className={`pl-5 group/nav-item-anchor relative hover:text-foreground text-sm ${isActive ? 'text-foreground' : 'text-foreground-lighter'}`}
>
{item.label}
<div
className={cn(
'absolute top-1/2 transform -translate-y-1/2 h-2 w-[3px] rounded-r-full duration-300',
'group-hover/nav-item-anchor:bg-foreground-muted group-hover/nav-item-anchor:left-0',
isActive ? '!bg-foreground left-0 w-[5px] duration-100' : '-left-1',
'transition-all'
)}
></div>
</Link>
{item.items && (
<ul role="menu" className="pl-5">
{item.items.map((childItem) => (
<SettingsItem key={childItem.key} item={childItem} basePath={basePath} />
))}
</ul>
)}
</li>
)
}
@@ -12,6 +12,7 @@ export default function PageRender() {
<span className="text-lg text-foreground">
{org} {config} {pathname}
</span>
<h1 className="text-xl text-foreground">{config}</h1>
<hr />
</div>
)
@@ -21,7 +21,7 @@ import {
export default function SideMenuOrgMenu() {
const [open, setOpenState] = useState(false)
const [config, setConfig] = useConfig()
const { organization, db } = config
const { selectedOrg, db } = config
return (
<>
@@ -33,7 +33,7 @@ export default function SideMenuOrgMenu() {
'flex items-center justify-center text-background text-xs font-semibold'
)}
>
{config?.organization?.slice(0, 2).toUpperCase()}
{config?.selectedOrg?.name?.slice(0, 2).toUpperCase()}
</div>
</PopoverTrigger_Shadcn_>
<PopoverContent_Shadcn_ className="w-[320px] p-0" side="right" align="start" sideOffset={8}>
@@ -50,9 +50,9 @@ export default function SideMenuOrgMenu() {
setConfig({
...config,
selectedOrg: db.orgs.find((o: Org) => o.key === currentValue),
selectedProject: db.orgs.find((o: Org) => o.key === currentValue)
.projects[0],
selectedEnv: db.orgs.find((o: Org) => o.key === currentValue).projects[0]
selectedProject: db?.orgs?.find((o: Org) => o.key === currentValue)
?.projects[0],
selectedEnv: db?.orgs?.find((o: Org) => o.key === currentValue)?.projects[0]
.branches[0] ?? {
name: 'main',
type: 'prod',
@@ -78,7 +78,7 @@ export default function SideMenuOrgMenu() {
className={cn(
'w-4 h-4 bg-foreground rounded-full',
'flex items-center justify-center',
organization === org.key ? 'opacity-100' : 'opacity-0'
selectedOrg?.key === org.key ? 'opacity-100' : 'opacity-0'
)}
>
<Check className={cn('h-2 w-2 text-background')} strokeWidth={5} />
@@ -90,7 +90,7 @@ export default function SideMenuOrgMenu() {
</CommandGroup_Shadcn_>
<CommandSeparator_Shadcn_ />
<CommandGroup_Shadcn_>
<Link href={`/${organization}/settings/general`}>
<Link href={`/${selectedOrg?.key}/settings/general`}>
<CommandItem_Shadcn_ onSelect={() => setOpenState(false)} value="Settings">
Organization Settings
</CommandItem_Shadcn_>
@@ -8,7 +8,7 @@ import { cn } from 'ui'
export default function SideNavMenuIcon({ product }: { product: any }) {
const { org } = useParams()
const [config] = useConfig()
const { organization, project } = config
const { selectedOrg, selectedProject } = config
const pathname = usePathname()
const isActive = pathname.startsWith(`/${org}${product.href}`)
@@ -20,10 +20,10 @@ export default function SideNavMenuIcon({ product }: { product: any }) {
*/
let overrideHref = null
if (product.name === 'settings') {
overrideHref = `/${organization}/settings/project/${project}/general`
overrideHref = `/${selectedOrg?.key}/settings/project/${selectedProject?.key}/general`
}
if (product.name === 'table-editor' && config.tableEditor.activeTabId) {
overrideHref = `/${organization}/table-editor/${config.tableEditor.activeTabId}`
overrideHref = `/${selectedOrg?.key}/table-editor/${config.tableEditor.activeTabId}`
}
return (
@@ -40,7 +40,7 @@ export default function TableEditorItemsPanel() {
'h-full',
'bg-dash-sidebar',
//
isActive ? 'w-[300px]' : 'w-[0px]',
isActive ? 'w-[340px]' : 'w-[0px]',
isActive &&
`
border-r
@@ -65,7 +65,7 @@ export default function TableEditorItemsPanel() {
})
}
>
<CollapsibleTrigger_Shadcn_ className="px-3 text-sm uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full">
<CollapsibleTrigger_Shadcn_ className="px-3 text-xs uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full h-[23px]">
<ChevronRight
size={14}
className="group-data-[state=open]:rotate-90 transform transition-all"
@@ -99,7 +99,7 @@ export default function TableEditorItemsPanel() {
})
}
>
<CollapsibleTrigger_Shadcn_ className="px-3 text-sm uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full">
<CollapsibleTrigger_Shadcn_ className="px-3 text-xs uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full h-[23px]">
<ChevronRight
size={14}
className="group-data-[state=open]:rotate-90 transform transition-all"
@@ -133,7 +133,7 @@ export default function TableEditorItemsPanel() {
})
}
>
<CollapsibleTrigger_Shadcn_ className="px-3 text-sm uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full">
<CollapsibleTrigger_Shadcn_ className="px-3 text-xs uppercase text-foreground-lighter/75 hover:text-foreground-light font-mono flex gap-3 items-center w-full h-[23px]">
<ChevronRight
size={14}
className="group-data-[state=open]:rotate-90 transform transition-all"
+42 -18
View File
@@ -9,28 +9,19 @@
{ "label": "API", "key": "api", "href": "/api" },
{ "label": "Integrations", "key": "integrations", "href": "/integrations" },
{ "label": "Add ons", "key": "add_ons", "href": "/add-ons" },
{ "label": "Branching", "key": "branching", "href": "/branching" },
{ "label": "Branching", "key": "branching", "href": "/branching" }
]
},
"ENV_SETTINGS": {
"metadata": {
"base_path": "/project"
},
"items": [
{ "label": "Database", "key": "database", "href": "/database" },
{
"label": "Authentication",
"key": "authentication",
"href": "/authentication",
"items": [
{ "label": "General", "key": "auth_general", "href": "/authentication/general" },
{ "label": "Providers", "key": "providers", "href": "/authentication/providers" },
{ "label": "Rate Limits", "key": "rate_limits", "href": "/authentication/rate-limits" },
{
"label": "Email templates",
"key": "email_templates",
"href": "/authentication/email-templates"
},
{
"label": "URL configuration",
"key": "url_configuration",
"href": "/authentication/url-configuration"
},
{ "label": "Hooks", "key": "hooks", "href": "/authentication/hooks" }
]
"href": "/authentication"
},
{ "label": "Storage", "key": "storage", "href": "/storage" },
{ "label": "Edge Functions", "key": "edge_functions", "href": "/edge-functions" },
@@ -59,5 +50,38 @@
{ "label": "Security", "key": "security", "href": "/security" },
{ "label": "Audit logs", "key": "audit_logs", "href": "/audit-logs" }
]
},
"BACKUP": {
"metadata": {
"base_path": "/project"
},
"items": [
{ "label": "Database", "key": "database", "href": "/database" },
{
"label": "Authentication",
"key": "authentication",
"href": "/authentication",
"items": [
{ "label": "General", "key": "auth_general", "href": "/authentication/general" },
{ "label": "Providers", "key": "providers", "href": "/authentication/providers" },
{ "label": "Rate Limits", "key": "rate_limits", "href": "/authentication/rate-limits" },
{
"label": "Email templates",
"key": "email_templates",
"href": "/authentication/email-templates"
},
{
"label": "URL configuration",
"key": "url_configuration",
"href": "/authentication/url-configuration"
},
{ "label": "Hooks", "key": "hooks", "href": "/authentication/hooks" }
]
},
{ "label": "Storage", "key": "storage", "href": "/storage" },
{ "label": "Edge Functions", "key": "edge_functions", "href": "/edge-functions" },
{ "label": "Realtime", "key": "realtime", "href": "/realtime" },
{ "label": "Vault", "key": "vault", "href": "/vault" }
]
}
}
@@ -3,6 +3,8 @@ export function resolveHideBranchesDropdown(
organizationKey: string | undefined,
projectKey: string | undefined
) {
console.log(pathName, organizationKey, projectKey)
return (
(pathName.startsWith(`/${organizationKey}/settings`) &&
!pathName.startsWith(`/${organizationKey}/settings/project`)) ||
@@ -149,7 +149,7 @@ const DialogTitle = React.forwardRef<
>(({ className, ...props }, ref) => (
<DialogPrimitive.Title
ref={ref}
className={cn('text-base leading-none font-normal', className)}
className={cn('text-base leading-none font-normal text-foreground', className)}
{...props}
/>
))