Skip to content

Commit bd9389a

Browse files
committed
adapt to enumValues ADJ logic
1 parent 0e1a797 commit bd9389a

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

backend/internal/pod_data/measurement.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ func getNumericMeasurement(adeMeas adj.Measurement, globalUnits map[string]utils
5555
warningRange := adeMeas.WarningRange
5656

5757
displayUnits, err := utils.ParseUnits(adeMeas.DisplayUnits, globalUnits)
58-
5958
if err != nil {
6059
measErrs.Add(err)
6160
}
6261

6362
podUnits, err := utils.ParseUnits(adeMeas.PodUnits, globalUnits)
64-
6563
if err != nil {
6664
measErrs.Add(err)
6765
}
@@ -87,18 +85,7 @@ func getEnumMeasurement(adeMeas adj.Measurement) EnumMeasurement {
8785
Id: adeMeas.Id,
8886
Name: adeMeas.Name,
8987
Type: EnumType,
90-
Options: getEnumMembers(adeMeas.Type),
91-
}
92-
}
93-
94-
func getEnumMembers(enumExp string) []string {
95-
if enumExp == "enum" {
96-
return []string{}
97-
} else {
98-
firstParenthesisIndex := strings.Index(enumExp, "(")
99-
lastParenthesisIndex := strings.LastIndex(enumExp, ")")
100-
101-
return strings.Split(enumExp[firstParenthesisIndex+1:lastParenthesisIndex], ",")
88+
Options: adeMeas.EnumValues,
10289
}
10390
}
10491

0 commit comments

Comments
 (0)