Skip to content

Commit

Permalink
[BUG] missed files for integration-mds setup (opensearch-project#1993)
Browse files Browse the repository at this point in the history
* bug fix for integration-mds

Signed-off-by: sumukhswamy <[email protected]>

* updated snapshots

Signed-off-by: sumukhswamy <[email protected]>

---------

Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy authored Jul 24, 2024
1 parent ddcaf08 commit d912d7b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState, CSSProperties, useEffect } from 'react';
import {
EuiSpacer,
EuiPanel,
EuiInMemoryTable,
EuiTitle,
EuiLink,
EuiButton,
EuiFieldSearch,
EuiFlexGroup,
EuiFlexItem,
EuiFieldSearch,
EuiButton,
EuiFlyout,
EuiIcon,
EuiInMemoryTable,
EuiLink,
EuiPanel,
EuiSpacer,
EuiText,
EuiFlyout,
EuiTitle,
} from '@elastic/eui';
import escapeRegExp from 'lodash/escapeRegExp';
import { IntegrationHealthBadge } from '../../../../integrations/components/added_integration';
import { SetupIntegrationForm } from '../../../../integrations/components/setup_integration';
import { coreRefs } from '../../../../../framework/core_refs';
import { basePathLink } from '../../../../../../common/utils/shared';
import { AvailableIntegrationsTable } from '../../../../integrations/components/available_integration_table';
import React, { CSSProperties, useEffect, useState } from 'react';
import { INTEGRATIONS_BASE } from '../../../../../../common/constants/shared';
import { AvailableIntegrationsList } from '../../../../integrations/components/available_integration_overview_page';
import { DatasourceType } from '../../../../../../common/types/data_connections';
import { basePathLink } from '../../../../../../common/utils/shared';
import { coreRefs } from '../../../../../framework/core_refs';
import { IntegrationHealthBadge } from '../../../../integrations/components/added_integration';
import { AvailableIntegrationsList } from '../../../../integrations/components/available_integration_overview_page';
import { AvailableIntegrationsTable } from '../../../../integrations/components/available_integration_table';
import { SetupIntegrationForm } from '../../../../integrations/components/setup_integration';
import { isS3Connection } from '../../../utils/helpers';

interface IntegrationInstanceTableEntry {
Expand Down
37 changes: 33 additions & 4 deletions public/components/integrations/components/setup_integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ import {
EuiPageContent,
EuiPageContentBody,
} from '@elastic/eui';
import React, { useState, useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { NotificationsStart, SavedObjectsStart } from '../../../../../../src/core/public';
import { DataSourceManagementPluginSetup } from '../../../../../../src/plugins/data_source_management/public';
import { Color } from '../../../../common/constants/integrations';
import { CONSOLE_PROXY, INTEGRATIONS_BASE } from '../../../../common/constants/shared';
import { IntegrationConnectionType } from '../../../../common/types/integrations';
import { coreRefs } from '../../../framework/core_refs';
import { addIntegrationRequest } from './create_integration_helpers';
import { SetupIntegrationFormInputs } from './setup_integration_inputs';
import { CONSOLE_PROXY, INTEGRATIONS_BASE } from '../../../../common/constants/shared';
import { SetupIntegrationInputsForSecurityLake } from './setup_integration_inputs_security_lake';
import { IntegrationConnectionType } from '../../../../common/types/integrations';

export interface IntegrationSetupInputs {
displayName: string;
Expand All @@ -44,6 +46,10 @@ export interface IntegrationConfigProps {
integration: IntegrationConfig;
setupCallout: SetupCallout;
lockConnectionType?: boolean;
notifications: NotificationsStart;
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
savedObjectsMDSClient: SavedObjectsStart;
}

type SetupCallout = { show: true; title: string; color?: Color; text?: string } | { show: false };
Expand Down Expand Up @@ -338,6 +344,10 @@ export function SetupIntegrationForm({
renderType = 'page',
unsetIntegration,
forceConnection,
notifications,
dataSourceEnabled,
dataSourceManagement,
savedObjectsMDSClient,
setIsInstalling,
}: {
integration: string;
Expand All @@ -347,6 +357,10 @@ export function SetupIntegrationForm({
name: string;
type: IntegrationConnectionType;
};
notifications: NotificationsStart;
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
savedObjectsMDSClient: SavedObjectsStart;
setIsInstalling?: (isInstalling: boolean, success?: boolean) => void;
}) {
const [integConfig, setConfig] = useState({
Expand Down Expand Up @@ -387,7 +401,6 @@ export function SetupIntegrationForm({
forceConnection?.type === 'securityLake' || integConfig.connectionType === 'securityLake'
? SetupIntegrationInputsForSecurityLake
: SetupIntegrationFormInputs;

const content = (
<>
{showLoading ? (
Expand All @@ -399,6 +412,10 @@ export function SetupIntegrationForm({
integration={template}
setupCallout={setupCallout}
lockConnectionType={forceConnection !== undefined}
dataSourceManagement={dataSourceManagement}
notifications={notifications}
dataSourceEnabled={dataSourceEnabled}
savedObjectsMDSClient={savedObjectsMDSClient}
/>
)}
</>
Expand Down Expand Up @@ -440,9 +457,17 @@ export function SetupIntegrationForm({
export function SetupIntegrationPage({
integration,
unsetIntegration,
notifications,
dataSourceEnabled,
dataSourceManagement,
savedObjectsMDSClient,
}: {
integration: string;
unsetIntegration?: () => void;
notifications: NotificationsStart;
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
savedObjectsMDSClient: SavedObjectsStart;
}) {
return (
<EuiPage>
Expand All @@ -451,6 +476,10 @@ export function SetupIntegrationPage({
integration={integration}
unsetIntegration={unsetIntegration}
renderType="page"
dataSourceManagement={dataSourceManagement}
notifications={notifications}
dataSourceEnabled={dataSourceEnabled}
savedObjectsMDSClient={savedObjectsMDSClient}
/>
</EuiPageBody>
</EuiPage>
Expand Down

0 comments on commit d912d7b

Please sign in to comment.