UI for RU/GB waiver preview feature

This commit is contained in:
Jordi Bunster 2020-10-20 01:37:39 -07:00
parent 34d8704071
commit a293a87528
2 changed files with 16 additions and 0 deletions

View File

@ -85,6 +85,13 @@
<span>Learn more about minimum throughput </span>
<a href="https://docs.microsoft.com/azure/cosmos-db/set-throughput" target="_blank">here.</a>
</p>
<p data-bind="visible: canRequestBelowMinRU">
Need to scale below <span data-bind="text: minRUsText"></span> RU/s? Reach out by filling
<a
href="https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbRzBPrdEMjvxPuDm8fCLUtXpUQ0JLV1Y5VVlDS1RNUE1aRzVHQlVQTVA1SS4u"
>this questionnaire</a
>.
</p>
<p data-bind="visible: canRequestSupport">
<!-- TODO: Replace link with call to the Azure Support blade -->
<a href="https://aka.ms/cosmosdbfeedback?subject=Cosmos%20DB%20More%20Throughput%20Request"

View File

@ -61,6 +61,7 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
public saveSettingsButton: ViewModels.Button;
public discardSettingsChangesButton: ViewModels.Button;
public canRequestBelowMinRU: ko.PureComputed<boolean>;
public canRequestSupport: ko.PureComputed<boolean>;
public canThroughputExceedMaximumValue: ko.Computed<boolean>;
public costsVisible: ko.Computed<boolean>;
@ -68,6 +69,7 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
public isTemplateReady: ko.Observable<boolean>;
public minRUAnotationVisible: ko.Computed<boolean>;
public minRUs: ko.Computed<number>;
public minRUsText: ko.PureComputed<string>;
public maxRUs: ko.Computed<number>;
public maxRUsText: ko.PureComputed<string>;
public maxRUThroughputInputLimit: ko.Computed<number>;
@ -203,6 +205,11 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
this.canThroughputExceedMaximumValue = ko.pureComputed<boolean>(
() => configContext.platform === Platform.Portal && !this.container.isRunningOnNationalCloud()
);
this.canRequestBelowMinRU = ko.pureComputed(() => {
return true; // TODO: Implement and test
});
this.canRequestSupport = ko.pureComputed(() => {
if (
configContext.platform === Platform.Emulator ||
@ -277,6 +284,8 @@ export default class DatabaseSettingsTab extends TabsBase implements ViewModels.
return this.maxRUs();
});
this.minRUsText = ko.pureComputed(() => this.minRUs().toLocaleString());
this.maxRUsText = ko.pureComputed(() => {
return SharedConstants.CollectionCreation.DefaultCollectionRUs1Million.toLocaleString();
});