forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added conditional rendering to datasource to check if datasource is a React component * Added isReact: true prop to datasources * Added wrapper component for conditional rendering of React vs non-React datasource components * Removed isReact prop from all datasources * Added templateFromReactComponent wrapper around datasource templates * Stored reference to domNode in datasource instead of spec. * Removed domNode static variable in datasource. Instead, ref to domNode is passed into callRenderFn.
- Loading branch information
Showing
5 changed files
with
70 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import React from 'react'; | ||
import { templateFromReactComponent } from '../../../lib/template_from_react_component'; | ||
import header from './header.png'; | ||
|
||
const DemodataDatasource = () => ( | ||
<div> | ||
<h3>The demodata source</h3> | ||
<p> | ||
This data source is connected to every Canvas element by default. Its purpose is to give you | ||
lightweight data to use in getting to know an element. The demo data set contains 4 strings, 3 | ||
numbers and a date. Feel free to experiment and, when you're ready, click the | ||
<i>Change Datasource</i> link below to connect to your own data. | ||
</p> | ||
</div> | ||
); | ||
|
||
export const demodata = () => ({ | ||
name: 'demodata', | ||
displayName: 'Demo Data', | ||
help: 'Mock data set with with usernames, prices, projects, countries and phases.', | ||
image: header, | ||
template() { | ||
return ( | ||
<div> | ||
<h3>The demodata source</h3> | ||
<p> | ||
This data source is connected to every Canvas element by default. Its purpose is to give | ||
you lightweight data to use in getting to know an element. The demo data set contains 4 | ||
strings, 3 numbers and a date. Feel free to experiment and, when you're ready, click the | ||
<i>Change Datasource</i> link below to connect to your own data. | ||
</p> | ||
</div> | ||
); | ||
}, | ||
template: templateFromReactComponent(DemodataDatasource), | ||
}); |
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