mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-24 11:21:23 +00:00
Compare commits
11 Commits
eslint/Not
...
resolve_Co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9780ff3ad | ||
|
|
deb18e5aa1 | ||
|
|
6da226fedb | ||
|
|
d301294eb5 | ||
|
|
9fd50ee9dd | ||
|
|
413472045d | ||
|
|
989f7b9cd2 | ||
|
|
00ccf4e525 | ||
|
|
afccd262a9 | ||
|
|
e9ad009f79 | ||
|
|
fc1067137b |
@@ -6,7 +6,7 @@ src/Api/Apis.ts
|
|||||||
src/AuthType.ts
|
src/AuthType.ts
|
||||||
src/Bindings/BindingHandlersRegisterer.ts
|
src/Bindings/BindingHandlersRegisterer.ts
|
||||||
src/Bindings/ReactBindingHandler.ts
|
src/Bindings/ReactBindingHandler.ts
|
||||||
src/Common/Constants.ts
|
src/Common/Constants/index.ts
|
||||||
src/Common/CosmosClient.test.ts
|
src/Common/CosmosClient.test.ts
|
||||||
src/Common/CosmosClient.ts
|
src/Common/CosmosClient.ts
|
||||||
src/Common/DataAccessUtilityBase.test.ts
|
src/Common/DataAccessUtilityBase.test.ts
|
||||||
@@ -81,8 +81,12 @@ src/Explorer/Tables/DataTable/DataTableBindingManager.ts
|
|||||||
src/Explorer/Tables/DataTable/DataTableBuilder.ts
|
src/Explorer/Tables/DataTable/DataTableBuilder.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
src/Explorer/Tables/DataTable/DataTableContextMenu.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
src/Explorer/Tables/DataTable/DataTableOperationManager.ts
|
||||||
|
# src/Explorer/Tables/DataTable/DataTableOperations.ts
|
||||||
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
src/Explorer/Tables/DataTable/DataTableViewModel.ts
|
||||||
|
# src/Explorer/Tables/DataTable/TableCommands.ts
|
||||||
|
# src/Explorer/Tables/DataTable/TableEntityCache.ts
|
||||||
src/Explorer/Tables/DataTable/TableEntityListViewModel.ts
|
src/Explorer/Tables/DataTable/TableEntityListViewModel.ts
|
||||||
|
# src/Explorer/Tables/Entities.ts
|
||||||
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
src/Explorer/Tables/QueryBuilder/CustomTimestampHelper.ts
|
||||||
src/Explorer/Tables/TableDataClient.ts
|
src/Explorer/Tables/TableDataClient.ts
|
||||||
src/Explorer/Tables/TableEntityProcessor.ts
|
src/Explorer/Tables/TableEntityProcessor.ts
|
||||||
@@ -93,7 +97,11 @@ src/Explorer/Tabs/DocumentsTab.test.ts
|
|||||||
src/Explorer/Tabs/DocumentsTab.ts
|
src/Explorer/Tabs/DocumentsTab.ts
|
||||||
src/Explorer/Tabs/GraphTab.ts
|
src/Explorer/Tabs/GraphTab.ts
|
||||||
src/Explorer/Tabs/MongoDocumentsTab.ts
|
src/Explorer/Tabs/MongoDocumentsTab.ts
|
||||||
|
src/Explorer/Tabs/NotebookV2Tab.ts
|
||||||
|
src/Explorer/Tabs/ScriptTabBase.ts
|
||||||
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
src/Explorer/Tabs/TabsBase.ts
|
src/Explorer/Tabs/TabsBase.ts
|
||||||
|
src/Explorer/Tabs/TriggerTab.ts
|
||||||
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
||||||
src/Explorer/Tree/AccessibleVerticalList.ts
|
src/Explorer/Tree/AccessibleVerticalList.ts
|
||||||
src/Explorer/Tree/Collection.ts
|
src/Explorer/Tree/Collection.ts
|
||||||
@@ -126,13 +134,20 @@ src/Explorer/Controls/Notebook/NotebookTerminalComponent.tsx
|
|||||||
src/Explorer/Controls/NotebookViewer/NotebookViewerComponent.tsx
|
src/Explorer/Controls/NotebookViewer/NotebookViewerComponent.tsx
|
||||||
src/Explorer/Controls/TreeComponent/TreeComponent.tsx
|
src/Explorer/Controls/TreeComponent/TreeComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx
|
src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.test.tsx
|
||||||
|
; src/Explorer/Graph/GraphExplorerComponent/GraphExplorer.tsx
|
||||||
|
src/Explorer/Graph/GraphExplorerComponent/GraphVizComponent.tsx
|
||||||
|
src/Explorer/Graph/GraphExplorerComponent/LeftPaneComponent.tsx
|
||||||
|
src/Explorer/Graph/GraphExplorerComponent/MiddlePaneComponent.tsx
|
||||||
|
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.test.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/NodePropertiesComponent.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx
|
||||||
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
|
||||||
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
|
||||||
|
; src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/contents/index.tsx
|
src/Explorer/Notebook/NotebookComponent/contents/index.tsx
|
||||||
|
; src/Explorer/Notebook/NotebookRenderer/NotebookReadOnlyRenderer.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/NotebookRenderer.tsx
|
src/Explorer/Notebook/NotebookRenderer/NotebookRenderer.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
||||||
|
|||||||
@@ -1,403 +0,0 @@
|
|||||||
export class CodeOfConductEndpoints {
|
|
||||||
public static privacyStatement: string = "https://aka.ms/ms-privacy-policy";
|
|
||||||
public static codeOfConduct: string = "https://aka.ms/cosmos-code-of-conduct";
|
|
||||||
public static termsOfUse: string = "https://aka.ms/ms-terms-of-use";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class EndpointsRegex {
|
|
||||||
public static readonly cassandra = [
|
|
||||||
"AccountEndpoint=(.*).cassandra.cosmosdb.azure.com",
|
|
||||||
"HostName=(.*).cassandra.cosmos.azure.com",
|
|
||||||
];
|
|
||||||
public static readonly mongo = "mongodb://.*:(.*)@(.*).documents.azure.com";
|
|
||||||
public static readonly mongoCompute = "mongodb://.*:(.*)@(.*).mongo.cosmos.azure.com";
|
|
||||||
public static readonly sql = "AccountEndpoint=https://(.*).documents.azure.com";
|
|
||||||
public static readonly table = "TableEndpoint=https://(.*).table.cosmosdb.azure.com";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ApiEndpoints {
|
|
||||||
public static runtimeProxy: string = "/api/RuntimeProxy";
|
|
||||||
public static guestRuntimeProxy: string = "/api/guest/RuntimeProxy";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ServerIds {
|
|
||||||
public static localhost: string = "localhost";
|
|
||||||
public static blackforest: string = "blackforest";
|
|
||||||
public static fairfax: string = "fairfax";
|
|
||||||
public static mooncake: string = "mooncake";
|
|
||||||
public static productionPortal: string = "prod";
|
|
||||||
public static dev: string = "dev";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ArmApiVersions {
|
|
||||||
public static readonly documentDB: string = "2015-11-06";
|
|
||||||
public static readonly arcadia: string = "2019-06-01-preview";
|
|
||||||
public static readonly arcadiaLivy: string = "2019-11-01-preview";
|
|
||||||
public static readonly arm: string = "2015-11-01";
|
|
||||||
public static readonly armFeatures: string = "2014-08-01-preview";
|
|
||||||
public static readonly publicVersion = "2020-04-01";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ArmResourceTypes {
|
|
||||||
public static readonly notebookWorkspaces = "Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces";
|
|
||||||
public static readonly synapseWorkspaces = "Microsoft.Synapse/workspaces";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BackendDefaults {
|
|
||||||
public static partitionKeyKind = "Hash";
|
|
||||||
public static singlePartitionStorageInGb: string = "10";
|
|
||||||
public static multiPartitionStorageInGb: string = "100";
|
|
||||||
public static maxChangeFeedRetentionDuration: number = 10;
|
|
||||||
public static partitionKeyVersion = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ClientDefaults {
|
|
||||||
public static requestTimeoutMs: number = 60000;
|
|
||||||
public static portalCacheTimeoutMs: number = 10000;
|
|
||||||
public static errorNotificationTimeoutMs: number = 5000;
|
|
||||||
public static copyHelperTimeoutMs: number = 2000;
|
|
||||||
public static waitForDOMElementMs: number = 500;
|
|
||||||
public static cacheBustingTimeoutMs: number =
|
|
||||||
10 /** minutes **/ * 60 /** to seconds **/ * 1000 /** to milliseconds **/;
|
|
||||||
public static databaseThroughputIncreaseFactor: number = 100;
|
|
||||||
public static readonly arcadiaTokenRefreshInterval: number =
|
|
||||||
20 /** minutes **/ * 60 /** to seconds **/ * 1000 /** to milliseconds **/;
|
|
||||||
public static readonly arcadiaTokenRefreshIntervalPaddingMs: number = 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum AccountKind {
|
|
||||||
DocumentDB = "DocumentDB",
|
|
||||||
MongoDB = "MongoDB",
|
|
||||||
Parse = "Parse",
|
|
||||||
GlobalDocumentDB = "GlobalDocumentDB",
|
|
||||||
Default = "DocumentDB",
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CorrelationBackend {
|
|
||||||
public static Url: string = "https://aka.ms/cosmosdbanalytics";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class CapabilityNames {
|
|
||||||
public static EnableTable: string = "EnableTable";
|
|
||||||
public static EnableGremlin: string = "EnableGremlin";
|
|
||||||
public static EnableCassandra: string = "EnableCassandra";
|
|
||||||
public static EnableAutoScale: string = "EnableAutoScale";
|
|
||||||
public static readonly EnableNotebooks: string = "EnableNotebooks";
|
|
||||||
public static readonly EnableStorageAnalytics: string = "EnableStorageAnalytics";
|
|
||||||
public static readonly EnableMongo: string = "EnableMongo";
|
|
||||||
public static readonly EnableServerless: string = "EnableServerless";
|
|
||||||
}
|
|
||||||
|
|
||||||
// flight names returned from the portal are always lowercase
|
|
||||||
export class Flights {
|
|
||||||
public static readonly SettingsV2 = "settingsv2";
|
|
||||||
public static readonly MongoIndexEditor = "mongoindexeditor";
|
|
||||||
public static readonly MongoIndexing = "mongoindexing";
|
|
||||||
public static readonly AutoscaleTest = "autoscaletest";
|
|
||||||
public static readonly PartitionKeyTest = "partitionkeytest";
|
|
||||||
public static readonly PKPartitionKeyTest = "pkpartitionkeytest";
|
|
||||||
public static readonly Phoenix = "phoenix";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class AfecFeatures {
|
|
||||||
public static readonly Spark = "spark-public-preview";
|
|
||||||
public static readonly Notebooks = "sparknotebooks-public-preview";
|
|
||||||
public static readonly StorageAnalytics = "storageanalytics-public-preview";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TagNames {
|
|
||||||
public static defaultExperience: string = "defaultExperience";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class MongoDBAccounts {
|
|
||||||
public static protocol: string = "https";
|
|
||||||
public static defaultPort: string = "10255";
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum MongoBackendEndpointType {
|
|
||||||
local,
|
|
||||||
remote,
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: 435619 Add default endpoints per cloud and use regional only when available
|
|
||||||
export class CassandraBackend {
|
|
||||||
public static readonly createOrDeleteApi: string = "api/cassandra/createordelete";
|
|
||||||
public static readonly guestCreateOrDeleteApi: string = "api/guest/cassandra/createordelete";
|
|
||||||
public static readonly queryApi: string = "api/cassandra";
|
|
||||||
public static readonly guestQueryApi: string = "api/guest/cassandra";
|
|
||||||
public static readonly keysApi: string = "api/cassandra/keys";
|
|
||||||
public static readonly guestKeysApi: string = "api/guest/cassandra/keys";
|
|
||||||
public static readonly schemaApi: string = "api/cassandra/schema";
|
|
||||||
public static readonly guestSchemaApi: string = "api/guest/cassandra/schema";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Queries {
|
|
||||||
public static CustomPageOption: string = "custom";
|
|
||||||
public static UnlimitedPageOption: string = "unlimited";
|
|
||||||
public static itemsPerPage: number = 100;
|
|
||||||
public static unlimitedItemsPerPage: number = 100; // TODO: Figure out appropriate value so it works for accounts with a large number of partitions
|
|
||||||
|
|
||||||
public static QueryEditorMinHeightRatio: number = 0.1;
|
|
||||||
public static QueryEditorMaxHeightRatio: number = 0.4;
|
|
||||||
public static readonly DefaultMaxDegreeOfParallelism = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SavedQueries {
|
|
||||||
public static readonly CollectionName: string = "___Query";
|
|
||||||
public static readonly DatabaseName: string = "___Cosmos";
|
|
||||||
public static readonly OfferThroughput: number = 400;
|
|
||||||
public static readonly PartitionKeyProperty: string = "id";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class DocumentsGridMetrics {
|
|
||||||
public static DocumentsPerPage: number = 100;
|
|
||||||
public static IndividualRowHeight: number = 34;
|
|
||||||
public static BufferHeight: number = 28;
|
|
||||||
public static SplitterMinWidth: number = 200;
|
|
||||||
public static SplitterMaxWidth: number = 360;
|
|
||||||
|
|
||||||
public static DocumentEditorMinWidthRatio: number = 0.2;
|
|
||||||
public static DocumentEditorMaxWidthRatio: number = 0.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Areas {
|
|
||||||
public static ResourceTree: string = "Resource Tree";
|
|
||||||
public static ContextualPane: string = "Contextual Pane";
|
|
||||||
public static Tab: string = "Tab";
|
|
||||||
public static ShareDialog: string = "Share Access Dialog";
|
|
||||||
public static Notebook: string = "Notebook";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class HttpHeaders {
|
|
||||||
public static activityId: string = "x-ms-activity-id";
|
|
||||||
public static apiType: string = "x-ms-cosmos-apitype";
|
|
||||||
public static authorization: string = "authorization";
|
|
||||||
public static collectionIndexTransformationProgress: string =
|
|
||||||
"x-ms-documentdb-collection-index-transformation-progress";
|
|
||||||
public static continuation: string = "x-ms-continuation";
|
|
||||||
public static correlationRequestId: string = "x-ms-correlation-request-id";
|
|
||||||
public static enableScriptLogging: string = "x-ms-documentdb-script-enable-logging";
|
|
||||||
public static guestAccessToken: string = "x-ms-encrypted-auth-token";
|
|
||||||
public static getReadOnlyKey: string = "x-ms-get-read-only-key";
|
|
||||||
public static connectionString: string = "x-ms-connection-string";
|
|
||||||
public static msDate: string = "x-ms-date";
|
|
||||||
public static location: string = "Location";
|
|
||||||
public static contentType: string = "Content-Type";
|
|
||||||
public static offerReplacePending: string = "x-ms-offer-replace-pending";
|
|
||||||
public static user: string = "x-ms-user";
|
|
||||||
public static populatePartitionStatistics: string = "x-ms-documentdb-populatepartitionstatistics";
|
|
||||||
public static queryMetrics: string = "x-ms-documentdb-query-metrics";
|
|
||||||
public static requestCharge: string = "x-ms-request-charge";
|
|
||||||
public static resourceQuota: string = "x-ms-resource-quota";
|
|
||||||
public static resourceUsage: string = "x-ms-resource-usage";
|
|
||||||
public static retryAfterMs: string = "x-ms-retry-after-ms";
|
|
||||||
public static scriptLogResults: string = "x-ms-documentdb-script-log-results";
|
|
||||||
public static populateCollectionThroughputInfo = "x-ms-documentdb-populatecollectionthroughputinfo";
|
|
||||||
public static supportSpatialLegacyCoordinates = "x-ms-documentdb-supportspatiallegacycoordinates";
|
|
||||||
public static usePolygonsSmallerThanAHemisphere = "x-ms-documentdb-usepolygonssmallerthanahemisphere";
|
|
||||||
public static autoPilotThroughput = "autoscaleSettings";
|
|
||||||
public static autoPilotThroughputSDK = "x-ms-cosmos-offer-autopilot-settings";
|
|
||||||
public static partitionKey: string = "x-ms-documentdb-partitionkey";
|
|
||||||
public static migrateOfferToManualThroughput: string = "x-ms-cosmos-migrate-offer-to-manual-throughput";
|
|
||||||
public static migrateOfferToAutopilot: string = "x-ms-cosmos-migrate-offer-to-autopilot";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ApiType {
|
|
||||||
// Mapped to hexadecimal values in the backend
|
|
||||||
public static readonly MongoDB: number = 1;
|
|
||||||
public static readonly Gremlin: number = 2;
|
|
||||||
public static readonly Cassandra: number = 4;
|
|
||||||
public static readonly Table: number = 8;
|
|
||||||
public static readonly SQL: number = 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class HttpStatusCodes {
|
|
||||||
public static readonly OK: number = 200;
|
|
||||||
public static readonly Created: number = 201;
|
|
||||||
public static readonly Accepted: number = 202;
|
|
||||||
public static readonly NoContent: number = 204;
|
|
||||||
public static readonly NotModified: number = 304;
|
|
||||||
public static readonly Unauthorized: number = 401;
|
|
||||||
public static readonly Forbidden: number = 403;
|
|
||||||
public static readonly NotFound: number = 404;
|
|
||||||
public static readonly TooManyRequests: number = 429;
|
|
||||||
public static readonly Conflict: number = 409;
|
|
||||||
|
|
||||||
public static readonly InternalServerError: number = 500;
|
|
||||||
public static readonly BadGateway: number = 502;
|
|
||||||
public static readonly ServiceUnavailable: number = 503;
|
|
||||||
public static readonly GatewayTimeout: number = 504;
|
|
||||||
|
|
||||||
public static readonly RetryableStatusCodes: number[] = [
|
|
||||||
HttpStatusCodes.TooManyRequests,
|
|
||||||
HttpStatusCodes.InternalServerError, // TODO: Handle all 500s on Portal backend and remove from retries list
|
|
||||||
HttpStatusCodes.BadGateway,
|
|
||||||
HttpStatusCodes.ServiceUnavailable,
|
|
||||||
HttpStatusCodes.GatewayTimeout,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Urls {
|
|
||||||
public static feedbackEmail = "https://aka.ms/cosmosdbfeedback?subject=Cosmos%20DB%20Data%20Explorer%20Feedback";
|
|
||||||
public static autoscaleMigration = "https://aka.ms/cosmos-autoscale-migration";
|
|
||||||
public static freeTierInformation = "https://aka.ms/cosmos-free-tier";
|
|
||||||
public static cosmosPricing = "https://aka.ms/azure-cosmos-db-pricing";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class HashRoutePrefixes {
|
|
||||||
public static databases: string = "/dbs/{db_id}";
|
|
||||||
public static collections: string = "/dbs/{db_id}/colls/{coll_id}";
|
|
||||||
public static sprocHash: string = "/sprocs/";
|
|
||||||
public static sprocs: string = HashRoutePrefixes.collections + HashRoutePrefixes.sprocHash + "{sproc_id}";
|
|
||||||
public static docs: string = HashRoutePrefixes.collections + "/docs/{doc_id}/";
|
|
||||||
public static conflicts: string = HashRoutePrefixes.collections + "/conflicts";
|
|
||||||
|
|
||||||
public static databasesWithId(databaseId: string): string {
|
|
||||||
return this.databases.replace("{db_id}", databaseId).replace("/", ""); // strip the first slash since hasher adds it
|
|
||||||
}
|
|
||||||
|
|
||||||
public static collectionsWithIds(databaseId: string, collectionId: string): string {
|
|
||||||
const transformedDatabasePrefix: string = this.collections.replace("{db_id}", databaseId);
|
|
||||||
|
|
||||||
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("/", ""); // strip the first slash since hasher adds it
|
|
||||||
}
|
|
||||||
|
|
||||||
public static sprocWithIds(
|
|
||||||
databaseId: string,
|
|
||||||
collectionId: string,
|
|
||||||
sprocId: string,
|
|
||||||
stripFirstSlash: boolean = true
|
|
||||||
): string {
|
|
||||||
const transformedDatabasePrefix: string = this.sprocs.replace("{db_id}", databaseId);
|
|
||||||
|
|
||||||
const transformedSprocRoute: string = transformedDatabasePrefix
|
|
||||||
.replace("{coll_id}", collectionId)
|
|
||||||
.replace("{sproc_id}", sprocId);
|
|
||||||
if (!!stripFirstSlash) {
|
|
||||||
return transformedSprocRoute.replace("/", ""); // strip the first slash since hasher adds it
|
|
||||||
}
|
|
||||||
|
|
||||||
return transformedSprocRoute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static conflictsWithIds(databaseId: string, collectionId: string) {
|
|
||||||
const transformedDatabasePrefix: string = this.conflicts.replace("{db_id}", databaseId);
|
|
||||||
|
|
||||||
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("/", ""); // strip the first slash since hasher adds it;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static docsWithIds(databaseId: string, collectionId: string, docId: string) {
|
|
||||||
const transformedDatabasePrefix: string = this.docs.replace("{db_id}", databaseId);
|
|
||||||
|
|
||||||
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("{doc_id}", docId).replace("/", ""); // strip the first slash since hasher adds it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ConfigurationOverridesValues {
|
|
||||||
public static IsBsonSchemaV2: string = "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class KeyCodes {
|
|
||||||
public static Space: number = 32;
|
|
||||||
public static Enter: number = 13;
|
|
||||||
public static Escape: number = 27;
|
|
||||||
public static UpArrow: number = 38;
|
|
||||||
public static DownArrow: number = 40;
|
|
||||||
public static LeftArrow: number = 37;
|
|
||||||
public static RightArrow: number = 39;
|
|
||||||
public static Tab: number = 9;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normalized per: https://www.w3.org/TR/uievents-key/#named-key-attribute-values
|
|
||||||
export class NormalizedEventKey {
|
|
||||||
public static readonly Space = " ";
|
|
||||||
public static readonly Enter = "Enter";
|
|
||||||
public static readonly Escape = "Escape";
|
|
||||||
public static readonly UpArrow = "ArrowUp";
|
|
||||||
public static readonly DownArrow = "ArrowDown";
|
|
||||||
public static readonly LeftArrow = "ArrowLeft";
|
|
||||||
public static readonly RightArrow = "ArrowRight";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TryCosmosExperience {
|
|
||||||
public static extendUrl: string = "https://trycosmosdb.azure.com/api/resource/extendportal?userId={0}";
|
|
||||||
public static deleteUrl: string = "https://trycosmosdb.azure.com/api/resource/deleteportal?userId={0}";
|
|
||||||
public static collectionsPerAccount: number = 3;
|
|
||||||
public static maxRU: number = 5000;
|
|
||||||
public static defaultRU: number = 3000;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OfferVersions {
|
|
||||||
public static V1: string = "V1";
|
|
||||||
public static V2: string = "V2";
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ConflictOperationType {
|
|
||||||
Replace = "replace",
|
|
||||||
Create = "create",
|
|
||||||
Delete = "delete",
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum ConnectionStatusType {
|
|
||||||
Connect = "Connect",
|
|
||||||
Connecting = "Connecting",
|
|
||||||
Connected = "Connected",
|
|
||||||
Failed = "Connection Failed",
|
|
||||||
ReConnect = "Reconnect",
|
|
||||||
}
|
|
||||||
|
|
||||||
export const EmulatorMasterKey =
|
|
||||||
//[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Well known public masterKey for emulator")]
|
|
||||||
"C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==";
|
|
||||||
|
|
||||||
// A variable @MyVariable defined in Constants.less is accessible as StyleConstants.MyVariable
|
|
||||||
export const StyleConstants = require("less-vars-loader!../../less/Common/Constants.less");
|
|
||||||
|
|
||||||
export class Notebook {
|
|
||||||
public static readonly defaultBasePath = "./notebooks";
|
|
||||||
public static readonly heartbeatDelayMs = 60000;
|
|
||||||
public static readonly kernelRestartInitialDelayMs = 1000;
|
|
||||||
public static readonly kernelRestartMaxDelayMs = 20000;
|
|
||||||
public static readonly autoSaveIntervalMs = 120000;
|
|
||||||
public static readonly memoryGuageToGB = 1048576;
|
|
||||||
public static readonly temporarilyDownMsg = "Notebooks is currently not available. We are working on it.";
|
|
||||||
public static readonly mongoShellTemporarilyDownMsg =
|
|
||||||
"We have identified an issue with the Mongo Shell and it is unavailable right now. We are actively working on the mitigation.";
|
|
||||||
public static readonly cassandraShellTemporarilyDownMsg =
|
|
||||||
"We have identified an issue with the Cassandra Shell and it is unavailable right now. We are actively working on the mitigation.";
|
|
||||||
public static saveNotebookModalTitle = "Save Notebook in temporary workspace";
|
|
||||||
public static saveNotebookModalContent =
|
|
||||||
"This notebook will be saved in the temporary workspace and will be removed when the session expires. To save your work permanently, save your notebooks to a GitHub repository or download the notebooks to your local machine before the session ends.";
|
|
||||||
public static newNotebookModalTitle = "Create Notebook in temporary workspace";
|
|
||||||
public static newNotebookUploadModalTitle = "Upload Notebook in temporary workspace";
|
|
||||||
public static newNotebookModalContent1 =
|
|
||||||
"A temporary workspace will be created to enable you to work with notebooks. When the session expires, any notebooks in the workspace will be removed.";
|
|
||||||
public static newNotebookModalContent2 =
|
|
||||||
"To save your work permanently, save your notebooks to a GitHub repository or download the notebooks to your local machine before the session ends. ";
|
|
||||||
public static galleryNotebookDownloadContent1 =
|
|
||||||
"To download, run, and make changes to this sample notebook, a temporary workspace will be created. When the session expires, any notebooks in the workspace will be removed.";
|
|
||||||
public static galleryNotebookDownloadContent2 =
|
|
||||||
"To save your work permanently, save your notebooks to a GitHub repository or download the Notebooks to your local machine before the session ends. ";
|
|
||||||
public static cosmosNotebookHomePageUrl = "https://aka.ms/cosmos-notebooks-limits";
|
|
||||||
public static cosmosNotebookGitDocumentationUrl = "https://aka.ms/cosmos-notebooks-github";
|
|
||||||
public static learnMore = "Learn more.";
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SparkLibrary {
|
|
||||||
public static readonly nameMinLength = 3;
|
|
||||||
public static readonly nameMaxLength = 63;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class AnalyticalStorageTtl {
|
|
||||||
public static readonly Days90: number = 7776000;
|
|
||||||
public static readonly Infinite: number = -1;
|
|
||||||
public static readonly Disabled: number = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TerminalQueryParams {
|
|
||||||
public static readonly Terminal = "terminal";
|
|
||||||
public static readonly Server = "server";
|
|
||||||
public static readonly Token = "token";
|
|
||||||
public static readonly SubscriptionId = "subscriptionId";
|
|
||||||
public static readonly TerminalEndpoint = "terminalEndpoint";
|
|
||||||
}
|
|
||||||
3
src/Common/Constants/AfecFeatures.ts
Normal file
3
src/Common/Constants/AfecFeatures.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const Spark = "spark-public-preview";
|
||||||
|
export const Notebooks = "sparknotebooks-public-preview";
|
||||||
|
export const StorageAnalytics = "storageanalytics-public-preview";
|
||||||
3
src/Common/Constants/AnalyticalStorageTtl.ts
Normal file
3
src/Common/Constants/AnalyticalStorageTtl.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const Days90 = 7776000;
|
||||||
|
export const Infinite = -1;
|
||||||
|
export const Disabled = 0;
|
||||||
2
src/Common/Constants/ApiEndpoints.ts
Normal file
2
src/Common/Constants/ApiEndpoints.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const runtimeProxy = "/api/RuntimeProxy";
|
||||||
|
export const guestRuntimeProxy = "/api/guest/RuntimeProxy";
|
||||||
6
src/Common/Constants/ApiType.ts
Normal file
6
src/Common/Constants/ApiType.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// Mapped to hexadecimal values in the backend
|
||||||
|
export const MongoDB = 1;
|
||||||
|
export const Gremlin = 2;
|
||||||
|
export const Cassandra = 4;
|
||||||
|
export const Table = 8;
|
||||||
|
export const SQL = 16;
|
||||||
5
src/Common/Constants/Areas.ts
Normal file
5
src/Common/Constants/Areas.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const ResourceTree = "Resource Tree";
|
||||||
|
export const ContextualPane = "Contextual Pane";
|
||||||
|
export const Tab = "Tab";
|
||||||
|
export const ShareDialog = "Share Access Dialog";
|
||||||
|
export const Notebook = "Notebook";
|
||||||
6
src/Common/Constants/ArmApiVersions.ts
Normal file
6
src/Common/Constants/ArmApiVersions.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export const documentDB = "2015-11-06";
|
||||||
|
export const arcadia = "2019-06-01-preview";
|
||||||
|
export const arcadiaLivy = "2019-11-01-preview";
|
||||||
|
export const arm = "2015-11-01";
|
||||||
|
export const armFeatures = "2014-08-01-preview";
|
||||||
|
export const publicVersion = "2020-04-01";
|
||||||
2
src/Common/Constants/ArmResourceTypes.ts
Normal file
2
src/Common/Constants/ArmResourceTypes.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const notebookWorkspaces = "Microsoft.DocumentDB/databaseAccounts/notebookWorkspaces";
|
||||||
|
export const synapseWorkspaces = "Microsoft.Synapse/workspaces";
|
||||||
5
src/Common/Constants/BackendDefaults.ts
Normal file
5
src/Common/Constants/BackendDefaults.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const partitionKeyKind = "Hash";
|
||||||
|
export const singlePartitionStorageInGb = "10";
|
||||||
|
export const multiPartitionStorageInGb = "100";
|
||||||
|
export const maxChangeFeedRetentionDuration = 10;
|
||||||
|
export const partitionKeyVersion = 2;
|
||||||
8
src/Common/Constants/CapabilityNames.ts
Normal file
8
src/Common/Constants/CapabilityNames.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const EnableTable = "EnableTable";
|
||||||
|
export const EnableGremlin = "EnableGremlin";
|
||||||
|
export const EnableCassandra = "EnableCassandra";
|
||||||
|
export const EnableAutoScale = "EnableAutoScale";
|
||||||
|
export const EnableNotebooks = "EnableNotebooks";
|
||||||
|
export const EnableStorageAnalytics = "EnableStorageAnalytics";
|
||||||
|
export const EnableMongo = "EnableMongo";
|
||||||
|
export const EnableServerless = "EnableServerless";
|
||||||
9
src/Common/Constants/CassandraBackend.ts
Normal file
9
src/Common/Constants/CassandraBackend.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
// TODO: 435619 Add default endpoints per cloud and use regional only when available
|
||||||
|
export const createOrDeleteApi = "api/cassandra/createordelete";
|
||||||
|
export const guestCreateOrDeleteApi = "api/guest/cassandra/createordelete";
|
||||||
|
export const queryApi = "api/cassandra";
|
||||||
|
export const guestQueryApi = "api/guest/cassandra";
|
||||||
|
export const keysApi = "api/cassandra/keys";
|
||||||
|
export const guestKeysApi = "api/guest/cassandra/keys";
|
||||||
|
export const schemaApi = "api/cassandra/schema";
|
||||||
|
export const guestSchemaApi = "api/guest/cassandra/schema";
|
||||||
9
src/Common/Constants/ClientDefaults.ts
Normal file
9
src/Common/Constants/ClientDefaults.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export const requestTimeoutMs = 60000;
|
||||||
|
export const portalCacheTimeoutMs = 10000;
|
||||||
|
export const errorNotificationTimeoutMs = 5000;
|
||||||
|
export const copyHelperTimeoutMs = 2000;
|
||||||
|
export const waitForDOMElementMs = 500;
|
||||||
|
export const cacheBustingTimeoutMs = 10 /** minutes **/ * 60 /** to seconds **/ * 1000; /** to milliseconds **/
|
||||||
|
export const databaseThroughputIncreaseFactor = 100;
|
||||||
|
export const arcadiaTokenRefreshInterval = 20 /** minutes **/ * 60 /** to seconds **/ * 1000; /** to milliseconds **/
|
||||||
|
export const arcadiaTokenRefreshIntervalPaddingMs = 2000;
|
||||||
3
src/Common/Constants/CodeOfConductEndpoints.ts
Normal file
3
src/Common/Constants/CodeOfConductEndpoints.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const privacyStatement = "https://aka.ms/ms-privacy-policy";
|
||||||
|
export const codeOfConduct = "https://aka.ms/cosmos-code-of-conduct";
|
||||||
|
export const termsOfUse = "https://aka.ms/ms-terms-of-use";
|
||||||
1
src/Common/Constants/ConfigurationOverridesValues.ts
Normal file
1
src/Common/Constants/ConfigurationOverridesValues.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const IsBsonSchemaV2 = "true";
|
||||||
1
src/Common/Constants/CorrelationBackend.ts
Normal file
1
src/Common/Constants/CorrelationBackend.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const Url = "https://aka.ms/cosmosdbanalytics";
|
||||||
8
src/Common/Constants/DocumentsGridMetrics.ts
Normal file
8
src/Common/Constants/DocumentsGridMetrics.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const DocumentsPerPage = 100;
|
||||||
|
export const IndividualRowHeight = 34;
|
||||||
|
export const BufferHeight = 28;
|
||||||
|
export const SplitterMinWidth = 200;
|
||||||
|
export const SplitterMaxWidth = 360;
|
||||||
|
|
||||||
|
export const DocumentEditorMinWidthRatio = 0.2;
|
||||||
|
export const DocumentEditorMaxWidthRatio = 0.4;
|
||||||
8
src/Common/Constants/EndpointsRegex.ts
Normal file
8
src/Common/Constants/EndpointsRegex.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const cassandra = [
|
||||||
|
"AccountEndpoint=(.*).cassandra.cosmosdb.azure.com",
|
||||||
|
"HostName=(.*).cassandra.cosmos.azure.com",
|
||||||
|
];
|
||||||
|
export const mongo = "mongodb://.*:(.*)@(.*).documents.azure.com";
|
||||||
|
export const mongoCompute = "mongodb://.*:(.*)@(.*).mongo.cosmos.azure.com";
|
||||||
|
export const sql = "AccountEndpoint=https://(.*).documents.azure.com";
|
||||||
|
export const table = "TableEndpoint=https://(.*).table.cosmosdb.azure.com";
|
||||||
8
src/Common/Constants/Flights.ts
Normal file
8
src/Common/Constants/Flights.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// flight names returned from the portal are always lowercase
|
||||||
|
export const SettingsV2 = "settingsv2";
|
||||||
|
export const MongoIndexEditor = "mongoindexeditor";
|
||||||
|
export const MongoIndexing = "mongoindexing";
|
||||||
|
export const AutoscaleTest = "autoscaletest";
|
||||||
|
export const PartitionKeyTest = "partitionkeytest";
|
||||||
|
export const PKPartitionKeyTest = "pkpartitionkeytest";
|
||||||
|
export const Phoenix = "phoenix";
|
||||||
40
src/Common/Constants/HashRoutePrefixes.ts
Normal file
40
src/Common/Constants/HashRoutePrefixes.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
export const databases = "/dbs/{db_id}";
|
||||||
|
export const collections = "/dbs/{db_id}/colls/{coll_id}";
|
||||||
|
export const sprocHash = "/sprocs/";
|
||||||
|
export const sprocs = collections + sprocHash + "{sproc_id}";
|
||||||
|
export const docs = collections + "/docs/{doc_id}/";
|
||||||
|
export const conflicts = collections + "/conflicts";
|
||||||
|
|
||||||
|
export const databasesWithId = (databaseId: string) => {
|
||||||
|
return databases.replace("{db_id}", databaseId).replace("/", ""); // strip the first slash since hasher adds it
|
||||||
|
};
|
||||||
|
|
||||||
|
export const collectionsWithIds = (databaseId: string, collectionId: string) => {
|
||||||
|
const transformedDatabasePrefix = collections.replace("{db_id}", databaseId);
|
||||||
|
|
||||||
|
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("/", ""); // strip the first slash since hasher adds it
|
||||||
|
};
|
||||||
|
|
||||||
|
export const sprocWithIds = (databaseId: string, collectionId: string, sprocId: string, stripFirstSlash = true) => {
|
||||||
|
const transformedDatabasePrefix = sprocs.replace("{db_id}", databaseId);
|
||||||
|
|
||||||
|
const transformedSprocRoute = transformedDatabasePrefix
|
||||||
|
.replace("{coll_id}", collectionId)
|
||||||
|
.replace("{sproc_id}", sprocId);
|
||||||
|
if (stripFirstSlash) {
|
||||||
|
return transformedSprocRoute.replace("/", ""); // strip the first slash since hasher adds it
|
||||||
|
}
|
||||||
|
|
||||||
|
return transformedSprocRoute;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const conflictsWithIds = (databaseId: string, collectionId: string) => {
|
||||||
|
const transformedDatabasePrefix = conflicts.replace("{db_id}", databaseId);
|
||||||
|
|
||||||
|
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("/", ""); // strip the first slash since hasher adds it;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const docsWithIds = (databaseId: string, collectionId: string, docId: string): string => {
|
||||||
|
const transformedDatabasePrefix = docs.replace("{db_id}", databaseId);
|
||||||
|
return transformedDatabasePrefix.replace("{coll_id}", collectionId).replace("{doc_id}", docId).replace("/", ""); // strip the first slash since hasher adds it
|
||||||
|
};
|
||||||
30
src/Common/Constants/HttpHeaders.ts
Normal file
30
src/Common/Constants/HttpHeaders.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
export const activityId = "x-ms-activity-id";
|
||||||
|
export const apiType = "x-ms-cosmos-apitype";
|
||||||
|
export const authorization = "authorization";
|
||||||
|
export const collectionIndexTransformationProgress = "x-ms-documentdb-collection-index-transformation-progress";
|
||||||
|
export const continuation = "x-ms-continuation";
|
||||||
|
export const correlationRequestId = "x-ms-correlation-request-id";
|
||||||
|
export const enableScriptLogging = "x-ms-documentdb-script-enable-logging";
|
||||||
|
export const guestAccessToken = "x-ms-encrypted-auth-token";
|
||||||
|
export const getReadOnlyKey = "x-ms-get-read-only-key";
|
||||||
|
export const connectionString = "x-ms-connection-string";
|
||||||
|
export const msDate = "x-ms-date";
|
||||||
|
export const location = "Location";
|
||||||
|
export const contentType = "Content-Type";
|
||||||
|
export const offerReplacePending = "x-ms-offer-replace-pending";
|
||||||
|
export const user = "x-ms-user";
|
||||||
|
export const populatePartitionStatistics = "x-ms-documentdb-populatepartitionstatistics";
|
||||||
|
export const queryMetrics = "x-ms-documentdb-query-metrics";
|
||||||
|
export const requestCharge = "x-ms-request-charge";
|
||||||
|
export const resourceQuota = "x-ms-resource-quota";
|
||||||
|
export const resourceUsage = "x-ms-resource-usage";
|
||||||
|
export const retryAfterMs = "x-ms-retry-after-ms";
|
||||||
|
export const scriptLogResults = "x-ms-documentdb-script-log-results";
|
||||||
|
export const populateCollectionThroughputInfo = "x-ms-documentdb-populatecollectionthroughputinfo";
|
||||||
|
export const supportSpatialLegacyCoordinates = "x-ms-documentdb-supportspatiallegacycoordinates";
|
||||||
|
export const usePolygonsSmallerThanAHemisphere = "x-ms-documentdb-usepolygonssmallerthanahemisphere";
|
||||||
|
export const autoPilotThroughput = "autoscaleSettings";
|
||||||
|
export const autoPilotThroughputSDK = "x-ms-cosmos-offer-autopilot-settings";
|
||||||
|
export const partitionKey = "x-ms-documentdb-partitionkey";
|
||||||
|
export const migrateOfferToManualThroughput = "x-ms-cosmos-migrate-offer-to-manual-throughput";
|
||||||
|
export const migrateOfferToAutopilot = "x-ms-cosmos-migrate-offer-to-autopilot";
|
||||||
23
src/Common/Constants/HttpStatusCodes.ts
Normal file
23
src/Common/Constants/HttpStatusCodes.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
export const OK = 200;
|
||||||
|
export const Created = 201;
|
||||||
|
export const Accepted = 202;
|
||||||
|
export const NoContent = 204;
|
||||||
|
export const NotModified = 304;
|
||||||
|
export const Unauthorized = 401;
|
||||||
|
export const Forbidden = 403;
|
||||||
|
export const NotFound = 404;
|
||||||
|
export const TooManyRequests = 429;
|
||||||
|
export const Conflict = 409;
|
||||||
|
|
||||||
|
export const InternalServerError = 500;
|
||||||
|
export const BadGateway = 502;
|
||||||
|
export const ServiceUnavailable = 503;
|
||||||
|
export const GatewayTimeout = 504;
|
||||||
|
|
||||||
|
export const RetryableStatusCodes: number[] = [
|
||||||
|
TooManyRequests,
|
||||||
|
InternalServerError, // TODO: Handle all 500s on Portal backend and remove from retries list
|
||||||
|
BadGateway,
|
||||||
|
ServiceUnavailable,
|
||||||
|
GatewayTimeout,
|
||||||
|
];
|
||||||
8
src/Common/Constants/KeyCodes.ts
Normal file
8
src/Common/Constants/KeyCodes.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const Space = 32;
|
||||||
|
export const Enter = 13;
|
||||||
|
export const Escape = 27;
|
||||||
|
export const UpArrow = 38;
|
||||||
|
export const DownArrow = 40;
|
||||||
|
export const LeftArrow = 37;
|
||||||
|
export const RightArrow = 39;
|
||||||
|
export const Tab = 9;
|
||||||
2
src/Common/Constants/MongoDBAccounts.ts
Normal file
2
src/Common/Constants/MongoDBAccounts.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const protocol = "https";
|
||||||
|
export const defaultPort = "10255";
|
||||||
8
src/Common/Constants/NormalizedEventKey.ts
Normal file
8
src/Common/Constants/NormalizedEventKey.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Normalized per: https://www.w3.org/TR/uievents-key/#named-key-attribute-values
|
||||||
|
export const Space = " ";
|
||||||
|
export const Enter = "Enter";
|
||||||
|
export const Escape = "Escape";
|
||||||
|
export const UpArrow = "ArrowUp";
|
||||||
|
export const DownArrow = "ArrowDown";
|
||||||
|
export const LeftArrow = "ArrowLeft";
|
||||||
|
export const RightArrow = "ArrowRight";
|
||||||
27
src/Common/Constants/Notebook.ts
Normal file
27
src/Common/Constants/Notebook.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
export const defaultBasePath = "./notebooks";
|
||||||
|
export const heartbeatDelayMs = 60000;
|
||||||
|
export const kernelRestartInitialDelayMs = 1000;
|
||||||
|
export const kernelRestartMaxDelayMs = 20000;
|
||||||
|
export const autoSaveIntervalMs = 120000;
|
||||||
|
export const memoryGuageToGB = 1048576;
|
||||||
|
export const temporarilyDownMsg = "Notebooks is currently not available. We are working on it.";
|
||||||
|
export const mongoShellTemporarilyDownMsg =
|
||||||
|
"We have identified an issue with the Mongo Shell and it is unavailable right now. We are actively working on the mitigation.";
|
||||||
|
export const cassandraShellTemporarilyDownMsg =
|
||||||
|
"We have identified an issue with the Cassandra Shell and it is unavailable right now. We are actively working on the mitigation.";
|
||||||
|
export const saveNotebookModalTitle = "Save Notebook in temporary workspace";
|
||||||
|
export const saveNotebookModalContent =
|
||||||
|
"This notebook will be saved in the temporary workspace and will be removed when the session expires. To save your work permanently, save your notebooks to a GitHub repository or download the notebooks to your local machine before the session ends.";
|
||||||
|
export const newNotebookModalTitle = "Create Notebook in temporary workspace";
|
||||||
|
export const newNotebookUploadModalTitle = "Upload Notebook in temporary workspace";
|
||||||
|
export const newNotebookModalContent1 =
|
||||||
|
"A temporary workspace will be created to enable you to work with notebooks. When the session expires, any notebooks in the workspace will be removed.";
|
||||||
|
export const newNotebookModalContent2 =
|
||||||
|
"To save your work permanently, save your notebooks to a GitHub repository or download the notebooks to your local machine before the session ends. ";
|
||||||
|
export const galleryNotebookDownloadContent1 =
|
||||||
|
"To download, run, and make changes to this sample notebook, a temporary workspace will be created. When the session expires, any notebooks in the workspace will be removed.";
|
||||||
|
export const galleryNotebookDownloadContent2 =
|
||||||
|
"To save your work permanently, save your notebooks to a GitHub repository or download the Notebooks to your local machine before the session ends. ";
|
||||||
|
export const cosmosNotebookHomePageUrl = "https://aka.ms/cosmos-notebooks-limits";
|
||||||
|
export const cosmosNotebookGitDocumentationUrl = "https://aka.ms/cosmos-notebooks-github";
|
||||||
|
export const learnMore = "Learn more.";
|
||||||
2
src/Common/Constants/OfferVersions.ts
Normal file
2
src/Common/Constants/OfferVersions.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const V1 = "V1";
|
||||||
|
export const V2 = "V2";
|
||||||
8
src/Common/Constants/Queries.ts
Normal file
8
src/Common/Constants/Queries.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export const CustomPageOption = "custom";
|
||||||
|
export const UnlimitedPageOption = "unlimited";
|
||||||
|
export const itemsPerPage = 100;
|
||||||
|
export const unlimitedItemsPerPage = 100; // TODO: Figure out appropriate value so it works for accounts with a large number of partitions
|
||||||
|
|
||||||
|
export const QueryEditorMinHeightRatio = 0.1;
|
||||||
|
export const QueryEditorMaxHeightRatio = 0.4;
|
||||||
|
export const DefaultMaxDegreeOfParallelism = 6;
|
||||||
4
src/Common/Constants/SavedQueries.ts
Normal file
4
src/Common/Constants/SavedQueries.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const CollectionName = "___Query";
|
||||||
|
export const DatabaseName = "___Cosmos";
|
||||||
|
export const OfferThroughput = 400;
|
||||||
|
export const PartitionKeyProperty = "id";
|
||||||
6
src/Common/Constants/ServerIds.ts
Normal file
6
src/Common/Constants/ServerIds.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export const localhost = "localhost";
|
||||||
|
export const blackforest = "blackforest";
|
||||||
|
export const fairfax = "fairfax";
|
||||||
|
export const mooncake = "mooncake";
|
||||||
|
export const productionPortal = "prod";
|
||||||
|
export const dev = "dev";
|
||||||
2
src/Common/Constants/SparkLibrary.ts
Normal file
2
src/Common/Constants/SparkLibrary.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export const nameMinLength = 3;
|
||||||
|
export const nameMaxLength = 63;
|
||||||
1
src/Common/Constants/TagNames.ts
Normal file
1
src/Common/Constants/TagNames.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const defaultExperience = "defaultExperience";
|
||||||
5
src/Common/Constants/TerminalQueryParams.ts
Normal file
5
src/Common/Constants/TerminalQueryParams.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const Terminal = "terminal";
|
||||||
|
export const Server = "server";
|
||||||
|
export const Token = "token";
|
||||||
|
export const SubscriptionId = "subscriptionId";
|
||||||
|
export const TerminalEndpoint = "terminalEndpoint";
|
||||||
5
src/Common/Constants/TryCosmosExperience.ts
Normal file
5
src/Common/Constants/TryCosmosExperience.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export const extendUrl = "https://trycosmosdb.azure.com/api/resource/extendportal?userId={0}";
|
||||||
|
export const deleteUrl = "https://trycosmosdb.azure.com/api/resource/deleteportal?userId={0}";
|
||||||
|
export const collectionsPerAccount = 3;
|
||||||
|
export const maxRU = 5000;
|
||||||
|
export const defaultRU = 3000;
|
||||||
4
src/Common/Constants/Urls.ts
Normal file
4
src/Common/Constants/Urls.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export const feedbackEmail = "https://aka.ms/cosmosdbfeedback?subject=Cosmos%20DB%20Data%20Explorer%20Feedback";
|
||||||
|
export const autoscaleMigration = "https://aka.ms/cosmos-autoscale-migration";
|
||||||
|
export const freeTierInformation = "https://aka.ms/cosmos-free-tier";
|
||||||
|
export const cosmosPricing = "https://aka.ms/azure-cosmos-db-pricing";
|
||||||
105
src/Common/Constants/index.ts
Normal file
105
src/Common/Constants/index.ts
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
import * as AfecFeatures from "./AfecFeatures";
|
||||||
|
import * as AnalyticalStorageTtl from "./AnalyticalStorageTtl";
|
||||||
|
import * as ApiEndpoints from "./ApiEndpoints";
|
||||||
|
import * as ApiType from "./ApiType";
|
||||||
|
import * as Areas from "./Areas";
|
||||||
|
import * as ArmApiVersions from "./ArmApiVersions";
|
||||||
|
import * as ArmResourceTypes from "./ArmResourceTypes";
|
||||||
|
import * as BackendDefaults from "./BackendDefaults";
|
||||||
|
import * as CapabilityNames from "./CapabilityNames";
|
||||||
|
import * as CassandraBackend from "./CassandraBackend";
|
||||||
|
import * as ClientDefaults from "./ClientDefaults";
|
||||||
|
import * as CodeOfConductEndpoints from "./CodeOfConductEndpoints";
|
||||||
|
import * as ConfigurationOverridesValues from "./ConfigurationOverridesValues";
|
||||||
|
import * as CorrelationBackend from "./CorrelationBackend";
|
||||||
|
import * as DocumentsGridMetrics from "./DocumentsGridMetrics";
|
||||||
|
import * as EndpointsRegex from "./EndpointsRegex";
|
||||||
|
import * as Flights from "./Flights";
|
||||||
|
import * as HashRoutePrefixes from "./HashRoutePrefixes";
|
||||||
|
import * as HttpHeaders from "./HttpHeaders";
|
||||||
|
import * as HttpStatusCodes from "./HttpStatusCodes";
|
||||||
|
import * as KeyCodes from "./KeyCodes";
|
||||||
|
import * as MongoDBAccounts from "./MongoDBAccounts";
|
||||||
|
import * as NormalizedEventKey from "./NormalizedEventKey";
|
||||||
|
import * as Notebook from "./Notebook";
|
||||||
|
import * as OfferVersions from "./OfferVersions";
|
||||||
|
import * as Queries from "./Queries";
|
||||||
|
import * as SavedQueries from "./SavedQueries";
|
||||||
|
import * as ServerIds from "./ServerIds";
|
||||||
|
import * as SparkLibrary from "./SparkLibrary";
|
||||||
|
import * as TagNames from "./TagNames";
|
||||||
|
import * as TerminalQueryParams from "./TerminalQueryParams";
|
||||||
|
import * as TryCosmosExperience from "./TryCosmosExperience";
|
||||||
|
import * as Urls from "./Urls";
|
||||||
|
|
||||||
|
const StyleConstants = require("less-vars-loader!../../../less/Common/Constants.less");
|
||||||
|
|
||||||
|
export {
|
||||||
|
StyleConstants,
|
||||||
|
SparkLibrary,
|
||||||
|
ConfigurationOverridesValues,
|
||||||
|
OfferVersions,
|
||||||
|
AnalyticalStorageTtl,
|
||||||
|
Notebook,
|
||||||
|
TryCosmosExperience,
|
||||||
|
NormalizedEventKey,
|
||||||
|
KeyCodes,
|
||||||
|
HashRoutePrefixes,
|
||||||
|
Urls,
|
||||||
|
HttpStatusCodes,
|
||||||
|
ApiType,
|
||||||
|
HttpHeaders,
|
||||||
|
Areas,
|
||||||
|
DocumentsGridMetrics,
|
||||||
|
SavedQueries,
|
||||||
|
Queries,
|
||||||
|
CassandraBackend,
|
||||||
|
MongoDBAccounts,
|
||||||
|
TagNames,
|
||||||
|
AfecFeatures,
|
||||||
|
Flights,
|
||||||
|
CorrelationBackend,
|
||||||
|
CapabilityNames,
|
||||||
|
ClientDefaults,
|
||||||
|
BackendDefaults,
|
||||||
|
ArmResourceTypes,
|
||||||
|
ArmApiVersions,
|
||||||
|
TerminalQueryParams,
|
||||||
|
CodeOfConductEndpoints,
|
||||||
|
ApiEndpoints,
|
||||||
|
EndpointsRegex,
|
||||||
|
ServerIds,
|
||||||
|
};
|
||||||
|
|
||||||
|
export enum ConnectionStatusType {
|
||||||
|
Connect = "Connect",
|
||||||
|
Connecting = "Connecting",
|
||||||
|
Connected = "Connected",
|
||||||
|
Failed = "Connection Failed",
|
||||||
|
ReConnect = "Reconnect",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ConflictOperationType {
|
||||||
|
Replace = "replace",
|
||||||
|
Create = "create",
|
||||||
|
Delete = "delete",
|
||||||
|
}
|
||||||
|
|
||||||
|
export const EmulatorMasterKey =
|
||||||
|
//[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Well known public masterKey for emulator")]
|
||||||
|
"C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==";
|
||||||
|
|
||||||
|
// A variable @MyVariable defined in Constants.less is accessible as StyleConstants.MyVariable
|
||||||
|
|
||||||
|
export enum AccountKind {
|
||||||
|
DocumentDB = "DocumentDB",
|
||||||
|
MongoDB = "MongoDB",
|
||||||
|
Parse = "Parse",
|
||||||
|
GlobalDocumentDB = "GlobalDocumentDB",
|
||||||
|
Default = "DocumentDB",
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum MongoBackendEndpointType {
|
||||||
|
local,
|
||||||
|
remote,
|
||||||
|
}
|
||||||
@@ -80,8 +80,7 @@ export function queryDocuments(
|
|||||||
};
|
};
|
||||||
|
|
||||||
const endpoint = getFeatureEndpointOrDefault("resourcelist") || "";
|
const endpoint = getFeatureEndpointOrDefault("resourcelist") || "";
|
||||||
|
const headers: HeadersInit = {
|
||||||
const headers = {
|
|
||||||
...defaultHeaders,
|
...defaultHeaders,
|
||||||
...authHeaders(),
|
...authHeaders(),
|
||||||
[CosmosSDKConstants.HttpHeaders.IsQuery]: "true",
|
[CosmosSDKConstants.HttpHeaders.IsQuery]: "true",
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export class LeftPaneComponent extends React.Component<LeftPaneComponentProps> {
|
|||||||
className={className}
|
className={className}
|
||||||
as="tr"
|
as="tr"
|
||||||
aria-label={node.caption}
|
aria-label={node.caption}
|
||||||
onActivated={() => this.props.onRootNodeSelected(node.id)}
|
onActivated={(e) => this.props.onRootNodeSelected(node.id)}
|
||||||
key={node.id}
|
key={node.id}
|
||||||
>
|
>
|
||||||
<td className="resultItem">
|
<td className="resultItem">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import React from "react";
|
||||||
import { mount, ReactWrapper } from "enzyme";
|
import { mount, ReactWrapper } from "enzyme";
|
||||||
import * as Q from "q";
|
import * as Q from "q";
|
||||||
import React from "react";
|
import { NodePropertiesComponent, NodePropertiesComponentProps, Mode } from "./NodePropertiesComponent";
|
||||||
import { GraphHighlightedNodeData, PossibleVertex } from "./GraphExplorer";
|
import { GraphHighlightedNodeData, EditedProperties, EditedEdges, PossibleVertex } from "./GraphExplorer";
|
||||||
import { Mode, NodePropertiesComponent, NodePropertiesComponentProps } from "./NodePropertiesComponent";
|
|
||||||
|
|
||||||
describe("Property pane", () => {
|
describe("Property pane", () => {
|
||||||
const title = "My Title";
|
const title = "My Title";
|
||||||
@@ -37,18 +37,17 @@ describe("Property pane", () => {
|
|||||||
return {
|
return {
|
||||||
expandedTitle: title,
|
expandedTitle: title,
|
||||||
isCollapsed: false,
|
isCollapsed: false,
|
||||||
onCollapsedChanged: jest.fn(),
|
onCollapsedChanged: (newValue: boolean): void => {},
|
||||||
node: highlightedNode,
|
node: highlightedNode,
|
||||||
getPkIdFromNodeData: (): string => undefined,
|
getPkIdFromNodeData: (v: GraphHighlightedNodeData): string => null,
|
||||||
collectionPartitionKeyProperty: undefined,
|
collectionPartitionKeyProperty: null,
|
||||||
updateVertexProperties: (): Q.Promise<void> => Q.resolve(),
|
updateVertexProperties: (editedProperties: EditedProperties): Q.Promise<void> => Q.resolve(),
|
||||||
selectNode: jest.fn(),
|
selectNode: (id: string): void => {},
|
||||||
updatePossibleVertices: (): Q.Promise<PossibleVertex[]> => Q.resolve(undefined),
|
updatePossibleVertices: (): Q.Promise<PossibleVertex[]> => Q.resolve(null),
|
||||||
possibleEdgeLabels: undefined,
|
possibleEdgeLabels: null,
|
||||||
//eslint-disable-next-line
|
editGraphEdges: (editedEdges: EditedEdges): Q.Promise<any> => Q.resolve(),
|
||||||
editGraphEdges: (): Q.Promise<any> => Q.resolve(),
|
deleteHighlightedNode: (): void => {},
|
||||||
deleteHighlightedNode: jest.fn(),
|
onModeChanged: (newMode: Mode): void => {},
|
||||||
onModeChanged: jest.fn(),
|
|
||||||
viewMode: Mode.READONLY_PROP,
|
viewMode: Mode.READONLY_PROP,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export class NodePropertiesComponent extends React.Component<
|
|||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
editedProperties: {
|
editedProperties: {
|
||||||
pkId: undefined,
|
pkId: null,
|
||||||
readOnlyProperties: [],
|
readOnlyProperties: [],
|
||||||
existingProperties: [],
|
existingProperties: [],
|
||||||
addedProperties: [],
|
addedProperties: [],
|
||||||
@@ -98,12 +98,15 @@ export class NodePropertiesComponent extends React.Component<
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getDerivedStateFromProps(props: NodePropertiesComponentProps): Partial<NodePropertiesComponentState> {
|
public static getDerivedStateFromProps(
|
||||||
|
props: NodePropertiesComponentProps,
|
||||||
|
state: NodePropertiesComponentState
|
||||||
|
): Partial<NodePropertiesComponentState> {
|
||||||
if (props.viewMode !== Mode.READONLY_PROP) {
|
if (props.viewMode !== Mode.READONLY_PROP) {
|
||||||
return { isDeleteConfirm: false };
|
return { isDeleteConfirm: false };
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
@@ -135,10 +138,10 @@ export class NodePropertiesComponent extends React.Component<
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
private static getTypeOption(value: any): ViewModels.InputPropertyValueTypeString {
|
private static getTypeOption(value: any): ViewModels.InputPropertyValueTypeString {
|
||||||
if (value === undefined) {
|
if (value == null) {
|
||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
const type = typeof value;
|
let type = typeof value;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "number":
|
case "number":
|
||||||
case "boolean":
|
case "boolean":
|
||||||
@@ -169,9 +172,10 @@ export class NodePropertiesComponent extends React.Component<
|
|||||||
];
|
];
|
||||||
|
|
||||||
const existingProps: ViewModels.InputProperty[] = [];
|
const existingProps: ViewModels.InputProperty[] = [];
|
||||||
|
|
||||||
if (this.props.node.hasOwnProperty("properties")) {
|
if (this.props.node.hasOwnProperty("properties")) {
|
||||||
const hProps = this.props.node["properties"];
|
const hProps = this.props.node["properties"];
|
||||||
for (const p in hProps) {
|
for (let p in hProps) {
|
||||||
const propValues = hProps[p];
|
const propValues = hProps[p];
|
||||||
(p === partitionKeyProperty ? readOnlyProps : existingProps).push({
|
(p === partitionKeyProperty ? readOnlyProps : existingProps).push({
|
||||||
key: p,
|
key: p,
|
||||||
@@ -433,7 +437,7 @@ export class NodePropertiesComponent extends React.Component<
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import * as React from "react";
|
|||||||
import { useFullScreenURLs } from "../hooks/useFullScreenURLs";
|
import { useFullScreenURLs } from "../hooks/useFullScreenURLs";
|
||||||
|
|
||||||
export const OpenFullScreen: React.FunctionComponent = () => {
|
export const OpenFullScreen: React.FunctionComponent = () => {
|
||||||
const [isReadUrlCopy, setIsReadUrlCopy] = React.useState<boolean>(false);
|
|
||||||
const [isReadWriteUrlCopy, setIsReadWriteUrlCopy] = React.useState<boolean>(false);
|
|
||||||
const result = useFullScreenURLs();
|
const result = useFullScreenURLs();
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return <Spinner label="Generating URLs..." ariaLive="assertive" labelPosition="right" />;
|
return <Spinner label="Generating URLs..." ariaLive="assertive" labelPosition="right" />;
|
||||||
@@ -27,9 +25,8 @@ export const OpenFullScreen: React.FunctionComponent = () => {
|
|||||||
<DefaultButton
|
<DefaultButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
copyToClipboard(readWriteUrl);
|
copyToClipboard(readWriteUrl);
|
||||||
setIsReadWriteUrlCopy(true);
|
|
||||||
}}
|
}}
|
||||||
text={isReadWriteUrlCopy ? "Copied" : "Copy"}
|
text="Copy"
|
||||||
iconProps={{ iconName: "Copy" }}
|
iconProps={{ iconName: "Copy" }}
|
||||||
/>
|
/>
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
@@ -44,10 +41,9 @@ export const OpenFullScreen: React.FunctionComponent = () => {
|
|||||||
<Stack horizontal tokens={{ childrenGap: 10 }}>
|
<Stack horizontal tokens={{ childrenGap: 10 }}>
|
||||||
<DefaultButton
|
<DefaultButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsReadUrlCopy(true);
|
|
||||||
copyToClipboard(readUrl);
|
copyToClipboard(readUrl);
|
||||||
}}
|
}}
|
||||||
text={isReadUrlCopy ? "Copied" : "Copy"}
|
text="Copy"
|
||||||
iconProps={{ iconName: "Copy" }}
|
iconProps={{ iconName: "Copy" }}
|
||||||
/>
|
/>
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCloseTabButtonClick(): Q.Promise<void> {
|
public onCloseTabButtonClick(): Q.Promise<any> {
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
this.notebookComponentAdapter.notebookShutdown();
|
this.notebookComponentAdapter.notebookShutdown();
|
||||||
super.onCloseTabButtonClick();
|
super.onCloseTabButtonClick();
|
||||||
@@ -78,7 +78,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async reconfigureServiceEndpoints(): Promise<void> {
|
public async reconfigureServiceEndpoints() {
|
||||||
if (!this.notebookComponentAdapter) {
|
if (!this.notebookComponentAdapter) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
const saveButtonChildren = [];
|
const saveButtonChildren = [];
|
||||||
if (this.container.notebookManager?.gitHubOAuthService.isLoggedIn()) {
|
if (this.container.notebookManager?.gitHubOAuthService.isLoggedIn()) {
|
||||||
saveButtonChildren.push({
|
saveButtonChildren.push({
|
||||||
iconName: copyToLabel,
|
iconName: "Copy",
|
||||||
onCommandClick: () => this.copyNotebook(),
|
onCommandClick: () => this.copyNotebook(),
|
||||||
commandButtonLabel: copyToLabel,
|
commandButtonLabel: copyToLabel,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
@@ -136,7 +136,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
ariaLabel: publishLabel,
|
ariaLabel: publishLabel,
|
||||||
});
|
});
|
||||||
|
|
||||||
const buttons: CommandButtonComponentProps[] = [
|
let buttons: CommandButtonComponentProps[] = [
|
||||||
{
|
{
|
||||||
iconSrc: SaveIcon,
|
iconSrc: SaveIcon,
|
||||||
iconAlt: saveLabel,
|
iconAlt: saveLabel,
|
||||||
@@ -160,7 +160,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
{
|
{
|
||||||
iconSrc: null,
|
iconSrc: null,
|
||||||
iconAlt: kernelLabel,
|
iconAlt: kernelLabel,
|
||||||
onCommandClick: () => undefined,
|
onCommandClick: () => {},
|
||||||
commandButtonLabel: null,
|
commandButtonLabel: null,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
disabled: availableKernels.length < 1,
|
disabled: availableKernels.length < 1,
|
||||||
@@ -271,7 +271,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
{
|
{
|
||||||
iconSrc: null,
|
iconSrc: null,
|
||||||
iconAlt: null,
|
iconAlt: null,
|
||||||
onCommandClick: () => undefined,
|
onCommandClick: () => {},
|
||||||
commandButtonLabel: null,
|
commandButtonLabel: null,
|
||||||
ariaLabel: cellTypeLabel,
|
ariaLabel: cellTypeLabel,
|
||||||
hasPopup: false,
|
hasPopup: false,
|
||||||
@@ -361,7 +361,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private onKernelUpdate = async () => {
|
private onKernelUpdate = async () => {
|
||||||
await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch(() => {
|
await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch((reason) => {
|
||||||
/* Erroring is ok here */
|
/* Erroring is ok here */
|
||||||
});
|
});
|
||||||
this.updateNavbarWithTabsButtons();
|
this.updateNavbarWithTabsButtons();
|
||||||
|
|||||||
@@ -25,12 +25,11 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
public errors: ko.ObservableArray<ViewModels.QueryError>;
|
public errors: ko.ObservableArray<ViewModels.QueryError>;
|
||||||
public statusMessge: ko.Observable<string>;
|
public statusMessge: ko.Observable<string>;
|
||||||
public statusIcon: ko.Observable<string>;
|
public statusIcon: ko.Observable<string>;
|
||||||
public formFields: ko.ObservableArray<ViewModels.Editable<unknown>>;
|
public formFields: ko.ObservableArray<ViewModels.Editable<any>>;
|
||||||
public formIsValid: ko.Computed<boolean>;
|
public formIsValid: ko.Computed<boolean>;
|
||||||
public formIsDirty: ko.Computed<boolean>;
|
public formIsDirty: ko.Computed<boolean>;
|
||||||
public isNew: ko.Observable<boolean>;
|
public isNew: ko.Observable<boolean>;
|
||||||
// TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct.
|
// TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
public resource: ko.Observable<any>;
|
public resource: ko.Observable<any>;
|
||||||
public isTemplateReady: ko.Observable<boolean>;
|
public isTemplateReady: ko.Observable<boolean>;
|
||||||
protected _partitionKey: DataModels.PartitionKey;
|
protected _partitionKey: DataModels.PartitionKey;
|
||||||
@@ -86,6 +85,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid);
|
this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ViewModels.ScriptEditorState.exisitingDirtyValid:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -182,7 +182,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
this.editorContent.setBaseline(resource.body);
|
this.editorContent.setBaseline(resource.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
public setBaselines(): void {
|
public setBaselines() {
|
||||||
this._setBaselines();
|
this._setBaselines();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,9 +194,9 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract onSaveClick: () => void;
|
public abstract onSaveClick: () => void;
|
||||||
public abstract onUpdateClick: () => Promise<void>;
|
public abstract onUpdateClick: () => Promise<any>;
|
||||||
|
|
||||||
public onDiscard = (): Q.Promise<void> => {
|
public onDiscard = (): Q.Promise<any> => {
|
||||||
this.setBaselines();
|
this.setBaselines();
|
||||||
const original = this.editorContent.getEditableOriginalValue();
|
const original = this.editorContent.getEditableOriginalValue();
|
||||||
const editorModel = this.editor() && this.editor().getModel();
|
const editorModel = this.editor() && this.editor().getModel();
|
||||||
@@ -289,7 +289,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
return !!value;
|
return !!value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async _createBodyEditor(): Promise<void> {
|
protected async _createBodyEditor() {
|
||||||
const id = this.editorId;
|
const id = this.editorId;
|
||||||
const container = document.getElementById(id);
|
const container = document.getElementById(id);
|
||||||
const options = {
|
const options = {
|
||||||
@@ -308,7 +308,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
|||||||
editorModel.onDidChangeContent(this._onBodyContentChange.bind(this));
|
editorModel.onDidChangeContent(this._onBodyContentChange.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _onBodyContentChange() {
|
private _onBodyContentChange(e: monaco.editor.IModelContentChangedEvent) {
|
||||||
const editorModel = this.editor().getModel();
|
const editorModel = this.editor().getModel();
|
||||||
this.editorContent(editorModel.getValue());
|
this.editorContent(editorModel.getValue());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
"./src/Bindings/ReactBindingHandler.ts",
|
"./src/Bindings/ReactBindingHandler.ts",
|
||||||
"./src/Common/ArrayHashMap.ts",
|
"./src/Common/ArrayHashMap.ts",
|
||||||
"./src/Common/CollapsedResourceTree.tsx",
|
"./src/Common/CollapsedResourceTree.tsx",
|
||||||
"./src/Common/Constants.ts",
|
|
||||||
"./src/Common/DeleteFeedback.ts",
|
"./src/Common/DeleteFeedback.ts",
|
||||||
"./src/Common/DocumentUtility.ts",
|
"./src/Common/DocumentUtility.ts",
|
||||||
"./src/Common/EnvironmentUtility.ts",
|
"./src/Common/EnvironmentUtility.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user