@@ -24,8 +24,11 @@ const loadStorages = (id) => API.get(`/api/providers/${id}?attributes=type,physi
2424const loadGroups = ( id ) => API . get ( `/api/physical_storages/${ id } ?attributes=host_initiator_groups` )
2525 // eslint-disable-next-line camelcase
2626 . then ( ( { host_initiator_groups } ) => {
27- const groupOptions = host_initiator_groups . map ( ( { id, name } ) => ( { label : name , value : id } ) ) ;
28- groupOptions . unshift ( { label : `<${ __ ( 'None' ) } >` , value : '' } ) ;
27+ const groupOptions = host_initiator_groups . map ( ( { name } ) => ( { label : name , value : name } ) ) ;
28+ groupOptions . unshift (
29+ { label : `<${ __ ( 'Choose' ) } >` , value : '-1' } ,
30+ { label : `<${ __ ( 'None' ) } >` , value : 'none' }
31+ ) ;
2932 return groupOptions ;
3033 } ) ;
3134
@@ -284,9 +287,11 @@ const createSchema = (state, setState, ems, initialValues, storageId, setStorage
284287 name : 'host_initiator_group' ,
285288 label : __ ( 'Host Initiator Group:' ) ,
286289 isRequired : true ,
287- validate : [ { type : validatorTypes . REQUIRED } ] ,
290+ validate : [
291+ { type : validatorTypes . REQUIRED } ,
292+ { type : validatorTypes . PATTERN , pattern : '^(?!-)' , message : __ ( 'Required' ) } ,
293+ ] ,
288294 loadOptions : ( ) => ( storageId ? loadGroups ( storageId ) : Promise . resolve ( [ ] ) ) ,
289- isSearchable : true ,
290295 condition : { and : [ { when : 'physical_storage_id' , isNotEmpty : true } , { when : 'port_type' , isNotEmpty : true } ] } ,
291296 } ,
292297 ] ,
0 commit comments