-
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.
* feat: ๐ธ add locator_examples plugin * feat: ๐ธ add example app in locator_examples * feat: ๐ธ add locator_explorer plugin * chore: ๐ค remove url_generaotrs_* example plugins * docs: โ๏ธ update share plugin readme * docs: โ๏ธ add locators readme * docs: โ๏ธ update docs link in example plugin * docs: โ๏ธ update navigation docs * fix: ๐ make P extend SerializableState * test: ๐ update test mocks * fix: ๐ use correct type in ingest pipeline locator * test: ๐ add missing methods in mock * test: ๐ update test mocks * chore: ๐ค update plugin list Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
64df698
commit 82e32fa
Showing
28 changed files
with
380 additions
and
188 deletions.
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
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,8 @@ | ||
# Locator examples | ||
|
||
This example plugin shows how to: | ||
|
||
- Register a URL locator. | ||
- Return locator from plugin contract. | ||
|
||
To run this example, use the command `yarn start --run-examples`. Navigate to the locator app. |
4 changes: 2 additions & 2 deletions
4
examples/url_generators_examples/kibana.json โ examples/locator_examples/kibana.json
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"id": "urlGeneratorsExamples", | ||
"id": "locatorExamples", | ||
"version": "0.0.1", | ||
"kibanaVersion": "kibana", | ||
"server": false, | ||
"ui": true, | ||
"requiredPlugins": ["share"], | ||
"optionalPlugins": [], | ||
"extraPublicDirs": [ | ||
"public/url_generator" | ||
"public/locator" | ||
] | ||
} |
File renamed without changes.
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,54 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { SerializableState, MigrateFunction } from 'src/plugins/kibana_utils/common'; | ||
import { LocatorDefinition, LocatorPublic } from '../../../src/plugins/share/public'; | ||
|
||
export const HELLO_LOCATOR = 'HELLO_LOCATOR'; | ||
|
||
export interface HelloLocatorV1Params extends SerializableState { | ||
name: string; | ||
} | ||
|
||
export interface HelloLocatorV2Params extends SerializableState { | ||
firstName: string; | ||
lastName: string; | ||
} | ||
|
||
export type HelloLocatorParams = HelloLocatorV2Params; | ||
|
||
const migrateV1ToV2: MigrateFunction<HelloLocatorV1Params, HelloLocatorV2Params> = ( | ||
v1: HelloLocatorV1Params | ||
) => { | ||
const v2: HelloLocatorV2Params = { | ||
firstName: v1.name, | ||
lastName: '', | ||
}; | ||
|
||
return v2; | ||
}; | ||
|
||
export type HelloLocator = LocatorPublic<HelloLocatorParams>; | ||
|
||
export class HelloLocatorDefinition implements LocatorDefinition<HelloLocatorParams> { | ||
public readonly id = HELLO_LOCATOR; | ||
|
||
public readonly getLocation = async ({ firstName, lastName }: HelloLocatorParams) => { | ||
return { | ||
app: 'locatorExamples', | ||
path: `/hello?firstName=${encodeURIComponent(firstName)}&lastName=${encodeURIComponent( | ||
lastName | ||
)}`, | ||
state: {}, | ||
}; | ||
}; | ||
|
||
public readonly migrations = { | ||
'0.0.2': (migrateV1ToV2 as unknown) as MigrateFunction, | ||
}; | ||
} |
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
File renamed without changes.
5 changes: 3 additions & 2 deletions
5
examples/url_generators_explorer/README.md โ examples/locator_explorer/README.md
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
4 changes: 2 additions & 2 deletions
4
examples/url_generators_explorer/kibana.json โ examples/locator_explorer/kibana.json
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"id": "urlGeneratorsExplorer", | ||
"id": "locatorExplorer", | ||
"version": "0.0.1", | ||
"kibanaVersion": "kibana", | ||
"server": false, | ||
"ui": true, | ||
"requiredPlugins": ["share", "urlGeneratorsExamples", "developerExamples"], | ||
"requiredPlugins": ["share", "locatorExamples", "developerExamples"], | ||
"optionalPlugins": [] | ||
} |
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
File renamed without changes.
Oops, something went wrong.