feat: add customOpenUrl utility for secure external link handling (#12705)

* feat: add customOpenUrl utility for secure external link handling

Extract window.open with noopener/noreferrer into a reusable customization
utility and use it in ProviderConfigurationForm. Also converts to type-only
imports where applicable.

* fix: use existing function

* fix: use custom open tab function
This commit is contained in:
Viktor Avelino
2026-04-14 18:07:49 -04:00
committed by GitHub
parent a47f2ad17e
commit 14fe53e150

View File

@ -4,10 +4,11 @@ import ShadTooltip from "@/components/common/shadTooltipComponent";
import MultiselectComponent from "@/components/core/parameterRenderComponent/components/multiselectComponent";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { ProviderVariable } from "@/constants/providerConstants";
import type { ProviderVariable } from "@/constants/providerConstants";
import { customOpenNewTab } from "@/customization/utils/custom-open-new-tab";
import useAlertStore from "@/stores/alertStore";
import DisconnectWarning from "./DisconnectWarning";
import { Provider } from "./types";
import type { Provider } from "./types";
const PROVIDER_KEY_PREVIEW: Record<
string,
@ -145,11 +146,7 @@ const ProviderConfigurationForm = ({
className="underline cursor-pointer hover:text-primary"
onClick={() => {
if (selectedProvider.api_docs_url) {
window.open(
selectedProvider.api_docs_url,
"_blank",
"noopener,noreferrer",
);
customOpenNewTab(selectedProvider.api_docs_url);
}
}}
>