@@ -38,9 +38,9 @@ import type { Endpoint, StorageBackend, StorageMap } from '../../../types/Endpoi
3838import type { Field } from '../../../types/Field'
3939import type { Instance , Nic , Disk } from '../../../types/Instance'
4040import type { Network , NetworkMap } from '../../../types/Network'
41+ import { providerTypes } from '../../../constants'
4142
4243import StyleProps from '../../styleUtils/StyleProps'
43- import configLoader from '../../../utils/Config'
4444
4545const PanelContent = styled . div `
4646 padding: 32px;
@@ -100,9 +100,11 @@ class EditReplica extends React.Component<Props, State> {
100100 scrollableRef : HTMLElement
101101
102102 componentWillMount ( ) {
103- if ( this . hasStorageMap ( ) ) {
104- endpointStore . loadStorage ( this . props . destinationEndpoint . id , { } )
105- }
103+ providerStore . loadProviders ( ) . then ( ( ) => {
104+ if ( this . hasStorageMap ( ) ) {
105+ endpointStore . loadStorage ( this . props . destinationEndpoint . id , { } )
106+ }
107+ } )
106108
107109 providerStore . loadDestinationSchema ( this . props . destinationEndpoint . type , this . props . type || 'replica' ) . then ( ( ) => {
108110 return providerStore . getDestinationOptions ( this . props . destinationEndpoint . id , this . props . destinationEndpoint . type , undefined , true )
@@ -111,13 +113,15 @@ class EditReplica extends React.Component<Props, State> {
111113 } )
112114 }
113115
114- hasStorageMap ( ) {
116+ hasStorageMap ( ) : boolean {
115117 if ( this . props . type === 'replica ') {
116118 // storage mapping edit is not currently supported by the API
117119 return false
118120 }
119121
120- return Boolean ( configLoader . config . storageProviders . find ( p => p === this . props . destinationEndpoint . type ) )
122+ return providerStore . providers && providerStore . providers [ this . props . destinationEndpoint . type ] ?
123+ ! ! providerStore . providers [ this . props . destinationEndpoint . type ] . types . find ( t => t === providerTypes . STORAGE )
124+ : false
121125 }
122126
123127 isUpdateDisabled ( ) {
0 commit comments