Update to ADO c5a09dcbef2464ad2dbd6d8a5c70d4b8f105816c (#6)

This commit is contained in:
Steve Faulkner 2020-05-27 18:24:10 -05:00 committed by GitHub
parent f84cf0ad68
commit 7acb1faa4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 178 additions and 164 deletions

View File

@ -163,6 +163,8 @@ export class ThroughputInputViewModel extends WaitsForTemplateViewModel {
public minAutoPilotThroughput: ko.Observable<number>; public minAutoPilotThroughput: ko.Observable<number>;
public overrideWithAutoPilotSettings: ko.Observable<boolean>; public overrideWithAutoPilotSettings: ko.Observable<boolean>;
public overrideWithProvisionedThroughputSettings: ko.Observable<boolean>; public overrideWithProvisionedThroughputSettings: ko.Observable<boolean>;
public isManualThroughputInputFieldRequired: ko.Computed<boolean>;
public isAutoscaleThroughputInputFieldRequired: ko.Computed<boolean>;
public constructor(options: ThroughputInputParams) { public constructor(options: ThroughputInputParams) {
super(); super();
@ -213,6 +215,10 @@ export class ThroughputInputViewModel extends WaitsForTemplateViewModel {
}); });
this.decreaseButtonAriaLabel = "Decrease throughput by " + this.step().toString(); this.decreaseButtonAriaLabel = "Decrease throughput by " + this.step().toString();
this.increaseButtonAriaLabel = "Increase throughput by " + this.step().toString(); this.increaseButtonAriaLabel = "Increase throughput by " + this.step().toString();
this.isManualThroughputInputFieldRequired = ko.pureComputed(() => this.isEnabled() && !this.isAutoPilotSelected());
this.isAutoscaleThroughputInputFieldRequired = ko.pureComputed(
() => this.isEnabled() && this.isAutoPilotSelected()
);
} }
public decreaseThroughput() { public decreaseThroughput() {

View File

@ -77,12 +77,21 @@
<p> <p>
<span>Max RU/s</span> <span>Max RU/s</span>
</p> </p>
<div data-bind="setTemplateReady: true">
<input <input
type="number" data-bind="textInput: overrideWithProvisionedThroughputSettings() ? '' : maxAutoPilotThroughputSet, attr:{
data-bind="textInput: overrideWithProvisionedThroughputSettings() ? '' : maxAutoPilotThroughputSet, attr:{disabled: overrideWithProvisionedThroughputSettings(), step: step, 'class':'migration collid select-font-size', min: minAutoPilotThroughput, css: { disabled: overrideWithProvisionedThroughputSettings(),
step: step,
'class':'migration collid select-font-size',
min: minAutoPilotThroughput,
'aria-label': ariaLabel,
type: isAutoscaleThroughputInputFieldRequired() ? 'number' : 'hidden',
css: {
dirty: maxAutoPilotThroughputSet.editableIsDirty dirty: maxAutoPilotThroughputSet.editableIsDirty
}}" }
}"
/> />
</div>
<p data-bind="visible: overrideWithProvisionedThroughputSettings && !overrideWithProvisionedThroughputSettings()"> <p data-bind="visible: overrideWithProvisionedThroughputSettings && !overrideWithProvisionedThroughputSettings()">
<span <span
data-bind=" data-bind="
@ -114,10 +123,7 @@
<div data-bind="visible: !isAutoPilotSelected()"> <div data-bind="visible: !isAutoPilotSelected()">
<div data-bind="setTemplateReady: true"> <div data-bind="setTemplateReady: true">
<p class="addContainerThroughputInput">
<input <input
type="number"
required
data-bind=" data-bind="
textInput: overrideWithAutoPilotSettings() ? maxAutoPilotThroughputSet : value, textInput: overrideWithAutoPilotSettings() ? maxAutoPilotThroughputSet : value,
css: { css: {
@ -125,16 +131,17 @@
}, },
enable: isEnabled, enable: isEnabled,
attr:{ attr:{
type: isManualThroughputInputFieldRequired() ? 'number' : 'hidden',
'data-test': testId, 'data-test': testId,
'class': cssClass, 'class': cssClass,
step: step, step: step,
min: minimum, min: minimum,
max: canExceedMaximumValue() ? null : maximum, max: canExceedMaximumValue() ? null : maximum,
'aria-label': ariaLabel, 'aria-label': ariaLabel,
disabled: overrideWithAutoPilotSettings() disabled: overrideWithAutoPilotSettings(),
required: isManualThroughputInputFieldRequired()
}" }"
/> />
</p>
</div> </div>
<p data-bind="visible: costsVisible"> <p data-bind="visible: costsVisible">

View File

@ -134,7 +134,7 @@
value: throughputDatabase, value: throughputDatabase,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: databaseCreateNewShared, isEnabled: databaseCreateNewShared() && databaseCreateNew(),
label: sharedThroughputRangeText, label: sharedThroughputRangeText,
ariaLabel: sharedThroughputRangeText, ariaLabel: sharedThroughputRangeText,
costsVisible: costsVisible, costsVisible: costsVisible,
@ -165,7 +165,7 @@
value: throughputDatabase, value: throughputDatabase,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: databaseCreateNewShared, isEnabled: databaseCreateNewShared() && databaseCreateNew(),
label: sharedThroughputRangeText, label: sharedThroughputRangeText,
ariaLabel: sharedThroughputRangeText, ariaLabel: sharedThroughputRangeText,
costsVisible: costsVisible, costsVisible: costsVisible,
@ -289,6 +289,7 @@
<!-- Fixed Button Content - Start --> <!-- Fixed Button Content - Start -->
<div class="tabcontent" data-bind="visible: isFixedStorageSelected() && !databaseHasSharedOffer()"> <div class="tabcontent" data-bind="visible: isFixedStorageSelected() && !databaseHasSharedOffer()">
<!-- 2 --> <!-- 2 -->
<!-- note: this is used when creating a fixed collection without shared throughput. only manual throughput is available. -->
<throughput-input params="{ <throughput-input params="{
testId: 'fixedThroughputValue', testId: 'fixedThroughputValue',
value: throughputSinglePartition, value: throughputSinglePartition,
@ -444,7 +445,7 @@
value: throughputMultiPartition, value: throughputMultiPartition,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: !databaseHasSharedOffer() || collectionWithThroughputInShared(), isEnabled: displayCollectionThroughput,
label: throughputRangeText, label: throughputRangeText,
ariaLabel: throughputRangeText, ariaLabel: throughputRangeText,
costsVisible: costsVisible, costsVisible: costsVisible,
@ -475,7 +476,7 @@
value: throughputMultiPartition, value: throughputMultiPartition,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: !databaseHasSharedOffer() || collectionWithThroughputInShared(), isEnabled: displayCollectionThroughput,
label: throughputRangeText, label: throughputRangeText,
ariaLabel: throughputRangeText, ariaLabel: throughputRangeText,
costsVisible: costsVisible, costsVisible: costsVisible,

View File

@ -148,7 +148,7 @@
value: keyspaceThroughput, value: keyspaceThroughput,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: keyspaceHasSharedOffer, isEnabled: keyspaceCreateNew() && keyspaceHasSharedOffer(),
label: sharedThroughputRangeText, label: sharedThroughputRangeText,
ariaLabel: sharedThroughputRangeText, ariaLabel: sharedThroughputRangeText,
requestUnitsUsageCost: requestUnitsUsageCostShared, requestUnitsUsageCost: requestUnitsUsageCostShared,
@ -179,7 +179,7 @@
value: keyspaceThroughput, value: keyspaceThroughput,
minimum: minThroughputRU, minimum: minThroughputRU,
maximum: maxThroughputRU, maximum: maxThroughputRU,
isEnabled: keyspaceHasSharedOffer, isEnabled: keyspaceCreateNew() && keyspaceHasSharedOffer(),
label: sharedThroughputRangeText, label: sharedThroughputRangeText,
ariaLabel: sharedThroughputRangeText, ariaLabel: sharedThroughputRangeText,
requestUnitsUsageCost: requestUnitsUsageCostShared, requestUnitsUsageCost: requestUnitsUsageCostShared,