Add telemetry for Notebooks Gallery and other updates (#413)

* Add telemetry for Notebooks Gallery

* More changes

* Address feedback and fix lint error

* Fix margins for My published work
This commit is contained in:
Tanuj Mittal
2021-02-03 14:48:50 +05:30
committed by GitHub
parent e0063c76d9
commit 5038a01079
12 changed files with 329 additions and 67 deletions

View File

@@ -716,6 +716,19 @@ export class ResourceTreeAdapter implements ReactAdapter {
},
];
if (item.type === NotebookContentItemType.Notebook) {
items.push({
label: "Publish to gallery",
iconSrc: undefined, // TODO
onClick: async () => {
const content = await this.container.readFile(item);
if (content) {
await this.container.publishNotebook(item.name, content);
}
},
});
}
// "Copy to ..." isn't needed if github locations are not available
if (!this.container.notebookManager?.gitHubOAuthService.isLoggedIn()) {
items = items.filter((item) => item.label !== "Copy to ...");