Move GitHub repos panel to react (#638)

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
vaidankarswapnil
2021-05-04 06:26:47 +05:30
committed by GitHub
parent 4efacace16
commit 038f3ee684
17 changed files with 6231 additions and 203 deletions

View File

@@ -21,7 +21,7 @@ import { getFullName } from "../../Utils/UserUtils";
import Explorer from "../Explorer";
import { ContextualPaneBase } from "../Panes/ContextualPaneBase";
import { CopyNotebookPane } from "../Panes/CopyNotebookPane/CopyNotebookPane";
import { GitHubReposPane } from "../Panes/GitHubReposPane";
// import { GitHubReposPane } from "../Panes/GitHubReposPane";
import { PublishNotebookPane } from "../Panes/PublishNotebookPane/PublishNotebookPane";
import { ResourceTreeAdapter } from "../Tree/ResourceTreeAdapter";
import { NotebookContentProvider } from "./NotebookComponent/NotebookContentProvider";
@@ -50,7 +50,7 @@ export default class NotebookManager {
private gitHubContentProvider: GitHubContentProvider;
public gitHubOAuthService: GitHubOAuthService;
private gitHubClient: GitHubClient;
public gitHubClient: GitHubClient;
public gitHubReposPane: ContextualPaneBase;
@@ -60,13 +60,6 @@ export default class NotebookManager {
this.gitHubOAuthService = new GitHubOAuthService(this.junoClient);
this.gitHubClient = new GitHubClient(this.onGitHubClientError);
this.gitHubReposPane = new GitHubReposPane({
id: "gitHubReposPane",
visible: ko.observable<boolean>(false),
container: this.params.container,
junoClient: this.junoClient,
gitHubClient: this.gitHubClient,
});
this.gitHubContentProvider = new GitHubContentProvider({
gitHubClient: this.gitHubClient,
@@ -92,9 +85,9 @@ export default class NotebookManager {
this.gitHubOAuthService.getTokenObservable().subscribe((token) => {
this.gitHubClient.setToken(token?.access_token);
if (this.gitHubReposPane.visible()) {
this.gitHubReposPane.open();
if (this?.gitHubOAuthService.isLoggedIn()) {
this.params.container.closeSidePanel();
this.params.container.openGitHubReposPanel("Manager GitHub settings", this.junoClient);
}
this.params.refreshCommandBarButtons();
@@ -163,7 +156,7 @@ export default class NotebookManager {
undefined,
"Cosmos DB cannot access your Github account anymore. Please connect to GitHub again.",
"Connect to GitHub",
() => this.gitHubReposPane.open(),
() => this.params.container.openGitHubReposPanel("Connect to GitHub"),
"Cancel",
undefined
);