mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Fix for QueryTab Load More (#907)
This commit is contained in:
parent
39215dc4de
commit
f9bd12eaa6
@ -33,6 +33,12 @@ export class EditorReact extends React.Component<EditorReactProps, EditorReactSt
|
|||||||
this.createEditor(this.configureEditor.bind(this));
|
this.createEditor(this.configureEditor.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public componentDidUpdate(previous: EditorReactProps) {
|
||||||
|
if (this.props.content !== previous.content) {
|
||||||
|
this.editor.setValue(this.props.content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
this.selectionListener && this.selectionListener.dispose();
|
this.selectionListener && this.selectionListener.dispose();
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,6 @@ interface IQueryTabStates {
|
|||||||
export default class QueryTabComponent extends React.Component<IQueryTabComponentProps, IQueryTabStates> {
|
export default class QueryTabComponent extends React.Component<IQueryTabComponentProps, IQueryTabStates> {
|
||||||
public queryEditorId: string;
|
public queryEditorId: string;
|
||||||
public executeQueryButton: Button;
|
public executeQueryButton: Button;
|
||||||
public fetchNextPageButton: Button;
|
|
||||||
public saveQueryButton: Button;
|
public saveQueryButton: Button;
|
||||||
public splitterId: string;
|
public splitterId: string;
|
||||||
public splitter: Splitter;
|
public splitter: Splitter;
|
||||||
@ -195,23 +194,6 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
|
|||||||
enabled: this.state._isSaveQueriesEnabled,
|
enabled: this.state._isSaveQueriesEnabled,
|
||||||
visible: this.state._isSaveQueriesEnabled,
|
visible: this.state._isSaveQueriesEnabled,
|
||||||
};
|
};
|
||||||
this.fetchNextPageButton = {
|
|
||||||
enabled: (() => {
|
|
||||||
const allResultsMetadata = this.state.allResultsMetadata || [];
|
|
||||||
const numberOfResultsMetadata = allResultsMetadata.length;
|
|
||||||
|
|
||||||
if (numberOfResultsMetadata === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (allResultsMetadata[numberOfResultsMetadata - 1].hasMoreResults) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
})(),
|
|
||||||
visible: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
this._buildCommandBarOptions();
|
this._buildCommandBarOptions();
|
||||||
props.onTabAccessor({
|
props.onTabAccessor({
|
||||||
@ -981,14 +963,17 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
|
|||||||
<span>
|
<span>
|
||||||
<span>{this.state.showingDocumentsDisplayText}</span>
|
<span>{this.state.showingDocumentsDisplayText}</span>
|
||||||
</span>
|
</span>
|
||||||
{this.fetchNextPageButton.enabled && <span className="queryResultDivider">|</span>}
|
{this.state.allResultsMetadata[this.state.allResultsMetadata.length - 1]
|
||||||
{this.fetchNextPageButton.enabled && (
|
.hasMoreResults && (
|
||||||
|
<>
|
||||||
|
<span className="queryResultDivider">|</span>
|
||||||
<span className="queryResultNextEnable">
|
<span className="queryResultNextEnable">
|
||||||
<a onClick={this.onFetchNextPageClick}>
|
<a onClick={this.onFetchNextPageClick.bind(this)}>
|
||||||
<span>Load more</span>
|
<span>Load more</span>
|
||||||
<img className="queryResultnextImg" src={QueryEditorNext} alt="Fetch next page" />
|
<img className="queryResultnextImg" src={QueryEditorNext} alt="Fetch next page" />
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{this.state.queryResults &&
|
{this.state.queryResults &&
|
||||||
|
Loading…
Reference in New Issue
Block a user