-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Observability] Fetch news feed (#71212)
* adding new feed * adding log when an error happens * fixing translations Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
1ed98d5
commit 14752ea
Showing
11 changed files
with
367 additions
and
88 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
x-pack/plugins/observability/public/components/app/news/index.test.tsx
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
x-pack/plugins/observability/public/components/app/news/mock/news.mock.data.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
68 changes: 68 additions & 0 deletions
68
x-pack/plugins/observability/public/components/app/news_feed/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import React from 'react'; | ||
import { NewsItem } from '../../../services/get_news_feed'; | ||
import { render } from '../../../utils/test_helper'; | ||
import { NewsFeed } from './'; | ||
|
||
const newsFeedItems = [ | ||
{ | ||
title: { | ||
en: 'Elastic introduces OpenTelemetry integration', | ||
}, | ||
description: { | ||
en: | ||
'We are pleased to announce the availability of the Elastic OpenTelemetry integration — available on Elastic Cloud, or when you download Elastic APM.', | ||
}, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/elastic-apm-opentelemetry-integration?blade=observabilitysolutionfeed', | ||
}, | ||
image_url: { | ||
en: 'foo.png', | ||
}, | ||
}, | ||
{ | ||
title: { | ||
en: 'Kubernetes observability tutorial: Log monitoring and analysis', | ||
}, | ||
description: { | ||
en: | ||
'Learn how Elastic Observability makes it easy to monitor and detect anomalies in millions of logs from thousands of containers running hundreds of microservices — while Kubernetes scales applications with changing pod counts. All from a single UI.', | ||
}, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-log-monitoring-and-analysis-elastic-stack?blade=observabilitysolutionfeed', | ||
}, | ||
image_url: null, | ||
}, | ||
{ | ||
title: { | ||
en: 'Kubernetes observability tutorial: K8s cluster setup and demo app deployment', | ||
}, | ||
description: { | ||
en: | ||
'This blog will walk you through configuring the environment you will be using for the Kubernetes observability tutorial blog series. We will be deploying Elasticsearch Service, a Minikube single-node Kubernetes cluster setup, and a demo app.', | ||
}, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-cluster-setup-demo-app-deployment?blade=observabilitysolutionfeed', | ||
}, | ||
image_url: { | ||
en: null, | ||
}, | ||
}, | ||
] as NewsItem[]; | ||
describe('News', () => { | ||
it('renders resources with all elements', () => { | ||
const { getByText, getAllByText, queryAllByTestId } = render( | ||
<NewsFeed items={newsFeedItems} /> | ||
); | ||
expect(getByText("What's new")).toBeInTheDocument(); | ||
expect(getAllByText('Read full story').length).toEqual(3); | ||
expect(queryAllByTestId('news_image').length).toEqual(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
x-pack/plugins/observability/public/pages/overview/mock/news_feed.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const newsFeedFetchData = async () => { | ||
return { | ||
items: [ | ||
{ | ||
title: { | ||
en: 'Elastic introduces OpenTelemetry integration', | ||
}, | ||
description: { | ||
en: | ||
'We are pleased to announce the availability of the Elastic OpenTelemetry integration — available on Elastic Cloud, or when you download Elastic APM.', | ||
}, | ||
link_text: null, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/elastic-apm-opentelemetry-integration?blade=observabilitysolutionfeed', | ||
}, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2020-07-02T00:00:00', | ||
expire_on: '2021-05-02T00:00:00', | ||
hash: '012caf3e161127d618ae8cc95e3e63f009a45d343eedf2f5e369cc95b1f9d9d3', | ||
}, | ||
{ | ||
title: { | ||
en: 'Kubernetes observability tutorial: Log monitoring and analysis', | ||
}, | ||
description: { | ||
en: | ||
'Learn how Elastic Observability makes it easy to monitor and detect anomalies in millions of logs from thousands of containers running hundreds of microservices — while Kubernetes scales applications with changing pod counts. All from a single UI.', | ||
}, | ||
link_text: null, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-log-monitoring-and-analysis-elastic-stack?blade=observabilitysolutionfeed', | ||
}, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2020-06-23T00:00:00', | ||
expire_on: '2021-06-23T00:00:00', | ||
hash: '79a28cb9be717e82df80bf32c27e5d475e56d0d315be694b661d133f9a58b3b3', | ||
}, | ||
{ | ||
title: { | ||
en: 'Kubernetes observability tutorial: K8s cluster setup and demo app deployment', | ||
}, | ||
description: { | ||
en: | ||
'This blog will walk you through configuring the environment you will be using for the Kubernetes observability tutorial blog series. We will be deploying Elasticsearch Service, a Minikube single-node Kubernetes cluster setup, and a demo app.', | ||
}, | ||
link_text: null, | ||
link_url: { | ||
en: | ||
'https://www.elastic.co/blog/kubernetes-observability-tutorial-k8s-cluster-setup-demo-app-deployment?blade=observabilitysolutionfeed', | ||
}, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2020-06-23T00:00:00', | ||
expire_on: '2021-06-23T00:00:00', | ||
hash: 'ad682c355af3d4470a14df116df3b441e941661b291cdac62335615e7c6f13c2', | ||
}, | ||
], | ||
}; | ||
}; |
Oops, something went wrong.