Merge remote-tracking branch 'origin' into delete-org

This commit is contained in:
Tuan Dang
2023-10-10 14:54:19 +01:00
15 changed files with 257 additions and 149 deletions
+33 -7
View File
@@ -87,13 +87,15 @@ const syncSecrets = async ({
integrationAuth, integrationAuth,
secrets, secrets,
accessId, accessId,
accessToken accessToken,
appendices
}: { }: {
integration: IIntegration; integration: IIntegration;
integrationAuth: IIntegrationAuth; integrationAuth: IIntegrationAuth;
secrets: Record<string, { value: string; comment?: string }>; secrets: Record<string, { value: string; comment?: string }>;
accessId: string | null; accessId: string | null;
accessToken: string; accessToken: string;
appendices?: { prefix: string, suffix: string };
}) => { }) => {
switch (integration.integration) { switch (integration.integration) {
case INTEGRATION_GCP_SECRET_MANAGER: case INTEGRATION_GCP_SECRET_MANAGER:
@@ -153,7 +155,8 @@ const syncSecrets = async ({
await syncSecretsGitHub({ await syncSecretsGitHub({
integration, integration,
secrets, secrets,
accessToken accessToken,
appendices
}); });
break; break;
case INTEGRATION_GITLAB: case INTEGRATION_GITLAB:
@@ -218,7 +221,8 @@ const syncSecrets = async ({
await syncSecretsCheckly({ await syncSecretsCheckly({
integration, integration,
secrets, secrets,
accessToken accessToken,
appendices
}); });
break; break;
case INTEGRATION_QOVERY: case INTEGRATION_QOVERY:
@@ -1342,11 +1346,13 @@ const syncSecretsNetlify = async ({
const syncSecretsGitHub = async ({ const syncSecretsGitHub = async ({
integration, integration,
secrets, secrets,
accessToken accessToken,
appendices
}: { }: {
integration: IIntegration; integration: IIntegration;
secrets: Record<string, { value: string; comment?: string }>; secrets: Record<string, { value: string; comment?: string }>;
accessToken: string; accessToken: string;
appendices?: { prefix: string, suffix: string };
}) => { }) => {
interface GitHubRepoKey { interface GitHubRepoKey {
key_id: string; key_id: string;
@@ -1376,7 +1382,7 @@ const syncSecretsGitHub = async ({
).data; ).data;
// Get local copy of decrypted secrets. We cannot decrypt them as we dont have access to GH private key // Get local copy of decrypted secrets. We cannot decrypt them as we dont have access to GH private key
const encryptedSecrets: GitHubSecretRes = ( let encryptedSecrets: GitHubSecretRes = (
await octokit.request("GET /repos/{owner}/{repo}/actions/secrets", { await octokit.request("GET /repos/{owner}/{repo}/actions/secrets", {
owner: integration.owner, owner: integration.owner,
repo: integration.app repo: integration.app
@@ -1389,6 +1395,15 @@ const syncSecretsGitHub = async ({
{} {}
); );
encryptedSecrets = Object.keys(encryptedSecrets).reduce((result: {
[key: string]: GitHubSecret;
}, key) => {
if ((appendices?.prefix !== undefined ? key.startsWith(appendices?.prefix) : true) && (appendices?.suffix !== undefined ? key.endsWith(appendices?.suffix) : true)) {
result[key] = encryptedSecrets[key];
}
return result;
}, {});
Object.keys(encryptedSecrets).map(async (key) => { Object.keys(encryptedSecrets).map(async (key) => {
if (!(key in secrets)) { if (!(key in secrets)) {
await octokit.request("DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}", { await octokit.request("DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}", {
@@ -2074,13 +2089,15 @@ const syncSecretsSupabase = async ({
const syncSecretsCheckly = async ({ const syncSecretsCheckly = async ({
integration, integration,
secrets, secrets,
accessToken accessToken,
appendices
}: { }: {
integration: IIntegration; integration: IIntegration;
secrets: Record<string, { value: string; comment?: string }>; secrets: Record<string, { value: string; comment?: string }>;
accessToken: string; accessToken: string;
appendices?: { prefix: string, suffix: string };
}) => { }) => {
const getSecretsRes = ( let getSecretsRes = (
await standardRequest.get(`${INTEGRATION_CHECKLY_API_URL}/v1/variables`, { await standardRequest.get(`${INTEGRATION_CHECKLY_API_URL}/v1/variables`, {
headers: { headers: {
Authorization: `Bearer ${accessToken}`, Authorization: `Bearer ${accessToken}`,
@@ -2096,6 +2113,15 @@ const syncSecretsCheckly = async ({
{} {}
); );
getSecretsRes = Object.keys(getSecretsRes).reduce((result: {
[key: string]: string;
}, key) => {
if ((appendices?.prefix !== undefined ? key.startsWith(appendices?.prefix) : true) && (appendices?.suffix !== undefined ? key.endsWith(appendices?.suffix) : true)) {
result[key] = getSecretsRes[key];
}
return result;
}, {});
// add secrets // add secrets
for await (const key of Object.keys(secrets)) { for await (const key of Object.keys(secrets)) {
if (!(key in getSecretsRes)) { if (!(key in getSecretsRes)) {
@@ -60,7 +60,8 @@ syncSecretsToThirdPartyServices.process(async (job: Job) => {
integrationAuth, integrationAuth,
secrets: Object.keys(suffixedSecrets).length !== 0 ? suffixedSecrets : secrets, secrets: Object.keys(suffixedSecrets).length !== 0 ? suffixedSecrets : secrets,
accessId: access.accessId === undefined ? null : access.accessId, accessId: access.accessId === undefined ? null : access.accessId,
accessToken: access.accessToken accessToken: access.accessToken,
appendices: { prefix: integration.metadata?.secretPrefix || "", suffix: integration.metadata?.secretSuffix || "" }
}); });
} }
}) })
Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

@@ -23,10 +23,8 @@ export const ContentLoader = ({ text, frequency = 2000 }: Props) => {
}, []); }, []);
return ( return (
<div className="container mx-auto flex relative flex-col h-1/2 w-full items-center justify-center px-8 text-mineshaft-50 dark:[color-scheme:dark] space-y-8"> <div className="container mx-auto flex relative flex-col h-screen w-full items-center justify-center px-8 text-mineshaft-50 dark:[color-scheme:dark] space-y-8">
<div> <img src="/images/loading/loading.gif" height={70} width={120} alt="loading animation" />
<img src="/images/loading/loading.gif" height={210} width={240} alt="loading animation" />
</div>
{text && isTextArray && ( {text && isTextArray && (
<AnimatePresence exitBeforeEnter> <AnimatePresence exitBeforeEnter>
<motion.div <motion.div
@@ -40,7 +38,7 @@ export const ContentLoader = ({ text, frequency = 2000 }: Props) => {
</motion.div> </motion.div>
</AnimatePresence> </AnimatePresence>
)} )}
{text && !isTextArray && <div className="text-primary text-sm">{text}</div>} {text && !isTextArray && <div className="text-primary text-xs">{text}</div>}
</div> </div>
); );
}; };
@@ -22,7 +22,7 @@ const sanitizeConf = {
const syntaxHighlight = (content?: string | null, isVisible?: boolean) => { const syntaxHighlight = (content?: string | null, isVisible?: boolean) => {
if (content === "") return "EMPTY"; if (content === "") return "EMPTY";
if (!content) return "missing"; if (!content) return "EMPTY";
if (!isVisible) return replaceContentWithDot(content); if (!isVisible) return replaceContentWithDot(content);
const sanitizedContent = sanitizeHtml( const sanitizedContent = sanitizeHtml(
+24 -28
View File
@@ -10,6 +10,7 @@ import crypto from "crypto";
import { useEffect } from "react"; import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { faGithub, faSlack } from "@fortawesome/free-brands-svg-icons"; import { faGithub, faSlack } from "@fortawesome/free-brands-svg-icons";
@@ -67,9 +68,10 @@ import {
useCreateWorkspace, useCreateWorkspace,
useGetOrgTrialUrl, useGetOrgTrialUrl,
useGetSecretApprovalRequestCount, useGetSecretApprovalRequestCount,
useGetUserAction,
useLogoutUser, useLogoutUser,
useUploadWsKey useRegisterUserAction,
} from "@app/hooks/api"; useUploadWsKey} from "@app/hooks/api";
interface LayoutProps { interface LayoutProps {
children: React.ReactNode; children: React.ReactNode;
@@ -117,7 +119,8 @@ export const AppLayout = ({ children }: LayoutProps) => {
const { user } = useUser(); const { user } = useUser();
const { subscription } = useSubscription(); const { subscription } = useSubscription();
const workspaceId = currentWorkspace?._id || ""; const workspaceId = currentWorkspace?._id || "";
// const [ isLearningNoteOpen, setIsLearningNoteOpen ] = useState(true); const { data: updateClosed } = useGetUserAction("september_update_closed");
const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({ workspaceId }); const { data: secretApprovalReqCount } = useGetSecretApprovalRequestCount({ workspaceId });
const isAddingProjectsAllowed = subscription?.workspaceLimit const isAddingProjectsAllowed = subscription?.workspaceLimit
@@ -144,6 +147,12 @@ export const AppLayout = ({ children }: LayoutProps) => {
const { t } = useTranslation(); const { t } = useTranslation();
const registerUserAction = useRegisterUserAction();
const closeUpdate = async () => {
await registerUserAction.mutateAsync("september_update_closed");
}
const logout = useLogoutUser(); const logout = useLogoutUser();
const logOutUser = async () => { const logOutUser = async () => {
try { try {
@@ -479,9 +488,9 @@ export const AppLayout = ({ children }: LayoutProps) => {
} }
icon="system-outline-189-domain-verification" icon="system-outline-189-domain-verification"
> >
Secret approval Secret approvals
{Boolean(secretApprovalReqCount?.open) && ( {Boolean(secretApprovalReqCount?.open) && (
<span className="text-xs p-0.5 rounded ml-2 bg-primary text-black"> <span className="text-xs font-semibold py-0.5 px-1 rounded ml-2 bg-primary-600 border border-primary-400 text-black">
{secretApprovalReqCount?.open} {secretApprovalReqCount?.open}
</span> </span>
)} )}
@@ -537,19 +546,6 @@ export const AppLayout = ({ children }: LayoutProps) => {
</MenuItem> </MenuItem>
</a> </a>
</Link> </Link>
{/* {workspaces.map(project => <Link key={project._id} href={`/project/${project?._id}/secrets/overview`} passHref>
<a>
<SubMenuItem
isSelected={false}
icon="system-outline-44-folder"
>
{project.name}
</SubMenuItem>
</a>
<div className="pl-8 text-mineshaft-300 text-sm py-1 cursor-default hover:text-mineshaft-100">
<FontAwesomeIcon icon={faFolder} className="text-xxs pr-0.5"/> {project.name} <FontAwesomeIcon icon={faArrowRight} className="text-xs pl-0.5"/>
</div>
</Link>)} */}
<Link href={`/org/${currentOrg?._id}/members`} passHref> <Link href={`/org/${currentOrg?._id}/members`} passHref>
<a> <a>
<MenuItem <MenuItem
@@ -601,26 +597,26 @@ export const AppLayout = ({ children }: LayoutProps) => {
: "mb-4" : "mb-4"
} flex w-full cursor-default flex-col items-center px-3 text-sm text-mineshaft-400`} } flex w-full cursor-default flex-col items-center px-3 text-sm text-mineshaft-400`}
> >
{/* <div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[9.9rem] ${router.asPath.includes("org") ? "bottom-[8.4rem]" : "bottom-[5.4rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-30`}/> {/* <div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[9.9rem] ${router.asPath.includes("org") ? "bottom-[8.4rem]" : "bottom-[5.4rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-30`}/>
<div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[10.7rem] ${router.asPath.includes("org") ? "bottom-[8.15rem]" : "bottom-[5.15rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-50`}/> <div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[10.7rem] ${router.asPath.includes("org") ? "bottom-[8.15rem]" : "bottom-[5.15rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-50`}/>
<div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[11.5rem] ${router.asPath.includes("org") ? "bottom-[7.9rem]" : "bottom-[4.9rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-70`}/> <div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[11.5rem] ${router.asPath.includes("org") ? "bottom-[7.9rem]" : "bottom-[4.9rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-70`}/>
<div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[12.3rem] ${router.asPath.includes("org") ? "bottom-[7.65rem]" : "bottom-[4.65rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-90`}/> <div className={`${isLearningNoteOpen ? "block" : "hidden"} z-0 absolute h-60 w-[12.3rem] ${router.asPath.includes("org") ? "bottom-[7.65rem]" : "bottom-[4.65rem]"} bg-mineshaft-900 border border-mineshaft-600 mb-4 rounded-md opacity-90`}/> */}
<div className={`${isLearningNoteOpen ? "block" : "hidden"} relative z-10 h-60 w-52 bg-mineshaft-900 border border-mineshaft-600 mb-6 rounded-md flex flex-col items-center justify-start px-3`}> <div className={`${!updateClosed ? "block" : "hidden"} relative z-10 h-64 w-52 bg-mineshaft-900 border border-mineshaft-600 mb-6 rounded-md flex flex-col items-center justify-start px-3`}>
<div className="w-full mt-2 text-md text-mineshaft-100 font-semibold">Kubernetes Operator</div> <div className="w-full mt-2 text-md text-mineshaft-100 font-semibold">Infisical September update</div>
<div className="w-full mt-1 text-sm text-mineshaft-300 font-normal leading-[1.2rem] mb-1">Integrate Infisical into your Kubernetes infrastructure</div> <div className="w-full mt-1 text-sm text-mineshaft-300 font-normal leading-[1.2rem] mb-1">Improved RBAC, new integrations, dashboard remake, and more!</div>
<div className="h-[6.8rem] w-full bg-mineshaft-200 rounded-md mt-2 rounded-md border border-mineshaft-700"> <div className="h-[6.77rem] w-full rounded-md mt-2 border border-mineshaft-700">
<Image src="/images/kubernetes-asset.png" height={319} width={539} alt="kubernetes image" className="rounded-sm" /> <Image src="/images/infisical-update-september-2023.png" height={319} width={539} alt="kubernetes image" className="rounded-sm" />
</div> </div>
<div className="w-full flex justify-between items-center mt-3 px-0.5"> <div className="w-full flex justify-between items-center mt-3 px-0.5">
<button <button
type="button" type="button"
onClick={() => setIsLearningNoteOpen(false)} onClick={() => closeUpdate()}
className="text-mineshaft-400 hover:text-mineshaft-100 duration-200" className="text-mineshaft-400 hover:text-mineshaft-100 duration-200"
> >
Close Close
</button> </button>
<a <a
href="https://infisical.com/docs/documentation/getting-started/kubernetes" href="https://infisical.com/blog/infisical-update-september-2023"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="text-sm text-mineshaft-400 font-normal leading-[1.2rem] hover:text-mineshaft-100 duration-200" className="text-sm text-mineshaft-400 font-normal leading-[1.2rem] hover:text-mineshaft-100 duration-200"
@@ -628,7 +624,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
Learn More <FontAwesomeIcon icon={faArrowUpRightFromSquare} className="text-xs pl-0.5"/> Learn More <FontAwesomeIcon icon={faArrowUpRightFromSquare} className="text-xs pl-0.5"/>
</a> </a>
</div> </div>
</div> */} </div>
{router.asPath.includes("org") && ( {router.asPath.includes("org") && (
<div <div
onKeyDown={() => null} onKeyDown={() => null}
+136 -64
View File
@@ -3,8 +3,9 @@ import Head from "next/head";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { faArrowUpRightFromSquare, faBookOpen, faBugs, faCircleInfo } from "@fortawesome/free-solid-svg-icons"; import { faAngleDown, faArrowUpRightFromSquare, faBookOpen, faBugs, faCheckCircle, faCircleInfo } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { motion } from "framer-motion";
import queryString from "query-string"; import queryString from "query-string";
import { import {
@@ -15,10 +16,18 @@ import {
Button, Button,
Card, Card,
CardTitle, CardTitle,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
FormControl, FormControl,
Input, Input,
Select, Select,
SelectItem SelectItem,
Tab,
TabList,
TabPanel,
Tabs
} from "../../../components/v2"; } from "../../../components/v2";
import { import {
useGetIntegrationAuthApps, useGetIntegrationAuthApps,
@@ -26,6 +35,11 @@ import {
} from "../../../hooks/api/integrationAuth"; } from "../../../hooks/api/integrationAuth";
import { useGetWorkspaceById } from "../../../hooks/api/workspace"; import { useGetWorkspaceById } from "../../../hooks/api/workspace";
enum TabSections {
Connection = "connection",
Options = "options"
}
export default function GitHubCreateIntegrationPage() { export default function GitHubCreateIntegrationPage() {
const router = useRouter(); const router = useRouter();
const { mutateAsync } = useCreateIntegration(); const { mutateAsync } = useCreateIntegration();
@@ -40,7 +54,8 @@ export default function GitHubCreateIntegrationPage() {
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState(""); const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
const [secretPath, setSecretPath] = useState("/"); const [secretPath, setSecretPath] = useState("/");
const [targetAppId, setTargetAppId] = useState(""); const [targetAppIds, setTargetAppIds] = useState<string[]>([]);
const [secretSuffix, setSecretSuffix] = useState("");
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
@@ -53,9 +68,9 @@ export default function GitHubCreateIntegrationPage() {
useEffect(() => { useEffect(() => {
if (integrationAuthApps) { if (integrationAuthApps) {
if (integrationAuthApps.length > 0) { if (integrationAuthApps.length > 0) {
setTargetAppId(integrationAuthApps[0].appId as string); setTargetAppIds([String(integrationAuthApps[0].appId)]);
} else { } else {
setTargetAppId("none"); setTargetAppIds(["none"]);
} }
} }
}, [integrationAuthApps]); }, [integrationAuthApps]);
@@ -66,20 +81,27 @@ export default function GitHubCreateIntegrationPage() {
if (!integrationAuth?._id) return; if (!integrationAuth?._id) return;
const targetApp = integrationAuthApps?.find( const targetApps = integrationAuthApps?.filter(
(integrationAuthApp) => integrationAuthApp.appId === targetAppId (integrationAuthApp) => targetAppIds.includes(String(integrationAuthApp.appId))
); );
if (!targetApp || !targetApp.owner) return; if (!targetApps) return;
await mutateAsync({ await Promise.all(
integrationAuthId: integrationAuth?._id, targetApps.map(async (targetApp) => {
isActive: true, await mutateAsync({
app: targetApp.name, integrationAuthId: integrationAuth?._id,
sourceEnvironment: selectedSourceEnvironment, isActive: true,
owner: targetApp.owner, app: targetApp.name,
secretPath sourceEnvironment: selectedSourceEnvironment,
}); owner: targetApp.owner,
secretPath,
metadata: {
secretSuffix
}
})
})
);
setIsLoading(false); setIsLoading(false);
router.push(`/integrations/${localStorage.getItem("projectData.id")}`); router.push(`/integrations/${localStorage.getItem("projectData.id")}`);
@@ -92,7 +114,7 @@ export default function GitHubCreateIntegrationPage() {
workspace && workspace &&
selectedSourceEnvironment && selectedSourceEnvironment &&
integrationAuthApps && integrationAuthApps &&
targetAppId ? ( targetAppIds ? (
<div className="flex flex-col h-full w-full items-center justify-center"> <div className="flex flex-col h-full w-full items-center justify-center">
<Head> <Head>
<title>Set Up GitHub Integration</title> <title>Set Up GitHub Integration</title>
@@ -124,59 +146,109 @@ export default function GitHubCreateIntegrationPage() {
</Link> </Link>
</div> </div>
</CardTitle> </CardTitle>
<FormControl label="Project Environment" className="px-6"> <Tabs defaultValue={TabSections.Connection} className="px-6">
<Select <TabList>
value={selectedSourceEnvironment} <div className="flex flex-row border-b border-mineshaft-600 w-full">
onValueChange={(val) => setSelectedSourceEnvironment(val)} <Tab value={TabSections.Connection}>Connection</Tab>
className="w-full border border-mineshaft-500" <Tab value={TabSections.Options}>Options</Tab>
> </div>
{workspace?.environments.map((sourceEnvironment) => ( </TabList>
<SelectItem <TabPanel value={TabSections.Connection}>
value={sourceEnvironment.slug} <motion.div
key={`azure-key-vault-environment-${sourceEnvironment.slug}`} key="panel-1"
> transition={{ duration: 0.15 }}
{sourceEnvironment.name} initial={{ opacity: 0, translateX: 30 }}
</SelectItem> animate={{ opacity: 1, translateX: 0 }}
))} exit={{ opacity: 0, translateX: 30 }}
</Select> >
</FormControl> <FormControl label="Project Environment">
<FormControl label="Secrets Path" className="px-6"> <Select
<Input value={selectedSourceEnvironment}
value={secretPath} onValueChange={(val) => setSelectedSourceEnvironment(val)}
onChange={(evt) => setSecretPath(evt.target.value)} className="w-full border border-mineshaft-500"
placeholder="Provide a path, default is /"
/>
</FormControl>
<FormControl label="GitHub Repo" className="px-6">
<Select
value={targetAppId}
onValueChange={(val) => setTargetAppId(val)}
className="w-full border border-mineshaft-500"
isDisabled={integrationAuthApps.length === 0}
>
{integrationAuthApps.length > 0 ? (
integrationAuthApps.map((integrationAuthApp) => (
<SelectItem
value={integrationAuthApp.appId as string}
key={`github-repo-${integrationAuthApp.appId}`}
> >
{integrationAuthApp.name} {workspace?.environments.map((sourceEnvironment) => (
</SelectItem> <SelectItem
)) value={sourceEnvironment.slug}
) : ( key={`azure-key-vault-environment-${sourceEnvironment.slug}`}
<SelectItem value="none" key="target-app-none"> >
No repositories found {sourceEnvironment.name}
</SelectItem> </SelectItem>
)} ))}
</Select> </Select>
</FormControl> </FormControl>
<FormControl label="Secrets Path">
<Input
value={secretPath}
onChange={(evt) => setSecretPath(evt.target.value)}
placeholder="Provide a path, default is /"
/>
</FormControl>
<FormControl label="GitHub Repo">
<DropdownMenu>
<DropdownMenuTrigger asChild>
{(integrationAuthApps.length > 0) ? <div className="w-full cursor-pointer border border-mineshaft-600 inline-flex items-center justify-between rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm font-normal text-bunker-200 outline-none data-[placeholder]:text-mineshaft-200">
{targetAppIds.length === 1 ? integrationAuthApps?.find(
(integrationAuthApp) => targetAppIds[0] === String(integrationAuthApp.appId)
)?.name : `${targetAppIds.length} repositories selected`}
<FontAwesomeIcon icon={faAngleDown} className="text-xs" />
</div> : <div className="w-full cursor-default border border-mineshaft-600 inline-flex items-center justify-between rounded-md bg-mineshaft-900 px-3 py-2 font-inter text-sm font-normal text-bunker-200 outline-none data-[placeholder]:text-mineshaft-200">
No repositories found
</div>}
</DropdownMenuTrigger>
<DropdownMenuContent align="start" className="z-[100] max-h-80 overflow-y-scroll thin-scrollbar">
{(integrationAuthApps.length > 0) ? (
integrationAuthApps.map((integrationAuthApp) => {
const isSelected = targetAppIds.includes(String(integrationAuthApp.appId));
return (
<DropdownMenuItem
onClick={() => {
if (targetAppIds.includes(String(integrationAuthApp.appId))) {
setTargetAppIds(targetAppIds.filter((appId) => appId !== String(integrationAuthApp.appId)));
} else {
setTargetAppIds([...targetAppIds, String(integrationAuthApp.appId)]);
}
}}
key={integrationAuthApp.appId}
icon={isSelected ? <FontAwesomeIcon icon={faCheckCircle} className="text-primary pr-0.5" /> : <div className="pl-[1.01rem]"/>}
iconPos="left"
className="w-[28.4rem] text-sm"
>
{integrationAuthApp.name}
</DropdownMenuItem>
)})
) : <div/>}
</DropdownMenuContent>
</DropdownMenu>
</FormControl>
</motion.div>
</TabPanel>
<TabPanel value={TabSections.Options}>
<motion.div
key="panel-1"
transition={{ duration: 0.15 }}
initial={{ opacity: 0, translateX: -30 }}
animate={{ opacity: 1, translateX: 0 }}
exit={{ opacity: 0, translateX: 30 }}
>
<FormControl label="Append Secret Names with..." className="pb-[9.75rem]">
<Input
value={secretSuffix}
onChange={(evt) => setSecretSuffix(evt.target.value)}
placeholder="Provide a suffix for secret names, default is no suffix"
/>
</FormControl>
</motion.div>
</TabPanel>
</Tabs>
<Button <Button
onClick={handleButtonClick} onClick={handleButtonClick}
color="mineshaft" color="mineshaft"
variant="outline_bg" variant="outline_bg"
className="mt-2 mb-6 ml-auto mr-6" className="mb-6 ml-auto mr-6"
isLoading={isLoading} isLoading={isLoading}
isDisabled={integrationAuthApps.length === 0} isDisabled={integrationAuthApps.length === 0 || targetAppIds.length === 0}
> >
Create Integration Create Integration
</Button> </Button>
+2 -1
View File
@@ -9,7 +9,7 @@ export default function LoginPage() {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<div className="flex min-h-screen flex-col justify-center bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6 pb-28 "> <div className="flex min-h-screen max-h-screen overflow-y-auto flex-col justify-center bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6">
<Head> <Head>
<title>{t("common.head-title", { title: t("login.title") })}</title> <title>{t("common.head-title", { title: t("login.title") })}</title>
<link rel="icon" href="/infisical.ico" /> <link rel="icon" href="/infisical.ico" />
@@ -23,6 +23,7 @@ export default function LoginPage() {
</div> </div>
</Link> </Link>
<Login /> <Login />
<div className="pb-28"/>
</div> </div>
); );
} }
+1 -1
View File
@@ -145,7 +145,7 @@ export default function SignUp() {
}; };
return ( return (
<div className="flex min-h-screen flex-col justify-center bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6 pb-28 "> <div className="flex min-h-screen max-h-screen overflow-y-auto flex-col justify-center bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 px-6 pb-28 ">
<Head> <Head>
<title>{t("common.head-title", { title: t("signup.title") })}</title> <title>{t("common.head-title", { title: t("signup.title") })}</title>
<link rel="icon" href="/infisical.ico" /> <link rel="icon" href="/infisical.ico" />
@@ -139,7 +139,7 @@ export const IntegrationsSection = ({
</div> </div>
</div> </div>
)} )}
{(integration.integration === "checkly") && ( {((integration.integration === "checkly") || (integration.integration === "github")) && (
<div className="ml-2 flex flex-col"> <div className="ml-2 flex flex-col">
<FormLabel label="Secret Suffix" /> <FormLabel label="Secret Suffix" />
<div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200"> <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200">
@@ -113,7 +113,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
<h1 className="mb-8 bg-gradient-to-b from-white to-bunker-200 bg-clip-text text-center text-xl font-medium text-transparent"> <h1 className="mb-8 bg-gradient-to-b from-white to-bunker-200 bg-clip-text text-center text-xl font-medium text-transparent">
Login to Infisical Login to Infisical
</h1> </h1>
<div className="mt-4 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-2 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button <Button
colorSchema="primary" colorSchema="primary"
variant="outline_bg" variant="outline_bg"
@@ -126,12 +126,12 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
window.close(); window.close();
}} }}
leftIcon={<FontAwesomeIcon icon={faGoogle} className="mr-2" />} leftIcon={<FontAwesomeIcon icon={faGoogle} className="mr-2" />}
className="mx-0 h-11 w-full" className="mx-0 h-10 w-full"
> >
{t("login.continue-with-google")} {t("login.continue-with-google")}
</Button> </Button>
</div> </div>
<div className="mt-4 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-2 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button <Button
colorSchema="primary" colorSchema="primary"
variant="outline_bg" variant="outline_bg"
@@ -145,12 +145,12 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
window.close(); window.close();
}} }}
leftIcon={<FontAwesomeIcon icon={faGithub} className="mr-2" />} leftIcon={<FontAwesomeIcon icon={faGithub} className="mr-2" />}
className="mx-0 h-11 w-full" className="mx-0 h-10 w-full"
> >
Continue with GitHub Continue with GitHub
</Button> </Button>
</div> </div>
<div className="mt-4 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-2 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button <Button
colorSchema="primary" colorSchema="primary"
variant="outline_bg" variant="outline_bg"
@@ -164,12 +164,12 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
window.close(); window.close();
}} }}
leftIcon={<FontAwesomeIcon icon={faGitlab} className="mr-2" />} leftIcon={<FontAwesomeIcon icon={faGitlab} className="mr-2" />}
className="mx-0 h-11 w-full" className="mx-0 h-10 w-full"
> >
Continue with GitLab Continue with GitLab
</Button> </Button>
</div> </div>
<div className="mt-4 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-2 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button <Button
colorSchema="primary" colorSchema="primary"
variant="outline_bg" variant="outline_bg"
@@ -177,7 +177,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
setStep(2); setStep(2);
}} }}
leftIcon={<FontAwesomeIcon icon={faLock} className="mr-2" />} leftIcon={<FontAwesomeIcon icon={faLock} className="mr-2" />}
className="mx-0 h-11 w-full" className="mx-0 h-10 w-full"
> >
Continue with SSO Continue with SSO
</Button> </Button>
@@ -195,10 +195,10 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
placeholder="Enter your email..." placeholder="Enter your email..."
isRequired isRequired
autoComplete="username" autoComplete="username"
className="h-11" className="h-10"
/> />
</div> </div>
<div className="mt-4 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-2 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Input <Input
value={password} value={password}
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
@@ -207,15 +207,15 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
isRequired isRequired
autoComplete="current-password" autoComplete="current-password"
id="current-password" id="current-password"
className="select:-webkit-autofill:focus h-11" className="select:-webkit-autofill:focus h-10"
/> />
</div> </div>
<div className="mt-5 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6"> <div className="mt-3 w-1/4 min-w-[21.2rem] rounded-md text-center md:min-w-[20.1rem] lg:w-1/6">
<Button <Button
type="submit" type="submit"
size="sm" size="sm"
isFullWidth isFullWidth
className="h-11" className="h-10"
colorSchema="primary" colorSchema="primary"
variant="solid" variant="solid"
isLoading={isLoading} isLoading={isLoading}
@@ -227,10 +227,9 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
{!isLoading && loginError && <Error text={t("login.error-login") ?? ""} />} {!isLoading && loginError && <Error text={t("login.error-login") ?? ""} />}
{!serverDetails?.inviteOnlySignup ? ( {!serverDetails?.inviteOnlySignup ? (
<div className="mt-6 flex flex-row text-sm text-bunker-400"> <div className="mt-6 flex flex-row text-sm text-bunker-400">
<span className="mr-1">Don&apos;t have an acount yet?</span>
<Link href="/signup"> <Link href="/signup">
<span className="cursor-pointer duration-200 hover:text-bunker-200 hover:underline hover:decoration-primary-700 hover:underline-offset-4"> <span className="cursor-pointer duration-200 hover:text-bunker-200 hover:underline hover:decoration-primary-700 hover:underline-offset-4">
{t("login.create-account")} Don&apos;t have an acount yet? {t("login.create-account")}
</span> </span>
</Link> </Link>
</div> </div>
@@ -238,10 +237,9 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
<div /> <div />
)} )}
<div className="flex flex-row text-sm text-bunker-400"> <div className="flex flex-row text-sm text-bunker-400">
<span className="mr-1">Forgot password?</span>
<Link href="/verify-email"> <Link href="/verify-email">
<span className="cursor-pointer duration-200 hover:text-bunker-200 hover:underline hover:decoration-primary-700 hover:underline-offset-4"> <span className="cursor-pointer duration-200 hover:text-bunker-200 hover:underline hover:decoration-primary-700 hover:underline-offset-4">
Recover your account Forgot password? Recover your account
</span> </span>
</Link> </Link>
</div> </div>
@@ -14,7 +14,7 @@ export const SecretApprovalPage = () => {
const workspaceId = currentWorkspace?._id || ""; const workspaceId = currentWorkspace?._id || "";
return ( return (
<div className="container mx-auto bg-bunker-800 text-white w-full h-full max-w-7xl"> <div className="container mx-auto bg-bunker-800 text-white w-full h-full max-w-7xl px-6">
<div className="my-6"> <div className="my-6">
<p className="text-3xl font-semibold text-gray-200">Secret Approvals</p> <p className="text-3xl font-semibold text-gray-200">Secret Approvals</p>
</div> </div>
@@ -39,9 +39,9 @@ import { StoreProvider } from "./SecretMainPage.store";
import { Filter, GroupBy, SortDir } from "./SecretMainPage.types"; import { Filter, GroupBy, SortDir } from "./SecretMainPage.types";
const LOADER_TEXT = [ const LOADER_TEXT = [
"Retriving your encrypted secrets", "Retrieving your encrypted secrets...",
"Fetching folders", "Fetching folders...",
"Getting secret import links" "Getting secret import links..."
]; ];
export const SecretMainPage = () => { export const SecretMainPage = () => {
@@ -325,7 +325,7 @@ export const SecretOverviewPage = () => {
className="bg-mineshaft-700" className="bg-mineshaft-700"
/> />
)} )}
{isTableEmpty && ( {isTableEmpty && !isTableLoading && (
<Tr> <Tr>
<Td colSpan={userAvailableEnvs.length + 1}> <Td colSpan={userAvailableEnvs.length + 1}>
<EmptyState title="Let's add some secrets" icon={faFolderBlank} iconSize="3x"> <EmptyState title="Let's add some secrets" icon={faFolderBlank} iconSize="3x">
@@ -335,7 +335,7 @@ export const SecretOverviewPage = () => {
query: { id: workspaceId, env: userAvailableEnvs?.[0]?.slug } query: { id: workspaceId, env: userAvailableEnvs?.[0]?.slug }
}} }}
> >
<Button className="mt-2 p-1">Go to {userAvailableEnvs?.[0]?.name}</Button> <Button className="mt-4" variant="outline_bg" colorSchema="primary" size="md">Go to {userAvailableEnvs?.[0]?.name}</Button>
</Link> </Link>
</EmptyState> </EmptyState>
</Td> </Td>
@@ -1,3 +1,7 @@
import Link from "next/link";
import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { OrgPermissionCan } from "@app/components/permissions"; import { OrgPermissionCan } from "@app/components/permissions";
import { Button } from "@app/components/v2"; import { Button } from "@app/components/v2";
import { import {
@@ -74,24 +78,36 @@ export const PreviewSection = () => {
subscription?.slug !== "enterprise" && subscription?.slug !== "enterprise" &&
subscription?.slug !== "pro" && subscription?.slug !== "pro" &&
subscription?.slug !== "pro-annual" && ( subscription?.slug !== "pro-annual" && (
<div className="p-4 rounded-lg flex-1 border border-mineshaft-600 mb-6 flex items-center bg-mineshaft-600"> <div className="flex flex-row space-x-6">
<div className="flex-1"> <div className="p-4 rounded-lg flex-1 border border-primary/40 mb-6 flex items-center bg-primary/10">
<h2 className="text-xl font-semibold text-mineshaft-50">Become Infisical</h2> <div className="flex-1">
<p className="text-gray-400 mt-4"> <h2 className="text-xl font-medium text-mineshaft-100">Unleash the full power of <span className="text-transparent font-semibold bg-clip-text bg-gradient-to-r from-primary-500 to-yellow">Infisical</span></h2>
Unlimited members, projects, RBAC, smart alerts, and so much more <p className="text-gray-400 mt-4">
</p> Get unlimited members, projects, RBAC, smart alerts, and so much more.
</p>
</div>
<OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Billing}>
{(isAllowed) => (
<Button
onClick={() => handleUpgradeBtnClick()}
color="mineshaft"
isDisabled={!isAllowed}
>
{!subscription.has_used_trial ? "Start Pro Free Trial" : "Upgrade Plan"}
</Button>
)}
</OrgPermissionCan>
</div>
<div className="flex flex-col max-w-[12rem] w-full items-start border border-mineshaft-600 mb-6 flex items-center bg-mineshaft-800 p-4 rounded-lg">
<div className="mb-4 flex justify-center w-full font-semibold text-mineshaft-200">Want to learn more? </div>
<div className="flex justify-center w-full">
<Link href="https://infisical.com/schedule-demo">
<span className="rounded-full px-4 py-2 bg-mineshaft-600 border border-mineshaft-500 hover:bg-primary/10 hover:border-primary/40 duration-200 cursor-pointer">
Book a demo <FontAwesomeIcon icon={faArrowUpRightFromSquare} className="text-xs mb-[0.06rem] ml-1"/>
</span>
</Link>
</div>
</div> </div>
<OrgPermissionCan I={OrgPermissionActions.Create} a={OrgPermissionSubjects.Billing}>
{(isAllowed) => (
<Button
onClick={() => handleUpgradeBtnClick()}
color="mineshaft"
isDisabled={!isAllowed}
>
{!subscription.has_used_trial ? "Start Pro Free Trial" : "Upgrade Plan"}
</Button>
)}
</OrgPermissionCan>
</div> </div>
)} )}
{!isLoading && subscription && data && ( {!isLoading && subscription && data && (