From e3acc8aa4519706b5f998bd8511dfd09fd8dd310 Mon Sep 17 00:00:00 2001 From: Kerry Gallagher <471693+Kerry350@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:06:44 +0000 Subject: [PATCH 1/2] Add refresh button --- .../stream_detail_schema_editor/index.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx index 68257b00348be..4d601023766be 100644 --- a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx @@ -4,10 +4,11 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useEffect } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiPortal } from '@elastic/eui'; +import React, { useCallback, useEffect } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiProgress, EuiPortal, EuiButton } from '@elastic/eui'; import { css } from '@emotion/css'; import { WiredReadStreamDefinition } from '@kbn/streams-schema'; +import { i18n } from '@kbn/i18n'; import { useEditingState } from './hooks/use_editing_state'; import { SchemaEditorFlyout } from './flyout'; import { useKibana } from '../../hooks/use_kibana'; @@ -90,6 +91,11 @@ const Content = ({ reset(); }, [definition.name, reset]); + const refreshData = useCallback(() => { + refreshDefinition(); + refreshUnmappedFields(); + }, [refreshDefinition, refreshUnmappedFields]); + return ( @@ -116,6 +122,13 @@ const Content = ({ onChangeFilterGroup={queryAndFiltersState.changeFilterGroups} /> + + + {i18n.translate('xpack.streams.schemaEditor.refreshDataButtonLabel', { + defaultMessage: 'Refresh', + })} + + Date: Tue, 28 Jan 2025 12:38:30 +0000 Subject: [PATCH 2/2] [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' --- .../public/components/stream_detail_schema_editor/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx index 4d601023766be..cdc05414349fd 100644 --- a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx @@ -123,7 +123,11 @@ const Content = ({ /> - + {i18n.translate('xpack.streams.schemaEditor.refreshDataButtonLabel', { defaultMessage: 'Refresh', })}