mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: prevent folder click on navigation from duplicating path addition
This commit is contained in:
@@ -963,6 +963,7 @@ const Page = () => {
|
|||||||
workspaceId={workspaceId}
|
workspaceId={workspaceId}
|
||||||
secretPath={secretPath}
|
secretPath={secretPath}
|
||||||
onNavigateToFolder={handleResetFilter}
|
onNavigateToFolder={handleResetFilter}
|
||||||
|
canNavigate={isFetched}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{canReadDynamicSecret && Boolean(dynamicSecrets?.length) && (
|
{canReadDynamicSecret && Boolean(dynamicSecrets?.length) && (
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
import { subject } from "@casl/ability";
|
import { subject } from "@casl/ability";
|
||||||
import {
|
import { faClose, faEdit, faFolder, faInfoCircle, faPencilSquare, faTrash } from "@fortawesome/free-solid-svg-icons";
|
||||||
faClose,
|
|
||||||
faEdit,
|
|
||||||
faFolder,
|
|
||||||
faInfoCircle,
|
|
||||||
faPencilSquare,
|
|
||||||
faTrash
|
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { useNavigate, useSearch } from "@tanstack/react-router";
|
import { useNavigate, useSearch } from "@tanstack/react-router";
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
@@ -36,6 +29,7 @@ type Props = {
|
|||||||
workspaceId: string;
|
workspaceId: string;
|
||||||
secretPath?: string;
|
secretPath?: string;
|
||||||
onNavigateToFolder: (path: string) => void;
|
onNavigateToFolder: (path: string) => void;
|
||||||
|
canNavigate: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FolderListView = ({
|
export const FolderListView = ({
|
||||||
@@ -43,7 +37,8 @@ export const FolderListView = ({
|
|||||||
environment,
|
environment,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
secretPath = "/",
|
secretPath = "/",
|
||||||
onNavigateToFolder
|
onNavigateToFolder,
|
||||||
|
canNavigate
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
const { popUp, handlePopUpToggle, handlePopUpOpen, handlePopUpClose } = usePopUp([
|
||||||
"updateFolder",
|
"updateFolder",
|
||||||
@@ -190,7 +185,7 @@ export const FolderListView = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleFolderClick = (name: string, isPending?: boolean) => {
|
const handleFolderClick = (name: string, isPending?: boolean) => {
|
||||||
if (isPending) {
|
if (isPending || !canNavigate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const path = `${secretPathQueryparam === "/" ? "" : secretPathQueryparam}/${name}`;
|
const path = `${secretPathQueryparam === "/" ? "" : secretPathQueryparam}/${name}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user