Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pricing calculator accepting negative values #2518

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/grid_client/src/modules/calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expose } from "../helpers/expose";
import { validateInput } from "../helpers/validator";
import { CalculatorModel, CUModel, SUModel } from "./models";

interface PricingInfo {
export interface PricingInfo {
dedicatedPrice: number;
dedicatedPackage: {
package: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
<VRow v-else>
<VCol cols="12">
<VAlert type="error">
Please provide a valid data inorder to calculate your deployment price correctly.
Please provide a valid data in order to calculate your deployment price correctly.
</VAlert>
</VCol>
</VRow>
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/src/stores/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Profile {
email: string;
}

interface State {
export interface State {
profile: Profile | null;
}

Expand Down
6 changes: 4 additions & 2 deletions packages/playground/src/utils/pricing_calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ function _applyRules(rules: Array<(value: string) => { message: string } | void>
export const cruRules = _applyRules([
required("CPU is required."),
isInt("CPU must be a valid integer."),
min("CPU min is 1 cores.", 1),
max("CPU max is 256 cores.", 256),
min("Minimum allowed cpu cores is 1", 1),
max("Maximum allowed cpu cores is 256.", 256),
]);

export const mruRules = _applyRules([
required("Memory is required."),
min("Minimum allowed Memory size is 1 GB.", 1),
isInt("Memory must be a valid integer."),
max("Maximum allowed memory is 1024 GB.", 1024),
]);
Expand All @@ -29,6 +30,7 @@ export const sruRules = _applyRules([
required("SSD Storage size is required."),
isInt("SSD Storage size must be a valid integer."),
max("Maximum allowed ssd storage size is 1000000 GB.", 1000000),
min("Minimum allowed ssd storage size is 0 GB.", 0),
]);

export const hruRules = _applyRules([
Expand Down
Loading