-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Newsfeed leftovers from the Legacy codebase #66084
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
878dd21
Remove Newsfeed leftovers from the Legacy codebase
afharo 7eb688d
Migrate Newsfeed test plugin (#66059)
afharo fe17e8e
PR feedback
afharo d4a8d0b
schema.duration returns Duration type :)
afharo 578cc55
Merge branch 'master' of github.com:elastic/kibana into remove-newsfe…
afharo a239142
Newsfeed test plugin: requests should match the current version only
afharo 37f4fac
Fix tests to match new types
afharo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,6 @@ | ||
{ | ||
"id": "newsfeed-fixtures", | ||
"version": "kibana", | ||
"server": true, | ||
"ui": false | ||
} |
126 changes: 0 additions & 126 deletions
126
test/common/fixtures/plugins/newsfeed/newsfeed_simulation.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
import { CoreSetup, Plugin } from 'kibana/server'; | ||
|
||
const PATH = '/api/_newsfeed-FTS-external-service-simulators'; | ||
|
||
export class NewsFeedSimulatorPlugin implements Plugin { | ||
public setup({ http }: CoreSetup) { | ||
const router = http.createRouter(); | ||
|
||
router.get( | ||
{ | ||
path: `${PATH}/kibana/v{version}.json`, | ||
validate: { params: schema.object({ version: schema.string() }) }, | ||
options: { authRequired: false }, | ||
}, | ||
(context, req, res) => { | ||
return res.ok({ body: this.mockNewsfeed(req.params.version) }); | ||
} | ||
); | ||
|
||
router.get( | ||
{ | ||
path: `${PATH}/kibana/crash.json`, | ||
validate: false, | ||
options: { authRequired: false }, | ||
}, | ||
(context, req, res) => { | ||
return res.internalError({ body: new Error('Internal server error') }); | ||
} | ||
); | ||
} | ||
|
||
public start() {} | ||
|
||
private mockNewsfeed(version: string) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||
return { | ||
items: [ | ||
{ | ||
title: { en: `You are functionally testing the newsfeed widget with fixtures!` }, | ||
description: { en: 'See test/common/fixtures/plugins/newsfeed/newsfeed_simulation' }, | ||
link_text: { en: 'Generic feed-viewer could go here' }, | ||
link_url: { en: 'https://feeds.elastic.co' }, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2019-06-21T00:00:00', | ||
expire_on: '2040-01-31T00:00:00', | ||
hash: '39ca7d409c7eb25f4c69a5a6a11309b2f5ced7ca3f9b3a0109517126e0fd91ca', | ||
}, | ||
{ | ||
title: { en: 'Staging too!' }, | ||
description: { en: 'Hello world' }, | ||
link_text: { en: 'Generic feed-viewer could go here' }, | ||
link_url: { en: 'https://feeds-staging.elastic.co' }, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2019-06-21T00:00:00', | ||
expire_on: '2040-01-31T00:00:00', | ||
hash: 'db445c9443eb50ea2eb15f20edf89cf0f7dac2b058b11cafc2c8c288b6e4ce2a', | ||
}, | ||
{ | ||
title: { en: 'This item is expired!' }, | ||
description: { en: 'This should not show up.' }, | ||
link_text: { en: 'Generic feed-viewer could go here' }, | ||
link_url: { en: 'https://feeds-staging.elastic.co' }, | ||
languages: null, | ||
badge: null, | ||
image_url: null, | ||
publish_on: '2019-06-21T00:00:00', | ||
expire_on: '2019-12-31T00:00:00', | ||
hash: 'db445c9443eb50ea2eb15f20edf89cf0f7dac2b058b11cafc2c8c288b6e4ce2a', | ||
}, | ||
], | ||
}; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PATH
is used in this file only. let's inline the value