Use graphql in GitHubClient and misc fixes (#8)

* Use graphql in GitHubClient

* Replace usage of Array.find with _.find
This commit is contained in:
Tanuj Mittal
2020-06-05 12:22:41 -07:00
committed by GitHub
parent e9d3160b57
commit aa8236666e
24 changed files with 761 additions and 657 deletions

View File

@@ -155,19 +155,7 @@ function openPane(action: ActionContracts.OpenPane, explorer: ViewModels.Explore
}
function openFile(action: ActionContracts.OpenSampleNotebook, explorer: ViewModels.Explorer) {
let path: string;
if (action.hasOwnProperty("file")) {
// This is deprecated
const downloadUrl: string = (action as any).file.download_url;
path = downloadUrl.replace(
"raw.githubusercontent.com/Azure-Samples/cosmos-notebooks",
"github.com/Azure-Samples/cosmos-notebooks/blob"
); // convert raw download url to something which GitHubContentProvider understands
} else {
path = action.path;
}
explorer.handleOpenFileAction(path);
explorer.handleOpenFileAction(decodeURIComponent(action.path));
}
function generateQueryText(action: ActionContracts.OpenQueryTab, partitionKeyProperty: string): string {