mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
Remove target environment input box from cloudflare workers integration
This commit is contained in:
@@ -9,10 +9,6 @@ import {
|
|||||||
import { Button, Card, CardTitle, FormControl, Select, SelectItem } from "../../../components/v2";
|
import { Button, Card, CardTitle, FormControl, Select, SelectItem } from "../../../components/v2";
|
||||||
import { useGetIntegrationAuthApps, useGetIntegrationAuthById } from "../../../hooks/api/integrationAuth";
|
import { useGetIntegrationAuthApps, useGetIntegrationAuthById } from "../../../hooks/api/integrationAuth";
|
||||||
|
|
||||||
const cloudflareEnvironments = [
|
|
||||||
{ name: "Production", slug: "production" }
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function CloudflareWorkersIntegrationPage() {
|
export default function CloudflareWorkersIntegrationPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { mutateAsync } = useCreateIntegration();
|
const { mutateAsync } = useCreateIntegration();
|
||||||
@@ -27,7 +23,6 @@ export default function CloudflareWorkersIntegrationPage() {
|
|||||||
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
|
const [selectedSourceEnvironment, setSelectedSourceEnvironment] = useState("");
|
||||||
const [targetApp, setTargetApp] = useState("");
|
const [targetApp, setTargetApp] = useState("");
|
||||||
const [targetAppId, setTargetAppId] = useState("");
|
const [targetAppId, setTargetAppId] = useState("");
|
||||||
const [targetEnvironment, setTargetEnvironment] = useState("");
|
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
@@ -42,10 +37,8 @@ export default function CloudflareWorkersIntegrationPage() {
|
|||||||
if (integrationAuthApps.length > 0) {
|
if (integrationAuthApps.length > 0) {
|
||||||
setTargetApp(integrationAuthApps[0].name);
|
setTargetApp(integrationAuthApps[0].name);
|
||||||
setTargetAppId(String(integrationAuthApps[0].appId));
|
setTargetAppId(String(integrationAuthApps[0].appId));
|
||||||
setTargetEnvironment(cloudflareEnvironments[0].slug);
|
|
||||||
} else {
|
} else {
|
||||||
setTargetApp("none");
|
setTargetApp("none");
|
||||||
setTargetEnvironment(cloudflareEnvironments[0].slug);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [integrationAuthApps]);
|
}, [integrationAuthApps]);
|
||||||
@@ -62,7 +55,6 @@ export default function CloudflareWorkersIntegrationPage() {
|
|||||||
app: targetApp,
|
app: targetApp,
|
||||||
appId: targetAppId,
|
appId: targetAppId,
|
||||||
sourceEnvironment: selectedSourceEnvironment,
|
sourceEnvironment: selectedSourceEnvironment,
|
||||||
targetEnvironment,
|
|
||||||
secretPath: "/",
|
secretPath: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -78,7 +70,6 @@ export default function CloudflareWorkersIntegrationPage() {
|
|||||||
workspace &&
|
workspace &&
|
||||||
selectedSourceEnvironment &&
|
selectedSourceEnvironment &&
|
||||||
integrationAuthApps &&
|
integrationAuthApps &&
|
||||||
targetEnvironment &&
|
|
||||||
targetApp ? (
|
targetApp ? (
|
||||||
<div className="flex h-full w-full items-center justify-center bg-gradient-to-tr from-mineshaft-900 to-bunker-900">
|
<div className="flex h-full w-full items-center justify-center bg-gradient-to-tr from-mineshaft-900 to-bunker-900">
|
||||||
<Card className="max-w-lg rounded-md p-0 border border-mineshaft-600">
|
<Card className="max-w-lg rounded-md p-0 border border-mineshaft-600">
|
||||||
@@ -122,22 +113,6 @@ export default function CloudflareWorkersIntegrationPage() {
|
|||||||
)}
|
)}
|
||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl label="Cloudflare Workers Environment" className="mt-4 px-6">
|
|
||||||
<Select
|
|
||||||
value={targetEnvironment}
|
|
||||||
onValueChange={(val) => setTargetEnvironment(val)}
|
|
||||||
className="w-full border border-mineshaft-500"
|
|
||||||
>
|
|
||||||
{cloudflareEnvironments.map((cloudflareEnvironment) => (
|
|
||||||
<SelectItem
|
|
||||||
value={cloudflareEnvironment.slug}
|
|
||||||
key={`target-environment-${cloudflareEnvironment.slug}`}
|
|
||||||
>
|
|
||||||
{cloudflareEnvironment.name}
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
</FormControl>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={handleButtonClick}
|
onClick={handleButtonClick}
|
||||||
color="mineshaft"
|
color="mineshaft"
|
||||||
|
|||||||
Reference in New Issue
Block a user