diff --git a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/selectors/source_selector.tsx b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/selectors/source_selector.tsx index c550d47e7..9c32a1290 100644 --- a/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/selectors/source_selector.tsx +++ b/public/components/datasources/components/manage/accelerations/create_accelerations_flyout/selectors/source_selector.tsx @@ -54,6 +54,7 @@ interface DataSourceSelectorProps { dataSourcesPreselected: boolean; tableFieldsLoading: boolean; dataSourceMDSId?: string; + hideHeader?: boolean; } export const DataSourceSelector: React.FC = ({ @@ -63,6 +64,7 @@ export const DataSourceSelector: React.FC = ({ dataSourcesPreselected, tableFieldsLoading, dataSourceMDSId, + hideHeader, }) => { const { setToast } = useToast(); const [databases, setDatabases] = useState>>([]); @@ -170,15 +172,19 @@ export const DataSourceSelector: React.FC = ({ return ( <> - -

Select data source

-
- - - Select the data source to accelerate data from. External data sources may take time to load. - - - + {!hideHeader && ( + <> + +

Select data source

+
+ + + Select the data source to accelerate data from. External data sources may take time to + load. + + + + )} {dataSourcesPreselected ? ( <> diff --git a/public/components/datasources/components/manage/data_connection.tsx b/public/components/datasources/components/manage/data_connection.tsx index 1233e2678..8819615c3 100644 --- a/public/components/datasources/components/manage/data_connection.tsx +++ b/public/components/datasources/components/manage/data_connection.tsx @@ -101,9 +101,7 @@ export const DataConnection = (props: { dataSource: string }) => { }, [datasourceDetails]); useEffect(() => { - const searchDataSourcePattern = new RegExp( - `flint_${escapeRegExp(datasourceDetails.name)}_default_.*` - ); + const searchDataSourcePattern = new RegExp(`flint_${escapeRegExp(datasourceDetails.name)}_.*`); const findIntegrations = async () => { // TODO: we just get all results and filter, ideally we send a filtering query to the API // Should still be probably okay until we get cases of 500+ integration instances diff --git a/public/components/integrations/components/setup_integration.tsx b/public/components/integrations/components/setup_integration.tsx index d58a57de6..209e9656e 100644 --- a/public/components/integrations/components/setup_integration.tsx +++ b/public/components/integrations/components/setup_integration.tsx @@ -24,6 +24,7 @@ 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'; export interface IntegrationSetupInputs { displayName: string; @@ -42,7 +43,6 @@ export interface IntegrationConfigProps { integration: IntegrationConfig; setupCallout: SetupCallout; lockConnectionType?: boolean; - isS3ConnectionWithLakeFormation?: boolean; } type SetupCallout = { show: true; title: string; color?: Color; text?: string } | { show: false }; @@ -190,7 +190,9 @@ const addIntegration = async ({ integration, setToast: setCalloutLikeToast, name: config.displayName, - indexPattern: `flint_${config.connectionDataSource}_default_${config.connectionTableName}__*`, + indexPattern: `flint_${config.connectionDataSource}_${ + config.connectionDatabaseName ?? 'default' + }_${config.connectionTableName}__*`, workflows: config.enabledWorkflows, skipRedirect: setIsInstalling ? true : false, dataSourceInfo: { dataSource: config.connectionDataSource, tableName: makeTableName(config) }, @@ -374,69 +376,57 @@ export function SetupIntegrationForm({ const updateConfig = (updates: Partial) => setConfig(Object.assign({}, integConfig, updates)); + const IntegrationInputFormComponent = forceConnection?.properties?.lakeFormationEnabled + ? SetupIntegrationInputsForSecurityLake + : SetupIntegrationFormInputs; + + const content = ( + <> + {showLoading ? ( + + ) : ( + + )} + + ); + + const bottomBar = ( + + ); + if (renderType === 'page') { return ( <> - - {showLoading ? ( - - ) : ( - - )} - + {content} - - - + {bottomBar} ); } else if (renderType === 'flyout') { return ( <> - - {showLoading ? ( - - ) : ( - - )} - - - - + {content} + {bottomBar} ); } + + return null; } export function SetupIntegrationPage({ diff --git a/public/components/integrations/components/setup_integration_inputs.tsx b/public/components/integrations/components/setup_integration_inputs.tsx index c25560693..1a4384339 100644 --- a/public/components/integrations/components/setup_integration_inputs.tsx +++ b/public/components/integrations/components/setup_integration_inputs.tsx @@ -19,7 +19,6 @@ import React, { useState, useEffect } from 'react'; import { coreRefs } from '../../../framework/core_refs'; import { CONSOLE_PROXY, DATACONNECTIONS_BASE } from '../../../../common/constants/shared'; import { IntegrationConfigProps, IntegrationSetupInputs } from './setup_integration'; -import { SetupIntegrationInputsForSecurityLake } from './setup_integration_inputs_security_lake'; // TODO support localization const INTEGRATION_CONNECTION_DATA_SOURCE_TYPES: Map< @@ -129,23 +128,21 @@ export function SetupWorkflowSelector({ ); }); - return cards; + return <>{cards}; } export function IntegrationDetailsInputs({ config, updateConfig, integration, - isS3ConnectionWithLakeFormation, }: { config: IntegrationSetupInputs; updateConfig: (updates: Partial) => void; integration: IntegrationConfig; - isS3ConnectionWithLakeFormation?: boolean; }) { return ( @@ -294,7 +291,7 @@ export function IntegrationQueryInputs({ )} - {isS3ConnectionWithLakeFormation ? ( - - ) : ( + +

Set Up Integration

+
+ + {setupCallout.show ? ( + +

{setupCallout.text}

+
+ ) : null} + + +

Integration Details

+
+ + + + +

Integration Connection

+
+ + + {config.connectionType === 's3' ? ( <> - -

Set Up Integration

-
- - {setupCallout.show ? ( - -

{setupCallout.text}

-
- ) : null} - - -

Integration Details

-
- - -

Integration Connection

+

Query Fields

+ + +

+ To set up the integration, we need to know some information about how to process + your data. +

+
+
- - {config.connectionType === 's3' ? ( + {integration.workflows ? ( <> -

Query Fields

+

Integration Resources

- To set up the integration, we need to know some information about how to process - your data. + This integration offers different kinds of resources compatible with your data + source. These can include dashboards, visualizations, indexes, and queries. + Select at least one of the following options.

- - {integration.workflows ? ( - <> - - -

Integration Resources

-
- - -

- This integration offers different kinds of resources compatible with your - data source. These can include dashboards, visualizations, indexes, and - queries. Select at least one of the following options. -

-
-
- - - - ) : null} - {/* Bottom bar will overlap content if there isn't some space at the end */} - - + ) : null} + {/* Bottom bar will overlap content if there isn't some space at the end */} + + - )} + ) : null} ); } diff --git a/public/components/integrations/components/setup_integration_inputs_security_lake.tsx b/public/components/integrations/components/setup_integration_inputs_security_lake.tsx index c201075f2..122bdf41a 100644 --- a/public/components/integrations/components/setup_integration_inputs_security_lake.tsx +++ b/public/components/integrations/components/setup_integration_inputs_security_lake.tsx @@ -29,7 +29,6 @@ export const SetupIntegrationInputsForSecurityLake = ({ updateConfig, integration, setupCallout, - isS3ConnectionWithLakeFormation, }: IntegrationConfigProps) => { const http = coreRefs.http!; const [dataSourceFormData, setDataSourceFormData] = useState({ @@ -64,7 +63,6 @@ export const SetupIntegrationInputsForSecurityLake = ({ config={config} updateConfig={updateConfig} integration={integration} - isS3ConnectionWithLakeFormation={isS3ConnectionWithLakeFormation} /> {config.connectionType === 's3' ? ( @@ -84,6 +82,7 @@ export const SetupIntegrationInputsForSecurityLake = ({ selectedDatasource={config.connectionDataSource} dataSourcesPreselected={false} tableFieldsLoading={false} + hideHeader={true} /> @@ -92,7 +91,7 @@ export const SetupIntegrationInputsForSecurityLake = ({ config={config} updateConfig={updateConfig} integration={integration} - isS3ConnectionWithLakeFormation={isS3ConnectionWithLakeFormation} + isS3ConnectionWithLakeFormation={true} /> {integration.workflows ? ( <>