Skip to content

Commit

Permalink
Temporarily remove Tutorials from "Add Data" page (#464)
Browse files Browse the repository at this point in the history
* temporarily remove tutorial

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* change text

Signed-off-by: Anan Zhuang <ananzh@amazon.com>

* clean out all tabs contents

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
  • Loading branch information
ananzh authored and kavilla committed Jun 21, 2021
1 parent 871df60 commit f530b8d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 127 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const addBasePathMock = jest.fn((path: string) => (path ? path : 'path'));
const mockFeatures = [
{
category: 'data',
description: 'Ingest data from popular apps and services.',
description: 'Get started with sample data, visualizations, and dashboards.',
showOnHomePage: true,
icon: 'indexOpen',
id: 'home_tutorial_directory',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
// @ts-expect-error untyped service
import { FeatureCatalogueEntry } from '../../services';
Expand All @@ -55,23 +55,6 @@ export const AddData: FC<Props> = ({ addBasePath, features }) => (
</h2>
</EuiTitle>
</EuiFlexItem>

<EuiFlexItem className="homDataAdd__actions" grow={false}>
<div>
<EuiButtonEmpty
className="homDataAdd__actionButton"
flush="left"
href="#/tutorial_directory/sampleData"
iconType="visTable"
size="xs"
>
<FormattedMessage
id="home.addData.sampleDataButtonLabel"
defaultMessage="Try our sample data"
/>
</EuiButtonEmpty>
</div>
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer size="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,45 +66,11 @@ class TutorialDirectoryUi extends React.Component {
constructor(props) {
super(props);

this.tabs = [
{
id: ALL_TAB_ID,
name: this.props.intl.formatMessage({
id: 'home.tutorial.tabs.allTitle',
defaultMessage: 'All',
}),
},
{
id: 'logging',
name: this.props.intl.formatMessage({
id: 'home.tutorial.tabs.loggingTitle',
defaultMessage: 'Logs',
}),
},
{
id: 'metrics',
name: this.props.intl.formatMessage({
id: 'home.tutorial.tabs.metricsTitle',
defaultMessage: 'Metrics',
}),
},
{
id: 'security',
name: this.props.intl.formatMessage({
id: 'home.tutorial.tabs.securitySolutionTitle',
defaultMessage: 'Security',
}),
},
{
id: SAMPLE_DATA_TAB_ID,
name: this.props.intl.formatMessage({
id: 'home.tutorial.tabs.sampleDataTitle',
defaultMessage: 'Sample data',
}),
},
];
// TODO: Enable the tabs once we have instructions
// and sample code snippets to instruct users to add data
this.tabs = [];

let openTab = ALL_TAB_ID;
let openTab = SAMPLE_DATA_TAB_ID;
if (
props.openTab &&
this.tabs.some((tab) => {
Expand Down Expand Up @@ -284,7 +250,7 @@ class TutorialDirectoryUi extends React.Component {
<h1>
<FormattedMessage
id="home.tutorial.addDataToOpenSearchDashboardsTitle"
defaultMessage="Add data"
defaultMessage="Add sample data"
/>
</h1>
</EuiTitle>
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/home/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ export class HomePublicPlugin
featureCatalogue.register({
id: 'home_tutorial_directory',
title: i18n.translate('home.tutorialDirectory.featureCatalogueTitle', {
defaultMessage: 'Add data',
defaultMessage: 'Add sample data',
}),
description: i18n.translate('home.tutorialDirectory.featureCatalogueDescription', {
defaultMessage: 'Ingest data from popular apps and services.',
defaultMessage: 'Get started with sample data, visualizations, and dashboards.',
}),
icon: 'indexOpen',
showOnHomePage: true,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { FeatureCatalogueCategory } from 'src/plugins/home/public';
const mockFeatures = [
{
category: FeatureCatalogueCategory.DATA,
description: 'Ingest data from popular apps and services.',
description: 'Get started with sample data, visualizations, and dashboards.',
showOnHomePage: true,
icon: 'indexOpen',
id: 'home_tutorial_directory',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import React, { FC } from 'react';
import PropTypes from 'prop-types';
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@osd/i18n/react';
import { CoreStart } from 'opensearch-dashboards/public';
import {
Expand Down Expand Up @@ -66,25 +66,6 @@ export const AddData: FC<Props> = ({ addBasePath, features }) => {
</h2>
</EuiTitle>
</EuiFlexItem>

<EuiFlexItem className="osdOverviewDataAdd__actions" grow={false}>
<RedirectAppLinks application={application}>
<div>
<EuiButtonEmpty
className="osdOverviewDataAdd__actionButton"
flush="left"
href={addBasePath('/app/home#/tutorial_directory/sampleData')}
iconType="visTable"
size="xs"
>
<FormattedMessage
id="opensearchDashboardsOverview.addData.sampleDataButtonLabel"
defaultMessage="Try our sample data"
/>
</EuiButtonEmpty>
</div>
</RedirectAppLinks>
</EuiFlexItem>
</EuiFlexGroup>

<EuiSpacer size="m" />
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/home/_add_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['common', 'header', 'home', 'dashboard']);

describe('add data tutorials', function describeIndexTests() {
it('directory should display registered tutorials', async () => {
it('directory should not display registered tutorials', async () => {
await PageObjects.common.navigateToUrl('home', 'tutorial_directory', { useActualUrl: true });
await PageObjects.header.waitUntilLoadingHasFinished();
await retry.try(async () => {
const tutorialExists = await PageObjects.home.doesSynopsisExist('netflowlogs');
expect(tutorialExists).to.be(true);
expect(tutorialExists).to.be(false);
});
});
});
Expand Down

0 comments on commit f530b8d

Please sign in to comment.