diff --git a/public/images/navigation.png b/public/images/navigation.png index e9c0bc235..250209724 100644 Binary files a/public/images/navigation.png and b/public/images/navigation.png differ diff --git a/src/components/Assets/AssetTypeList/index.tsx b/src/components/Assets/AssetTypeList/index.tsx index e35600393..83ed5591e 100644 --- a/src/components/Assets/AssetTypeList/index.tsx +++ b/src/components/Assets/AssetTypeList/index.tsx @@ -13,8 +13,8 @@ const ASSET_TYPE_IDS = [ ]; export const AssetTypeList = (props: AssetListProps) => { - const handleAssetTypeClick = (categoryId: string) => { - props.onAssetTypeSelect(categoryId); + const handleAssetTypeClick = (assetTypeId: string) => { + props.onAssetTypeSelect(assetTypeId); }; return ( diff --git a/src/components/Assets/AssetTypeList/types.ts b/src/components/Assets/AssetTypeList/types.ts index df5949294..9c35917f9 100644 --- a/src/components/Assets/AssetTypeList/types.ts +++ b/src/components/Assets/AssetTypeList/types.ts @@ -2,5 +2,5 @@ import { ExtendedAssetEntry } from "../types"; export interface AssetListProps { data: { [key: string]: { [key: string]: ExtendedAssetEntry[] } }; - onAssetTypeSelect: (categoryId: string) => void; + onAssetTypeSelect: (assetTypeId: string) => void; } diff --git a/src/components/InstallationWizard/index.tsx b/src/components/InstallationWizard/index.tsx index f97926b6f..e47083c0e 100644 --- a/src/components/InstallationWizard/index.tsx +++ b/src/components/InstallationWizard/index.tsx @@ -2,6 +2,7 @@ import copy from "copy-to-clipboard"; import { useState } from "react"; import { getActions } from "../../utils/getActions"; import { CheckmarkCircleIcon } from "../common/icons/CheckmarkCircleIcon"; +import { CheckmarkCircleInvertedIcon } from "../common/icons/CheckmarkCircleInvertedIcon"; import { CopyIcon } from "../common/icons/CopyIcon"; import { Loader } from "../common/Loader"; import { Button } from "./Button"; @@ -10,13 +11,15 @@ import * as s from "./styles"; const ACTION_PREFIX = "INSTALLATION_WIZARD"; const actions = getActions(ACTION_PREFIX, { - skip: "SKIP", finish: "FINISH" }); export const InstallationWizard = () => { - const [currentStep, setCurrentStep] = useState(0); + const [currentStep, setCurrentStep] = useState(0); const [isDigmaInstalled, setIsDigmaInstalled] = useState(false); + const [isCollectorModified, setIsCollectorModified] = + useState(false); + const [isAlreadyUsingOtel, setIsAlreadyUsingOtel] = useState(false); const handleCopyButtonClick = (text: string) => { copy(text); @@ -26,6 +29,14 @@ export const InstallationWizard = () => { setIsDigmaInstalled(true); }; + const handleInstallDigmaButtonClick = () => { + window.open( + "https://open.docker.com/extensions/marketplace?extensionId=digmaai/digma-docker-extension", + "_blank", + "noopener,noreferrer" + ); + }; + const handleContinueButtonClick = () => { if (currentStep < steps.length - 1) { setCurrentStep(currentStep + 1); @@ -38,18 +49,20 @@ export const InstallationWizard = () => { const handleSkipLinkClick = (e: React.MouseEvent) => { e.preventDefault(); - window.sendMessageToDigma({ - action: actions.skip - }); + if (currentStep < steps.length - 1) { + setCurrentStep(currentStep + 1); + } }; const handleAlreadyUsingOTELLinkClick = ( e: React.MouseEvent ) => { e.preventDefault(); - window.sendMessageToDigma({ - action: actions.skip - }); + setIsAlreadyUsingOtel(!isAlreadyUsingOtel); + }; + + const handleCollectorIsModifiedButtonClick = () => { + setIsCollectorModified(true); }; const renderDigmaInstallationContent = () => { @@ -61,6 +74,27 @@ export const InstallationWizard = () => { return ( <> + Install Digma Docker Extension + + (You’ll need{" "} + + Docker Desktop + {" "} + installed) + + + + + or Run the following from the terminal/command line to start the Digma backend: @@ -124,7 +158,7 @@ export const InstallationWizard = () => { > these {" "} - instructions instead: + instructions instead {isDigmaInstalled ? ( - - Already using OpenTelemetry? - - - - ); + const renderObservabilityContent = (isAlreadyUsingOtel: boolean) => { + const collectorConfigurationSnippet = `otlp/digma: + endpoint: "localhost:5050" + tls: + insecure: true +service: + pipelines: + traces: + exporters: [otlp/digma, ...]`; + + return isAlreadyUsingOtel ? ( + <> + Add Digma to your collector: + + Modify your collector configuration file to add Digma’s backend as a + target. For example: + + + {collectorConfigurationSnippet} + handleCopyButtonClick(collectorConfigurationSnippet)} + > + + + + {isCollectorModified ? ( + + ) : ( + + )} + + + + Observe your application + + + + ) : ( + <> + How to get started? + + Press in three dots icon and enable "Observability" toggle + + + + + + Already using OpenTelemetry? + + + + ); + }; const steps = [ { + shortTitle: "Install Digma", title: "Get Digma up and running", content: renderDigmaInstallationContent(), link: { @@ -193,8 +282,13 @@ export const InstallationWizard = () => { } }, { - title: "Observe your application", - content: renderObservabilityContent(), + shortTitle: isAlreadyUsingOtel + ? "If you’re already using OpenTelemetry… " + : "Observe your application", + title: isAlreadyUsingOtel + ? "If you’re already using OpenTelemetry… " + : "Observe your application", + content: renderObservabilityContent(isAlreadyUsingOtel), link: { text: "Already using OpenTelemetry?", onClick: (e: React.MouseEvent) => { @@ -206,9 +300,22 @@ export const InstallationWizard = () => { const step = steps[currentStep]; + const previousSteps = steps.slice(0, currentStep); + return ( - Digma quick start guide for Java + {previousSteps.length > 0 ? ( + previousSteps.map((step, i) => ( + + + Step {i + 1} + {step.shortTitle} + + )) + ) : ( + Follow the steps to configure your project + )} + Step {currentStep + 1} {step.title} diff --git a/src/components/InstallationWizard/styles.ts b/src/components/InstallationWizard/styles.ts index 6b3086568..7038159fe 100644 --- a/src/components/InstallationWizard/styles.ts +++ b/src/components/InstallationWizard/styles.ts @@ -8,9 +8,25 @@ export const Container = styled.div` flex-direction: column; `; +export const PreviousStepHeader = styled.div` + display: flex; + gap: 8px; + padding: 9px; + color: #919191; + background: #6a6a6a; + font-weight: 500; + font-size: 10px; + line-height: 12px; + text-transform: uppercase; +`; + +export const StepShortTitle = styled.span` + margin-left: auto; + text-transform: none; +`; + export const Header = styled.div` display: flex; - text-align: center; justify-content: center; // TODO: check font /* font-family: "Nunito"; */ @@ -64,6 +80,16 @@ export const SectionTitle = styled.span` color: #ededed; `; +export const SectionDivider = styled.span` + // TODO: check font + /* font-family: "Nunito"; */ + font-weight: 700; + font-size: 12px; + line-height: 16px; + margin: 20px 0; + color: #ededed; +`; + export const SectionDescription = styled.span` // TODO: check font /* font-family: "Nunito"; */ @@ -93,6 +119,7 @@ export const Code = styled.code` line-height: 20px; letter-spacing: -0.1px; color: #dadada; + white-space: pre; `; export const CopyButton = styled.button` @@ -124,6 +151,7 @@ export const Link = styled.a` line-height: 12px; color: #dadada; text-decoration: underline; + cursor: pointer; `; // export const SectionNumber = styled.div` diff --git a/src/components/common/icons/CheckmarkCircleInvertedIcon.tsx b/src/components/common/icons/CheckmarkCircleInvertedIcon.tsx new file mode 100644 index 000000000..c2ade8b22 --- /dev/null +++ b/src/components/common/icons/CheckmarkCircleInvertedIcon.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import { useIconProps } from "./hooks"; +import { IconProps } from "./types"; + +const CheckmarkCircleInvertedIconComponent = (props: IconProps) => { + const { size, color } = useIconProps(props); + + return ( + + + + + ); +}; + +export const CheckmarkCircleInvertedIcon = React.memo( + CheckmarkCircleInvertedIconComponent +);