Skip to content

Commit 40af81d

Browse files
author
guyplusplus
committed
Form content more info
1 parent 44a1585 commit 40af81d

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,20 @@ $ sudo apt update
7373
$ sudo apt install yarn
7474
```
7575

76-
6. Download Kibana source code and select the target version (v7.6.2, v7.0.0, etc.)
76+
6. Download Kibana source code and select the target version (v7.6.2, v7.0.0, etc.). `kibana` is the top directory.
7777

7878
```
7979
$ git clone https://github.com/elastic/kibana.git
8080
$ cd kibana
8181
$ git checkout v7.6.2
8282
```
8383

84-
7. Copy the source code with modified name inside `kibana/plugins`
84+
7. Copy the source code with modified name inside the `kibana/plugins` directory.
8585

86-
8. Start in development mode, ensuring only OSS (Open Source) is used
86+
8. Start Kibana in development mode, ensuring only OSS (Open Source) features are used
8787

8888
```
89+
$ cd kibana
8990
$ nvm use
9091
$ yarn kbn bootstrap
9192
$ yarn start --oss
@@ -104,9 +105,36 @@ $ sudo sysctl -p
104105
elasticsearch.ignoreVersionMismatch: true
105106
```
106107

107-
## Building the plugin
108+
## Creating the actual form (step 7)
109+
110+
The current plugin name is based on accounts data. Simply perform a search replace in filenames and in the source code, respecting letter capitalization.
111+
112+
The form itself is contained in the [controller file](https://github.com/guyplusplus/Kibana-Plugin-Custom-Form-Filter-Visualization/blob/master/vis_type_custom_form_filter_accounts/public/custom_form_filter_accounts_vis_controller.tsx). An [option tab](https://github.com/guyplusplus/Kibana-Plugin-Custom-Form-Filter-Visualization/blob/master/vis_type_custom_form_filter_accounts/public/custom_form_filter_accounts_options.tsx) is also possible.
113+
114+
The form code looks like this and is very simple to modify, based on EUI React components.
115+
* [Documentation](https://elastic.github.io/eui/#/)
116+
* [Source Code](https://github.com/elastic/eui)
117+
118+
```
119+
<div>
120+
<EuiForm>
121+
<EuiFormRow label="Age" helpText="Input customer age">
122+
<EuiFieldText name="age" onChange={e => this.onFormChange(e)} value={this.state.age} />
123+
</EuiFormRow>
124+
<EuiFormRow label="Minimum balance" helpText={minimumBalanceHelpText} >
125+
<EuiFieldText name="minimumBalance" onChange={e => this.onFormChange(e)} value={this.state.minimumBalance} />
126+
</EuiFormRow>
127+
<EuiSpacer />
128+
<EuiButton onClick={this.onClickButtonApplyFilter} fill>Apply filter</EuiButton>&nbsp;
129+
<EuiButton onClick={this.onClickButtonDeleteFilter} >Delete filter</EuiButton>&nbsp;
130+
<EuiButton onClick={this.onClickButtonClearForm} >Clear form</EuiButton>
131+
</EuiForm>
132+
</div>
133+
```
134+
135+
## Creating the plugin zip file
108136

109-
Simply add the plugin directory inside a kibana folder and zip the file. The zip structure is
137+
Simply add the plugin directory inside a kibana folder and zip the file. Do not include the `kibana/target` directory. The zip structure is
110138

111139
```
112140
my-plugin_7.7.0.zip
@@ -122,7 +150,7 @@ my-plugin_7.7.0.zip
122150

123151
## Installing the plugin
124152

125-
The plugin can then be installed like this.
153+
The plugin can then be installed like this for an apt installed Kibana.
126154

127155
```
128156
$ sudo ./bin/kibana-plugin --allow-root install file:///home/john/downloads/kbn_tp_custom_form_filter_accounts_7.7.0_1.0.0.zip
@@ -134,3 +162,11 @@ Deleting then installing the plugin often fails for me. I fix it by running this
134162
```
135163
$ rm -rf /usr/share/kibana/optimize/bundles
136164
```
165+
166+
## Project TODO List
167+
168+
- [ ] Create form content (i.e. dropdown, slider) based on actual data
169+
- [ ] Create a script to replace 'accounts' in filenames and file content
170+
- [ ] Create own plugin icon
171+
172+

0 commit comments

Comments
 (0)