@@ -13,9 +13,10 @@ import { BSONType } from 'mongodb';
1313import  { 
1414  createNewRelationship , 
1515  deleteRelationship , 
16-   extractFieldsFromSchema , 
16+   getCurrentDiagramFromState , 
1717  renameField , 
18-   selectCurrentModelFromState , 
18+   selectCurrentModel , 
19+   selectFieldsForCurrentModel , 
1920  selectRelationship , 
2021}  from  '../../store/diagram' ; 
2122import  type  {  DataModelingState  }  from  '../../store/reducer' ; 
@@ -196,7 +197,8 @@ export default connect(
196197    state : DataModelingState , 
197198    ownProps : {  namespace : string ;  fieldPath : FieldPath  } 
198199  )  =>  { 
199-     const  model  =  selectCurrentModelFromState ( state ) ; 
200+     const  diagram  =  getCurrentDiagramFromState ( state ) ; 
201+     const  model  =  selectCurrentModel ( diagram . edits ) ; 
200202    const  collectionSchema  =  model . collections . find ( 
201203      ( collection )  =>  collection . ns  ===  ownProps . namespace 
202204    ) ?. jsonSchema ; 
@@ -209,7 +211,9 @@ export default connect(
209211          jsonSchema : collectionSchema , 
210212          fieldPath : ownProps . fieldPath , 
211213        } ) ?. fieldTypes  ??  [ ] , 
212-       fieldPaths : extractFieldsFromSchema ( collectionSchema ) , 
214+       fieldPaths : selectFieldsForCurrentModel ( diagram . edits ) [ 
215+         ownProps . namespace 
216+       ] , 
213217      relationships : model . relationships . filter ( ( {  relationship } )  => 
214218        isRelationshipOfAField ( 
215219          relationship , 
0 commit comments