@@ -259,10 +259,11 @@ class EditReplica extends React.Component<Props, State> {
259259 source : this . state . sourceData ,
260260 destination : this . state . destinationData ,
261261 network : this . state . selectedNetworks . length > 0 ? this . getSelectedNetworks ( ) : [ ] ,
262- storage : this . state . destinationData . default_storage || this . state . storageMap . length > 0 ? this . getStorageMap ( ) : [ ] ,
262+ storage : this . state . storageMap ,
263263 }
264264 if ( this . props . type === 'replica' ) {
265- replicaStore . update ( this . props . replica , this . props . destinationEndpoint , updateData ) . then ( ( ) => {
265+ let storageConfigDefault = this . getFieldValue ( 'destination' , 'default_storage' ) || endpointStore . storageConfigDefault
266+ replicaStore . update ( this . props . replica , this . props . destinationEndpoint , updateData , storageConfigDefault ) . then ( ( ) => {
266267 this . props . onRequestClose ( )
267268 this . props . onUpdateComplete ( `/replica/executions/${ this . props . replica . id } ` )
268269 } ) . catch ( ( ) => {
@@ -360,7 +361,7 @@ class EditReplica extends React.Component<Props, State> {
360361 this . state . storageMap . forEach ( mapping => {
361362 let fieldName = mapping . type === 'backend' ? 'storage_backend_identifier' : 'id'
362363 let existingMapping = storageMap . find ( m => m . type === mapping . type &&
363- m . source [ fieldName ] === mapping . source [ fieldName ]
364+ m . source [ fieldName ] === String ( mapping . source [ fieldName ] )
364365 )
365366 if ( existingMapping ) {
366367 existingMapping . target = mapping . target
@@ -388,6 +389,7 @@ class EditReplica extends React.Component<Props, State> {
388389 fields = { fields }
389390 hasStorageMap = { type === 'source' ? false : this . hasStorageMap ( ) }
390391 storageBackends = { endpointStore . storageBackends }
392+ storageConfigDefault = { endpointStore . storageConfigDefault }
391393 onChange = { ( f , v ) => { this . handleFieldChange ( type , f , v ) } }
392394 oneColumnStyle = { { marginTop : '-16px' , display : 'flex' , flexDirection : 'column' , width : '100%' , alignItems : 'center' } }
393395 columnStyle = { { marginRight : 0 } }
@@ -412,7 +414,6 @@ class EditReplica extends React.Component<Props, State> {
412414 storageBackends = { endpointStore . storageBackends }
413415 instancesDetails = { this . props . instancesDetails }
414416 storageMap = { this . getStorageMap ( ) }
415- defaultStorage = { this . getFieldValue ( 'destination' , 'default_storage' ) }
416417 onChange = { ( s , t , type ) => { this . handleStorageChange ( s , t , type ) } }
417418 />
418419 )
0 commit comments