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