-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set
EmitUnpopulated
to false; Use string for proto enums
- Loading branch information
Sunghoon Kang
committed
Sep 12, 2023
1 parent
e522c04
commit 6d008bb
Showing
7 changed files
with
401 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { HealthState } from '@ui/gen/v1alpha1/types_pb'; | ||
export enum HealthStatus { | ||
HEALTHY = 'Healthy', | ||
PROGRESSING = 'Progressing', | ||
UNHEALTHY = 'Unhealthy', | ||
UNKNOWN = 'Unknown', | ||
UNDEFINED = '' | ||
} | ||
|
||
export const healthStateToString = (status?: HealthState): string => { | ||
export const healthStatusToEnum = (status?: string): HealthStatus => { | ||
switch (status) { | ||
case HealthState.HEALTHY: | ||
return 'Healthy'; | ||
case HealthState.PROGRESSING: | ||
return 'Progressing'; | ||
case HealthState.UNHEALTHY: | ||
return 'Unhealthy'; | ||
case HealthState.UNKNOWN: | ||
return 'Unknown'; | ||
case HealthStatus.HEALTHY: | ||
return HealthStatus.HEALTHY; | ||
case HealthStatus.PROGRESSING: | ||
return HealthStatus.PROGRESSING; | ||
case HealthStatus.UNHEALTHY: | ||
return HealthStatus.UNHEALTHY; | ||
case HealthStatus.UNKNOWN: | ||
return HealthStatus.UNKNOWN; | ||
default: | ||
return ''; | ||
return HealthStatus.UNDEFINED; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters