Skip to content

Commit

Permalink
Disable "increases to above" dropdown in the Create Intervention Poli… (
Browse files Browse the repository at this point in the history
#4820)

Co-authored-by: Tom Szendrey <[email protected]>
  • Loading branch information
mloppie and Tom-Szendrey authored Sep 23, 2024
1 parent dd4ed2f commit 2f0f9a0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@
option-value="value"
placeholder="Select a trigger"
/>
<Dropdown
:model-value="intervention.dynamicInterventions[0].isGreaterThan"
@change="onComparisonOperatorChange"
:options="comparisonOperations"
option-label="label"
option-value="value"
/>
crosses the threshold
<tera-input-number
auto-width
:model-value="intervention.dynamicInterventions[0].threshold"
Expand Down Expand Up @@ -175,11 +169,6 @@ const interventionType = computed(() => {
return 'static';
});
const comparisonOperations = [
{ label: 'increases to above', value: true },
{ label: 'decreases to below', value: false }
];
const onUpdateName = (name: string) => {
const intervention = cloneDeep(props.intervention);
intervention.name = name;
Expand Down Expand Up @@ -243,8 +232,7 @@ const onInterventionTypeChange = (value: string) => {
{
threshold: Number.NaN,
value: Number.NaN,
parameter: '',
isGreaterThan: true
parameter: ''
}
];
}
Expand All @@ -258,12 +246,6 @@ const onTargetParameterChange = (event: DropdownChangeEvent) => {
emit('update', intervention);
};
const onComparisonOperatorChange = (event: DropdownChangeEvent) => {
const intervention = cloneDeep(props.intervention);
intervention.dynamicInterventions[0].isGreaterThan = event.value;
emit('update', intervention);
};
const onSemanticChange = (event: DropdownChangeEvent) => {
const intervention = cloneDeep(props.intervention);
intervention.type = event.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@
Set {{ intervention.type }} {{ appliedTo }} to
{{ intervention.dynamicInterventions[0].value }} when the
{{ intervention.dynamicInterventions[0].parameter }}
{{
intervention.dynamicInterventions[0].isGreaterThan ? 'increases to above' : 'decreases to below'
}}
when it crosses the threshold value
{{ intervention.dynamicInterventions[0].threshold }}.
</p>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
</div>
<p>
Set the {{ config.intervention?.type }}&nbsp; <strong>{{ config.intervention?.appliedTo }}</strong> to
<strong>{{ dynamicInterventions[0].threshold }}</strong> days when it
<strong>{{ dynamicInterventions[0].isGreaterThan ? 'increase to above' : 'decrease to below' }}</strong>
the threshold value <strong>{{ dynamicInterventions[0].value }}</strong> person.
<strong>{{ dynamicInterventions[0].threshold }}</strong> days when it crosses the threshold value
<strong>{{ dynamicInterventions[0].value }}</strong> person.
</p>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
</li>
<li v-for="(dynamicIntervention, index) in intervention.dynamicInterventions" :key="`dynamic_${index}`">
Set the {{ intervention?.type }}&nbsp; <strong>{{ intervention?.appliedTo }}</strong> to
<strong>{{ dynamicIntervention.threshold }}</strong> days when it
<strong>{{ dynamicIntervention.isGreaterThan ? 'increase to above' : 'decrease to below' }}</strong>
the threshold value <strong>{{ dynamicIntervention.value }}</strong> person.
<strong>{{ dynamicIntervention.threshold }}</strong> days when it crosses the threshold value
<strong>{{ dynamicIntervention.value }}</strong> person.
</li>
</ul>
</section>
Expand Down
1 change: 0 additions & 1 deletion packages/client/hmi-client/src/types/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ export interface DynamicIntervention {
parameter: string;
threshold: number;
value: number;
isGreaterThan: boolean;
}

export interface Intervention {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ public class DynamicIntervention {
private String parameter;
private Number threshold;
private Number value;
private Boolean isGreaterThan;

@Override
public DynamicIntervention clone() {
DynamicIntervention clone = new DynamicIntervention();
clone.parameter = this.parameter;
clone.threshold = this.threshold;
clone.value = this.value;
clone.isGreaterThan = this.isGreaterThan;
return clone;
}
}

0 comments on commit 2f0f9a0

Please sign in to comment.