mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 05:49:40 +02:00
[WEB-3978] chore: cmd k search result redirection improvements (#3126)
* chore: ce sync changes * chore: code refactor * chore: cmd-K search result redirection improvement * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor --------- Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
This commit is contained in:
committed by
GitHub
parent
454295acf4
commit
2515bd2fbd
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { Command } from "cmdk";
|
||||
// components
|
||||
import { openProjectAndScrollToSidebar } from "@/components/command-palette/actions/helper";
|
||||
// hooks
|
||||
import { useAppRouter } from "@/hooks/use-app-router";
|
||||
// plane web helpers
|
||||
@@ -32,6 +34,12 @@ export const PagesAppCommandPaletteSearchResults: React.FC<Props> = (props) => {
|
||||
onSelect={() => {
|
||||
closePalette();
|
||||
router.push(currentSection.path(item, undefined));
|
||||
const itemProjectId =
|
||||
item?.project_id ||
|
||||
(Array.isArray(item?.project_ids) && item?.project_ids?.length > 0
|
||||
? item?.project_ids[0]
|
||||
: undefined);
|
||||
if (itemProjectId) openProjectAndScrollToSidebar(itemProjectId);
|
||||
}}
|
||||
value={`${key}-${item?.id}-${item.name}-${item.project__identifier ?? ""}-${item.sequence_id ?? ""}`}
|
||||
className="focus:outline-none"
|
||||
|
||||
@@ -39,6 +39,7 @@ export const ProjectNavigationRoot: FC<TProjectItemsRootProps> = observer((props
|
||||
const additionalNavigationItems = (workspaceSlug: string, projectId: string): TNavigationItem[] => [
|
||||
{
|
||||
name: "Overview",
|
||||
key: "overview",
|
||||
href: `/${workspaceSlug}/projects/${projectId}/overview/`,
|
||||
icon: RssIcon,
|
||||
access: [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER],
|
||||
@@ -49,6 +50,7 @@ export const ProjectNavigationRoot: FC<TProjectItemsRootProps> = observer((props
|
||||
},
|
||||
{
|
||||
name: "Epics",
|
||||
key: "epics",
|
||||
href: `/${workspaceSlug}/projects/${projectId}/epics`,
|
||||
icon: EpicIcon,
|
||||
access: [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER],
|
||||
|
||||
@@ -1322,3 +1322,14 @@ input[type="color"].custom-color-picker {
|
||||
--ease-in-out-expo: cubic-bezier(1, 0, 0, 1);
|
||||
--ease-in-out-circ: cubic-bezier(0.785, 0.135, 0.15, 0.86);
|
||||
}
|
||||
|
||||
@keyframes highlight {
|
||||
0% {
|
||||
background-color: rgba(var(--color-background-90), 1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
100% {
|
||||
background-color: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user