Skip to content

Commit

Permalink
Add acc creation action in data connection table
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Jul 23, 2024
1 parent 407e084 commit 08dd0de
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import S3Logo from '../icons/s3_logo.svg';
import { DataSourceSelector } from '../../data_source_selector';
import { DataSourceOption } from '../../data_source_menu/types';
import { DATACONNECTIONS_BASE } from '../../../constants';
import { getRenderCreateAccelerationFlyout } from '../../../plugin';

interface DataConnection {
connectionType: DirectQueryDatasourceType;
Expand Down Expand Up @@ -164,6 +165,8 @@ export const ManageDirectQueryDataConnectionsTable: React.FC<ManageDirectQueryDa
setIsModalVisible(true);
};

const renderCreateAccelerationFlyout = getRenderCreateAccelerationFlyout();

const actions = [
{
name: (datasource: DataConnection) =>
Expand All @@ -182,7 +185,12 @@ export const ManageDirectQueryDataConnectionsTable: React.FC<ManageDirectQueryDa
icon: 'bolt',
type: 'icon',
available: (datasource: DataConnection) => datasource.connectionType !== 'PROMETHEUS',
onClick: () => {},
onClick: (datasource: DataConnection) => {
renderCreateAccelerationFlyout({
dataSourceName: datasource.name,
dataSourceMDSId: selectedDataSourceId,
});
},
'data-test-subj': 'action-accelerate',
},
{
Expand Down

0 comments on commit 08dd0de

Please sign in to comment.