|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | import { i18n } from '@kbn/i18n'; |
8 | | -import { FunctionComponent } from 'react'; |
| 8 | +import React, { FunctionComponent, ReactNode } from 'react'; |
| 9 | +import { FormattedMessage } from '@kbn/i18n/react'; |
| 10 | +import { EuiCode, EuiLink } from '@elastic/eui'; |
9 | 11 |
|
10 | 12 | import { |
11 | 13 | Append, |
@@ -40,6 +42,7 @@ interface FieldDescriptor { |
40 | 42 | * A sentence case label that can be displayed to users |
41 | 43 | */ |
42 | 44 | label: string; |
| 45 | + description?: string | ReactNode; |
43 | 46 | } |
44 | 47 |
|
45 | 48 | type MapProcessorTypeToDescriptor = Record<string, FieldDescriptor>; |
@@ -121,69 +124,123 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { |
121 | 124 | label: i18n.translate('xpack.ingestPipelines.processors.label.enrich', { |
122 | 125 | defaultMessage: 'Enrich', |
123 | 126 | }), |
| 127 | + description: () => ( |
| 128 | + <FormattedMessage |
| 129 | + id="xpack.ingestPipelines.processors.description.enrich" |
| 130 | + defaultMessage="Adds enrich data to incoming documents based on an {enrichPolicyLink}." |
| 131 | + values={{ |
| 132 | + enrichPolicyLink: ( |
| 133 | + <EuiLink external target="_blank" href={esDocUrl + '/ingest-enriching-data.html'}> |
| 134 | + {'enrich policy'} |
| 135 | + </EuiLink> |
| 136 | + ), |
| 137 | + }} |
| 138 | + /> |
| 139 | + ), |
124 | 140 | }, |
125 | 141 | fail: { |
126 | 142 | FieldsComponent: Fail, |
127 | 143 | docLinkPath: '/fail-processor.html', |
128 | 144 | label: i18n.translate('xpack.ingestPipelines.processors.label.fail', { |
129 | 145 | defaultMessage: 'Fail', |
130 | 146 | }), |
| 147 | + description: i18n.translate('xpack.ingestPipelines.processors.description.fail', { |
| 148 | + defaultMessage: |
| 149 | + 'Returns a custom error message on failure. Often used to notify requesters of required conditions.', |
| 150 | + }), |
131 | 151 | }, |
132 | 152 | foreach: { |
133 | 153 | FieldsComponent: Foreach, |
134 | 154 | docLinkPath: '/foreach-processor.html', |
135 | 155 | label: i18n.translate('xpack.ingestPipelines.processors.label.foreach', { |
136 | 156 | defaultMessage: 'Foreach', |
137 | 157 | }), |
| 158 | + description: i18n.translate('xpack.ingestPipelines.processors.description.foreach', { |
| 159 | + defaultMessage: 'Applies an ingest processor to each value in an array.', |
| 160 | + }), |
138 | 161 | }, |
139 | 162 | geoip: { |
140 | 163 | FieldsComponent: GeoIP, |
141 | 164 | docLinkPath: '/geoip-processor.html', |
142 | 165 | label: i18n.translate('xpack.ingestPipelines.processors.label.geoip', { |
143 | 166 | defaultMessage: 'GeoIP', |
144 | 167 | }), |
| 168 | + description: i18n.translate('xpack.ingestPipelines.processors.description.geoip', { |
| 169 | + defaultMessage: |
| 170 | + 'Adds geo data based on an IP address. Uses geo data from a Maxmind database file.', |
| 171 | + }), |
145 | 172 | }, |
146 | 173 | grok: { |
147 | 174 | FieldsComponent: Grok, |
148 | 175 | docLinkPath: '/grok-processor.html', |
149 | 176 | label: i18n.translate('xpack.ingestPipelines.processors.label.grok', { |
150 | 177 | defaultMessage: 'Grok', |
151 | 178 | }), |
| 179 | + description: () => ( |
| 180 | + <FormattedMessage |
| 181 | + id="xpack.ingestPipelines.processors.description.grok" |
| 182 | + defaultMessage="Uses {grokLink} expressions to extract matches from a field.." |
| 183 | + values={{ |
| 184 | + grokLink: ( |
| 185 | + <EuiLink external target="_blank" href={esDocUrl + '/grok-processor.html'}> |
| 186 | + {'grok'} |
| 187 | + </EuiLink> |
| 188 | + ), |
| 189 | + }} |
| 190 | + /> |
| 191 | + ), |
152 | 192 | }, |
153 | 193 | gsub: { |
154 | 194 | FieldsComponent: Gsub, |
155 | 195 | docLinkPath: '/gsub-processor.html', |
156 | 196 | label: i18n.translate('xpack.ingestPipelines.processors.label.gsub', { |
157 | 197 | defaultMessage: 'Gsub', |
158 | 198 | }), |
| 199 | + description: i18n.translate('xpack.ingestPipelines.processors.description.gsub', { |
| 200 | + defaultMessage: 'Uses a regular expression to replace field substrings.', |
| 201 | + }), |
159 | 202 | }, |
160 | 203 | html_strip: { |
161 | 204 | FieldsComponent: HtmlStrip, |
162 | 205 | docLinkPath: '/htmlstrip-processor.html', |
163 | 206 | label: i18n.translate('xpack.ingestPipelines.processors.label.htmlStrip', { |
164 | 207 | defaultMessage: 'HTML strip', |
165 | 208 | }), |
| 209 | + description: i18n.translate('xpack.ingestPipelines.processors.description.htmlStrip', { |
| 210 | + defaultMessage: 'Removes HTML tags from a field.', |
| 211 | + }), |
166 | 212 | }, |
167 | 213 | inference: { |
168 | 214 | FieldsComponent: Inference, |
169 | 215 | docLinkPath: '/inference-processor.html', |
170 | 216 | label: i18n.translate('xpack.ingestPipelines.processors.label.inference', { |
171 | 217 | defaultMessage: 'Inference', |
172 | 218 | }), |
| 219 | + description: i18n.translate('xpack.ingestPipelines.processors.description.inference', { |
| 220 | + defaultMessage: |
| 221 | + 'Uses a pre-trained data frame analytics model to infer against incoming data.', |
| 222 | + }), |
173 | 223 | }, |
174 | 224 | join: { |
175 | 225 | FieldsComponent: Join, |
176 | 226 | docLinkPath: '/join-processor.html', |
177 | 227 | label: i18n.translate('xpack.ingestPipelines.processors.label.join', { |
178 | 228 | defaultMessage: 'Join', |
179 | 229 | }), |
| 230 | + description: i18n.translate('xpack.ingestPipelines.processors.description.join', { |
| 231 | + defaultMessage: |
| 232 | + 'Joins array elements into a string. Inserts a separator between each element.', |
| 233 | + }), |
180 | 234 | }, |
181 | 235 | json: { |
182 | 236 | FieldsComponent: Json, |
183 | 237 | docLinkPath: '/json-processor.html', |
184 | 238 | label: i18n.translate('xpack.ingestPipelines.processors.label.json', { |
185 | 239 | defaultMessage: 'JSON', |
186 | 240 | }), |
| 241 | + description: i18n.translate('xpack.ingestPipelines.processors.description.json', { |
| 242 | + defaultMessage: 'Creates a JSON object from a compatible string.', |
| 243 | + }), |
187 | 244 | }, |
188 | 245 | kv: { |
189 | 246 | FieldsComponent: undefined, // TODO: Implement |
|
0 commit comments