-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add materlized views, manual refresh option and minor fixes #159
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ interface SQLPageProps { | |
sqlTranslations: ResponseDetail<TranslateResult>[]; | ||
selectedDatasource: EuiComboBoxOptionOption[]; | ||
asyncLoading: boolean; | ||
openAccelerationFlyout: boolean; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we change this to something like isAccelerationFlyoutOpen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
setIsAccelerationFlyoutOpened: (value: boolean) => void; | ||
} | ||
|
||
interface SQLPageState { | ||
|
@@ -80,6 +82,21 @@ export class SQLPage extends React.Component<SQLPageProps, SQLPageState> { | |
}); | ||
}; | ||
|
||
componentDidUpdate(prevProps: SQLPageProps) { | ||
const { selectedDatasource, openAccelerationFlyout } = this.props; | ||
const prevDataSource = prevProps.selectedDatasource[0].label; | ||
const currentDataSource = selectedDatasource[0].label; | ||
|
||
if ( | ||
currentDataSource !== prevDataSource && | ||
currentDataSource !== 'OpenSearch' && | ||
openAccelerationFlyout | ||
) { | ||
this.setAccelerationFlyout(); | ||
this.props.setIsAccelerationFlyoutOpened(true); | ||
} | ||
} | ||
|
||
render() { | ||
const closeModal = () => this.setIsModalVisible(false); | ||
const showModal = () => this.setIsModalVisible(true); | ||
|
@@ -187,7 +204,6 @@ export class SQLPage extends React.Component<SQLPageProps, SQLPageState> { | |
this.props.selectedDatasource[0].label !== 'OpenSearch' && ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
fill={true} | ||
className="sql-accelerate-button" | ||
onClick={this.setAccelerationFlyout} | ||
isDisabled={this.props.asyncLoading} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get why these two booleans are used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is for the prop which dictates if URL has a datasource that needs to be open with acceleration flyout. The other is to keep a local state. We need the local state to make sure, the URL flyout only opens once.