Skip to content

Commit

Permalink
Merge branch 'main' into update-traces-span-redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstn authored Oct 11, 2024
2 parents 6837d9f + f68eba1 commit c6c6835
Show file tree
Hide file tree
Showing 48 changed files with 1,281 additions and 1,909 deletions.
43 changes: 43 additions & 0 deletions common/constants/getting_started_routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export type TutorialId =
| 'otelLogs'
| 'otelMetrics'
| 'otelTraces'
| 'nginx'
| 'java'
| 'python'
| 'golang';

export const COMPONENT_MAP: Record<TutorialId, string> = {
otelLogs: 'otel-index-patterns',
otelMetrics: 'otel-index-patterns',
otelTraces: 'otel-index-patterns',
nginx: 'nginx',
java: 'java-tutorial',
python: 'python-tutorial',
golang: 'golang-tutorial',
};

export const VERSION_MAP: Record<TutorialId, string> = {
otelLogs: '1.0.0',
otelMetrics: '1.0.0',
otelTraces: '1.0.0',
nginx: '1.0.0',
java: '1.0.0',
python: '1.0.0',
golang: '1.0.0',
};

export const SIGNAL_MAP: Record<TutorialId, string> = {
otelLogs: 'Logs',
otelMetrics: 'Metrics',
otelTraces: 'Traces',
nginx: '',
java: '',
python: '',
golang: '',
};
40 changes: 1 addition & 39 deletions public/components/getting_started/components/getting_started.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui';
import { EuiPage, EuiPageBody } from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import { HomeProps } from 'public/components/getting_started/home';
import { CollectAndShipData } from './getting_started_collectData';
import { QueryAndAnalyze } from './getting_started_queryAndAnalyze';
import { observabilityGettingStartedTitle } from '../../../../common/constants/shared';

interface ExtendedHomeProps extends HomeProps {
Expand All @@ -17,10 +16,7 @@ interface ExtendedHomeProps extends HomeProps {

export const NewGettingStarted = (props: ExtendedHomeProps) => {
const { chrome, selectedDataSourceId, selectedDataSourceLabel } = props;
const [selectedSource, setSelectedSource] = useState('');
const [isPickYourSourceOpen, setIsPickYourSourceOpen] = useState(true);
const [isQueryDataOpen, setIsQueryDataOpen] = useState(false);
const [isSampleDataset, setIsSampleDataset] = useState(false);

useEffect(() => {
chrome.setBreadcrumbs([
Expand All @@ -31,28 +27,8 @@ export const NewGettingStarted = (props: ExtendedHomeProps) => {
]);
}, [chrome]);

const handleSelectSource = (source: string) => {
setSelectedSource(source);
};

const togglePickYourSource = (isOpen: boolean) => {
setIsPickYourSourceOpen(isOpen);
if (isOpen) {
setIsQueryDataOpen(false);
}
};

const toggleQueryData = (isOpen: boolean) => {
setIsQueryDataOpen(isOpen);
};

const setQueryDataOpen = () => {
setIsPickYourSourceOpen(false);
setIsQueryDataOpen(true);
};

const handleCardSelectionChange = (isSample: boolean) => {
setIsSampleDataset(isSample);
};

return (
Expand All @@ -61,23 +37,9 @@ export const NewGettingStarted = (props: ExtendedHomeProps) => {
<CollectAndShipData
isOpen={isPickYourSourceOpen}
onToggle={togglePickYourSource}
selectedTechnology={selectedSource}
onMoveToQueryData={setQueryDataOpen}
onSelectSource={handleSelectSource}
onCardSelectionChange={handleCardSelectionChange}
selectedDataSourceId={selectedDataSourceId}
selectedDataSourceLabel={selectedDataSourceLabel}
/>
<EuiSpacer size="m" />
{!isSampleDataset && (
<QueryAndAnalyze
isOpen={isQueryDataOpen}
onToggle={toggleQueryData}
selectedTechnology={selectedSource}
selectedDataSourceId={selectedDataSourceId}
selectedDataSourceLabel={selectedDataSourceLabel}
/>
)}
</EuiPageBody>
</EuiPage>
);
Expand Down
Loading

0 comments on commit c6c6835

Please sign in to comment.