Skip to content
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

Display stored procedures in graphs #639

Merged
merged 2 commits into from
Jun 19, 2018
Merged

Display stored procedures in graphs #639

merged 2 commits into from
Jun 19, 2018

Conversation

PrashanthCorp
Copy link
Contributor

@PrashanthCorp PrashanthCorp commented May 23, 2018

Fixes #422

  • The UX I'm implementing follows the portal.
    Extension:
    image
    Portal:
    image

Leaving some comments at places I would like some clarification.

@PrashanthCorp PrashanthCorp requested a review from a team May 23, 2018 18:14
@@ -20,7 +21,7 @@ export class DocDBStoredProceduresTreeItem extends DocDBTreeItemBase<ProcedureMe
public readonly contextValue: string = DocDBStoredProceduresTreeItem.contextValue;
public readonly childTypeLabel: string = "Stored Procedure";

constructor(endpoint: string, masterKey: string, private _collection: DocDBCollectionTreeItem, isEmulator: boolean) {
constructor(endpoint: string, masterKey: string, private _collection: DocDBCollectionTreeItem | GraphCollectionTreeItem, isEmulator: boolean) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the change made to DocDBStoredProcedure is minimal, hence it doesn't warrant any refactoring.

* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is not the clearest. Would GraphViewTreeItem be clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think GraphTreeItem is fine.

public hasMoreChildren(): boolean {
return false;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some repeated code, but not enough to make a DocDBCollectionTreeItemBase as opposed to DocDBDatabaseTreeItemBase

Also, see #414 - I did not want to perpetuate that.

@PrashanthCorp PrashanthCorp requested a review from fiveisprime May 25, 2018 20:07
@fiveisprime
Copy link
Member

What does it look like with mongo? I remember talking about this structure a while back and the original thought included a "documents" node, did that go away?

@PrashanthCorp
Copy link
Contributor Author

  1. Mongo doesn't seem to have Stored Procedures, last I checked. This comment from View graph stored procs in the browser tree #422 has the relevant screenshot.
  2. Coming to graphs, I don't see an equivalent vertices entity that we list. Hence we have a graph node, and associated Stored Procedures.

@@ -18,7 +19,7 @@ export class DocDBStoredProcedureTreeItem implements IAzureTreeItem {
public readonly contextValue: string = DocDBStoredProcedureTreeItem.contextValue;
public readonly commandId: string = 'cosmosDB.openStoredProcedure';

constructor(private _endpoint: string, private _masterKey: string, private _isEmulator: boolean, private _collection: DocDBCollectionTreeItem, public procedure: ProcedureMeta) {
constructor(private _endpoint: string, private _masterKey: string, private _isEmulator: boolean, private _collection: DocDBCollectionTreeItem | GraphCollectionTreeItem, public procedure: ProcedureMeta) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Offline feedback: The only reason _collection is required is for the DocumentClient here. Consider:

  1. An interface type to handle this.
  2. Passing just the client.
  3. Passing merely the getDocumentClient. This feels weird to me because a parameterless function storing state seems obfuscated if I were to debug this later.

@StephenWeatherford was there anything else I missed?

@PrashanthCorp
Copy link
Contributor Author

Commit performs option 2 from this previous comment

@PrashanthCorp PrashanthCorp removed the request for review from a team June 19, 2018 17:35
@PrashanthCorp
Copy link
Contributor Author

Ping

@PrashanthCorp PrashanthCorp merged commit 3ea8080 into master Jun 19, 2018
@PrashanthCorp PrashanthCorp deleted the ps/422 branch June 29, 2018 17:27
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants