mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
Support serverless accounts (#109)
* Changes for serverless accounts * Dont show upsell message for serverless accounts * Update CassandraAddCollectionPane to support serverless
This commit is contained in:
@@ -93,6 +93,8 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
public canExceedMaximumValue: ko.PureComputed<boolean>;
|
||||
public hasAutoPilotV2FeatureFlag: ko.PureComputed<boolean>;
|
||||
public ruToolTipText: ko.Computed<string>;
|
||||
public canConfigureThroughput: ko.PureComputed<boolean>;
|
||||
public showUpsellMessage: ko.PureComputed<boolean>;
|
||||
|
||||
private _databaseOffers: HashMap<DataModels.Offer>;
|
||||
private _isSynapseLinkEnabled: ko.Computed<boolean>;
|
||||
@@ -102,6 +104,8 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
this._databaseOffers = new HashMap<DataModels.Offer>();
|
||||
this.hasAutoPilotV2FeatureFlag = ko.pureComputed(() => this.container.hasAutoPilotV2FeatureFlag());
|
||||
this.ruToolTipText = ko.pureComputed(() => PricingUtils.getRuToolTipText(this.hasAutoPilotV2FeatureFlag()));
|
||||
this.canConfigureThroughput = ko.pureComputed(() => !this.container.isServerlessEnabled());
|
||||
this.showUpsellMessage = ko.pureComputed(() => !this.container.isServerlessEnabled());
|
||||
this.formWarnings = ko.observable<string>();
|
||||
this.collectionId = ko.observable<string>();
|
||||
this.databaseId = ko.observable<string>();
|
||||
@@ -591,6 +595,11 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
if (config.platform === Platform.Emulator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.container.isServerlessEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.container.isPreferredApiDocumentDB()) {
|
||||
return true;
|
||||
}
|
||||
@@ -723,10 +732,19 @@ export default class AddCollectionPane extends ContextualPaneBase {
|
||||
}
|
||||
|
||||
private _computeOfferThroughput(): number {
|
||||
if (this.databaseCreateNewShared()) {
|
||||
return this.isSharedAutoPilotSelected() ? undefined : this._getThroughput();
|
||||
if (!this.canConfigureThroughput()) {
|
||||
return undefined;
|
||||
}
|
||||
return this.isAutoPilotSelected() ? undefined : this._getThroughput();
|
||||
|
||||
if (this.isAutoPilotSelected()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (this.databaseCreateNewShared() && this.isSharedAutoPilotSelected()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return this._getThroughput();
|
||||
}
|
||||
|
||||
public submit() {
|
||||
|
||||
Reference in New Issue
Block a user