mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 02:41:39 +00:00
Use graphql in GitHubClient and misc fixes (#8)
* Use graphql in GitHubClient * Replace usage of Array.find with _.find
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user