mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
feat(cloud): an 'Orca Cloud' group with 'Add a GitHub repository…' in the Add project menu
This commit is contained in:
+2
-2
@@ -9,11 +9,11 @@ const { addProjectMenu } = withCloudAddProjectEntry(
|
||||
noop
|
||||
)
|
||||
|
||||
/** PROJ-MENU part 2: the Add project menu with "From GitHub (Orca Cloud)…" as its last entry. */
|
||||
/** PROJ-MENU part 2: the Add project menu with an "Orca Cloud" group with "Add a GitHub repository…". */
|
||||
export const addProjectMenuWithCloud = defineFixture({
|
||||
width: 520,
|
||||
render: () => (
|
||||
<div className="h-[260px] bg-background p-4">
|
||||
<div className="h-[320px] bg-background p-4">
|
||||
<AddProjectMenu
|
||||
open
|
||||
side="bottom"
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@ describe('withCloudAddProjectEntry (PROJ-MENU part 2)', () => {
|
||||
<DropdownMenuContent>{result.addProjectMenu?.extraItems?.(closeMenus)}</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)
|
||||
fireEvent.click(screen.getByRole('menuitem', { name: 'From GitHub (Orca Cloud)…' }))
|
||||
expect(screen.getByText('Orca Cloud')).toBeTruthy()
|
||||
fireEvent.click(screen.getByRole('menuitem', { name: 'Add a GitHub repository…' }))
|
||||
expect(closeMenus).toHaveBeenCalledOnce()
|
||||
expect(more).toHaveBeenCalledOnce()
|
||||
expect(closeMenus.mock.invocationCallOrder[0]).toBeLessThan(more.mock.invocationCallOrder[0])
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
// PROJ-MENU part 2: "Give Orca Cloud access to more repositories" moves out of the project list into
|
||||
// the Add project menu, as one more way to add a project: "From GitHub (Orca Cloud)…".
|
||||
// the Add project menu, in its own "Orca Cloud" group: "Add a GitHub repository…".
|
||||
import React from 'react'
|
||||
import { Github } from 'lucide-react'
|
||||
import { DropdownMenuItem } from '@/components/ui/dropdown-menu'
|
||||
import { DropdownMenuItem, DropdownMenuSeparator } from '@/components/ui/dropdown-menu'
|
||||
import { useTranslate } from '@/i18n/use-translate'
|
||||
import type { ProjectComboboxAddProjectMenu } from './ProjectComboboxAddProjectOption'
|
||||
|
||||
function FromGitHubItem({ onSelect }: { onSelect: () => void }): React.JSX.Element {
|
||||
const t = useTranslate()
|
||||
return (
|
||||
<DropdownMenuItem onSelect={onSelect}>
|
||||
<Github />
|
||||
<span className="truncate">
|
||||
{t('components.newWorkspace.cloudOnly.fromGitHub', 'From GitHub (Orca Cloud)…')}
|
||||
</span>
|
||||
</DropdownMenuItem>
|
||||
<>
|
||||
{/* Its own group: the header's host picker doesn't apply to Orca Cloud. */}
|
||||
<DropdownMenuSeparator />
|
||||
<div
|
||||
role="presentation"
|
||||
className="flex min-h-[26px] items-center py-0.5 pl-2.5 text-2xs font-semibold text-muted-foreground select-none"
|
||||
>
|
||||
{t('components.newWorkspace.cloudOnly.menuGroup', 'Orca Cloud')}
|
||||
</div>
|
||||
<DropdownMenuItem onSelect={onSelect}>
|
||||
<Github />
|
||||
{/* The same words as the composer's link, so both ways in read the same. */}
|
||||
<span className="truncate">
|
||||
{t('components.newWorkspace.cloudOnly.addRepositoryMenu', 'Add a GitHub repository…')}
|
||||
</span>
|
||||
</DropdownMenuItem>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -23900,7 +23900,8 @@
|
||||
"rowPrivate": "{{repo}}, private, cloud only",
|
||||
"rowPublic": "{{repo}}, cloud only",
|
||||
"privateLabel": "Private",
|
||||
"fromGitHub": "From GitHub (Orca Cloud)…"
|
||||
"menuGroup": "Orca Cloud",
|
||||
"addRepositoryMenu": "Add a GitHub repository…"
|
||||
},
|
||||
"agentLabel": "Agent"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user