mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: patchy patchy for request secret
This commit is contained in:
@@ -28,7 +28,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
|
||||
rbac: false,
|
||||
githubOrgSync: false,
|
||||
customRateLimits: false,
|
||||
subOrganization: true,
|
||||
subOrganization: false,
|
||||
customAlerts: false,
|
||||
secretAccessInsights: false,
|
||||
auditLogs: false,
|
||||
|
||||
@@ -33,7 +33,7 @@ export type TFeatureSet = {
|
||||
membersUsed: number;
|
||||
identityLimit: null;
|
||||
identitiesUsed: number;
|
||||
subOrganization: true;
|
||||
subOrganization: false;
|
||||
environmentLimit: null;
|
||||
environmentsUsed: 0;
|
||||
secretVersioning: true;
|
||||
|
||||
@@ -383,7 +383,6 @@ export const Navbar = () => {
|
||||
to: "/organization/projects",
|
||||
search: (prev) => ({ ...prev, subOrganization: subOrg.name })
|
||||
});
|
||||
|
||||
await router.invalidate({ sync: true }).catch(() => null);
|
||||
}}
|
||||
className="cursor-pointer font-normal"
|
||||
|
||||
@@ -51,7 +51,6 @@ export const NewSubOrganizationForm = ({ onClose }: ContentProps) => {
|
||||
to: "/organization/projects",
|
||||
search: (prev) => ({ ...prev, subOrganization: organization.name })
|
||||
});
|
||||
|
||||
await router.invalidate({ sync: true }).catch(() => null);
|
||||
} catch {
|
||||
createNotification({
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Controller, useForm } from "react-hook-form";
|
||||
import { faCheck, faCopy, faRedo } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useSearch } from "@tanstack/react-router";
|
||||
import { z } from "zod";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
@@ -36,6 +37,10 @@ export const RequestSecretForm = () => {
|
||||
const [, isCopyingSecret, setCopyTextSecret] = useTimedReset<string>({
|
||||
initialState: "Copy to clipboard"
|
||||
});
|
||||
const subOrganization = useSearch({
|
||||
strict: false,
|
||||
select: (el) => el?.subOrganization
|
||||
});
|
||||
|
||||
const { mutateAsync: createSecretRequest } = useCreateSecretRequest();
|
||||
|
||||
@@ -58,12 +63,15 @@ export const RequestSecretForm = () => {
|
||||
expiresAt
|
||||
});
|
||||
|
||||
const link = `${window.location.origin}/secret-request/secret/${id}`;
|
||||
const link = new URL(`${window.location.origin}/secret-request/secret/${id}`);
|
||||
if (subOrganization) {
|
||||
link.searchParams.set("subOrganization", subOrganization);
|
||||
}
|
||||
|
||||
setSecretLink(link);
|
||||
setSecretLink(link.toString());
|
||||
reset();
|
||||
|
||||
navigator.clipboard.writeText(link);
|
||||
navigator.clipboard.writeText(link.toString());
|
||||
setCopyTextSecret("secret");
|
||||
|
||||
createNotification({
|
||||
|
||||
@@ -46,7 +46,7 @@ export const SubOrgNameChangeSection = (): JSX.Element => {
|
||||
});
|
||||
|
||||
navigate({ to: "/organization/settings", search: { subOrganization: name } });
|
||||
queryClient.clear();
|
||||
queryClient.invalidateQueries();
|
||||
await router.invalidate({ sync: true });
|
||||
createNotification({
|
||||
text: "Successfully updated sub-organization details",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { createRootRouteWithContext, Outlet, useSearch } from "@tanstack/react-router";
|
||||
|
||||
@@ -6,7 +7,6 @@ import { TooltipProvider } from "@app/components/v2";
|
||||
import { adminQueryKeys, fetchServerConfig } from "@app/hooks/api/admin/queries";
|
||||
import { TServerConfig } from "@app/hooks/api/admin/types";
|
||||
import { queryClient } from "@app/hooks/api/reactQuery";
|
||||
import { useEffect } from "react";
|
||||
|
||||
type TRouterContext = {
|
||||
serverConfig: TServerConfig | null;
|
||||
@@ -20,7 +20,7 @@ const RootPage = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
queryClient.clear();
|
||||
queryClient.invalidateQueries();
|
||||
}, [subOrganization]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user