mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.12`: - [[Search] Fix connector config resetting without changes (#176235)](https://github.com/elastic/kibana/pull/176235) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sander Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-02-06T14:08:19Z","message":"[Search] Fix connector config resetting without changes (#176235)\n\n## Summary\r\n\r\nThis fixes an issue in the connector configuration where the config\r\nwould keep resetting without config changes.","sha":"9ccd7cc5713cf893c8f22fc52f3f8d5d71635e7e","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.13.0","v8.12.2"],"title":"[Search] Fix connector config resetting without changes","number":176235,"url":"https://github.com/elastic/kibana/pull/176235","mergeCommit":{"message":"[Search] Fix connector config resetting without changes (#176235)\n\n## Summary\r\n\r\nThis fixes an issue in the connector configuration where the config\r\nwould keep resetting without config changes.","sha":"9ccd7cc5713cf893c8f22fc52f3f8d5d71635e7e"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/176235","number":176235,"mergeCommit":{"message":"[Search] Fix connector config resetting without changes (#176235)\n\n## Summary\r\n\r\nThis fixes an issue in the connector configuration where the config\r\nwould keep resetting without config changes.","sha":"9ccd7cc5713cf893c8f22fc52f3f8d5d71635e7e"}},{"branch":"8.12","label":"v8.12.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
This commit is contained in:
parent
02ddd20b41
commit
341e9e6122
1 changed files with 14 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import React, { createContext, useEffect, useState } from 'react';
|
||||
import React, { createContext, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import {
|
||||
EuiButton,
|
||||
|
@ -20,8 +20,15 @@ import {
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { isDeepEqual } from 'react-use/lib/util';
|
||||
import { sortAndFilterConnectorConfiguration } from '../../utils/connector_configuration_utils';
|
||||
import { Connector, ConnectorConfigProperties, ConnectorStatus, FeatureName } from '../..';
|
||||
import {
|
||||
Connector,
|
||||
ConnectorConfigProperties,
|
||||
ConnectorConfiguration,
|
||||
ConnectorStatus,
|
||||
FeatureName,
|
||||
} from '../..';
|
||||
|
||||
import { ConnectorConfigurationForm } from './connector_configuration_form';
|
||||
|
||||
|
@ -82,6 +89,7 @@ export const ConnectorConfigurationComponent: React.FC<ConnectorConfigurationPro
|
|||
subscriptionLink,
|
||||
stackManagementLink,
|
||||
}) => {
|
||||
const configurationRef = useRef<ConnectorConfiguration>({});
|
||||
const {
|
||||
configuration,
|
||||
error,
|
||||
|
@ -95,7 +103,10 @@ export const ConnectorConfigurationComponent: React.FC<ConnectorConfigurationPro
|
|||
const [isEditing, setIsEditing] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setIsEditing(false);
|
||||
if (!isDeepEqual(configuration, configurationRef.current)) {
|
||||
configurationRef.current = configuration;
|
||||
setIsEditing(false);
|
||||
}
|
||||
}, [configuration]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue