Files
cosmos-explorer/src/Shared/Telemetry/TelemetryConstants.ts
JustinKol 7c0aae6ffa Open VS Code via Data Explorer button (#2116)
* master pull

* Reverting .npmrc file

* Removed logging userContext

* Prettier run

* Added support for opening CosmosDB Account without clicking database tab

* Reverting change in settings.json

* Prettier run

* Added check if the link closed

* Added check if the link didn't closed

* Check if VS Code was opened, if not popup with download button link

* Prettier run

* Redirect to Download VS Code if not opened

* Added error message to VS Code timeout and redirect

* Fixing baseUrl from testing

* Increased timeout for when user is asked to open VS Code

* switched to iframe for redirects

* Fixed VS Code url

* Removed insider url

* Added log messages

* Added link to vCore data explorer dashboard

* Increased timeout to 2.5 secs to see if that helps with VS Code open popup

* Changed to dialog box

* Changed param name

* Increase startTime for extra popup

* Changed to dialog box only when no VS Code detected

* Fixed vscode url

* Changed title back to Open CosmosDB in VS Code

* Added text on required extensions

* Removed text on required extensions as it will prompt by default

* Fixed wording and Primary Button timeout

* Spelled out VS Code

* Removed console log of timeout

* Updated snapshots and lowered timeout

* Remove VS Code button from Gremlin

* Prettier run on CommandBarComponentButtonFactory

* Changed from referencing location to a link

* Prettier run

* Reverting back to popup for opening

* Updated unit test snapshots

* Added vscode: to Content Security Policy

* Reverting back to popup only if opening times out
2025-05-12 10:55:06 -04:00

200 lines
4.9 KiB
TypeScript

// Data Explorer specific actions. No need to keep this in sync with the one in Portal.
// Some of the enums names are used in Fabric. Please do not rename them.
export enum Action {
CollapseTreeNode,
CreateCollection, // Used in Fabric. Please do not rename.
CreateGlobalSecondaryIndex,
CreateDocument, // Used in Fabric. Please do not rename.
CreateStoredProcedure,
CreateTrigger,
CreateUDF,
DeleteCollection, // Used in Fabric. Please do not rename.
DeleteDatabase,
DeleteDocument,
ExpandTreeNode,
ExecuteQuery, // Used in Fabric. Please do not rename.
HasFeature,
GetVNETServices,
InitializeAccountLocationFromResourceGroup,
InitializeDataExplorer,
LoadDatabaseAccount,
LoadCollections,
LoadDatabases,
LoadOffers,
MongoShell,
ContextualPane,
ScaleThroughput,
ToggleAutoscaleSetting,
SelectItem,
Tab,
UpdateDocument,
UpdateSettings,
UpdateStoredProcedure,
UpdateTrigger,
UpdateUDF,
LoadResourceTree,
CreateDatabase,
ResolveConflict,
DeleteConflict,
SaveQuery,
SetupSavedQueries,
LoadSavedQuery,
DeleteSavedQuery,
ConnectEncryptionToken,
SignInAad,
SignOutAad,
FetchTenants,
FetchSubscriptions,
FetchAccounts,
GetAccountKeys,
LoadingStatus,
AccountSwitch,
SubscriptionSwitch,
TenantSwitch,
DefaultTenantSwitch,
CreateNotebookWorkspace,
NotebookErrorNotification,
CreateSparkCluster,
UpdateSparkCluster,
DeleteSparkCluster,
LibraryManage,
ClusterLibraryManage,
ModifyOptionForThroughputWithSharedDatabase,
EnableAzureSynapseLink,
CreateNewNotebook,
OpenSampleNotebook,
ExecuteCell,
ExecuteCellPromptBtn,
ExecuteAllCells,
NotebookEnabled,
NotebooksGitHubConnect,
NotebooksGitHubAuthorize,
NotebooksGitHubManualRepoAdd,
NotebooksGitHubManageRepo,
NotebooksGitHubCommit,
NotebooksGitHubDisconnect,
NotebooksFetched,
NotebooksKernelSpecName,
NotebooksExecuteCellFromMenu,
NotebooksClearOutputsFromMenu,
NotebooksInsertCodeCellAboveFromMenu,
NotebooksInsertCodeCellBelowFromMenu,
NotebooksInsertTextCellAboveFromMenu,
NotebooksInsertTextCellBelowFromMenu,
NotebooksMoveCellUpFromMenu,
NotebooksMoveCellDownFromMenu,
PhoenixConnection,
PhoenixHeartBeat,
PhoenixResetWorkspace,
PhoenixDBAccountAllowed,
DeleteCellFromMenu,
OpenTerminal,
OpenCloudShellTerminal,
CreateMongoCollectionWithWildcardIndex,
ClickCommandBarButton,
RefreshResourceTreeMyNotebooks,
ClickResourceTreeNodeContextMenuItem,
DiscardSettings,
SettingsV2Updated,
SettingsV2Discarded,
MongoIndexUpdated,
NotebooksGalleryPublish,
NotebooksGalleryReportAbuse,
NotebooksGalleryClickReportAbuse,
NotebooksGalleryViewCodeOfConduct,
NotebooksGalleryAcceptCodeOfConduct,
NotebooksGalleryFavorite,
NotebooksGalleryUnfavorite,
NotebooksGalleryClickDelete,
NotebooksGalleryDelete,
NotebooksGalleryClickDownload,
NotebooksGalleryDownload,
NotebooksGalleryViewNotebook,
NotebooksGalleryViewGallery,
NotebooksGalleryViewOfficialSamples,
NotebooksGalleryViewPublicGallery,
NotebooksGalleryViewFavorites,
NotebooksGalleryViewPublishedNotebooks,
NotebooksGalleryClickPublishToGallery,
NotebooksGalleryOfficialSamplesCount,
NotebooksGalleryPublicGalleryCount,
NotebooksGalleryFavoritesCount,
NotebooksGalleryPublishedCount,
SelfServe,
ExpandAddCollectionPaneAdvancedSection,
ExpandAddGlobalSecondaryIndexPaneAdvancedSection,
SchemaAnalyzerClickAnalyze,
SelfServeComponent,
LaunchQuickstart,
NewContainerHomepage,
Top3ItemsClicked,
LearningResourcesClicked,
PlayCarouselVideo,
OpenCarousel,
CompleteCarousel,
LaunchUITour,
CancelUITour,
CompleteUITour,
OpenQueryCopilotFromSplashScreen,
OpenQueryCopilotFromNewQuery,
ActivateQueryCopilot,
DeactivateQueryCopilot,
QueryGenerationFromCopilotPrompt,
QueryEdited,
ExecuteQueryGeneratedFromQueryCopilot,
DeleteDocuments,
ReadPersistedTabState,
SavePersistedTabState,
DeletePersistedTabState,
UploadDocuments, // Used in Fabric. Please do not rename.
CloudShellUserConsent,
CloudShellTerminalSession,
OpenVSCode,
}
export const ActionModifiers = {
Start: "start",
Success: "success",
Failed: "failed",
Mark: "mark",
Open: "open",
IFrameReady: "iframeready",
Close: "close",
Submit: "submit",
IndexAll: "index all properties",
NoIndex: "no indexing",
Cancel: "cancel",
ToggleAutoscaleOn: "autoscale on",
ToggleAutoscaleOff: "autoscale off",
} as const;
export enum SourceBlade {
AddCollection,
AzureFunction,
BrowseCollectionBlade,
CassandraAccountCreateBlade,
CollectionSetting,
DatabaseAccountCreateBlade,
DataExplorer,
DeleteCollection,
DeleteDatabase,
DocumentExplorer,
FirewallVNETBlade,
Metrics,
NonDocumentDBAccountCreateBlade,
OverviewBlade,
QueryExplorer,
Quickstart,
ReaderWarning,
ResourceMenu,
RpcProvider,
ScaleCollection,
ScriptExplorer,
Keys,
}
export enum Source {
ResourceTreeMenu = "ResourceTreeMenu",
CommandBarMenu = "CommandBarMenu",
}