mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Fixed settingsV2 bugs and added experimentation (#264)
* inital commit for flight tests - FIxed bugs with settingstab v2 * minor edits * removed console log * fixed bug with autoscale throughput step increase * resolved PR comments * fixed compile error * Added comment
This commit is contained in:
committed by
GitHub
parent
444f663733
commit
8028734cb0
@@ -6,6 +6,7 @@ import * as PricingUtils from "../../../Utils/PricingUtils";
|
||||
|
||||
import Explorer from "../../Explorer";
|
||||
|
||||
const zeroValue = 0;
|
||||
export type isDirtyTypes = boolean | string | number | DataModels.IndexingPolicy;
|
||||
export const TtlOff = "off";
|
||||
export const TtlOn = "on";
|
||||
@@ -129,6 +130,16 @@ export const parseConflictResolutionProcedure = (procedureFromBackEnd: string):
|
||||
return procedureFromBackEnd;
|
||||
};
|
||||
|
||||
export const getSanitizedInputValue = (newValueString: string, max: number): number => {
|
||||
let newValue = parseInt(newValueString);
|
||||
if (isNaN(newValue)) {
|
||||
newValue = zeroValue;
|
||||
} else if (newValue > max) {
|
||||
newValue = Math.floor(newValue / 10);
|
||||
}
|
||||
return newValue;
|
||||
};
|
||||
|
||||
export const isDirty = (current: isDirtyTypes, baseline: isDirtyTypes): boolean => {
|
||||
const currentType = typeof current;
|
||||
const baselineType = typeof baseline;
|
||||
|
||||
Reference in New Issue
Block a user