Skip to content

Commit fbd1359

Browse files
committed
custom graphs: Improve error message for explicit range
CMK-33524 Change-Id: I3c60ccb4221d79eaa49079081f0e8c0ba664e537
1 parent f8ef115 commit fbd1359

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/cmk-frontend-vue/src/graph-designer/private/ExplicitVerticalRangeEditor.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ const explicitVerticalRangeSuggestions: Suggestion[] = [
4343
4444
const validateLower = (value: number | undefined) => {
4545
if (typeof value !== 'number' || typeof dataExplicitVerticalRangeUpper.value !== 'number') {
46-
return []
46+
return [_t('The lower bound must be a number')]
4747
}
48-
return value > dataExplicitVerticalRangeUpper.value ? ['Must be less than upper bound'] : []
48+
return value > dataExplicitVerticalRangeUpper.value
49+
? [_t('The lower bound must be less than the upper bound')]
50+
: []
4951
}
5052
5153
const validateUpper = (value: number | undefined) => {
5254
if (typeof value !== 'number' || typeof dataExplicitVerticalRangeLower.value !== 'number') {
53-
return []
55+
return [_t('The upper bound must be a number')]
5456
}
55-
return value < dataExplicitVerticalRangeLower.value ? ['Must be more than lower bound'] : []
57+
return value < dataExplicitVerticalRangeLower.value
58+
? [_t('The upper bound must be greater than the lower bound')]
59+
: []
5660
}
5761
5862
const emit = defineEmits<{

0 commit comments

Comments
 (0)