From 70e4031cea973b67003d23af9211d08cf43f3266 Mon Sep 17 00:00:00 2001 From: Jacqueline Amherst Date: Mon, 21 Apr 2025 20:35:50 -0500 Subject: [PATCH 1/4] make non-editable config options appear non-editable --- .../[name]/configuration/components/ComponentsFormRow.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/instances/[name]/configuration/components/ComponentsFormRow.tsx b/src/app/instances/[name]/configuration/components/ComponentsFormRow.tsx index 5fe8df1..b6f0ab0 100644 --- a/src/app/instances/[name]/configuration/components/ComponentsFormRow.tsx +++ b/src/app/instances/[name]/configuration/components/ComponentsFormRow.tsx @@ -29,7 +29,7 @@ export default function ComponentsFormRow({ item.description )} - + {isLoading ? (
) : item.type === "dropdown" && Array.isArray(item.options) ? ( @@ -45,6 +45,10 @@ export default function ComponentsFormRow({ ))} + ) : Boolean(item.readOnly) ? ( + + {configuration[item.key] ?? ""} + ) : ( Date: Mon, 21 Apr 2025 20:45:17 -0500 Subject: [PATCH 2/4] fix config validation to check that consumer_timeout >= 1 --- src/utils/validateConfig.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/validateConfig.ts b/src/utils/validateConfig.ts index d9e2ef6..7131ba1 100644 --- a/src/utils/validateConfig.ts +++ b/src/utils/validateConfig.ts @@ -35,9 +35,9 @@ export function validateConsumerTimeout( const num = Number(value); if ( value !== undefined && - (isNaN(num) || !Number.isInteger(num) || num < 0) + (isNaN(num) || !Number.isInteger(num) || num < 1) ) { - return "Consumer Timeout must be an integer greater than or equal to 0."; + return "Consumer Timeout must be an integer greater than or equal to 1."; } return null; } From e4da77c51a55df3688e4f1367ae69abc22a3d619 Mon Sep 17 00:00:00 2001 From: Jacqueline Amherst Date: Mon, 21 Apr 2025 20:48:00 -0500 Subject: [PATCH 3/4] all alarm thresholds must be >= 1 --- .../instances/[name]/alarms/components/NewAlarmModal.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/instances/[name]/alarms/components/NewAlarmModal.tsx b/src/app/instances/[name]/alarms/components/NewAlarmModal.tsx index 5d9717a..a5b2e07 100644 --- a/src/app/instances/[name]/alarms/components/NewAlarmModal.tsx +++ b/src/app/instances/[name]/alarms/components/NewAlarmModal.tsx @@ -52,18 +52,18 @@ export const NewAlarmModal = ({ onClose, onAddAlarms }: Props) => { return false; } - if (memoryThreshold && (memoryThreshold < 0 || memoryThreshold > 100)) { + if (memoryThreshold && (memoryThreshold < 1 || memoryThreshold > 100)) { setErrors((prev) => [ ...prev, - "Memory threshold must be between 0 and 100.", + "Memory threshold must be between 1 and 100.", ]); return false; } - if (storageThreshold && (storageThreshold < 0 || storageThreshold > 100)) { + if (storageThreshold && (storageThreshold < 1 || storageThreshold > 100)) { setErrors((prev) => [ ...prev, - "Storage threshold must be between 0 and 100.", + "Storage threshold must be between 1 and 100.", ]); return false; } From a05c9f9ed7161a4d439c55cbf324e26fbe7235a1 Mon Sep 17 00:00:00 2001 From: larencozart Date: Tue, 22 Apr 2025 19:54:40 -0500 Subject: [PATCH 4/4] Fix pending to stop save from spinning on errors --- .../configuration/components/ComponentsForm.tsx | 15 ++++++++------- src/app/instances/[name]/configuration/page.tsx | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/instances/[name]/configuration/components/ComponentsForm.tsx b/src/app/instances/[name]/configuration/components/ComponentsForm.tsx index 2e4629c..98ce4b5 100644 --- a/src/app/instances/[name]/configuration/components/ComponentsForm.tsx +++ b/src/app/instances/[name]/configuration/components/ComponentsForm.tsx @@ -9,7 +9,7 @@ interface Props { onChange: (e: React.ChangeEvent) => void; onSubmit: (e: React.FormEvent) => void; disabled: boolean; - pending: boolean; + isPending: boolean; } export default function ComponentsForm({ @@ -18,6 +18,7 @@ export default function ComponentsForm({ onChange, onSubmit, disabled, + isPending }: Props) { return (
@@ -55,13 +56,13 @@ export default function ComponentsForm({