diff --git a/src/Explorer/Panes/GitHubReposPane.html b/src/Explorer/Panes/GitHubReposPane.html
deleted file mode 100644
index 398acaeaf..000000000
--- a/src/Explorer/Panes/GitHubReposPane.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-

-
-
-
-
diff --git a/src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.test.tsx b/src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.test.tsx
new file mode 100644
index 000000000..3d12139f5
--- /dev/null
+++ b/src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.test.tsx
@@ -0,0 +1,19 @@
+import { shallow } from "enzyme";
+import React from "react";
+import { GitHubClient } from "../../../GitHub/GitHubClient";
+import { JunoClient } from "../../../Juno/JunoClient";
+import Explorer from "../../Explorer";
+import { GitHubReposPanel } from "./GitHubReposPanel";
+const props = {
+ explorer: new Explorer(),
+ closePanel: (): void => undefined,
+ gitHubClientProp: new GitHubClient((): void => undefined),
+ junoClientProp: new JunoClient(),
+ openNotificationConsole: (): void => undefined,
+};
+describe("GitHub Repos Panel", () => {
+ it("should render Default properly", () => {
+ const wrapper = shallow(
);
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/src/Explorer/Panes/GitHubReposPane.ts b/src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.tsx
similarity index 52%
rename from src/Explorer/Panes/GitHubReposPane.ts
rename to src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.tsx
index b360b1865..b7fd4aa82 100644
--- a/src/Explorer/Panes/GitHubReposPane.ts
+++ b/src/Explorer/Panes/GitHubReposPanel/GitHubReposPanel.tsx
@@ -1,27 +1,42 @@
-import _ from "underscore";
-import { Areas, HttpStatusCodes } from "../../Common/Constants";
-import * as ViewModels from "../../Contracts/ViewModels";
-import { GitHubClient, IGitHubPageInfo, IGitHubRepo } from "../../GitHub/GitHubClient";
-import { IPinnedRepo, JunoClient } from "../../Juno/JunoClient";
-import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
-import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
-import * as GitHubUtils from "../../Utils/GitHubUtils";
-import * as JunoUtils from "../../Utils/JunoUtils";
-import { AuthorizeAccessComponent } from "../Controls/GitHub/AuthorizeAccessComponent";
-import { GitHubReposComponent, GitHubReposComponentProps, RepoListItem } from "../Controls/GitHub/GitHubReposComponent";
-import { GitHubReposComponentAdapter } from "../Controls/GitHub/GitHubReposComponentAdapter";
-import { BranchesProps, PinnedReposProps, UnpinnedReposProps } from "../Controls/GitHub/ReposListComponent";
-import { ContextualPaneBase } from "./ContextualPaneBase";
-import { handleError } from "../../Common/ErrorHandlingUtils";
+import React from "react";
+import { Areas, HttpStatusCodes } from "../../../Common/Constants";
+import { handleError } from "../../../Common/ErrorHandlingUtils";
+import { GitHubClient, IGitHubPageInfo, IGitHubRepo } from "../../../GitHub/GitHubClient";
+import { IPinnedRepo, JunoClient } from "../../../Juno/JunoClient";
+import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants";
+import * as TelemetryProcessor from "../../../Shared/Telemetry/TelemetryProcessor";
+import * as GitHubUtils from "../../../Utils/GitHubUtils";
+import * as JunoUtils from "../../../Utils/JunoUtils";
+import { AuthorizeAccessComponent } from "../../Controls/GitHub/AuthorizeAccessComponent";
+import {
+ GitHubReposComponent,
+ GitHubReposComponentProps,
+ RepoListItem,
+} from "../../Controls/GitHub/GitHubReposComponent";
+import { ContentMainStyle } from "../../Controls/GitHub/GitHubStyleConstants";
+import { BranchesProps, PinnedReposProps, UnpinnedReposProps } from "../../Controls/GitHub/ReposListComponent";
+import Explorer from "../../Explorer";
+import { PanelInfoErrorComponent } from "../PanelInfoErrorComponent";
+import { PanelLoadingScreen } from "../PanelLoadingScreen";
-interface GitHubReposPaneOptions extends ViewModels.PaneOptions {
- gitHubClient: GitHubClient;
- junoClient: JunoClient;
+interface IGitHubReposPanelProps {
+ explorer: Explorer;
+ closePanel: () => void;
+ gitHubClientProp: GitHubClient;
+ junoClientProp: JunoClient;
+ openNotificationConsole: () => void;
}
-export class GitHubReposPane extends ContextualPaneBase {
+interface IGitHubReposPanelState {
+ showAuthorizationAcessState: boolean;
+ isExecuting: boolean;
+ errorMessage: string;
+ showErrorDetails: boolean;
+ gitHubReposState: GitHubReposComponentProps;
+}
+export class GitHubReposPanel extends React.Component
{
private static readonly PageSize = 30;
-
+ private isAddedRepo = false;
private gitHubClient: GitHubClient;
private junoClient: JunoClient;
@@ -29,73 +44,73 @@ export class GitHubReposPane extends ContextualPaneBase {
private pinnedReposProps: PinnedReposProps;
private unpinnedReposProps: UnpinnedReposProps;
- private gitHubReposProps: GitHubReposComponentProps;
- private gitHubReposAdapter: GitHubReposComponentAdapter;
-
private allGitHubRepos: IGitHubRepo[];
private allGitHubReposLastPageInfo?: IGitHubPageInfo;
private pinnedReposUpdated: boolean;
- constructor(options: GitHubReposPaneOptions) {
- super(options);
+ constructor(props: IGitHubReposPanelProps) {
+ super(props);
- this.gitHubClient = options.gitHubClient;
- this.junoClient = options.junoClient;
-
- this.branchesProps = {};
- this.pinnedReposProps = {
- repos: [],
- };
this.unpinnedReposProps = {
repos: [],
hasMore: true,
isLoading: true,
loadMore: (): Promise => this.loadMoreUnpinnedRepos(),
};
-
- this.gitHubReposProps = {
- showAuthorizeAccess: true,
- authorizeAccessProps: {
- scope: this.getOAuthScope(),
- authorizeAccess: (scope): void => this.connectToGitHub(scope),
- },
- reposListProps: {
- branchesProps: this.branchesProps,
- pinnedReposProps: this.pinnedReposProps,
- unpinnedReposProps: this.unpinnedReposProps,
- pinRepo: (item): Promise => this.pinRepo(item),
- unpinRepo: (item): Promise => this.unpinRepo(item),
- },
- addRepoProps: {
- container: this.container,
- getRepo: (owner, repo): Promise => this.getRepo(owner, repo),
- pinRepo: (item): Promise => this.pinRepo(item),
- },
- resetConnection: (): void => this.setup(true),
- onOkClick: (): Promise => this.submit(),
- onCancelClick: (): void => this.cancel(),
+ this.branchesProps = {};
+ this.pinnedReposProps = {
+ repos: [],
};
- this.gitHubReposAdapter = new GitHubReposComponentAdapter(this.gitHubReposProps);
this.allGitHubRepos = [];
this.allGitHubReposLastPageInfo = undefined;
this.pinnedReposUpdated = false;
+
+ this.state = {
+ showAuthorizationAcessState: true,
+ isExecuting: false,
+ errorMessage: "",
+ showErrorDetails: false,
+ gitHubReposState: {
+ showAuthorizeAccess: !this.props.explorer.notebookManager?.gitHubOAuthService.isLoggedIn(),
+ authorizeAccessProps: {
+ scope: this.getOAuthScope(),
+ authorizeAccess: (scope): void => this.connectToGitHub(scope),
+ },
+ reposListProps: {
+ branchesProps: this.branchesProps,
+ pinnedReposProps: this.pinnedReposProps,
+ unpinnedReposProps: this.unpinnedReposProps,
+ pinRepo: (item): Promise => this.pinRepo(item),
+ unpinRepo: (item): Promise => this.unpinRepo(item),
+ },
+ addRepoProps: {
+ container: this.props.explorer,
+ getRepo: (owner, repo): Promise => this.getRepo(owner, repo),
+ pinRepo: (item): Promise => this.pinRepo(item),
+ },
+ resetConnection: (): void => this.setup(true),
+ onOkClick: (): Promise => this.submit(),
+ onCancelClick: (): void => this.props.closePanel(),
+ },
+ };
+ this.gitHubClient = this.props.gitHubClientProp;
+ this.junoClient = this.props.junoClientProp;
+ }
+
+ componentDidMount(): void {
+ this.open();
}
public open(): void {
this.resetData();
this.setup();
-
- super.open();
}
public async submit(): Promise {
const pinnedReposUpdated = this.pinnedReposUpdated;
const reposToPin: IPinnedRepo[] = this.pinnedReposProps.repos.map((repo) => JunoUtils.toPinnedRepo(repo));
- // Submit resets data too
- super.submit();
-
if (pinnedReposUpdated) {
try {
const response = await this.junoClient.updatePinnedRepos(reposToPin);
@@ -109,57 +124,44 @@ export class GitHubReposPane extends ContextualPaneBase {
}
public resetData(): void {
- // Reset cached branches
this.branchesProps = {};
- this.gitHubReposProps.reposListProps.branchesProps = this.branchesProps;
- // Reset cached pinned and unpinned repos
this.pinnedReposProps.repos = [];
this.unpinnedReposProps.repos = [];
-
- // Reset cached repos
this.allGitHubRepos = [];
this.allGitHubReposLastPageInfo = undefined;
- // Reset flags
this.pinnedReposUpdated = false;
this.unpinnedReposProps.hasMore = true;
this.unpinnedReposProps.isLoading = true;
-
- this.triggerRender();
-
- super.resetData();
}
private getOAuthScope(): string {
return (
- this.container.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope ||
+ this.props.explorer.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope ||
AuthorizeAccessComponent.Scopes.Public.key
);
}
private setup(forceShowConnectToGitHub = false): void {
- forceShowConnectToGitHub || !this.container.notebookManager?.gitHubOAuthService.isLoggedIn()
+ forceShowConnectToGitHub || !this.props.explorer.notebookManager?.gitHubOAuthService.isLoggedIn()
? this.setupForConnectToGitHub()
: this.setupForManageRepos();
}
private setupForConnectToGitHub(): void {
- this.gitHubReposProps.showAuthorizeAccess = true;
- this.gitHubReposProps.authorizeAccessProps.scope = this.getOAuthScope();
- this.isExecuting(false);
- this.title(GitHubReposComponent.ConnectToGitHubTitle); // Used for telemetry
- this.triggerRender();
+ this.setState({
+ isExecuting: false,
+ });
}
private async setupForManageRepos(): Promise {
- this.gitHubReposProps.showAuthorizeAccess = false;
- this.isExecuting(false);
- this.title(GitHubReposComponent.ManageGitHubRepoTitle); // Used for telemetry
+ this.setState({
+ isExecuting: false,
+ });
TelemetryProcessor.trace(Action.NotebooksGitHubManageRepo, ActionModifiers.Mark, {
dataExplorerArea: Areas.Notebook,
});
- this.triggerRender();
this.refreshManageReposComponent();
}
@@ -182,15 +184,15 @@ export class GitHubReposPane extends ContextualPaneBase {
const branchesProps = this.branchesProps[GitHubUtils.toRepoFullName(repo.owner, repo.name)];
branchesProps.hasMore = true;
branchesProps.isLoading = true;
- this.triggerRender();
try {
const response = await this.gitHubClient.getBranchesAsync(
repo.owner,
repo.name,
- GitHubReposPane.PageSize,
+ GitHubReposPanel.PageSize,
branchesProps.lastPageInfo?.endCursor
);
+
if (response.status !== HttpStatusCodes.OK) {
throw new Error(`Received HTTP ${response.status} when fetching branches`);
}
@@ -205,19 +207,37 @@ export class GitHubReposPane extends ContextualPaneBase {
branchesProps.isLoading = false;
branchesProps.hasMore = branchesProps.lastPageInfo?.hasNextPage;
- this.triggerRender();
+ this.setState({
+ gitHubReposState: {
+ ...this.state.gitHubReposState,
+ reposListProps: {
+ ...this.state.gitHubReposState.reposListProps,
+ branchesProps: {
+ ...this.state.gitHubReposState.reposListProps.branchesProps,
+ [GitHubUtils.toRepoFullName(repo.owner, repo.name)]: branchesProps,
+ },
+ pinnedReposProps: {
+ repos: this.pinnedReposProps.repos,
+ },
+ unpinnedReposProps: {
+ ...this.state.gitHubReposState.reposListProps.unpinnedReposProps,
+ repos: this.unpinnedReposProps.repos,
+ },
+ },
+ },
+ });
}
private async loadMoreUnpinnedRepos(): Promise {
this.unpinnedReposProps.isLoading = true;
this.unpinnedReposProps.hasMore = true;
- this.triggerRender();
try {
const response = await this.gitHubClient.getReposAsync(
- GitHubReposPane.PageSize,
+ GitHubReposPanel.PageSize,
this.allGitHubReposLastPageInfo?.endCursor
);
+
if (response.status !== HttpStatusCodes.OK) {
throw new Error(`Received HTTP ${response.status} when fetching unpinned repos`);
}
@@ -233,7 +253,21 @@ export class GitHubReposPane extends ContextualPaneBase {
this.unpinnedReposProps.isLoading = false;
this.unpinnedReposProps.hasMore = this.allGitHubReposLastPageInfo?.hasNextPage;
- this.triggerRender();
+
+ this.setState({
+ gitHubReposState: {
+ ...this.state.gitHubReposState,
+ reposListProps: {
+ ...this.state.gitHubReposState.reposListProps,
+ unpinnedReposProps: {
+ ...this.state.gitHubReposState.reposListProps.unpinnedReposProps,
+ isLoading: this.unpinnedReposProps.isLoading,
+ hasMore: this.unpinnedReposProps.hasMore,
+ repos: this.unpinnedReposProps.repos,
+ },
+ },
+ },
+ });
}
private async getRepo(owner: string, repo: string): Promise {
@@ -242,7 +276,7 @@ export class GitHubReposPane extends ContextualPaneBase {
if (response.status !== HttpStatusCodes.OK) {
throw new Error(`Received HTTP ${response.status} when fetching repo`);
}
-
+ this.isAddedRepo = true;
return response.data;
} catch (error) {
handleError(error, "GitHubReposPane/getRepo", "Failed to fetch repo");
@@ -254,7 +288,7 @@ export class GitHubReposPane extends ContextualPaneBase {
this.pinnedReposUpdated = true;
const initialReposLength = this.pinnedReposProps.repos.length;
- const existingRepo = _.find(this.pinnedReposProps.repos, (repo) => repo.key === item.key);
+ const existingRepo = this.pinnedReposProps.repos.find((repo) => repo.key === item.key);
if (existingRepo) {
existingRepo.branches = item.branches;
} else {
@@ -262,7 +296,6 @@ export class GitHubReposPane extends ContextualPaneBase {
}
this.unpinnedReposProps.repos = this.calculateUnpinnedRepos();
- this.triggerRender();
if (this.pinnedReposProps.repos.length > initialReposLength) {
this.refreshBranchesForPinnedRepos();
@@ -273,7 +306,22 @@ export class GitHubReposPane extends ContextualPaneBase {
this.pinnedReposUpdated = true;
this.pinnedReposProps.repos = this.pinnedReposProps.repos.filter((pinnedRepo) => pinnedRepo.key !== item.key);
this.unpinnedReposProps.repos = this.calculateUnpinnedRepos();
- this.triggerRender();
+
+ this.setState({
+ gitHubReposState: {
+ ...this.state.gitHubReposState,
+ reposListProps: {
+ ...this.state.gitHubReposState.reposListProps,
+ pinnedReposProps: {
+ repos: this.pinnedReposProps.repos,
+ },
+ unpinnedReposProps: {
+ ...this.state.gitHubReposState.reposListProps.unpinnedReposProps,
+ repos: this.unpinnedReposProps.repos,
+ },
+ },
+ },
+ });
}
private async refreshManageReposComponent(): Promise {
@@ -284,12 +332,12 @@ export class GitHubReposPane extends ContextualPaneBase {
private async refreshPinnedRepoListItems(): Promise {
this.pinnedReposProps.repos = [];
- this.triggerRender();
try {
const response = await this.junoClient.getPinnedRepos(
- this.container.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope
+ this.props.explorer.notebookManager?.gitHubOAuthService.getTokenObservable()()?.scope
);
+
if (response.status !== HttpStatusCodes.OK && response.status !== HttpStatusCodes.NoContent) {
throw new Error(`Received HTTP ${response.status} when fetching pinned repos`);
}
@@ -305,7 +353,6 @@ export class GitHubReposPane extends ContextualPaneBase {
);
this.pinnedReposProps.repos = pinnedRepos;
- this.triggerRender();
}
} catch (error) {
handleError(error, "GitHubReposPane/refreshPinnedReposListItems", "Failed to fetch pinned repos");
@@ -322,28 +369,85 @@ export class GitHubReposPane extends ContextualPaneBase {
isLoading: true,
loadMore: (): Promise => this.loadMoreBranches(item.repo),
};
+ this.setState({
+ gitHubReposState: {
+ ...this.state.gitHubReposState,
+ reposListProps: {
+ ...this.state.gitHubReposState.reposListProps,
+ branchesProps: {
+ ...this.state.gitHubReposState.reposListProps.branchesProps,
+ [GitHubUtils.toRepoFullName(item.repo.owner, item.repo.name)]: this.branchesProps[item.key],
+ },
+ pinnedReposProps: {
+ repos: this.pinnedReposProps.repos,
+ },
+ unpinnedReposProps: {
+ ...this.state.gitHubReposState.reposListProps.unpinnedReposProps,
+ repos: this.unpinnedReposProps.repos,
+ },
+ },
+ },
+ });
this.loadMoreBranches(item.repo);
+ } else {
+ if (this.isAddedRepo === false) {
+ this.setState({
+ gitHubReposState: {
+ ...this.state.gitHubReposState,
+ reposListProps: {
+ ...this.state.gitHubReposState.reposListProps,
+ pinnedReposProps: {
+ repos: this.pinnedReposProps.repos,
+ },
+ unpinnedReposProps: {
+ ...this.state.gitHubReposState.reposListProps.unpinnedReposProps,
+ repos: this.unpinnedReposProps.repos,
+ },
+ },
+ },
+ });
+ }
}
});
+ this.isAddedRepo = false;
}
private async refreshUnpinnedRepoListItems(): Promise {
this.allGitHubRepos = [];
this.allGitHubReposLastPageInfo = undefined;
this.unpinnedReposProps.repos = [];
+
this.loadMoreUnpinnedRepos();
}
private connectToGitHub(scope: string): void {
- this.isExecuting(true);
+ this.setState({
+ isExecuting: true,
+ });
TelemetryProcessor.trace(Action.NotebooksGitHubAuthorize, ActionModifiers.Mark, {
dataExplorerArea: Areas.Notebook,
scopesSelected: scope,
});
- this.container.notebookManager?.gitHubOAuthService.startOAuth(scope);
+ this.props.explorer.notebookManager?.gitHubOAuthService.startOAuth(scope);
}
- private triggerRender(): void {
- this.gitHubReposAdapter.triggerRender();
+ render(): JSX.Element {
+ return (
+
+ );
}
}
diff --git a/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap
new file mode 100644
index 000000000..71b70e0ed
--- /dev/null
+++ b/src/Explorer/Panes/GitHubReposPanel/__snapshots__/GitHubReposPanel.test.tsx.snap
@@ -0,0 +1,1318 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`GitHub Repos Panel should render Default properly 1`] = `
+
+`;
diff --git a/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx
index 6a8fed727..d2079c010 100644
--- a/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx
+++ b/src/Explorer/Panes/LoadQueryPane/LoadQueryPane.tsx
@@ -37,7 +37,7 @@ export const LoadQueryPane: FunctionComponent = ({
const title = "Load Query";
const genericPaneProps: GenericRightPaneProps = {
- container: explorer,
+ expandConsole: () => explorer.expandConsole(),
formError: formError,
formErrorDetail: formErrorsDetails,
id: "loadQueryPane",
diff --git a/src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap b/src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap
index ee672aa5c..badff47b7 100644
--- a/src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap
+++ b/src/Explorer/Panes/LoadQueryPane/__snapshots__/LoadQueryPane.test.tsx.snap
@@ -2,7 +2,7 @@
exports[`Load Query Pane should render Default properly 1`] = `
* {
+ & > :not(.collapsibleSection) {
margin-bottom: @DefaultSpace;
- & > * {
- margin-bottom: @SmallSpace;
+ & > :not(:last-child) {
+ margin-bottom: @DefaultSpace;
}
}
@@ -23,7 +23,6 @@
font-size: @mediumFontSize;
width: @mediumFontSize;
margin: auto 0 auto @SmallSpace;
- color: @InfoIconColor;
cursor: default;
vertical-align: middle;
}
@@ -49,10 +48,6 @@
font-size: @mediumFontSize;
padding: 0 @LargeSpace 0 @SmallSpace;
}
-
- .collapsibleSection {
- margin-bottom: 0;
- }
}
}
@@ -99,7 +94,7 @@
}
.panelFooter {
- padding: 20px 34px;
+ padding: 16px 34px;
border-top: solid 1px #bbbbbb;
& button {
@@ -123,8 +118,8 @@
cursor: pointer;
}
-.panelGroupSpacing > * {
- margin-bottom: @SmallSpace;
+.panelGroupSpacing > :not(:last-child) {
+ margin-bottom: @DefaultSpace;
}
.fileUpload {
display: none !important;
@@ -170,3 +165,6 @@
.column-select-view {
margin: 20px 0px 0px 0px;
}
+.panelSeparator::before {
+ background-color: #edebe9;
+}
diff --git a/src/Explorer/Panes/PanelInfoErrorComponent.tsx b/src/Explorer/Panes/PanelInfoErrorComponent.tsx
index 97282b12e..150fbcc25 100644
--- a/src/Explorer/Panes/PanelInfoErrorComponent.tsx
+++ b/src/Explorer/Panes/PanelInfoErrorComponent.tsx
@@ -1,5 +1,5 @@
-import React from "react";
import { Icon, Link, Stack, Text } from "office-ui-fabric-react";
+import React from "react";
export interface PanelInfoErrorProps {
message: string;
@@ -23,7 +23,7 @@ export const PanelInfoErrorComponent: React.FunctionComponent
+
{icon}
diff --git a/src/Explorer/Panes/PublishNotebookPane/PublishNotebookPane.tsx b/src/Explorer/Panes/PublishNotebookPane/PublishNotebookPane.tsx
index 7bbd3eaec..244fcf0d3 100644
--- a/src/Explorer/Panes/PublishNotebookPane/PublishNotebookPane.tsx
+++ b/src/Explorer/Panes/PublishNotebookPane/PublishNotebookPane.tsx
@@ -158,7 +158,6 @@ export const PublishNotebookPane: FunctionComponent =
};
const props: GenericRightPaneProps = {
- container: container,
formError: formError,
formErrorDetail: formErrorDetail,
id: "publishnotebookpane",
@@ -167,6 +166,7 @@ export const PublishNotebookPane: FunctionComponent =
submitButtonText: "Publish",
onSubmit: () => submit(),
onClose: closePanel,
+ expandConsole: () => container.expandConsole(),
isSubmitButtonHidden: !isCodeOfConductAccepted,
};
diff --git a/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx
index 949e9203f..652c58949 100644
--- a/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx
+++ b/src/Explorer/Panes/SaveQueryPane/SaveQueryPane.tsx
@@ -32,7 +32,7 @@ export const SaveQueryPane: FunctionComponent = ({
const title = "Save Query";
const { canSaveQueries } = explorer;
const genericPaneProps: GenericRightPaneProps = {
- container: explorer,
+ expandConsole: () => explorer.expandConsole(),
formError: formError,
formErrorDetail: formErrorsDetails,
id: "saveQueryPane",
diff --git a/src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap b/src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap
index b5ed7ed77..aba5e17b8 100644
--- a/src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap
+++ b/src/Explorer/Panes/SaveQueryPane/__snapshots__/SaveQueryPane.test.tsx.snap
@@ -2,11 +2,7 @@
exports[`Save Query Pane should render Default properly 1`] = `
undefined,
closePanel: (): void => undefined,
};
describe("Settings Pane", () => {
diff --git a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx
index 02dfdd614..480f358c5 100644
--- a/src/Explorer/Panes/SettingsPane/SettingsPane.tsx
+++ b/src/Explorer/Panes/SettingsPane/SettingsPane.tsx
@@ -7,19 +7,18 @@ import { LocalStorageUtility, StorageKey } from "../../../Shared/StorageUtility"
import * as StringUtility from "../../../Shared/StringUtility";
import { userContext } from "../../../UserContext";
import { logConsoleInfo } from "../../../Utils/NotificationConsoleUtils";
-import Explorer from "../../Explorer";
import {
GenericRightPaneComponent,
GenericRightPaneProps,
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
export interface SettingsPaneProps {
- explorer: Explorer;
+ expandConsole: () => void;
closePanel: () => void;
}
export const SettingsPane: FunctionComponent = ({
- explorer: container,
+ expandConsole,
closePanel,
}: SettingsPaneProps) => {
const [formErrors, setFormErrors] = useState("");
@@ -107,7 +106,7 @@ export const SettingsPane: FunctionComponent = ({
};
const genericPaneProps: GenericRightPaneProps = {
- container,
+ expandConsole,
formError: formErrors,
formErrorDetail: "",
id: "settingspane",
diff --git a/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap b/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap
index 6f150e9dc..c20b14595 100644
--- a/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap
+++ b/src/Explorer/Panes/SettingsPane/__snapshots__/SettingsPane.test.tsx.snap
@@ -2,503 +2,7 @@
exports[`Settings Pane should render Default properly 1`] = `
= ({
}
};
const genericPaneProps: GenericRightPaneProps = {
- container: container,
formError: formErrors,
formErrorDetail: formErrorsDetails,
id: "stringInputPane",
@@ -101,6 +100,7 @@ export const StringInputPane: FunctionComponent
= ({
submitButtonText: submitButtonLabel,
onClose: closePanel,
onSubmit: submit,
+ expandConsole: () => container.expandConsole(),
};
return (
diff --git a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap
index 397099172..30051a5d8 100644
--- a/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap
+++ b/src/Explorer/Panes/StringInputPane/__snapshots__/StringInputPane.test.tsx.snap
@@ -405,6 +405,773 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
"databases": [Function],
"deleteCollectionText": [Function],
"deleteDatabaseText": [Function],
+ "gitHubClient": GitHubClient {
+ "errorCallback": [Function],
+ "ocktokit": OctokitWithDefaults {
+ "actions": Object {
+ "addSelectedRepoToOrgSecret": [Function],
+ "cancelWorkflowRun": [Function],
+ "createOrUpdateOrgSecret": [Function],
+ "createOrUpdateRepoSecret": [Function],
+ "createOrUpdateSecretForRepo": [Function],
+ "createRegistrationToken": [Function],
+ "createRegistrationTokenForOrg": [Function],
+ "createRegistrationTokenForRepo": [Function],
+ "createRemoveToken": [Function],
+ "createRemoveTokenForOrg": [Function],
+ "createRemoveTokenForRepo": [Function],
+ "deleteArtifact": [Function],
+ "deleteOrgSecret": [Function],
+ "deleteRepoSecret": [Function],
+ "deleteSecretFromRepo": [Function],
+ "deleteSelfHostedRunnerFromOrg": [Function],
+ "deleteSelfHostedRunnerFromRepo": [Function],
+ "deleteWorkflowRunLogs": [Function],
+ "downloadArtifact": [Function],
+ "downloadJobLogsForWorkflowRun": [Function],
+ "downloadWorkflowJobLogs": [Function],
+ "downloadWorkflowRunLogs": [Function],
+ "getArtifact": [Function],
+ "getJobForWorkflowRun": [Function],
+ "getOrgPublicKey": [Function],
+ "getOrgSecret": [Function],
+ "getPublicKey": [Function],
+ "getRepoPublicKey": [Function],
+ "getRepoSecret": [Function],
+ "getSecret": [Function],
+ "getSelfHostedRunner": [Function],
+ "getSelfHostedRunnerForOrg": [Function],
+ "getSelfHostedRunnerForRepo": [Function],
+ "getWorkflow": [Function],
+ "getWorkflowJob": [Function],
+ "getWorkflowRun": [Function],
+ "getWorkflowRunUsage": [Function],
+ "getWorkflowUsage": [Function],
+ "listArtifactsForRepo": [Function],
+ "listDownloadsForSelfHostedRunnerApplication": [Function],
+ "listJobsForWorkflowRun": [Function],
+ "listOrgSecrets": [Function],
+ "listRepoSecrets": [Function],
+ "listRepoWorkflowRuns": [Function],
+ "listRepoWorkflows": [Function],
+ "listRunnerApplicationsForOrg": [Function],
+ "listRunnerApplicationsForRepo": [Function],
+ "listSecretsForRepo": [Function],
+ "listSelectedReposForOrgSecret": [Function],
+ "listSelfHostedRunnersForOrg": [Function],
+ "listSelfHostedRunnersForRepo": [Function],
+ "listWorkflowJobLogs": [Function],
+ "listWorkflowRunArtifacts": [Function],
+ "listWorkflowRunLogs": [Function],
+ "listWorkflowRuns": [Function],
+ "listWorkflowRunsForRepo": [Function],
+ "reRunWorkflow": [Function],
+ "removeSelectedRepoFromOrgSecret": [Function],
+ "removeSelfHostedRunner": [Function],
+ "setSelectedReposForOrgSecret": [Function],
+ },
+ "activity": Object {
+ "checkRepoIsStarredByAuthenticatedUser": [Function],
+ "checkStarringRepo": [Function],
+ "deleteRepoSubscription": [Function],
+ "deleteThreadSubscription": [Function],
+ "getFeeds": [Function],
+ "getRepoSubscription": [Function],
+ "getThread": [Function],
+ "getThreadSubscription": [Function],
+ "getThreadSubscriptionForAuthenticatedUser": [Function],
+ "listEventsForAuthenticatedUser": [Function],
+ "listEventsForOrg": [Function],
+ "listEventsForUser": [Function],
+ "listFeeds": [Function],
+ "listNotifications": [Function],
+ "listNotificationsForAuthenticatedUser": [Function],
+ "listNotificationsForRepo": [Function],
+ "listOrgEventsForAuthenticatedUser": [Function],
+ "listPublicEvents": [Function],
+ "listPublicEventsForOrg": [Function],
+ "listPublicEventsForRepoNetwork": [Function],
+ "listPublicEventsForUser": [Function],
+ "listPublicOrgEvents": [Function],
+ "listReceivedEventsForUser": [Function],
+ "listReceivedPublicEventsForUser": [Function],
+ "listRepoEvents": [Function],
+ "listRepoNotificationsForAuthenticatedUser": [Function],
+ "listReposStarredByAuthenticatedUser": [Function],
+ "listReposStarredByUser": [Function],
+ "listReposWatchedByUser": [Function],
+ "listStargazersForRepo": [Function],
+ "listWatchedReposForAuthenticatedUser": [Function],
+ "listWatchersForRepo": [Function],
+ "markAsRead": [Function],
+ "markNotificationsAsRead": [Function],
+ "markNotificationsAsReadForRepo": [Function],
+ "markRepoNotificationsAsRead": [Function],
+ "markThreadAsRead": [Function],
+ "setRepoSubscription": [Function],
+ "setThreadSubscription": [Function],
+ "starRepo": [Function],
+ "starRepoForAuthenticatedUser": [Function],
+ "unstarRepo": [Function],
+ "unstarRepoForAuthenticatedUser": [Function],
+ },
+ "apps": Object {
+ "addRepoToInstallation": [Function],
+ "checkAccountIsAssociatedWithAny": [Function],
+ "checkAccountIsAssociatedWithAnyStubbed": [Function],
+ "checkToken": [Function],
+ "createContentAttachment": [Function],
+ "createFromManifest": [Function],
+ "createInstallationAccessToken": [Function],
+ "createInstallationToken": [Function],
+ "deleteAuthorization": [Function],
+ "deleteInstallation": [Function],
+ "deleteToken": [Function],
+ "getAuthenticated": [Function],
+ "getBySlug": [Function],
+ "getInstallation": [Function],
+ "getOrgInstallation": [Function],
+ "getRepoInstallation": [Function],
+ "getSubscriptionPlanForAccount": [Function],
+ "getSubscriptionPlanForAccountStubbed": [Function],
+ "getUserInstallation": [Function],
+ "listAccountsForPlan": [Function],
+ "listAccountsForPlanStubbed": [Function],
+ "listAccountsUserOrOrgOnPlan": [Function],
+ "listAccountsUserOrOrgOnPlanStubbed": [Function],
+ "listInstallationReposForAuthenticatedUser": [Function],
+ "listInstallations": [Function],
+ "listInstallationsForAuthenticatedUser": [Function],
+ "listMarketplacePurchasesForAuthenticatedUser": [Function],
+ "listMarketplacePurchasesForAuthenticatedUserStubbed": [Function],
+ "listPlans": [Function],
+ "listPlansStubbed": [Function],
+ "listRepos": [Function],
+ "listReposAccessibleToInstallation": [Function],
+ "listSubscriptionsForAuthenticatedUser": [Function],
+ "listSubscriptionsForAuthenticatedUserStubbed": [Function],
+ "removeRepoFromInstallation": [Function],
+ "resetToken": [Function],
+ "revokeInstallationAccessToken": [Function],
+ "revokeInstallationToken": [Function],
+ "suspendInstallation": [Function],
+ "unsuspendInstallation": [Function],
+ },
+ "auth": [Function],
+ "checks": Object {
+ "create": [Function],
+ "createSuite": [Function],
+ "get": [Function],
+ "getSuite": [Function],
+ "listAnnotations": [Function],
+ "listForRef": [Function],
+ "listForSuite": [Function],
+ "listSuitesForRef": [Function],
+ "rerequestSuite": [Function],
+ "setSuitesPreferences": [Function],
+ "update": [Function],
+ },
+ "codeScanning": Object {
+ "getAlert": [Function],
+ "listAlertsForRepo": [Function],
+ },
+ "codesOfConduct": Object {
+ "getAllCodesOfConduct": [Function],
+ "getConductCode": [Function],
+ "getForRepo": [Function],
+ "listConductCodes": [Function],
+ },
+ "emojis": Object {
+ "get": [Function],
+ },
+ "gists": Object {
+ "checkIsStarred": [Function],
+ "create": [Function],
+ "createComment": [Function],
+ "delete": [Function],
+ "deleteComment": [Function],
+ "fork": [Function],
+ "get": [Function],
+ "getComment": [Function],
+ "getRevision": [Function],
+ "list": [Function],
+ "listComments": [Function],
+ "listCommits": [Function],
+ "listForUser": [Function],
+ "listForks": [Function],
+ "listPublic": [Function],
+ "listPublicForUser": [Function],
+ "listStarred": [Function],
+ "star": [Function],
+ "unstar": [Function],
+ "update": [Function],
+ "updateComment": [Function],
+ },
+ "git": Object {
+ "createBlob": [Function],
+ "createCommit": [Function],
+ "createRef": [Function],
+ "createTag": [Function],
+ "createTree": [Function],
+ "deleteRef": [Function],
+ "getBlob": [Function],
+ "getCommit": [Function],
+ "getRef": [Function],
+ "getTag": [Function],
+ "getTree": [Function],
+ "listMatchingRefs": [Function],
+ "updateRef": [Function],
+ },
+ "gitignore": Object {
+ "getAllTemplates": [Function],
+ "getTemplate": [Function],
+ "listTemplates": [Function],
+ },
+ "graphql": [Function],
+ "hook": [Function],
+ "interactions": Object {
+ "addOrUpdateRestrictionsForOrg": [Function],
+ "addOrUpdateRestrictionsForRepo": [Function],
+ "getRestrictionsForOrg": [Function],
+ "getRestrictionsForRepo": [Function],
+ "removeRestrictionsForOrg": [Function],
+ "removeRestrictionsForRepo": [Function],
+ "setRestrictionsForOrg": [Function],
+ "setRestrictionsForRepo": [Function],
+ },
+ "issues": Object {
+ "addAssignees": [Function],
+ "addLabels": [Function],
+ "checkAssignee": [Function],
+ "checkUserCanBeAssigned": [Function],
+ "create": [Function],
+ "createComment": [Function],
+ "createLabel": [Function],
+ "createMilestone": [Function],
+ "deleteComment": [Function],
+ "deleteLabel": [Function],
+ "deleteMilestone": [Function],
+ "get": [Function],
+ "getComment": [Function],
+ "getEvent": [Function],
+ "getLabel": [Function],
+ "getMilestone": [Function],
+ "list": [Function],
+ "listAssignees": [Function],
+ "listComments": [Function],
+ "listCommentsForRepo": [Function],
+ "listEvents": [Function],
+ "listEventsForRepo": [Function],
+ "listEventsForTimeline": [Function],
+ "listForAuthenticatedUser": [Function],
+ "listForOrg": [Function],
+ "listForRepo": [Function],
+ "listLabelsForMilestone": [Function],
+ "listLabelsForRepo": [Function],
+ "listLabelsOnIssue": [Function],
+ "listMilestones": [Function],
+ "listMilestonesForRepo": [Function],
+ "lock": [Function],
+ "removeAllLabels": [Function],
+ "removeAssignees": [Function],
+ "removeLabel": [Function],
+ "removeLabels": [Function],
+ "replaceAllLabels": [Function],
+ "replaceLabels": [Function],
+ "setLabels": [Function],
+ "unlock": [Function],
+ "update": [Function],
+ "updateComment": [Function],
+ "updateLabel": [Function],
+ "updateMilestone": [Function],
+ },
+ "licenses": Object {
+ "get": [Function],
+ "getAllCommonlyUsed": [Function],
+ "getForRepo": [Function],
+ "listCommonlyUsed": [Function],
+ },
+ "log": Object {
+ "debug": [Function],
+ "error": [Function],
+ "info": [Function],
+ "warn": [Function],
+ },
+ "markdown": Object {
+ "render": [Function],
+ "renderRaw": [Function],
+ },
+ "meta": Object {
+ "get": [Function],
+ },
+ "migrations": Object {
+ "cancelImport": [Function],
+ "deleteArchiveForAuthenticatedUser": [Function],
+ "deleteArchiveForOrg": [Function],
+ "downloadArchiveForOrg": [Function],
+ "getArchiveForAuthenticatedUser": [Function],
+ "getCommitAuthors": [Function],
+ "getImportProgress": [Function],
+ "getImportStatus": [Function],
+ "getLargeFiles": [Function],
+ "getStatusForAuthenticatedUser": [Function],
+ "getStatusForOrg": [Function],
+ "listForAuthenticatedUser": [Function],
+ "listForOrg": [Function],
+ "listReposForOrg": [Function],
+ "listReposForUser": [Function],
+ "mapCommitAuthor": [Function],
+ "setLfsPreference": [Function],
+ "startForAuthenticatedUser": [Function],
+ "startForOrg": [Function],
+ "startImport": [Function],
+ "unlockRepoForAuthenticatedUser": [Function],
+ "unlockRepoForOrg": [Function],
+ "updateImport": [Function],
+ },
+ "orgs": Object {
+ "addOrUpdateMembership": [Function],
+ "blockUser": [Function],
+ "checkBlockedUser": [Function],
+ "checkMembership": [Function],
+ "checkMembershipForUser": [Function],
+ "checkPublicMembership": [Function],
+ "checkPublicMembershipForUser": [Function],
+ "concealMembership": [Function],
+ "convertMemberToOutsideCollaborator": [Function],
+ "createHook": [Function],
+ "createInvitation": [Function],
+ "createWebhook": [Function],
+ "deleteHook": [Function],
+ "deleteWebhook": [Function],
+ "get": [Function],
+ "getHook": [Function],
+ "getMembership": [Function],
+ "getMembershipForAuthenticatedUser": [Function],
+ "getMembershipForUser": [Function],
+ "getWebhook": [Function],
+ "list": [Function],
+ "listAppInstallations": [Function],
+ "listBlockedUsers": [Function],
+ "listForAuthenticatedUser": [Function],
+ "listForUser": [Function],
+ "listHooks": [Function],
+ "listInstallations": [Function],
+ "listInvitationTeams": [Function],
+ "listMembers": [Function],
+ "listMemberships": [Function],
+ "listMembershipsForAuthenticatedUser": [Function],
+ "listOutsideCollaborators": [Function],
+ "listPendingInvitations": [Function],
+ "listPublicMembers": [Function],
+ "listWebhooks": [Function],
+ "pingHook": [Function],
+ "pingWebhook": [Function],
+ "publicizeMembership": [Function],
+ "removeMember": [Function],
+ "removeMembership": [Function],
+ "removeMembershipForUser": [Function],
+ "removeOutsideCollaborator": [Function],
+ "removePublicMembershipForAuthenticatedUser": [Function],
+ "setMembershipForUser": [Function],
+ "setPublicMembershipForAuthenticatedUser": [Function],
+ "unblockUser": [Function],
+ "update": [Function],
+ "updateHook": [Function],
+ "updateMembership": [Function],
+ "updateMembershipForAuthenticatedUser": [Function],
+ "updateWebhook": [Function],
+ },
+ "paginate": [Function],
+ "projects": Object {
+ "addCollaborator": [Function],
+ "createCard": [Function],
+ "createColumn": [Function],
+ "createForAuthenticatedUser": [Function],
+ "createForOrg": [Function],
+ "createForRepo": [Function],
+ "delete": [Function],
+ "deleteCard": [Function],
+ "deleteColumn": [Function],
+ "get": [Function],
+ "getCard": [Function],
+ "getColumn": [Function],
+ "getPermissionForUser": [Function],
+ "listCards": [Function],
+ "listCollaborators": [Function],
+ "listColumns": [Function],
+ "listForOrg": [Function],
+ "listForRepo": [Function],
+ "listForUser": [Function],
+ "moveCard": [Function],
+ "moveColumn": [Function],
+ "removeCollaborator": [Function],
+ "reviewUserPermissionLevel": [Function],
+ "update": [Function],
+ "updateCard": [Function],
+ "updateColumn": [Function],
+ },
+ "pulls": Object {
+ "checkIfMerged": [Function],
+ "create": [Function],
+ "createComment": [Function],
+ "createReplyForReviewComment": [Function],
+ "createReview": [Function],
+ "createReviewComment": [Function],
+ "createReviewCommentReply": [Function],
+ "createReviewRequest": [Function],
+ "deleteComment": [Function],
+ "deletePendingReview": [Function],
+ "deleteReviewComment": [Function],
+ "deleteReviewRequest": [Function],
+ "dismissReview": [Function],
+ "get": [Function],
+ "getComment": [Function],
+ "getCommentsForReview": [Function],
+ "getReview": [Function],
+ "getReviewComment": [Function],
+ "list": [Function],
+ "listComments": [Function],
+ "listCommentsForRepo": [Function],
+ "listCommentsForReview": [Function],
+ "listCommits": [Function],
+ "listFiles": [Function],
+ "listRequestedReviewers": [Function],
+ "listReviewComments": [Function],
+ "listReviewCommentsForRepo": [Function],
+ "listReviewRequests": [Function],
+ "listReviews": [Function],
+ "merge": [Function],
+ "removeRequestedReviewers": [Function],
+ "requestReviewers": [Function],
+ "submitReview": [Function],
+ "update": [Function],
+ "updateBranch": [Function],
+ "updateComment": [Function],
+ "updateReview": [Function],
+ "updateReviewComment": [Function],
+ },
+ "rateLimit": Object {
+ "get": [Function],
+ },
+ "reactions": Object {
+ "createForCommitComment": [Function],
+ "createForIssue": [Function],
+ "createForIssueComment": [Function],
+ "createForPullRequestReviewComment": [Function],
+ "createForTeamDiscussionCommentInOrg": [Function],
+ "createForTeamDiscussionInOrg": [Function],
+ "delete": [Function],
+ "deleteForCommitComment": [Function],
+ "deleteForIssue": [Function],
+ "deleteForIssueComment": [Function],
+ "deleteForPullRequestComment": [Function],
+ "deleteForTeamDiscussion": [Function],
+ "deleteForTeamDiscussionComment": [Function],
+ "deleteLegacy": [Function],
+ "listForCommitComment": [Function],
+ "listForIssue": [Function],
+ "listForIssueComment": [Function],
+ "listForPullRequestReviewComment": [Function],
+ "listForTeamDiscussionCommentInOrg": [Function],
+ "listForTeamDiscussionInOrg": [Function],
+ },
+ "repos": Object {
+ "acceptInvitation": [Function],
+ "addAppAccessRestrictions": [Function],
+ "addCollaborator": [Function],
+ "addDeployKey": [Function],
+ "addProtectedBranchAdminEnforcement": [Function],
+ "addProtectedBranchAppRestrictions": [Function],
+ "addProtectedBranchRequiredSignatures": [Function],
+ "addProtectedBranchRequiredStatusChecksContexts": [Function],
+ "addProtectedBranchTeamRestrictions": [Function],
+ "addProtectedBranchUserRestrictions": [Function],
+ "addStatusCheckContexts": [Function],
+ "addTeamAccessRestrictions": [Function],
+ "addUserAccessRestrictions": [Function],
+ "checkCollaborator": [Function],
+ "checkVulnerabilityAlerts": [Function],
+ "compareCommits": [Function],
+ "createCommitComment": [Function],
+ "createCommitSignatureProtection": [Function],
+ "createCommitStatus": [Function],
+ "createDeployKey": [Function],
+ "createDeployment": [Function],
+ "createDeploymentStatus": [Function],
+ "createDispatchEvent": [Function],
+ "createForAuthenticatedUser": [Function],
+ "createFork": [Function],
+ "createHook": [Function],
+ "createInOrg": [Function],
+ "createOrUpdateFile": [Function],
+ "createOrUpdateFileContents": [Function],
+ "createPagesSite": [Function],
+ "createRelease": [Function],
+ "createStatus": [Function],
+ "createUsingTemplate": [Function],
+ "createWebhook": [Function],
+ "declineInvitation": [Function],
+ "delete": [Function],
+ "deleteAccessRestrictions": [Function],
+ "deleteAdminBranchProtection": [Function],
+ "deleteBranchProtection": [Function],
+ "deleteCommitComment": [Function],
+ "deleteCommitSignatureProtection": [Function],
+ "deleteDeployKey": [Function],
+ "deleteDeployment": [Function],
+ "deleteDownload": [Function],
+ "deleteFile": [Function],
+ "deleteHook": [Function],
+ "deleteInvitation": [Function],
+ "deletePagesSite": [Function],
+ "deletePullRequestReviewProtection": [Function],
+ "deleteRelease": [Function],
+ "deleteReleaseAsset": [Function],
+ "deleteWebhook": [Function],
+ "disableAutomatedSecurityFixes": [Function],
+ "disablePagesSite": [Function],
+ "disableVulnerabilityAlerts": [Function],
+ "downloadArchive": [Function],
+ "enableAutomatedSecurityFixes": [Function],
+ "enablePagesSite": [Function],
+ "enableVulnerabilityAlerts": [Function],
+ "get": [Function],
+ "getAccessRestrictions": [Function],
+ "getAdminBranchProtection": [Function],
+ "getAllStatusCheckContexts": [Function],
+ "getAllTopics": [Function],
+ "getAppsWithAccessToProtectedBranch": [Function],
+ "getArchiveLink": [Function],
+ "getBranch": [Function],
+ "getBranchProtection": [Function],
+ "getClones": [Function],
+ "getCodeFrequencyStats": [Function],
+ "getCollaboratorPermissionLevel": [Function],
+ "getCombinedStatusForRef": [Function],
+ "getCommit": [Function],
+ "getCommitActivityStats": [Function],
+ "getCommitComment": [Function],
+ "getCommitSignatureProtection": [Function],
+ "getCommunityProfileMetrics": [Function],
+ "getContent": [Function],
+ "getContents": [Function],
+ "getContributorsStats": [Function],
+ "getDeployKey": [Function],
+ "getDeployment": [Function],
+ "getDeploymentStatus": [Function],
+ "getDownload": [Function],
+ "getHook": [Function],
+ "getLatestPagesBuild": [Function],
+ "getLatestRelease": [Function],
+ "getPages": [Function],
+ "getPagesBuild": [Function],
+ "getParticipationStats": [Function],
+ "getProtectedBranchAdminEnforcement": [Function],
+ "getProtectedBranchPullRequestReviewEnforcement": [Function],
+ "getProtectedBranchRequiredSignatures": [Function],
+ "getProtectedBranchRequiredStatusChecks": [Function],
+ "getProtectedBranchRestrictions": [Function],
+ "getPullRequestReviewProtection": [Function],
+ "getPunchCardStats": [Function],
+ "getReadme": [Function],
+ "getRelease": [Function],
+ "getReleaseAsset": [Function],
+ "getReleaseByTag": [Function],
+ "getStatusChecksProtection": [Function],
+ "getTeamsWithAccessToProtectedBranch": [Function],
+ "getTopPaths": [Function],
+ "getTopReferrers": [Function],
+ "getUsersWithAccessToProtectedBranch": [Function],
+ "getViews": [Function],
+ "getWebhook": [Function],
+ "list": [Function],
+ "listAssetsForRelease": [Function],
+ "listBranches": [Function],
+ "listBranchesForHeadCommit": [Function],
+ "listCollaborators": [Function],
+ "listCommentsForCommit": [Function],
+ "listCommitComments": [Function],
+ "listCommitCommentsForRepo": [Function],
+ "listCommitStatusesForRef": [Function],
+ "listCommits": [Function],
+ "listContributors": [Function],
+ "listDeployKeys": [Function],
+ "listDeploymentStatuses": [Function],
+ "listDeployments": [Function],
+ "listDownloads": [Function],
+ "listForAuthenticatedUser": [Function],
+ "listForOrg": [Function],
+ "listForUser": [Function],
+ "listForks": [Function],
+ "listHooks": [Function],
+ "listInvitations": [Function],
+ "listInvitationsForAuthenticatedUser": [Function],
+ "listLanguages": [Function],
+ "listPagesBuilds": [Function],
+ "listProtectedBranchRequiredStatusChecksContexts": [Function],
+ "listPublic": [Function],
+ "listPullRequestsAssociatedWithCommit": [Function],
+ "listReleaseAssets": [Function],
+ "listReleases": [Function],
+ "listStatusesForRef": [Function],
+ "listTags": [Function],
+ "listTeams": [Function],
+ "listTopics": [Function],
+ "listWebhooks": [Function],
+ "merge": [Function],
+ "pingHook": [Function],
+ "pingWebhook": [Function],
+ "removeAppAccessRestrictions": [Function],
+ "removeBranchProtection": [Function],
+ "removeCollaborator": [Function],
+ "removeDeployKey": [Function],
+ "removeProtectedBranchAdminEnforcement": [Function],
+ "removeProtectedBranchAppRestrictions": [Function],
+ "removeProtectedBranchPullRequestReviewEnforcement": [Function],
+ "removeProtectedBranchRequiredSignatures": [Function],
+ "removeProtectedBranchRequiredStatusChecks": [Function],
+ "removeProtectedBranchRequiredStatusChecksContexts": [Function],
+ "removeProtectedBranchRestrictions": [Function],
+ "removeProtectedBranchTeamRestrictions": [Function],
+ "removeProtectedBranchUserRestrictions": [Function],
+ "removeStatusCheckContexts": [Function],
+ "removeStatusCheckProtection": [Function],
+ "removeTeamAccessRestrictions": [Function],
+ "removeUserAccessRestrictions": [Function],
+ "replaceAllTopics": [Function],
+ "replaceProtectedBranchAppRestrictions": [Function],
+ "replaceProtectedBranchRequiredStatusChecksContexts": [Function],
+ "replaceProtectedBranchTeamRestrictions": [Function],
+ "replaceProtectedBranchUserRestrictions": [Function],
+ "replaceTopics": [Function],
+ "requestPageBuild": [Function],
+ "requestPagesBuild": [Function],
+ "retrieveCommunityProfileMetrics": [Function],
+ "setAdminBranchProtection": [Function],
+ "setAppAccessRestrictions": [Function],
+ "setStatusCheckContexts": [Function],
+ "setTeamAccessRestrictions": [Function],
+ "setUserAccessRestrictions": [Function],
+ "testPushHook": [Function],
+ "testPushWebhook": [Function],
+ "transfer": [Function],
+ "update": [Function],
+ "updateBranchProtection": [Function],
+ "updateCommitComment": [Function],
+ "updateHook": [Function],
+ "updateInformationAboutPagesSite": [Function],
+ "updateInvitation": [Function],
+ "updateProtectedBranchPullRequestReviewEnforcement": [Function],
+ "updateProtectedBranchRequiredStatusChecks": [Function],
+ "updatePullRequestReviewProtection": [Function],
+ "updateRelease": [Function],
+ "updateReleaseAsset": [Function],
+ "updateStatusCheckPotection": [Function],
+ "updateWebhook": [Function],
+ "uploadReleaseAsset": [Function],
+ },
+ "request": [Function],
+ "search": Object {
+ "code": [Function],
+ "commits": [Function],
+ "issuesAndPullRequests": [Function],
+ "labels": [Function],
+ "repos": [Function],
+ "topics": [Function],
+ "users": [Function],
+ },
+ "teams": Object {
+ "addOrUpdateMembershipForUserInOrg": [Function],
+ "addOrUpdateMembershipInOrg": [Function],
+ "addOrUpdateProjectInOrg": [Function],
+ "addOrUpdateProjectPermissionsInOrg": [Function],
+ "addOrUpdateRepoInOrg": [Function],
+ "addOrUpdateRepoPermissionsInOrg": [Function],
+ "checkManagesRepoInOrg": [Function],
+ "checkPermissionsForProjectInOrg": [Function],
+ "checkPermissionsForRepoInOrg": [Function],
+ "create": [Function],
+ "createDiscussionCommentInOrg": [Function],
+ "createDiscussionInOrg": [Function],
+ "deleteDiscussionCommentInOrg": [Function],
+ "deleteDiscussionInOrg": [Function],
+ "deleteInOrg": [Function],
+ "getByName": [Function],
+ "getDiscussionCommentInOrg": [Function],
+ "getDiscussionInOrg": [Function],
+ "getMembershipForUserInOrg": [Function],
+ "getMembershipInOrg": [Function],
+ "list": [Function],
+ "listChildInOrg": [Function],
+ "listDiscussionCommentsInOrg": [Function],
+ "listDiscussionsInOrg": [Function],
+ "listForAuthenticatedUser": [Function],
+ "listMembersInOrg": [Function],
+ "listPendingInvitationsInOrg": [Function],
+ "listProjectsInOrg": [Function],
+ "listReposInOrg": [Function],
+ "removeMembershipForUserInOrg": [Function],
+ "removeMembershipInOrg": [Function],
+ "removeProjectInOrg": [Function],
+ "removeRepoInOrg": [Function],
+ "reviewProjectInOrg": [Function],
+ "updateDiscussionCommentInOrg": [Function],
+ "updateDiscussionInOrg": [Function],
+ "updateInOrg": [Function],
+ },
+ "users": Object {
+ "addEmailForAuthenticated": [Function],
+ "addEmails": [Function],
+ "block": [Function],
+ "checkBlocked": [Function],
+ "checkFollowing": [Function],
+ "checkFollowingForUser": [Function],
+ "checkPersonIsFollowedByAuthenticated": [Function],
+ "createGpgKey": [Function],
+ "createGpgKeyForAuthenticated": [Function],
+ "createPublicKey": [Function],
+ "createPublicSshKeyForAuthenticated": [Function],
+ "deleteEmailForAuthenticated": [Function],
+ "deleteEmails": [Function],
+ "deleteGpgKey": [Function],
+ "deleteGpgKeyForAuthenticated": [Function],
+ "deletePublicKey": [Function],
+ "deletePublicSshKeyForAuthenticated": [Function],
+ "follow": [Function],
+ "getAuthenticated": [Function],
+ "getByUsername": [Function],
+ "getContextForUser": [Function],
+ "getGpgKey": [Function],
+ "getGpgKeyForAuthenticated": [Function],
+ "getPublicKey": [Function],
+ "getPublicSshKeyForAuthenticated": [Function],
+ "list": [Function],
+ "listBlocked": [Function],
+ "listBlockedByAuthenticated": [Function],
+ "listEmails": [Function],
+ "listEmailsForAuthenticated": [Function],
+ "listFollowedByAuthenticated": [Function],
+ "listFollowersForAuthenticatedUser": [Function],
+ "listFollowersForUser": [Function],
+ "listFollowingForAuthenticatedUser": [Function],
+ "listFollowingForUser": [Function],
+ "listGpgKeys": [Function],
+ "listGpgKeysForAuthenticated": [Function],
+ "listGpgKeysForUser": [Function],
+ "listPublicEmails": [Function],
+ "listPublicEmailsForAuthenticated": [Function],
+ "listPublicKeys": [Function],
+ "listPublicKeysForUser": [Function],
+ "listPublicSshKeysForAuthenticated": [Function],
+ "setPrimaryEmailVisibilityForAuthenticated": [Function],
+ "togglePrimaryEmailVisibility": [Function],
+ "unblock": [Function],
+ "unfollow": [Function],
+ "updateAuthenticated": [Function],
+ },
+ },
+ },
"graphStylingPane": GraphStylingPane {
"container": [Circular],
"firstFieldHasFocus": [Function],
@@ -430,7 +1197,6 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
"isAutoscaleDefaultEnabled": [Function],
"isEnableMongoCapabilityPresent": [Function],
"isFixedCollectionWithSharedThroughputSupported": [Function],
- "isGitHubPaneEnabled": [Function],
"isHostedDataExplorerEnabled": [Function],
"isLeftPaneExpanded": [Function],
"isMongoIndexingEnabled": [Function],
@@ -445,9 +1211,14 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
"isSparkEnabledForAccount": [Function],
"isSynapseLinkUpdating": [Function],
"isTabsContentExpanded": [Function],
+ "junoClient": JunoClient {
+ "cachedPinnedRepos": [Function],
+ "databaseAccount": undefined,
+ },
"memoryUsageInfo": [Function],
"notebookBasePath": [Function],
"notebookServerInfo": [Function],
+ "onGitHubClientError": [Function],
"onRefreshDatabasesKeyPress": [Function],
"onRefreshResourcesClick": [Function],
"onSwitchToConnectionString": [Function],
@@ -518,503 +1289,7 @@ exports[`StringInput Pane should render Create new directory properly 1`] = `
successMessage="Created directory "
>
selectedKey={entity.type}
entityPropertyPlaceHolder={detailedHelp}
entityValuePlaceholder={entity.entityValuePlaceholder}
- entityValue={entity.value}
+ entityValue={entity.value?.toString()}
isEntityTypeDate={entity.isEntityTypeDate}
entityTimeValue={entity.entityTimeValue}
isEntityValueDisable={entity.isEntityValueDisable}
diff --git a/src/Explorer/Panes/Tables/TableQuerySelectPanel/__snapshots__/index.test.tsx.snap b/src/Explorer/Panes/Tables/TableQuerySelectPanel/__snapshots__/index.test.tsx.snap
index a347a6dfc..b24311210 100644
--- a/src/Explorer/Panes/Tables/TableQuerySelectPanel/__snapshots__/index.test.tsx.snap
+++ b/src/Explorer/Panes/Tables/TableQuerySelectPanel/__snapshots__/index.test.tsx.snap
@@ -11,7 +11,7 @@ exports[`Table query select Panel should render Default properly 1`] = `
}
>
(true);
const genericPaneProps: GenericRightPaneProps = {
- container: explorer,
formError: "",
formErrorDetail: "",
id: "querySelectPane",
@@ -41,6 +40,7 @@ export const TableQuerySelectPanel: FunctionComponent closePanel(),
onSubmit: () => submit(),
+ expandConsole: () => explorer.expandConsole(),
};
const submit = (): void => {
diff --git a/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx b/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx
index 70b66baea..d65301610 100644
--- a/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx
+++ b/src/Explorer/Panes/UploadFilePane/UploadFilePane.tsx
@@ -1,7 +1,6 @@
import React, { ChangeEvent, FunctionComponent, useState } from "react";
import { Upload } from "../../../Common/Upload/Upload";
import { logConsoleError, logConsoleInfo, logConsoleProgress } from "../../../Utils/NotificationConsoleUtils";
-import Explorer from "../../Explorer";
import { NotebookContentItem } from "../../Notebook/NotebookContentItem";
import {
GenericRightPaneComponent,
@@ -9,13 +8,13 @@ import {
} from "../GenericRightPaneComponent/GenericRightPaneComponent";
export interface UploadFilePanelProps {
- explorer: Explorer;
+ expandConsole: () => void;
closePanel: () => void;
uploadFile: (name: string, content: string) => Promise;
}
export const UploadFilePane: FunctionComponent = ({
- explorer: container,
+ expandConsole,
closePanel,
uploadFile,
}: UploadFilePanelProps) => {
@@ -93,7 +92,7 @@ export const UploadFilePane: FunctionComponent = ({
};
const genericPaneProps: GenericRightPaneProps = {
- container: container,
+ expandConsole,
formError: formErrors,
formErrorDetail: formErrorsDetails,
id: "uploadFilePane",
diff --git a/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx
index c2836ba3c..31448612f 100644
--- a/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx
+++ b/src/Explorer/Panes/UploadItemsPane/UploadItemsPane.tsx
@@ -71,7 +71,7 @@ export const UploadItemsPane: FunctionComponent = ({
};
const genericPaneProps: GenericRightPaneProps = {
- container: explorer,
+ expandConsole: () => explorer.expandConsole(),
formError,
formErrorDetail,
id: "uploaditemspane",
diff --git a/src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap b/src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap
index 8417b8705..c13f7f4ae 100644
--- a/src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap
+++ b/src/Explorer/Panes/UploadItemsPane/__snapshots__/UploadItemsPane.test.tsx.snap
@@ -2,503 +2,7 @@
exports[`Upload Items Pane should render Default properly 1`] = `
DataTypes)[entity[property].$],
- $v: DateTimeUtilities.convertJSDateToTicksWithPadding(entity[property]._),
- };
- } else {
- document[property] = {
- $t: (
DataTypes)[entity[property].$],
- $v: entity[property]._,
- };
+ const propertyValue = entity[property]._;
+ let parsedValue;
+ switch (entity[property].$) {
+ case Constants.TableType.DateTime:
+ parsedValue = DateTimeUtilities.convertJSDateToTicksWithPadding(propertyValue);
+ break;
+ case Constants.TableType.Boolean:
+ parsedValue = propertyValue.toLowerCase() === "true";
+ break;
+ case Constants.TableType.Int32:
+ case Constants.TableType.Int64:
+ parsedValue = parseInt(propertyValue, 10);
+ break;
+ case Constants.TableType.Double:
+ parsedValue = parseFloat(propertyValue);
+ break;
+ default:
+ parsedValue = propertyValue;
}
+
+ document[property] = {
+ $t: (DataTypes)[entity[property].$],
+ $v: parsedValue,
+ };
}
}
return document;
diff --git a/src/Explorer/Tabs/GraphTab.tsx b/src/Explorer/Tabs/GraphTab.tsx
index 8a6712b67..3402b7275 100644
--- a/src/Explorer/Tabs/GraphTab.tsx
+++ b/src/Explorer/Tabs/GraphTab.tsx
@@ -5,8 +5,12 @@ import StyleIcon from "../../../images/Style.svg";
import { DatabaseAccount } from "../../Contracts/DataModels";
import * as ViewModels from "../../Contracts/ViewModels";
import { CommandButtonComponentProps } from "../Controls/CommandButton/CommandButtonComponent";
-import { GraphAccessor, GraphExplorerError } from "../Graph/GraphExplorerComponent/GraphExplorer";
-import { GraphExplorerAdapter } from "../Graph/GraphExplorerComponent/GraphExplorerAdapter";
+import {
+ GraphAccessor,
+ GraphExplorer,
+ GraphExplorerError,
+ GraphExplorerProps,
+} from "../Graph/GraphExplorerComponent/GraphExplorer";
import { ContextualPaneBase } from "../Panes/ContextualPaneBase";
import GraphStylingPane from "../Panes/GraphStylingPane";
import { NewVertexPanel } from "../Panes/NewVertexPanel/NewVertexPanel";
@@ -36,15 +40,13 @@ interface GraphTabOptions extends ViewModels.TabOptions {
}
export default class GraphTab extends TabsBase {
- public readonly html =
- '';
// Graph default configuration
public static readonly DEFAULT_NODE_CAPTION = "id";
private static readonly LINK_COLOR = "#aaa";
private static readonly NODE_SIZE = 10;
private static readonly NODE_COLOR = "orange";
private static readonly LINK_WIDTH = 1;
- private graphExplorerAdapter: GraphExplorerAdapter;
+ private graphExplorerProps: GraphExplorerProps;
private isNewVertexDisabled: ko.Observable;
private isPropertyEditing: ko.Observable;
private isGraphDisplayed: ko.Observable;
@@ -70,7 +72,7 @@ export default class GraphTab extends TabsBase {
this.graphConfig = GraphTab.createGraphConfig();
// TODO Merge this with this.graphConfig
this.graphConfigUiData = GraphTab.createGraphConfigUiData(this.graphConfig);
- this.graphExplorerAdapter = new GraphExplorerAdapter({
+ this.graphExplorerProps = {
onGraphAccessorCreated: (instance: GraphAccessor): void => {
this.graphAccessor = instance;
},
@@ -89,8 +91,9 @@ export default class GraphTab extends TabsBase {
onResetDefaultGraphConfigValues: () => this.setDefaultGraphConfigValues(),
graphConfig: this.graphConfig,
graphConfigUiData: this.graphConfigUiData,
- onIsFilterQueryLoading: (isFilterQueryLoading: boolean): void => this.isFilterQueryLoading(isFilterQueryLoading),
- onIsValidQuery: (isValidQuery: boolean): void => this.isValidQuery(isValidQuery),
+ onIsFilterQueryLoadingChange: (isFilterQueryLoading: boolean): void =>
+ this.isFilterQueryLoading(isFilterQueryLoading),
+ onIsValidQueryChange: (isValidQuery: boolean): void => this.isValidQuery(isValidQuery),
collectionPartitionKeyProperty: options.collectionPartitionKeyProperty,
graphBackendEndpoint: GraphTab.getGremlinEndpoint(options.account),
databaseId: options.databaseId,
@@ -103,7 +106,7 @@ export default class GraphTab extends TabsBase {
}
},
resourceId: options.account.id,
- });
+ };
this.isFilterQueryLoading = ko.observable(false);
this.isValidQuery = ko.observable(true);
@@ -115,6 +118,14 @@ export default class GraphTab extends TabsBase {
: `${account.name}.graphs.azure.com:443/`;
}
+ public render(): JSX.Element {
+ return (
+
+
+
+ );
+ }
+
public onTabClick(): void {
super.onTabClick();
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Graph);
diff --git a/src/Explorer/Tree/Database.ts b/src/Explorer/Tree/Database.ts
index c82cd686e..bcebbb63f 100644
--- a/src/Explorer/Tree/Database.ts
+++ b/src/Explorer/Tree/Database.ts
@@ -205,9 +205,8 @@ export default class Database implements ViewModels.Database {
this.deleteCollectionsFromList(deltaCollections.toDelete);
}
- public openAddCollection(database: Database, event: MouseEvent) {
- database.container.addCollectionPane.databaseId(database.id());
- database.container.addCollectionPane.open();
+ public openAddCollection(database: Database) {
+ database.container.openAddCollectionPanel(database.id());
}
public findCollectionWithId(collectionId: string): ViewModels.Collection {
diff --git a/src/Explorer/Tree/ResourceTreeAdapter.tsx b/src/Explorer/Tree/ResourceTreeAdapter.tsx
index 870045a18..4acfb9576 100644
--- a/src/Explorer/Tree/ResourceTreeAdapter.tsx
+++ b/src/Explorer/Tree/ResourceTreeAdapter.tsx
@@ -197,7 +197,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
className: "databaseHeader",
children: [],
isSelected: () => this.isDataNodeSelected(database.id()),
- contextMenu: ResourceTreeContextMenuButtonFactory.createDatabaseContextMenu(this.container),
+ contextMenu: ResourceTreeContextMenuButtonFactory.createDatabaseContextMenu(this.container, database.id()),
onClick: async (isExpanded) => {
// Rewritten version of expandCollapseDatabase():
if (isExpanded) {
@@ -607,7 +607,7 @@ export class ResourceTreeAdapter implements ReactAdapter {
gitHubNotebooksTree.contextMenu = [
{
label: "Manage GitHub settings",
- onClick: () => this.container.gitHubReposPane.open(),
+ onClick: () => this.container.openGitHubReposPanel("Manage GitHub settings"),
},
{
label: "Disconnect from GitHub",
diff --git a/src/Main.tsx b/src/Main.tsx
index 8970ffbc8..ccdde0f57 100644
--- a/src/Main.tsx
+++ b/src/Main.tsx
@@ -53,7 +53,6 @@ import { useConfig } from "./hooks/useConfig";
import { useKnockoutExplorer } from "./hooks/useKnockoutExplorer";
import { useSidePanel } from "./hooks/useSidePanel";
import { useTabs } from "./hooks/useTabs";
-import { KOCommentEnd, KOCommentIfStart } from "./koComment";
import "./Libs/jquery";
import "./Shared/appInsights";
import { userContext } from "./UserContext";
@@ -232,9 +231,6 @@ const App: React.FunctionComponent = () => {
-
-
-
{showDialog && }
);
diff --git a/src/Shared/Telemetry/TelemetryConstants.ts b/src/Shared/Telemetry/TelemetryConstants.ts
index f14cfaf7e..5500118ce 100644
--- a/src/Shared/Telemetry/TelemetryConstants.ts
+++ b/src/Shared/Telemetry/TelemetryConstants.ts
@@ -115,6 +115,7 @@ export enum Action {
NotebooksGalleryFavoritesCount,
NotebooksGalleryPublishedCount,
SelfServe,
+ ExpandAddCollectionPaneAdvancedSection,
}
export const ActionModifiers = {
diff --git a/src/UserContext.ts b/src/UserContext.ts
index 4d42c0254..0cbec9226 100644
--- a/src/UserContext.ts
+++ b/src/UserContext.ts
@@ -19,7 +19,7 @@ interface UserContext {
readonly quotaId?: string;
// API Type is not yet provided by ARM. You need to manually inspect all the capabilities+kind so we abstract that logic in userContext
// This is coming in a future Cosmos ARM API version as a prperty on databaseAccount
- apiType?: ApiType;
+ apiType: ApiType;
readonly isTryCosmosDBSubscription?: boolean;
readonly portalEnv?: PortalEnv;
readonly features: Features;
diff --git a/src/Utils/APITypeUtils.ts b/src/Utils/APITypeUtils.ts
new file mode 100644
index 000000000..c321bd98b
--- /dev/null
+++ b/src/Utils/APITypeUtils.ts
@@ -0,0 +1,30 @@
+import { userContext } from "../UserContext";
+
+export const getCollectionName = (isPlural?: boolean): string => {
+ let collectionName: string;
+ let unknownApiType: never;
+ switch (userContext.apiType) {
+ case "SQL":
+ collectionName = "Container";
+ break;
+ case "Mongo":
+ collectionName = "Collection";
+ break;
+ case "Cassandra":
+ case "Tables":
+ collectionName = "Table";
+ break;
+ case "Gremlin":
+ collectionName = "Graph";
+ break;
+ default:
+ unknownApiType = userContext.apiType;
+ throw new Error(`Unknown API type: ${unknownApiType}`);
+ }
+
+ if (isPlural) {
+ collectionName += "s";
+ }
+
+ return collectionName;
+};
diff --git a/src/Utils/PricingUtils.ts b/src/Utils/PricingUtils.ts
index 61c06692e..9c458c3b2 100644
--- a/src/Utils/PricingUtils.ts
+++ b/src/Utils/PricingUtils.ts
@@ -1,5 +1,5 @@
import * as Constants from "../Shared/Constants";
-import { userContext } from "../UserContext";
+import { getCollectionName } from "../Utils/APITypeUtils";
import * as AutoPilotUtils from "../Utils/AutoPilotUtils";
interface ComputeRUUsagePriceHourlyArgs {
@@ -11,7 +11,7 @@ interface ComputeRUUsagePriceHourlyArgs {
}
export const estimatedCostDisclaimer =
- "*This cost is an estimate and may vary based on the regions where your account is deployed and potential discounts applied to your account";
+ "This cost is an estimate and may vary based on the regions where your account is deployed and potential discounts applied to your account";
/**
* Anything that is not a number should return 0
@@ -99,8 +99,8 @@ export function computeDisplayUsageString(usageInKB: number): string {
usageInGB > 0.1
? usageInGB.toFixed(2) + " GB"
: usageInMB > 0.1
- ? usageInMB.toFixed(2) + " MB"
- : usageInKB.toFixed(2) + " KB";
+ ? usageInMB.toFixed(2) + " MB"
+ : usageInKB.toFixed(2) + " KB";
return displayUsageString;
}
@@ -162,14 +162,13 @@ export function getAutoPilotV3SpendHtml(maxAutoPilotThroughputSet: number, isDat
return "";
}
- const resource: string = isDatabaseThroughput ? "database" : "container";
+ const resource: string = isDatabaseThroughput ? "database" : getCollectionName().toLocaleLowerCase();
return `Your ${resource} throughput will automatically scale from ${AutoPilotUtils.getMinRUsBasedOnUserInput(
maxAutoPilotThroughputSet
)} RU/s (10% of max RU/s) - ${maxAutoPilotThroughputSet} RU/s based on usage.
After the first ${AutoPilotUtils.getStorageBasedOnUserInput(
maxAutoPilotThroughputSet
- )} GB of data stored, the max RU/s will be automatically upgraded based on the new storage value. Learn more.`;
+ )} GB of data stored, the max RU/s will be automatically upgraded based on the new storage value. Learn more.`;
}
export function getEstimatedAutoscaleSpendHtml(
@@ -196,8 +195,7 @@ export function getEstimatedAutoscaleSpendHtml(
`Estimated monthly cost (${currency}): ` +
`${currencySign}${calculateEstimateNumber(monthlyPrice / 10)} - ` +
`${currencySign}${calculateEstimateNumber(monthlyPrice)} ` +
- `(${regions} ${regions === 1 ? "region" : "regions"}, ${
- throughput / 10
+ `(${regions} ${regions === 1 ? "region" : "regions"}, ${throughput / 10
} - ${throughput} RU/s, ${currencySign}${pricePerRu}/RU)`
);
}
@@ -228,7 +226,7 @@ export function getEstimatedSpendHtml(
`${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly ` +
`(${regions} ${regions === 1 ? "region" : "regions"}, ${throughput}RU/s, ${currencySign}${pricePerRu}/RU)` +
`` +
- `${estimatedCostDisclaimer}
`
+ `*${estimatedCostDisclaimer}`
);
}
@@ -251,22 +249,21 @@ export function getEstimatedSpendAcknowledgeString(
const currencySign: string = getCurrencySign(serverId);
return !isAutoscale
? `I acknowledge the estimated ${currencySign}${calculateEstimateNumber(
- dailyPrice
- )} daily cost for the throughput above.`
+ dailyPrice
+ )} daily cost for the throughput above.`
: `I acknowledge the estimated ${currencySign}${calculateEstimateNumber(
- monthlyPrice / 10
- )} - ${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly cost for the throughput above.`;
+ monthlyPrice / 10
+ )} - ${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly cost for the throughput above.`;
}
export function getUpsellMessage(
serverId = "default",
isFreeTier = false,
isFirstResourceCreated = false,
- defaultExperience: typeof userContext.apiType,
isCollection: boolean
): string {
if (isFreeTier) {
- const collectionName = getCollectionName(defaultExperience);
+ const collectionName = getCollectionName().toLocaleLowerCase();
const resourceType = isCollection ? collectionName : "database";
return isFirstResourceCreated
? `The free tier discount of 400 RU/s has already been applied to a database or ${collectionName} in this account. Billing will apply to this ${resourceType} after it is created.`
@@ -278,22 +275,8 @@ export function getUpsellMessage(
price = Constants.OfferPricing.MonthlyPricing.mooncake.Standard.StartingPrice;
}
- return `Start at ${getCurrencySign(serverId)}${price}/mo per database, multiple containers included`;
- }
-}
-
-export function getCollectionName(defaultExperience: typeof userContext.apiType): string {
- switch (defaultExperience) {
- case "SQL":
- return "container";
- case "Mongo":
- return "collection";
- case "Tables":
- case "Cassandra":
- return "table";
- case "Gremlin":
- return "graph";
- default:
- throw Error("unknown API type");
+ return `Start at ${getCurrencySign(serverId)}${price}/mo per database, multiple ${getCollectionName(
+ true
+ ).toLocaleLowerCase()} included`;
}
}
diff --git a/src/koComment.tsx b/src/koComment.tsx
deleted file mode 100644
index 7b9f8f889..000000000
--- a/src/koComment.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-/* eslint-disable react/prop-types */
-import React, { useEffect, useRef } from "react";
-
-export const KOCommentIfStart: React.FunctionComponent<{ if: string }> = (props) => {
- const el = useRef();
- useEffect(() => {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (el.current as any).outerHTML = ``;
- }, []);
- return ;
-};
-
-export const KOCommentEnd: React.FunctionComponent = () => {
- const el = useRef();
- useEffect(() => {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- (el.current as any).outerHTML = ``;
- }, []);
- return ;
-};
diff --git a/test/mongo/container.spec.ts b/test/mongo/container.spec.ts
index d2f20358f..02ca87d52 100644
--- a/test/mongo/container.spec.ts
+++ b/test/mongo/container.spec.ts
@@ -16,15 +16,10 @@ test("Mongo CRUD", async () => {
// Create new database and collection
await explorer.click('[data-test="New Collection"]');
- await explorer.click('[data-test="addCollection-newDatabaseId"]');
- await explorer.fill('[data-test="addCollection-newDatabaseId"]', databaseId);
- await explorer.click('[data-test="addCollection-collectionId"]');
- await explorer.fill('[data-test="addCollection-collectionId"]', containerId);
- await explorer.click('[data-test="addCollection-collectionId"]');
- await explorer.fill('[data-test="addCollection-collectionId"]', containerId);
- await explorer.click('[data-test="addCollection-partitionKeyValue"]');
- await explorer.fill('[data-test="addCollection-partitionKeyValue"]', "/pk");
- await explorer.click('[data-test="addCollection-createCollection"]');
+ await explorer.fill('[aria-label="New database id"]', databaseId);
+ await explorer.fill('[aria-label="Collection id"]', containerId);
+ await explorer.fill('[aria-label="Shard key"]', "/pk");
+ await explorer.click("#sidePanelOkButton");
await safeClick(explorer, `.nodeItem >> text=${databaseId}`);
await safeClick(explorer, `.nodeItem >> text=${containerId}`);
// Create indexing policy
diff --git a/test/sql/container.spec.ts b/test/sql/container.spec.ts
index 689bd3196..5bec9cdef 100644
--- a/test/sql/container.spec.ts
+++ b/test/sql/container.spec.ts
@@ -15,15 +15,10 @@ test("SQL CRUD", async () => {
});
await explorer.click('[data-test="New Container"]');
- await explorer.click('[data-test="addCollection-newDatabaseId"]');
- await explorer.fill('[data-test="addCollection-newDatabaseId"]', databaseId);
- await explorer.click('[data-test="addCollection-collectionId"]');
- await explorer.fill('[data-test="addCollection-collectionId"]', containerId);
- await explorer.click('[data-test="addCollection-collectionId"]');
- await explorer.fill('[data-test="addCollection-collectionId"]', containerId);
- await explorer.click('[data-test="addCollection-partitionKeyValue"]');
- await explorer.fill('[data-test="addCollection-partitionKeyValue"]', "/pk");
- await explorer.click('[data-test="addCollection-createCollection"]');
+ await explorer.fill('[aria-label="New database id"]', databaseId);
+ await explorer.fill('[aria-label="Container id"]', containerId);
+ await explorer.fill('[aria-label="Partition key"]', "/pk");
+ await explorer.click("#sidePanelOkButton");
await safeClick(explorer, `.nodeItem >> text=${databaseId}`);
await safeClick(explorer, `[data-test="${containerId}"] [aria-label="More"]`);
await safeClick(explorer, 'button[role="menuitem"]:has-text("Delete Container")');
diff --git a/test/tables/container.spec.ts b/test/tables/container.spec.ts
index d679b89b6..33362c0e6 100644
--- a/test/tables/container.spec.ts
+++ b/test/tables/container.spec.ts
@@ -15,9 +15,8 @@ test("Tables CRUD", async () => {
});
await explorer.click('[data-test="New Table"]');
- await explorer.click('[data-test="addCollection-collectionId"]');
- await explorer.fill('[data-test="addCollection-collectionId"]', tableId);
- await explorer.click('[data-test="addCollection-createCollection"]');
+ await explorer.fill('[aria-label="Table id"]', tableId);
+ await explorer.click("#sidePanelOkButton");
await safeClick(explorer, `[data-test="TablesDB"]`);
await safeClick(explorer, `[data-test="${tableId}"] [aria-label="More"]`);
await safeClick(explorer, 'button[role="menuitem"]:has-text("Delete Table")');