diff --git a/frontend/src/container/OnboardingQuestionaire/AboutSigNozQuestions/AboutSigNozQuestions.tsx b/frontend/src/container/OnboardingQuestionaire/AboutSigNozQuestions/AboutSigNozQuestions.tsx index 09ca867e5f..c573d552fe 100644 --- a/frontend/src/container/OnboardingQuestionaire/AboutSigNozQuestions/AboutSigNozQuestions.tsx +++ b/frontend/src/container/OnboardingQuestionaire/AboutSigNozQuestions/AboutSigNozQuestions.tsx @@ -1,23 +1,52 @@ /* eslint-disable sonarjs/cognitive-complexity */ import '../OnboardingQuestionaire.styles.scss'; -import { Button, Typography } from 'antd'; -import { ArrowLeft, ArrowRight } from 'lucide-react'; +import { Color } from '@signozhq/design-tokens'; +import { Button, Input, Typography } from 'antd'; +import logEvent from 'api/common/logEvent'; +import { ArrowLeft, ArrowRight, CheckCircle } from 'lucide-react'; import { useEffect, useState } from 'react'; interface AboutSigNozQuestionsProps { + signozDetails: any; + setSignozDetails: (details: any) => void; onNext: () => void; onBack: () => void; } +const hearAboutSignozOptions: Record = { + blog: 'Blog', + hackerNews: 'Hacker News', + linkedin: 'LinkedIn', + twitter: 'Twitter', + reddit: 'Reddit', + colleaguesFriends: 'Colleagues / Friends', +}; + +const interestedInOptions: Record = { + savingCosts: 'Saving costs', + otelNativeStack: 'Interested in Otel-native stack', + allInOne: 'All in one', +}; + export function AboutSigNozQuestions({ + signozDetails, + setSignozDetails, onNext, onBack, }: AboutSigNozQuestionsProps): JSX.Element { - const [hearAboutSignoz, setHearAboutSignoz] = useState(null); - const [otherAboutSignoz, setOtherAboutSignoz] = useState(''); - const [interestedSignoz, setInterestedSignoz] = useState(null); - const [otherInterest, setOtherInterest] = useState(''); + const [hearAboutSignoz, setHearAboutSignoz] = useState( + signozDetails?.hearAboutSignoz || null, + ); + const [otherAboutSignoz, setOtherAboutSignoz] = useState( + signozDetails?.otherAboutSignoz || '', + ); + const [interestedSignoz, setInterestedSignoz] = useState( + signozDetails?.interestedSignoz || null, + ); + const [otherInterest, setOtherInterest] = useState( + signozDetails?.otherInterest || '', + ); const [isNextDisabled, setIsNextDisabled] = useState(true); useEffect((): void => { @@ -33,6 +62,42 @@ export function AboutSigNozQuestions({ } }, [hearAboutSignoz, otherAboutSignoz, interestedSignoz, otherInterest]); + const handleOnNext = (): void => { + setSignozDetails({ + hearAboutSignoz, + otherAboutSignoz, + interestedSignoz, + otherInterest, + }); + + logEvent('Onboarding: SigNoz Questions: Next', { + hearAboutSignoz, + otherAboutSignoz, + interestedSignoz, + otherInterest, + }); + + onNext(); + }; + + const handleOnBack = (): void => { + setSignozDetails({ + hearAboutSignoz, + otherAboutSignoz, + interestedSignoz, + otherInterest, + }); + + logEvent('Onboarding: SigNoz Questions: Back', { + hearAboutSignoz, + otherAboutSignoz, + interestedSignoz, + otherInterest, + }); + + onBack(); + }; + return (
@@ -46,78 +111,49 @@ export function AboutSigNozQuestions({
Where did you hear about SigNoz?
-
- - - - - - +
+ {Object.keys(hearAboutSignozOptions).map((option: string) => ( + + ))} {hearAboutSignoz === 'Others' ? ( - + ) : ( + '' + ) + } onChange={(e): void => setOtherAboutSignoz(e.target.value)} /> ) : ( - + )}
@@ -126,62 +162,56 @@ export function AboutSigNozQuestions({
What are you interested in doing with SigNoz?
-
- - - +
+ {Object.keys(interestedInOptions).map((option: string) => ( + + ))} {interestedSignoz === 'Others' ? ( - + ) : ( + '' + ) + } onChange={(e): void => setOtherInterest(e.target.value)} /> ) : ( - + )}
- @@ -189,7 +219,7 @@ export function AboutSigNozQuestions({
@@ -63,7 +127,7 @@ function InviteTeamMembers({ Back - diff --git a/frontend/src/container/OnboardingQuestionaire/OnboardingQuestionaire.styles.scss b/frontend/src/container/OnboardingQuestionaire/OnboardingQuestionaire.styles.scss index df07b47f27..8be4dc608c 100644 --- a/frontend/src/container/OnboardingQuestionaire/OnboardingQuestionaire.styles.scss +++ b/frontend/src/container/OnboardingQuestionaire/OnboardingQuestionaire.styles.scss @@ -216,6 +216,7 @@ transition: background-color 0.3s ease; min-width: 258px; cursor: pointer; + box-sizing: border-box; } .radio-button.active, @@ -228,6 +229,61 @@ background: rgba(78, 116, 248, 0.2); } + .two-column-grid { + width: 100%; + display: grid; + grid-template-columns: 1fr 1fr; /* Two equal columns */ + gap: 10px; + } + + .onboarding-questionaire-button, + .add-another-member-button { + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 2px; + border: 1px solid var(--Greyscale-Slate-400, #1d212d); + background: var(--Ink-300, #16181d); + color: var(--Vanilla-400, var(--Greyscale-Vanilla-400, #c0c1c3)); + box-shadow: none; + font-size: 14px; + font-style: normal; + text-align: left; + font-weight: 400; + transition: background-color 0.3s ease; + cursor: pointer; + height: 40px; + box-sizing: border-box; + + &:hover { + border: 1px solid rgba(78, 116, 248, 0.4); + background: rgba(78, 116, 248, 0.2); + } + + &:focus-visible { + outline: none; + } + + &.active { + border: 1px solid rgba(78, 116, 248, 0.4); + background: rgba(78, 116, 248, 0.2); + } + } + + .add-another-member-button { + font-size: 12px; + height: 32px; + } + + .onboarding-questionaire-other-input { + .ant-input-group { + .ant-input { + border-top-right-radius: 0px !important; + border-bottom-right-radius: 0px !important; + } + } + } + .tool-grid { grid-template-columns: repeat(4, 1fr); } @@ -275,4 +331,12 @@ padding: 12px 24px; box-sizing: border-box; } + + .invite-team-members-add-another-member-container { + width: 100%; + display: flex; + justify-content: flex-end; + align-items: center; + margin-top: 12px; + } } diff --git a/frontend/src/container/OnboardingQuestionaire/OptimiseSignozNeeds/OptimiseSignozNeeds.tsx b/frontend/src/container/OnboardingQuestionaire/OptimiseSignozNeeds/OptimiseSignozNeeds.tsx index 52f45ca0b5..107b1830ef 100644 --- a/frontend/src/container/OnboardingQuestionaire/OptimiseSignozNeeds/OptimiseSignozNeeds.tsx +++ b/frontend/src/container/OnboardingQuestionaire/OptimiseSignozNeeds/OptimiseSignozNeeds.tsx @@ -1,7 +1,11 @@ import { Button, Slider, SliderSingleProps, Typography } from 'antd'; +import logEvent from 'api/common/logEvent'; import { ArrowLeft, ArrowRight, Minus } from 'lucide-react'; +import { useState } from 'react'; interface OptimiseSignozNeedsProps { + optimiseSignozDetails: Record | null; + setOptimiseSignozDetails: (details: Record | null) => void; onNext: () => void; onBack: () => void; } @@ -32,9 +36,69 @@ const serviceMarks: SliderSingleProps['marks'] = { }; function OptimiseSignozNeeds({ + optimiseSignozDetails, + setOptimiseSignozDetails, onNext, onBack, }: OptimiseSignozNeedsProps): JSX.Element { + const [logsPerDay, setLogsPerDay] = useState( + optimiseSignozDetails?.logsPerDay || 25, + ); + const [hostsPerDay, setHostsPerDay] = useState( + optimiseSignozDetails?.hostsPerDay || 40, + ); + const [services, setServices] = useState( + optimiseSignozDetails?.services || 10, + ); + + const handleOnNext = (): void => { + setOptimiseSignozDetails({ + logsPerDay, + hostsPerDay, + services, + }); + + logEvent('Onboarding: Optimise SigNoz Needs: Next', { + logsPerDay, + hostsPerDay, + services, + }); + + onNext(); + }; + + const handleOnBack = (): void => { + setOptimiseSignozDetails({ + logsPerDay, + hostsPerDay, + services, + }); + + logEvent('Onboarding: Optimise SigNoz Needs: Back', { + logsPerDay, + hostsPerDay, + services, + }); + + onBack(); + }; + + const handleWillDoLater = (): void => { + setOptimiseSignozDetails({ + logsPerDay: 0, + hostsPerDay: 0, + services: 0, + }); + + logEvent('Onboarding: Optimise SigNoz Needs: Will do later', { + logsPerDay: 0, + hostsPerDay: 0, + services: 0, + }); + + onNext(); + }; + return (
@@ -57,7 +121,8 @@ function OptimiseSignozNeeds({
setLogsPerDay(value)} styles={{ track: { background: '#4E74F8', @@ -69,12 +134,13 @@ function OptimiseSignozNeeds({
setHostsPerDay(value)} styles={{ track: { background: '#4E74F8', @@ -91,7 +157,8 @@ function OptimiseSignozNeeds({
setServices(value)} styles={{ track: { background: '#4E74F8', @@ -103,19 +170,19 @@ function OptimiseSignozNeeds({
- -
-
diff --git a/frontend/src/container/OnboardingQuestionaire/OrgQuestions/OrgQuestions.tsx b/frontend/src/container/OnboardingQuestionaire/OrgQuestions/OrgQuestions.tsx index 9988c9e97c..6cd679c5da 100644 --- a/frontend/src/container/OnboardingQuestionaire/OrgQuestions/OrgQuestions.tsx +++ b/frontend/src/container/OnboardingQuestionaire/OrgQuestions/OrgQuestions.tsx @@ -1,27 +1,58 @@ /* eslint-disable sonarjs/cognitive-complexity */ import '../OnboardingQuestionaire.styles.scss'; -import { Button, Typography } from 'antd'; -import { ArrowRight } from 'lucide-react'; +import { Color } from '@signozhq/design-tokens'; +import { Button, Input, Typography } from 'antd'; +import logEvent from 'api/common/logEvent'; +import { ArrowRight, CheckCircle } from 'lucide-react'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import AppReducer from 'types/reducer/app'; interface OrgQuestionsProps { + orgDetails: any; + setOrgDetails: (details: any) => void; onNext: () => void; } -function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element { - const [organisationName, setOrganisationName] = useState(''); +const observabilityTools = [ + 'AWS Cloudwatch', + 'DataDog', + 'New Relic', + 'Grafana / Prometheus', + 'Azure App Monitor', + 'GCP-native o11y tools', + 'Honeycomb', +]; + +const o11yFamiliarityOptions: Record = { + new: "I'm completely new", + builtStack: "I've built a stack before", + experienced: 'I have some experience', + dontKnow: "I don't know what it is", +}; + +function OrgQuestions({ + orgDetails, + setOrgDetails, + onNext, +}: OrgQuestionsProps): JSX.Element { + const [organisationName, setOrganisationName] = useState( + orgDetails?.organisationName || '', + ); const [usesObservability, setUsesObservability] = useState( - null, + orgDetails?.usesObservability || null, ); const [observabilityTool, setObservabilityTool] = useState( - null, + orgDetails?.observabilityTool || null, + ); + const [otherTool, setOtherTool] = useState( + orgDetails?.otherTool || '', + ); + const [familiarity, setFamiliarity] = useState( + orgDetails?.familiarity || null, ); - const [otherTool, setOtherTool] = useState(''); - const [familiarity, setFamiliarity] = useState(null); const [isNextDisabled, setIsNextDisabled] = useState(true); const { user } = useSelector((state) => state.app); @@ -45,6 +76,26 @@ function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element { otherTool, ]); + const handleOnNext = (): void => { + setOrgDetails({ + organisationName, + usesObservability, + observabilityTool, + otherTool, + familiarity, + }); + + logEvent('Onboarding: Org Questions: Next', { + organisationName, + usesObservability, + observabilityTool, + otherTool, + familiarity, + }); + + onNext(); + }; + return (
@@ -77,20 +128,25 @@ function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element { Do you currently use any observability/monitoring tool? -
- - + + No{' '} + {usesObservability === false && ( + + )} +
@@ -109,83 +168,44 @@ function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element { -
- - - - - - - +
+ {observabilityTools.map((tool) => ( + + ))} {observabilityTool === 'Others' ? ( - + ) : ( + '' + ) + } onChange={(e): void => setOtherTool(e.target.value)} /> ) : ( - - - +
+ {Object.keys(o11yFamiliarityOptions).map((option: string) => ( + + ))}
@@ -242,7 +245,7 @@ function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element {