Skip to content

Commit

Permalink
GettingStarted Rework (#2194)
Browse files Browse the repository at this point in the history
* UI pass updating everything

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* dashboard re-direct to integration for otel

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* correct naming and icon for three cases

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* updates to jsons and ndjsons

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* remove dashboard creation from the create assets call

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* update name to Self Managed

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* Remove hyperlink from discover

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* address comments

Signed-off-by: Adam Tackett <tackadam@amazon.com>

---------

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
(cherry picked from commit f68eba1)
  • Loading branch information
TackAdam authored and Adam Tackett committed Oct 11, 2024
1 parent 60e4603 commit 3486452
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 3486452

Please sign in to comment.