File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/core/plugins/oas31/components/models Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,12 @@ const Models = ({
30
30
* Effects.
31
31
*/
32
32
useEffect ( ( ) => {
33
- const isOpenAndExpanded = isOpen && defaultModelsExpandDepth > 1
33
+ const includesExpandedSchema = Object . entries ( schemas ) . some (
34
+ ( [ schemaName ] ) =>
35
+ layoutSelectors . isShown ( [ ...schemasPath , schemaName ] , false )
36
+ )
37
+ const isOpenAndExpanded =
38
+ isOpen && ( defaultModelsExpandDepth > 1 || includesExpandedSchema )
34
39
const isResolved = specSelectors . specResolvedSubtree ( schemasPath ) != null
35
40
if ( isOpenAndExpanded && ! isResolved ) {
36
41
specActions . requestResolvedSubtree ( schemasPath )
@@ -55,12 +60,15 @@ const Models = ({
55
60
}
56
61
}
57
62
const handleJSONSchema202012Expand = ( schemaName ) => ( e , expanded ) => {
63
+ const schemaPath = [ ...schemasPath , schemaName ]
58
64
if ( expanded ) {
59
- const schemaPath = [ ...schemasPath , schemaName ]
60
65
const isResolved = specSelectors . specResolvedSubtree ( schemaPath ) != null
61
66
if ( ! isResolved ) {
62
67
specActions . requestResolvedSubtree ( [ ...schemasPath , schemaName ] )
63
68
}
69
+ layoutActions . show ( schemaPath , true )
70
+ } else {
71
+ layoutActions . show ( schemaPath , false )
64
72
}
65
73
}
66
74
You can’t perform that action at this time.
0 commit comments