[TSVB] Index pattern select field disappear in Annotation tab#102314
[TSVB] Index pattern select field disappear in Annotation tab#102314alexwizp merged 9 commits intoelastic:masterfrom
Conversation
| }; | ||
| const changeFetchedIndex = async (index) => { | ||
| handleChange(index); | ||
| await this.setFetchedIndex(index[INDEX_PATTERN_NAME]); |
There was a problem hiding this comment.
how it should work in case of 2 or more annotations with different index patterns? Looks like you set in state the last fetchedIndex which will be used for each annotations.
alexwizp
left a comment
There was a problem hiding this comment.
I recommend you to put renderRow in a separate component. It should help you to solve that issue.
|
@elasticmachine merge upstream |
| query_string: filter, | ||
| }); | ||
|
|
||
| const onChange = (part: Partial<Annotation>) => |
There was a problem hiding this comment.
please use useCallback for these cases
src/plugins/vis_type_timeseries/public/application/components/annotation_row.tsx
Show resolved
Hide resolved
| import { getDefaultQueryLanguage } from './lib/get_default_query_language'; | ||
| import type { Annotation, FetchedIndexPattern, IndexPatternValue } from '../../../common/types'; | ||
| import type { AnnotationsEditorProps } from './annotations_editor'; | ||
| import { newAnnotation } from './annotations_editor'; |
There was a problem hiding this comment.
please avoid of cross references annotations_editor <---> annotations_ropw
| import type { Annotation } from '../../../common/types'; | ||
|
|
||
| interface YesNoProps<ParamName extends keyof TimeseriesVisParams> { | ||
| interface YesNoProps<ParamName extends keyof TimeseriesVisParams | keyof Annotation> { |
There was a problem hiding this comment.
wrong type. not sure that YesNo component should know anything about Annotation.
There was a problem hiding this comment.
and TimeseriesVisParams. Looks like bad typed Component. Can we use string instead?
| defaultMessage="Click the button below to create an annotation data source." | ||
| /> | ||
| </p> | ||
| <EuiButton fill onClick={() => collectionActions.handleAdd(props, newAnnotation)}> |
There was a problem hiding this comment.
see comment above, use useCallback
| export interface AnnotationsEditorProps { | ||
| fields: VisFields; | ||
| model: Panel; | ||
| name: 'annotations'; |
There was a problem hiding this comment.
what's a purpose of that field?
…Row, remove cross refecrence and update types
VladLasitsa
left a comment
There was a problem hiding this comment.
LGTM, tested locally in chrome
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
stratoula
left a comment
There was a problem hiding this comment.
Thanx for the "typescripting" 🙂
I tested both a new and an existing visualization with annotations and it works fine.
Just some nit picks, in general LGTM
| </EuiFlexItem> | ||
| <EuiFlexItem> | ||
| <FieldSelect | ||
| type={'time_field'} |
There was a problem hiding this comment.
nit: No need to wrap it, type='time_field' and as we have done it for const INDEX_PATTERN_KEY = 'index_pattern'; we could do the same here
| } | ||
| restrict={RESTRICT_FIELDS} | ||
| value={model.time_field} | ||
| onChange={handleChange('time_field')} |
There was a problem hiding this comment.
Same here, could use the same constant.
|
|
||
| const NoContent = ({ handleAdd }: { handleAdd: () => void }) => ( | ||
| <EuiText textAlign="center"> | ||
| <p> |
There was a problem hiding this comment.
Nit, do we need the extra p ?
There was a problem hiding this comment.
Yes... don't see any difference with and without p
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
…c#102314) * [TSVB] Index pattern select field disappear in Annotation tab * Refactor AnnotationsEditor and move renderRow logic into AnnotationRow * Remove duplicated license, add useCallback to functions in AnnotationRow, remove cross refecrence and update types * Refactor AnnotationEditor and AnnotationRow * refactoring * remove extra props * fix nits Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
…c#102314) * [TSVB] Index pattern select field disappear in Annotation tab * Refactor AnnotationsEditor and move renderRow logic into AnnotationRow * Remove duplicated license, add useCallback to functions in AnnotationRow, remove cross refecrence and update types * Refactor AnnotationEditor and AnnotationRow * refactoring * remove extra props * fix nits Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com> # Conflicts: # src/plugins/vis_type_timeseries/public/application/components/yes_no.tsx
…102314) (#102654) * [TSVB] Index pattern select field disappear in Annotation tab (#102314) * [TSVB] Index pattern select field disappear in Annotation tab * Refactor AnnotationsEditor and move renderRow logic into AnnotationRow * Remove duplicated license, add useCallback to functions in AnnotationRow, remove cross refecrence and update types * Refactor AnnotationEditor and AnnotationRow * refactoring * remove extra props * fix nits Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com> # Conflicts: # src/plugins/vis_type_timeseries/public/application/components/yes_no.tsx * fix merge conflicts Co-authored-by: Diana Derevyankina <54894989+DziyanaDzeraviankina@users.noreply.github.com>
… (#102653) * [TSVB] Index pattern select field disappear in Annotation tab * Refactor AnnotationsEditor and move renderRow logic into AnnotationRow * Remove duplicated license, add useCallback to functions in AnnotationRow, remove cross refecrence and update types * Refactor AnnotationEditor and AnnotationRow * refactoring * remove extra props * fix nits Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alexey Antonov <alexwizp@gmail.com> Co-authored-by: Diana Derevyankina <54894989+DziyanaDzeraviankina@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…-png-pdf-report-type * 'master' of github.com:elastic/kibana: (447 commits) skip flaky suite (elastic#102366) [Security Solution][Endpoint][Host Isolation] Isolation status badge from alert details (elastic#102274) Add email connector info for Elastic Cloud (elastic#91363) [Workplace Search] remove or replace xs props for text on source connect view (elastic#102663) Do not double register dashboard url generator (elastic#102599) [TSVB] Replaces EuiCodeEditor 👉 Monaco editor (elastic#100684) [Discover] Update kibana.json adding owner and description (elastic#102292) [Exploratory View] Mobile experience (elastic#99565) chore(NA): moving @kbn/ui-shared-deps into bazel (elastic#101669) [TSVB] Index pattern select field disappear in Annotation tab (elastic#102314) [Security Solution][Endpoint][Host Isolation] Fixes bug where host isolation/unisolation works from alert details (elastic#102581) TSVB visualizations with no timefield do not render after upgrading from 7.12.1 to 7.13.0 (elastic#102494) [Logs UI] Add `event.original` fallback to message reconstruction rules (elastic#102236) [ML] Remove blank job definition as it is unused and out-of-sync with Elasticsearch (elastic#102506) [Lens] Fix wrong error detection on transition to Top values operation (elastic#102384) [ML] Anomaly detection job custom_settings improvements (elastic#102099) [Cases] Route: Get all alerts attach to a case (elastic#101878) Fixes wrong list exception type when creating endpoint event filters list (elastic#102522) remove search bar that's not working yet (elastic#102550) Migrated Ingest Node Pipeline Functional Tests to use test_user (elastic#102409) ... # Conflicts: # x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx



Closes #102180
Summary
Fixed missed index pattern field for the annotations panel.
The reason was no
fetchedIndexprovided forIndexPatternSelect.For maintainers