= ({ container }: Props) => {
);
}
- const rootStyle =
- configContext.platform === Platform.Fabric
- ? {
- root: {
- backgroundColor: "transparent",
- padding: "2px 8px 0px 8px",
- },
- }
- : {
- root: {
- backgroundColor: backgroundColor,
- },
- };
+ const rootStyle = isFabric()
+ ? {
+ root: {
+ backgroundColor: "transparent",
+ padding: "2px 8px 0px 8px",
+ },
+ }
+ : {
+ root: {
+ backgroundColor: backgroundColor,
+ },
+ };
const allButtons = staticButtons.concat(contextButtons).concat(controlButtons);
const keyboardHandlers = CommandBarUtil.createKeyboardHandlers(allButtons);
diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts
index 0a4a805d2..8ac604ea2 100644
--- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts
+++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts
@@ -37,21 +37,25 @@ describe("CommandBarComponentButtonFactory tests", () => {
expect(enableAzureSynapseLinkBtn).toBeDefined();
});
- it("Button should not be visible for Tables API", () => {
- updateUserContext({
- databaseAccount: {
- properties: {
- capabilities: [{ name: "EnableTable" }],
- },
- } as DatabaseAccount,
- });
-
- const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
- const enableAzureSynapseLinkBtn = buttons.find(
- (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel,
- );
- expect(enableAzureSynapseLinkBtn).toBeUndefined();
- });
+ // TODO: Now that Tables API supports dataplane RBAC, calling createStaticCommandBarButtons will enable the
+ // Entra ID Login button, which causes this test to fail due to "Invalid hook call.". This seems to be
+ // unsupported in jest and needs to be tested with react-hooks-testing-library.
+ //
+ // it("Button should not be visible for Tables API", () => {
+ // updateUserContext({
+ // databaseAccount: {
+ // properties: {
+ // capabilities: [{ name: "EnableTable" }],
+ // },
+ // } as DatabaseAccount,
+ // });
+ //
+ // const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState);
+ // const enableAzureSynapseLinkBtn = buttons.find(
+ // (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel,
+ // );
+ // expect(enableAzureSynapseLinkBtn).toBeUndefined();
+ //});
it("Button should not be visible for Cassandra API", () => {
updateUserContext({
diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
index 8c374a4c1..fbf1b4434 100644
--- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
+++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
@@ -1,4 +1,5 @@
import { KeyboardAction } from "KeyboardShortcuts";
+import { isDataplaneRbacSupported } from "Utils/APITypeUtils";
import * as React from "react";
import { useEffect, useState } from "react";
import AddSqlQueryIcon from "../../../../images/AddSqlQuery_16x16.svg";
@@ -13,6 +14,7 @@ import OpenQueryFromDiskIcon from "../../../../images/OpenQueryFromDisk.svg";
import OpenInTabIcon from "../../../../images/open-in-tab.svg";
import SettingsIcon from "../../../../images/settings_15x15.svg";
import SynapseIcon from "../../../../images/synapse-link.svg";
+import VSCodeIcon from "../../../../images/vscode.svg";
import { AuthType } from "../../../AuthType";
import * as Constants from "../../../Common/Constants";
import { Platform, configContext } from "../../../ConfigContext";
@@ -59,9 +61,13 @@ export function createStaticCommandBarButtons(
addDivider();
buttons.push(addSynapseLink);
}
+ if (userContext.apiType !== "Gremlin") {
+ const addVsCode = createOpenVsCodeDialogButton(container);
+ buttons.push(addVsCode);
+ }
}
- if (userContext.apiType === "SQL") {
+ if (isDataplaneRbacSupported(userContext.apiType)) {
const [loginButtonProps, setLoginButtonProps] = useState
(undefined);
const dataPlaneRbacEnabled = useDataPlaneRbac((state) => state.dataPlaneRbacEnabled);
const aadTokenUpdated = useDataPlaneRbac((state) => state.aadTokenUpdated);
@@ -125,13 +131,14 @@ export function createContextCommandBarButtons(
const buttons: CommandButtonComponentProps[] = [];
if (!selectedNodeState.isDatabaseNodeOrNoneSelected() && userContext.apiType === "Mongo") {
- const label = useNotebook.getState().isShellEnabled ? "Open Mongo Shell" : "New Shell";
+ const label =
+ useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell ? "Open Mongo Shell" : "New Shell";
const newMongoShellBtn: CommandButtonComponentProps = {
iconSrc: HostedTerminalIcon,
iconAlt: label,
onCommandClick: () => {
const selectedCollection: ViewModels.Collection = selectedNodeState.findSelectedCollection();
- if (useNotebook.getState().isShellEnabled) {
+ if (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) {
container.openNotebookTerminal(ViewModels.TerminalKind.Mongo);
} else {
selectedCollection && selectedCollection.onNewMongoShellClick();
@@ -145,7 +152,7 @@ export function createContextCommandBarButtons(
}
if (
- useNotebook.getState().isShellEnabled &&
+ (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) &&
!selectedNodeState.isDatabaseNodeOrNoneSelected() &&
userContext.apiType === "Cassandra"
) {
@@ -266,6 +273,18 @@ function createOpenSynapseLinkDialogButton(container: Explorer): CommandButtonCo
};
}
+function createOpenVsCodeDialogButton(container: Explorer): CommandButtonComponentProps {
+ const label = "Visual Studio Code";
+ return {
+ iconSrc: VSCodeIcon,
+ iconAlt: label,
+ onCommandClick: () => container.openInVsCode(),
+ commandButtonLabel: label,
+ hasPopup: false,
+ ariaLabel: label,
+ };
+}
+
function createLoginForEntraIDButton(container: Explorer): CommandButtonComponentProps {
if (configContext.platform !== Platform.Portal) {
return undefined;
@@ -454,7 +473,7 @@ function createOpenTerminalButtonByKind(
iconSrc: HostedTerminalIcon,
iconAlt: label,
onCommandClick: () => {
- if (useNotebook.getState().isNotebookEnabled) {
+ if (useNotebook.getState().isNotebookEnabled || userContext.features.enableCloudShell) {
container.openNotebookTerminal(terminalKind);
}
},
@@ -498,6 +517,6 @@ export function createPostgreButtons(container: Explorer): CommandButtonComponen
export function createVCoreMongoButtons(container: Explorer): CommandButtonComponentProps[] {
const openVCoreMongoTerminalButton = createOpenTerminalButtonByKind(container, ViewModels.TerminalKind.VCoreMongo);
-
- return [openVCoreMongoTerminalButton];
+ const addVsCode = createOpenVsCodeDialogButton(container);
+ return [openVCoreMongoTerminalButton, addVsCode];
}
diff --git a/src/Explorer/Menus/NotificationConsole/ConsoleData.tsx b/src/Explorer/Menus/NotificationConsole/ConsoleData.tsx
index 2ede2f003..9307c164f 100644
--- a/src/Explorer/Menus/NotificationConsole/ConsoleData.tsx
+++ b/src/Explorer/Menus/NotificationConsole/ConsoleData.tsx
@@ -13,4 +13,5 @@ export enum ConsoleDataType {
Info = 0,
Error = 1,
InProgress = 2,
+ Warning = 3,
}
diff --git a/src/Explorer/Menus/NotificationConsole/NotificationConsole.less b/src/Explorer/Menus/NotificationConsole/NotificationConsole.less
index 2e9413020..fb5aed51c 100644
--- a/src/Explorer/Menus/NotificationConsole/NotificationConsole.less
+++ b/src/Explorer/Menus/NotificationConsole/NotificationConsole.less
@@ -36,6 +36,10 @@
&:active {
background-color:@NotificationHigh;
}
+
+ &:focus {
+ .focusedBorder();
+ }
.statusBar {
.dataTypeIcons {
@@ -169,8 +173,20 @@
.message {
flex-grow: 1;
white-space:pre-wrap;
+ overflow-wrap: break-word;
+ word-break: break-word;
}
}
}
}
+
+ @media (max-width: 768px) {
+ .notificationConsoleContents {
+ overflow-y: auto;
+
+ .notificationConsoleData {
+ overflow: visible;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx b/src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
index e86f08320..1288ee5da 100644
--- a/src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
+++ b/src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
@@ -14,6 +14,7 @@ import ErrorRedIcon from "../../../../images/error_red.svg";
import infoBubbleIcon from "../../../../images/info-bubble-9x9.svg";
import InfoIcon from "../../../../images/info_color.svg";
import LoadingIcon from "../../../../images/loading.svg";
+import WarningIcon from "../../../../images/warning.svg";
import { ClientDefaults, KeyCodes } from "../../../Common/Constants";
import { userContext } from "../../../UserContext";
import { useNotificationConsole } from "../../../hooks/useNotificationConsole";
@@ -81,10 +82,6 @@ export class NotificationConsoleComponent extends React.Component<
}
}
- public setElememntRef = (element: HTMLElement): void => {
- this.consoleHeaderElement = element;
- };
-
public render(): JSX.Element {
const numInProgress = this.state.allConsoleData.filter(
(data: ConsoleData) => data.type === ConsoleDataType.InProgress,
@@ -95,13 +92,18 @@ export class NotificationConsoleComponent extends React.Component<
const numInfoItems = this.state.allConsoleData.filter(
(data: ConsoleData) => data.type === ConsoleDataType.Info,
).length;
+ const numWarningItems = this.state.allConsoleData.filter(
+ (data: ConsoleData) => data.type === ConsoleDataType.Warning,
+ ).length;
return (