mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-07 11:36:47 +00:00
Wire database id and collection id
This commit is contained in:
@@ -18,6 +18,8 @@ import "./MongoQueryComponent.less";
|
|||||||
interface MongoQueryComponentPureProps {
|
interface MongoQueryComponentPureProps {
|
||||||
contentRef: ContentRef;
|
contentRef: ContentRef;
|
||||||
kernelRef: KernelRef;
|
kernelRef: KernelRef;
|
||||||
|
databaseId: string;
|
||||||
|
collectionId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MongoQueryComponentDispatchProps {
|
interface MongoQueryComponentDispatchProps {
|
||||||
@@ -71,7 +73,7 @@ export class MongoQueryComponent extends React.Component<MongoQueryComponentProp
|
|||||||
};
|
};
|
||||||
|
|
||||||
private onInputChange = (text: string) => {
|
private onInputChange = (text: string) => {
|
||||||
this.props.onChange(this.createFilterQuery("mydb", "airbnb-ch", text),
|
this.props.onChange(this.createFilterQuery(this.props.databaseId, this.props.collectionId, text),
|
||||||
this.props.firstCellId, this.props.contentRef);
|
this.props.firstCellId, this.props.contentRef);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export class MongoQueryComponentAdapter extends NotebookComponentBootstrapper im
|
|||||||
public parameters: unknown;
|
public parameters: unknown;
|
||||||
private kernelRef: KernelRef;
|
private kernelRef: KernelRef;
|
||||||
|
|
||||||
constructor(options: NotebookComponentBootstrapperOptions) {
|
constructor(options: NotebookComponentBootstrapperOptions, private databaseId: string, private collectionId: string) {
|
||||||
super(options);
|
super(options);
|
||||||
|
|
||||||
if (!this.contentRef) {
|
if (!this.contentRef) {
|
||||||
@@ -33,9 +33,16 @@ export class MongoQueryComponentAdapter extends NotebookComponentBootstrapper im
|
|||||||
}
|
}
|
||||||
|
|
||||||
public renderComponent(): JSX.Element {
|
public renderComponent(): JSX.Element {
|
||||||
|
const props = {
|
||||||
|
contentRef: this.contentRef,
|
||||||
|
kernelRef: this.kernelRef,
|
||||||
|
databaseId: this.databaseId,
|
||||||
|
collectionId: this.collectionId
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Provider store={this.getStore()}>
|
<Provider store={this.getStore()}>
|
||||||
<MongoQueryComponent contentRef={this.contentRef} kernelRef={this.kernelRef} />;
|
<MongoQueryComponent {...props} />;
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default class MongoDocumentsTabV2 extends NotebookTabBase {
|
|||||||
this.mongoQueryComponentAdapter = new MongoQueryComponentAdapter({
|
this.mongoQueryComponentAdapter = new MongoQueryComponentAdapter({
|
||||||
contentRef: undefined,
|
contentRef: undefined,
|
||||||
notebookClient: NotebookTabBase.clientManager
|
notebookClient: NotebookTabBase.clientManager
|
||||||
});
|
}, options.collection?.databaseId, options.collection?.id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCloseTabButtonClick(): Q.Promise<void> {
|
public onCloseTabButtonClick(): Q.Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user