mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-10-13 23:38:45 +01:00
master pull
This commit is contained in:
parent
af4e1d10b4
commit
5f4ea0e614
4
.npmrc
4
.npmrc
@ -1,4 +1,6 @@
|
|||||||
save-exact=true
|
save-exact=true
|
||||||
|
registry=https://msdata.pkgs.visualstudio.com/_packaging/cosmosdbportal/npm/registry/
|
||||||
|
always-auth=true
|
||||||
|
allow-same-version=true
|
||||||
# Ignore peer dependency conflicts
|
# Ignore peer dependency conflicts
|
||||||
force=true # TODO: Remove this when we update to React 17 or higher!
|
force=true # TODO: Remove this when we update to React 17 or higher!
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -24,5 +24,6 @@
|
|||||||
"source.organizeImports": "explicit"
|
"source.organizeImports": "explicit"
|
||||||
},
|
},
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"sarif-viewer.connectToGithubCodeScanning": "off"
|
||||||
}
|
}
|
||||||
|
@ -282,6 +282,27 @@ export default class Explorer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public openInVsCode(): void {
|
||||||
|
const startTime = TelemetryProcessor.traceStart(Action.OpenVSCode);
|
||||||
|
const clearInProgressMessage = logConsoleProgress(
|
||||||
|
"Opening VS Code for this account.",
|
||||||
|
);
|
||||||
|
useDialog.getState().closeDialog();
|
||||||
|
try {
|
||||||
|
`vscode://ms-azuretools.vscode-cosmosdb?resourceId=/subscriptions/${userContext.subscriptionId}/resourceGroups/${userContext.resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${userContext?.databaseAccount}&database=${userContext.parsedResourceToken?.databaseId}&container=${userContext.parsedResourceToken?.collectionId}`
|
||||||
|
// preview version of vscode
|
||||||
|
// `vscode-insiders://ms-azuretools.vscode-cosmosdb?resourceId=/subscriptions/${userContext.subscriptionId}/resourceGroups/${userContext.resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${userContext?.databaseAccount}&database=${userContext.parsedResourceToken?.databaseId}&container=${userContext.parsedResourceToken?.databaseId}`
|
||||||
|
clearInProgressMessage();
|
||||||
|
logConsoleInfo("Opening Visual Studio Code for this account");
|
||||||
|
TelemetryProcessor.traceSuccess(Action.OpenVSCode, {}, startTime);
|
||||||
|
} catch (error) {
|
||||||
|
// If the browser can't handle a `vscode://` or `vscode-insiders://` url route them to the VS Code download page
|
||||||
|
clearInProgressMessage();
|
||||||
|
logConsoleError(`**Visual Studio Code** isn't installed on this device. Please install it here: **https://code.visualstudio.com/download**${getErrorMessage(error)}`);
|
||||||
|
TelemetryProcessor.traceFailure(Action.OpenVSCode, {}, startTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async openCESCVAFeedbackBlade(): Promise<void> {
|
public async openCESCVAFeedbackBlade(): Promise<void> {
|
||||||
sendMessage({ type: MessageTypes.OpenCESCVAFeedbackBlade });
|
sendMessage({ type: MessageTypes.OpenCESCVAFeedbackBlade });
|
||||||
Logger.logInfo(
|
Logger.logInfo(
|
||||||
|
@ -14,6 +14,7 @@ import OpenQueryFromDiskIcon from "../../../../images/OpenQueryFromDisk.svg";
|
|||||||
import OpenInTabIcon from "../../../../images/open-in-tab.svg";
|
import OpenInTabIcon from "../../../../images/open-in-tab.svg";
|
||||||
import SettingsIcon from "../../../../images/settings_15x15.svg";
|
import SettingsIcon from "../../../../images/settings_15x15.svg";
|
||||||
import SynapseIcon from "../../../../images/synapse-link.svg";
|
import SynapseIcon from "../../../../images/synapse-link.svg";
|
||||||
|
import VSCodeIcon from "../../../../images/vscode.svg";
|
||||||
import { AuthType } from "../../../AuthType";
|
import { AuthType } from "../../../AuthType";
|
||||||
import * as Constants from "../../../Common/Constants";
|
import * as Constants from "../../../Common/Constants";
|
||||||
import { Platform, configContext } from "../../../ConfigContext";
|
import { Platform, configContext } from "../../../ConfigContext";
|
||||||
@ -60,6 +61,8 @@ export function createStaticCommandBarButtons(
|
|||||||
addDivider();
|
addDivider();
|
||||||
buttons.push(addSynapseLink);
|
buttons.push(addSynapseLink);
|
||||||
}
|
}
|
||||||
|
const addVsCode = createOpenVsCodeDialogButton(container);
|
||||||
|
buttons.push(addVsCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDataplaneRbacSupported(userContext.apiType)) {
|
if (isDataplaneRbacSupported(userContext.apiType)) {
|
||||||
@ -267,6 +270,18 @@ function createOpenSynapseLinkDialogButton(container: Explorer): CommandButtonCo
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createOpenVsCodeDialogButton(container: Explorer): CommandButtonComponentProps {
|
||||||
|
const label = "Open in VS Code";
|
||||||
|
return {
|
||||||
|
iconSrc: VSCodeIcon,
|
||||||
|
iconAlt: label,
|
||||||
|
onCommandClick: () => container.openInVsCode(),
|
||||||
|
commandButtonLabel: label,
|
||||||
|
hasPopup: false,
|
||||||
|
ariaLabel: label,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function createLoginForEntraIDButton(container: Explorer): CommandButtonComponentProps {
|
function createLoginForEntraIDButton(container: Explorer): CommandButtonComponentProps {
|
||||||
if (configContext.platform !== Platform.Portal) {
|
if (configContext.platform !== Platform.Portal) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -146,6 +146,7 @@ export enum Action {
|
|||||||
SavePersistedTabState,
|
SavePersistedTabState,
|
||||||
DeletePersistedTabState,
|
DeletePersistedTabState,
|
||||||
UploadDocuments, // Used in Fabric. Please do not rename.
|
UploadDocuments, // Used in Fabric. Please do not rename.
|
||||||
|
OpenVSCode,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ActionModifiers = {
|
export const ActionModifiers = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user