mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
Merge pull request #4949 from Infisical/fix/project-navigation
fix: project navigation
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
|||||||
faStar as faSolidStar
|
faStar as faSolidStar
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { Link, linkOptions } from "@tanstack/react-router";
|
import { Link, linkOptions, useParams } from "@tanstack/react-router";
|
||||||
|
|
||||||
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
||||||
import { OrgPermissionCan } from "@app/components/permissions";
|
import { OrgPermissionCan } from "@app/components/permissions";
|
||||||
@@ -46,7 +46,7 @@ const PROJECT_TYPE_NAME: Record<ProjectType, string> = {
|
|||||||
[ProjectType.SecretScanning]: "Secret Scanning"
|
[ProjectType.SecretScanning]: "Secret Scanning"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ProjectSelect = () => {
|
const ProjectSelectInner = () => {
|
||||||
const [searchProject, setSearchProject] = useState("");
|
const [searchProject, setSearchProject] = useState("");
|
||||||
const { currentProject: currentWorkspace } = useProject();
|
const { currentProject: currentWorkspace } = useProject();
|
||||||
const { currentOrg } = useOrganization();
|
const { currentOrg } = useOrganization();
|
||||||
@@ -238,3 +238,14 @@ export const ProjectSelect = () => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ProjectSelect = () => {
|
||||||
|
const params = useParams({ strict: false });
|
||||||
|
|
||||||
|
// Return null during navigation when projectId is not available
|
||||||
|
if (!params.projectId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return <ProjectSelectInner />;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user