interface PersistableStateService {
getMigrations: { [key: string]: MigrationFn }
}
function collectDashboardPanelMigrations(): { [key:string]: MigrationFn } {
// Dashboard plugin may have registered some of it's own panel migrations.
const panelMigrations: { [key:string]: MigrationFn } = {
- Registrar wants to add a migration to every registry item.
Specific example: Author of
Embeddable
api wants to migrate baseEmbeddableInput
. - Enhancer wants to add a migration to every registry item.
Specific example: Author of
EnhancedEmbeddableDrilldowns
wants to migrateEnhancedEmbeddableInput
. - Registrator wants to add a migration to it's specific registry item.
Example: Author of
Visualize
plugin wants to migrateVisualizeEmbeddableInput
- Registrar wants to add a migration to every registry item.
Example: Author of
Embeddable
api wants to migrate baseEmbeddableInput
. - Enhancer wants to add a migration to every registry item.
Author of
EnhancedEmbeddableDrilldowns
wants to migrateEnhancedEmbeddableInput
. - Registrator wants to add a migration to it's specific registry item.
Example: Author of
VisState
wants to migrateVisualizeEmbeddableInput
class InMemoryTable extends IDataTable {
// basic impl of all the funcs on an in memory table.
}
interface IDataTable {
narrow(narrowingQuery: INarrowingQuery): IDataTable;
selectColumns(columns: string[]): IDataTable;
groupBy(aggs: Aggs): IDataTable;
getFieldSuggestions(fieldPrefix: string): IDataTable;
To convert existing code over to typescript:
- rename the file from
.js
to either.ts
(if there is no html or jsx in the file) or.tsx
(if there is). - Ensure tslint is running and installed in the IDE of your choice. There will usually be some linter errors after a save.
- Auto-fix what you can. This will save you a lot of time! I have VSCode set to auto fix tslint errors when I save the file.
Panel loaded on a dashboard
// dashboard_panel.js
async componentDidMount() {
this.props.renderEmbeddable(this.panelElement, this.props.panel);
}
render() {
return (
<div
Every Day
- Issue/PR triage
ASAP
- Add dashboard only mode docs and link to it with
Learn More
links. - Start working on custom dashboard colors.
- Sync with elastic/kibana#11632 and use new API for dashboard
- Check up on stats api: https://github.com/elastic/x-pack-kibana/issues/1005
Soon
Stateless function components are more concise, and there are plans for react to increase performance of them. Good:
export function KuiButton({ onClick, isDisabled }) {
return <button className="kuiButton" onClick={onClick} isDisabled={isDisabled}/>
};