Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/RecentActivity/EnvironmentTypePanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useContext } from "react";
import { openURLInDefaultBrowser } from "../../../utils/openURLInDefaultBrowser";
import { sendTrackingEvent } from "../../../utils/sendTrackingEvent";
import { ConfigContext } from "../../common/App/ConfigContext";
import { EnvironmentType } from "../../common/App/types";
import { IconTag } from "../../common/IconTag";
import { NewButton } from "../../common/NewButton";
Expand All @@ -12,6 +14,9 @@ import { EnvironmentTypeData, EnvironmentTypePanelProps } from "./types";
const DIGMA_FOR_TEAMS_URL = "https://digma.ai/digma-for-teams/";

export const EnvironmentTypePanel = (props: EnvironmentTypePanelProps) => {
const config = useContext(ConfigContext);
const isHelmDeployment = config.backendInfo?.deploymentType === "Helm";

const handleEnvironmentTypeButtonClick = (type: EnvironmentType) => {
const typeData = environmentTypes.find((x) => x.type === type);

Expand All @@ -21,7 +26,7 @@ export const EnvironmentTypePanel = (props: EnvironmentTypePanelProps) => {
});
}

if (type === "shared") {
if (type === "shared" && !isHelmDeployment) {
openURLInDefaultBrowser(DIGMA_FOR_TEAMS_URL);
return;
}
Expand Down Expand Up @@ -54,7 +59,7 @@ export const EnvironmentTypePanel = (props: EnvironmentTypePanelProps) => {
button: (
<NewButton
onClick={() => handleEnvironmentTypeButtonClick("shared")}
label={"Learn more"}
label={isHelmDeployment ? "Add" : "Learn more"}
buttonType={"secondary"}
size={"large"}
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/common/App/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface BackendInfo {
}

export enum DeploymentType {
HELM = "Helm",
DOCKER_COMPOSE = "DockerCompose",
DOCKER_EXTENSION = "DockerExtension"
}
Expand Down