Skip to content

Commit

Permalink
updated the branch
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Aug 30, 2024
1 parent 4dbb751 commit cb55e28
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 15 deletions.
66 changes: 53 additions & 13 deletions public/components/Main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import {
EuiSmallButton,
EuiButtonIcon,
EuiCallOut,
EuiComboBoxOptionOption,
Expand All @@ -15,6 +14,7 @@ import {
EuiPageContentBody,
EuiPageSideBar,
EuiPanel,
EuiSmallButton,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';
Expand Down Expand Up @@ -296,7 +296,7 @@ export class Main extends React.Component<MainProps, MainState> {
selectedMDSDataConnectionId: this.props.dataSourceMDSId,
mdsClusterName: '',
flintDataConnections: false,
newNavEnabled: coreRefs?.chrome?.navGroup.getNavGroupEnabled()
newNavEnabled: coreRefs?.chrome?.navGroup.getNavGroupEnabled(),
};
this.httpClient = this.props.httpClient;
this.updateSQLQueries = _.debounce(this.updateSQLQueries, 250).bind(this);
Expand All @@ -320,7 +320,9 @@ export class Main extends React.Component<MainProps, MainState> {
fetchFlintDataSources = () => {
fetchDataSources(
this.httpClient,
this.state.newNavEnabled ? this.props.dataSourceMDSId : this.state.selectedMDSDataConnectionId ,
this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
this.props.urlDataSource,
(dataOptions) => {
if (dataOptions.length > 0) {
Expand Down Expand Up @@ -442,7 +444,11 @@ export class Main extends React.Component<MainProps, MainState> {
const endpoint = '/api/sql_console/' + (_.isEqual(language, 'SQL') ? 'sqlquery' : 'pplquery');
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId };
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
const responsePromise = Promise.all(
queries.map((eachQuery: string) =>
Expand Down Expand Up @@ -577,7 +583,9 @@ export class Main extends React.Component<MainProps, MainState> {
});
}
},
this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId,
this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
(errorDetails: string) => {
this.setState({
asyncLoading: false,
Expand Down Expand Up @@ -606,7 +614,11 @@ export class Main extends React.Component<MainProps, MainState> {
if (queries.length > 0) {
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId };
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
const endpoint =
'/api/sql_console/' + (_.isEqual(language, 'SQL') ? 'translatesql' : 'translateppl');
Expand Down Expand Up @@ -658,7 +670,11 @@ export class Main extends React.Component<MainProps, MainState> {
if (queries.length > 0) {
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId};
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
Promise.all(
queries.map((eachQuery: string) =>
Expand Down Expand Up @@ -695,7 +711,11 @@ export class Main extends React.Component<MainProps, MainState> {
if (queries.length > 0) {
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId};
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
const endpoint = '/api/sql_console/' + (_.isEqual(language, 'SQL') ? 'sqlquery' : 'pplquery');
Promise.all(
Expand Down Expand Up @@ -733,7 +753,11 @@ export class Main extends React.Component<MainProps, MainState> {
if (queries.length > 0) {
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId };
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
const endpoint = '/api/sql_console/' + (_.isEqual(language, 'SQL') ? 'sqlcsv' : 'pplcsv');
Promise.all(
Expand Down Expand Up @@ -771,7 +795,11 @@ export class Main extends React.Component<MainProps, MainState> {
if (queries.length > 0) {
let query = {};
if (this.props.dataSourceEnabled) {
query = { dataSourceMDSId: this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId };
query = {
dataSourceMDSId: this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId,
};
}
const endpoint = '/api/sql_console/' + (_.isEqual(language, 'SQL') ? 'sqltext' : 'ppltext');
Promise.all(
Expand Down Expand Up @@ -954,7 +982,11 @@ export class Main extends React.Component<MainProps, MainState> {
openAccelerationFlyout={
this.props.isAccelerationFlyoutOpen && !this.state.isAccelerationFlyoutOpened
}
dataSourceMDSId={this.state.newNavEnabled? this.props.dataSourceMDSId: this.state.selectedMDSDataConnectionId}
dataSourceMDSId={
this.state.newNavEnabled
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId
}
setIsAccelerationFlyoutOpened={this.setIsAccelerationFlyoutOpened}
/>
);
Expand Down Expand Up @@ -1093,7 +1125,11 @@ export class Main extends React.Component<MainProps, MainState> {
onSelect={this.handleDataSelect}
urlDataSource={this.props.urlDataSource}
asyncLoading={this.state.asyncLoading}
dataSourceMDSId={coreRefs?.chrome?.navGroup.getNavGroupEnabled()? this.props.dataSourceMDSId : this.state.selectedMDSDataConnectionId}
dataSourceMDSId={
coreRefs?.chrome?.navGroup.getNavGroupEnabled()
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId
}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand All @@ -1112,7 +1148,11 @@ export class Main extends React.Component<MainProps, MainState> {
updateSQLQueries={this.updateSQLQueries}
refreshTree={this.state.refreshTree}
dataSourceEnabled={this.props.dataSourceEnabled}
dataSourceMDSId={coreRefs?.chrome?.navGroup.getNavGroupEnabled()? this.props.dataSourceMDSId : this.state.selectedMDSDataConnectionId}
dataSourceMDSId={
coreRefs?.chrome?.navGroup.getNavGroupEnabled()
? this.props.dataSourceMDSId
: this.state.selectedMDSDataConnectionId
}
clusterTab={this.state.cluster}
language={this.state.language}
updatePPLQueries={this.updatePPLQueries}
Expand Down
3 changes: 1 addition & 2 deletions public/components/acceleration/selectors/source_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiCompressedComboBox, EuiComboBoxOptionOption, EuiCompressedFormRow, EuiSpacer, EuiText } from '@elastic/eui';
import { EuiComboBoxOptionOption, EuiCompressedComboBox, EuiCompressedFormRow, EuiSpacer, EuiText } from '@elastic/eui';

Check failure on line 6 in public/components/acceleration/selectors/source_selector.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `·EuiComboBoxOptionOption,·EuiCompressedComboBox,·EuiCompressedFormRow,·EuiSpacer,·EuiText·` with `⏎··EuiComboBoxOptionOption,⏎··EuiCompressedComboBox,⏎··EuiCompressedFormRow,⏎··EuiSpacer,⏎··EuiText,⏎`
import producer from 'immer';
import React, { useEffect, useState } from 'react';
import { CoreStart } from '../../../../../../src/core/public';
Expand All @@ -29,7 +29,6 @@ export const AccelerationDataSourceSelector = ({
setAccelerationFormData,
selectedDatasource,
}: AccelerationDataSourceSelectorProps) => {
console.log(selectedDatasource)
const { setToast } = useToast();
const [dataConnections, setDataConnections] = useState<Array<EuiComboBoxOptionOption<string>>>(
[]
Expand Down

0 comments on commit cb55e28

Please sign in to comment.