File tree 2 files changed +29
-26
lines changed
site/src/components/DeploySettingsLayout
2 files changed +29
-26
lines changed Original file line number Diff line number Diff line change @@ -85,28 +85,30 @@ export const OptionValue: FC<OptionValueProps> = (props) => {
85
85
if ( typeof children === "object" && ! Array . isArray ( children ) ) {
86
86
return (
87
87
< ul css = { listStyles } >
88
- { Object . entries ( children ) . map ( ( [ option , isEnabled ] ) => (
89
- < li key = { option } css = { optionStyles } >
90
- < Box
91
- sx = { {
92
- display : "inline-flex" ,
93
- alignItems : "center" ,
94
- } }
95
- >
96
- { option }
97
- { isEnabled && (
98
- < CheckCircleOutlined
99
- sx = { {
100
- width : 16 ,
101
- height : 16 ,
102
- color : ( theme ) => theme . palette . success . light ,
103
- margin : ( theme ) => theme . spacing ( 0 , 1 ) ,
104
- } }
105
- />
106
- ) }
107
- </ Box >
108
- </ li >
109
- ) ) }
88
+ { Object . entries ( children )
89
+ . sort ( ( a , b ) => a [ 0 ] . localeCompare ( b [ 0 ] ) )
90
+ . map ( ( [ option , isEnabled ] ) => (
91
+ < li key = { option } css = { optionStyles } >
92
+ < Box
93
+ sx = { {
94
+ display : "inline-flex" ,
95
+ alignItems : "center" ,
96
+ } }
97
+ >
98
+ { option }
99
+ { isEnabled && (
100
+ < CheckCircleOutlined
101
+ sx = { {
102
+ width : 16 ,
103
+ height : 16 ,
104
+ color : ( theme ) => theme . palette . success . light ,
105
+ margin : ( theme ) => theme . spacing ( 0 , 1 ) ,
106
+ } }
107
+ />
108
+ ) }
109
+ </ Box >
110
+ </ li >
111
+ ) ) }
110
112
</ ul >
111
113
) ;
112
114
}
Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ export function optionValue(
31
31
{ } as Record < string , boolean > ,
32
32
) ;
33
33
34
+ if ( ! experimentMap ) {
35
+ break ;
36
+ }
37
+
34
38
for ( const v of option . value ) {
35
- if (
36
- experimentMap &&
37
- Object . prototype . hasOwnProperty . call ( experimentMap , v )
38
- ) {
39
+ if ( Object . hasOwn ( experimentMap , v ) ) {
39
40
experimentMap [ v ] = true ;
40
41
}
41
42
}
You can’t perform that action at this time.
0 commit comments