mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Update to ADO 5ed9b2130da7f822153531489d802c28986f5d30
This commit is contained in:
@@ -13,13 +13,13 @@ import EnvironmentUtility from "../../Common/EnvironmentUtility";
|
||||
import Q from "q";
|
||||
import TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor";
|
||||
import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants";
|
||||
import { config, Platform } from "../../Config";
|
||||
import { ContextualPaneBase } from "./ContextualPaneBase";
|
||||
import { CosmosClient } from "../../Common/CosmosClient";
|
||||
import { createMongoCollectionWithARM, createMongoCollectionWithProxy } from "../../Common/MongoProxyClient";
|
||||
import { DynamicListItem } from "../Controls/DynamicList/DynamicListComponent";
|
||||
import { HashMap } from "../../Common/HashMap";
|
||||
import { PlatformType } from "../../PlatformType";
|
||||
import { config, Platform } from "../../Config";
|
||||
|
||||
export default class AddCollectionPane extends ContextualPaneBase implements ViewModels.AddCollectionPane {
|
||||
public defaultExperience: ko.Computed<string>;
|
||||
@@ -832,7 +832,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
const isAadUser = EnvironmentUtility.isAadUser();
|
||||
|
||||
// note: v3 autopilot not supported yet for Mongo fixed collections (only tier supported)
|
||||
if (!isAadUser || isFixedCollectionWithSharedThroughputBeingCreated) {
|
||||
if (!isAadUser) {
|
||||
createCollectionFunc = () =>
|
||||
Q(
|
||||
createMongoCollectionWithProxy(
|
||||
@@ -853,6 +853,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
this.container.armEndpoint(),
|
||||
databaseId,
|
||||
this._getAnalyticalStorageTtl(),
|
||||
isFixedCollectionWithSharedThroughputBeingCreated,
|
||||
collectionId,
|
||||
offerThroughput,
|
||||
partitionKeyPath,
|
||||
@@ -1007,14 +1008,14 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
this.uniqueKeys([]);
|
||||
this.useIndexingForSharedThroughput(true);
|
||||
|
||||
const subscriptionType = this.container.subscriptionType();
|
||||
const flight = this.container.flight();
|
||||
const defaultStorage = AddCollectionUtility.Utilities.getDefaultStorage(flight, subscriptionType);
|
||||
const defaultStorage = this.container.collectionCreationDefaults.storage;
|
||||
this.storage(defaultStorage);
|
||||
|
||||
const defaultThroughput = AddCollectionUtility.Utilities.getDefaultThroughput(flight, subscriptionType);
|
||||
const defaultThroughput = this.container.collectionCreationDefaults.throughput;
|
||||
this.throughputSinglePartition(defaultThroughput.fixed);
|
||||
this.throughputMultiPartition(defaultThroughput.unlimited(this.container));
|
||||
this.throughputMultiPartition(
|
||||
AddCollectionUtility.Utilities.getMaxThroughput(this.container.collectionCreationDefaults, this.container)
|
||||
);
|
||||
|
||||
this.throughputDatabase(defaultThroughput.shared);
|
||||
this.databaseCreateNew(true);
|
||||
@@ -1211,7 +1212,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
) {
|
||||
return !this.hasAutoPilotV2FeatureFlag()
|
||||
? {
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: `{ "maxThroughput": ${this.sharedAutoPilotThroughput() * 1} }`
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: { maxThroughput: this.sharedAutoPilotThroughput() * 1 }
|
||||
}
|
||||
: { [Constants.HttpHeaders.autoPilotTier]: this.selectedSharedAutoPilotTier().toString() };
|
||||
}
|
||||
@@ -1221,7 +1222,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
) {
|
||||
return !this.hasAutoPilotV2FeatureFlag()
|
||||
? {
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: `{ "maxThroughput": ${this.autoPilotThroughput() * 1} }`
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: { maxThroughput: this.autoPilotThroughput() * 1 }
|
||||
}
|
||||
: { [Constants.HttpHeaders.autoPilotTier]: this.selectedAutoPilotTier().toString() };
|
||||
}
|
||||
@@ -1268,12 +1269,16 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
}
|
||||
|
||||
private _updateThroughputLimitByCollectionStorage() {
|
||||
const subscriptionType = this.container.subscriptionType();
|
||||
const flight = this.container.flight();
|
||||
const storage = this.storage();
|
||||
const minThroughputRU = AddCollectionUtility.Utilities.getMinRUForStorageOption(subscriptionType, flight, storage);
|
||||
const minThroughputRU = AddCollectionUtility.Utilities.getMinRUForStorageOption(
|
||||
this.container.collectionCreationDefaults,
|
||||
storage
|
||||
);
|
||||
|
||||
let maxThroughputRU = AddCollectionUtility.Utilities.getMaxRUForStorageOption(subscriptionType, flight, storage);
|
||||
let maxThroughputRU = AddCollectionUtility.Utilities.getMaxRUForStorageOption(
|
||||
this.container.collectionCreationDefaults,
|
||||
storage
|
||||
);
|
||||
if (this.isTryCosmosDBSubscription()) {
|
||||
maxThroughputRU = Constants.TryCosmosExperience.maxRU;
|
||||
}
|
||||
@@ -1283,10 +1288,7 @@ export default class AddCollectionPane extends ContextualPaneBase implements Vie
|
||||
}
|
||||
|
||||
private _updateThroughputLimitByDatabase() {
|
||||
const subscriptionType = this.container.subscriptionType();
|
||||
const flight = this.container.flight();
|
||||
const defaultThruoghput = AddCollectionUtility.Utilities.getDefaultThroughput(flight, subscriptionType);
|
||||
|
||||
const defaultThruoghput = this.container.collectionCreationDefaults.throughput;
|
||||
this.maxThroughputRU(defaultThruoghput.unlimitedmax);
|
||||
this.minThroughputRU(defaultThruoghput.unlimitedmin);
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ export default class AddDatabasePane extends ContextualPaneBase implements ViewM
|
||||
) {
|
||||
return !this.hasAutoPilotV2FeatureFlag()
|
||||
? {
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: `{ "maxThroughput": ${this.maxAutoPilotThroughputSet() * 1} }`
|
||||
[Constants.HttpHeaders.autoPilotThroughput]: { maxThroughput: this.maxAutoPilotThroughputSet() * 1 }
|
||||
}
|
||||
: { [Constants.HttpHeaders.autoPilotTier]: this.selectedAutoPilotTier().toString() };
|
||||
}
|
||||
@@ -586,13 +586,7 @@ export default class AddDatabasePane extends ContextualPaneBase implements ViewM
|
||||
}
|
||||
|
||||
private _updateThroughputLimitByDatabase() {
|
||||
const subscriptionType = this.container.subscriptionType();
|
||||
const flight = this.container.flight();
|
||||
const throughputDefaults: AddCollectionUtility.ThroughputDefaults = AddCollectionUtility.Utilities.getDefaultThroughput(
|
||||
flight,
|
||||
subscriptionType
|
||||
);
|
||||
|
||||
const throughputDefaults = this.container.collectionCreationDefaults.throughput;
|
||||
this.throughput(throughputDefaults.shared);
|
||||
this.maxThroughputRU(throughputDefaults.unlimitedmax);
|
||||
this.minThroughputRU(throughputDefaults.unlimitedmin);
|
||||
|
||||
@@ -74,10 +74,7 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase
|
||||
});
|
||||
this.keyspaceId.extend({ rateLimit: 100 });
|
||||
this.dedicateTableThroughput = ko.observable<boolean>(false);
|
||||
|
||||
const flight = this.container.flight();
|
||||
const subscriptionType = this.container.subscriptionType();
|
||||
const throughputDefaults = AddCollectionUtility.Utilities.getDefaultThroughput(flight, subscriptionType);
|
||||
const throughputDefaults = this.container.collectionCreationDefaults.throughput;
|
||||
this.maxThroughputRU = ko.observable<number>(throughputDefaults.unlimitedmax);
|
||||
this.minThroughputRU = ko.observable<number>(throughputDefaults.unlimitedmin);
|
||||
|
||||
@@ -489,17 +486,16 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase
|
||||
|
||||
public resetData() {
|
||||
super.resetData();
|
||||
const throughputDefaults = AddCollectionUtility.Utilities.getDefaultThroughput(
|
||||
this.container.flight(),
|
||||
this.container.subscriptionType()
|
||||
);
|
||||
const throughputDefaults = this.container.collectionCreationDefaults.throughput;
|
||||
this.isAutoPilotSelected(false);
|
||||
this.isSharedAutoPilotSelected(false);
|
||||
this.selectedAutoPilotTier(null);
|
||||
this.selectedSharedAutoPilotTier(null);
|
||||
this.selectedAutoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput);
|
||||
this.sharedAutoPilotThroughput(AutoPilotUtils.minAutoPilotThroughput);
|
||||
this.throughput(throughputDefaults.unlimited(this.container));
|
||||
this.throughput(
|
||||
AddCollectionUtility.Utilities.getMaxThroughput(this.container.collectionCreationDefaults, this.container)
|
||||
);
|
||||
this.keyspaceThroughput(throughputDefaults.shared);
|
||||
this.maxThroughputRU(throughputDefaults.unlimitedmax);
|
||||
this.minThroughputRU(throughputDefaults.unlimitedmin);
|
||||
|
||||
@@ -13,6 +13,7 @@ import { GitHubReposComponentAdapter } from "../Controls/GitHub/GitHubReposCompo
|
||||
import { BranchesProps, PinnedReposProps, UnpinnedReposProps } from "../Controls/GitHub/ReposListComponent";
|
||||
import { ConsoleDataType } from "../Menus/NotificationConsole/NotificationConsoleComponent";
|
||||
import { ContextualPaneBase } from "./ContextualPaneBase";
|
||||
import { JunoUtils } from "../../Utils/JunoUtils";
|
||||
|
||||
export class GitHubReposPane extends ContextualPaneBase {
|
||||
private static readonly PageSize = 30;
|
||||
@@ -84,7 +85,7 @@ export class GitHubReposPane extends ContextualPaneBase {
|
||||
|
||||
public async submit(): Promise<void> {
|
||||
const pinnedReposUpdated = this.pinnedReposUpdated;
|
||||
const reposToPin: IPinnedRepo[] = this.pinnedReposProps.repos.map(repo => GitHubUtils.toPinnedRepo(repo));
|
||||
const reposToPin: IPinnedRepo[] = this.pinnedReposProps.repos.map(repo => JunoUtils.toPinnedRepo(repo));
|
||||
|
||||
// Submit resets data too
|
||||
super.submit();
|
||||
@@ -298,7 +299,7 @@ export class GitHubReposPane extends ContextualPaneBase {
|
||||
({
|
||||
key: GitHubUtils.toRepoFullName(pinnedRepo.owner, pinnedRepo.name),
|
||||
branches: pinnedRepo.branches,
|
||||
repo: GitHubUtils.toGitHubRepo(pinnedRepo)
|
||||
repo: JunoUtils.toGitHubRepo(pinnedRepo)
|
||||
} as RepoListItem)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user