From 9519bcfb84db68fde9653177274cc74d476c2dc4 Mon Sep 17 00:00:00 2001 From: mloppie Date: Thu, 24 Oct 2024 13:31:42 -0400 Subject: [PATCH 1/2] show negative timesteps as invalid in the intervention policy drilldown, fix test formatting --- .../hmi-client/src/components/widgets/tera-input-number.vue | 3 ++- .../ops/intervention-policy/tera-intervention-card.vue | 1 + testing/manual/intervention-policy.md | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/client/hmi-client/src/components/widgets/tera-input-number.vue b/packages/client/hmi-client/src/components/widgets/tera-input-number.vue index 9b60f25a3d..1869039e18 100644 --- a/packages/client/hmi-client/src/components/widgets/tera-input-number.vue +++ b/packages/client/hmi-client/src/components/widgets/tera-input-number.vue @@ -34,6 +34,7 @@ const props = defineProps<{ disabled?: boolean; placeholder?: string; autoWidth?: boolean; + invalidateNegative?: boolean; }>(); const emit = defineEmits(['update:model-value', 'focusout']); const inputField = ref(null); @@ -63,7 +64,7 @@ const updateValue = (event: Event) => { const value = (event.target as HTMLInputElement).value; maskedValue.value = value; const numValue = toNumber(value); - error.value = isNaN(numValue) ? 'Invalid number' : ''; + error.value = isNaN(numValue) || (props.invalidateNegative && numValue < 0) ? 'Invalid number' : ''; }; function displayValue() { diff --git a/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue b/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue index d5f8d212ea..2b0ff2e7b6 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue @@ -29,6 +29,7 @@ diff --git a/testing/manual/intervention-policy.md b/testing/manual/intervention-policy.md index 4147c775c4..b49fa1f0ca 100644 --- a/testing/manual/intervention-policy.md +++ b/testing/manual/intervention-policy.md @@ -23,7 +23,7 @@ Report any issues into GitHub: [open an issue](https://github.com/DARPA-ASKEM/te 2. Edit the default intervention card, name it `Static Parameters` and leave it as _Static_. 3. Set Parameter `beta` to value `0.0001` starting at timestep `20`. 4. Click `+ Add`. -5. Set the Parameter gamma to 0.5 +5. Set the Parameter gamma to `0.5` 6. Check that the charts reflect the intervention ### 5. Try to create an invalid intervention @@ -42,7 +42,7 @@ Report any issues into GitHub: [open an issue](https://github.com/DARPA-ASKEM/te ### 7. Create a static state criteria 1. Click `+ Add intervention` 2. Name it `Static State` and leave it as _Static_. -3. Set State `I` to value `600` starting at timestep 40`. +3. Set State `I` to value `600` starting at timestep `40`. ### 8. Create a dynamic state criteria 1. Click `+ Add intervention` From 15a44cf0ba1856cfa2fb29f033e58a7236326abf Mon Sep 17 00:00:00 2001 From: mloppie Date: Thu, 24 Oct 2024 14:01:10 -0400 Subject: [PATCH 2/2] code simplification --- .../workflow/ops/intervention-policy/tera-intervention-card.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue b/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue index 2b0ff2e7b6..321fdaa305 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/intervention-policy/tera-intervention-card.vue @@ -28,8 +28,8 @@ Starting at day