Skip to content

Commit a86fcf3

Browse files
authored
improvement: re-enable and improve Models jump-to-path (#4674)
1 parent 815dbe0 commit a86fcf3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/core/components/models.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default class Models extends Component {
4141
const ModelWrapper = getComponent("ModelWrapper")
4242
const Collapse = getComponent("Collapse")
4343
const ModelCollapse = getComponent("ModelCollapse")
44+
const JumpToPath = getComponent("JumpToPath")
4445

4546
return <section className={ showModels ? "models is-open" : "models"}>
4647
<h4 onClick={() => layoutActions.show("models", !showModels)}>
@@ -64,11 +65,13 @@ export default class Models extends Component {
6465
this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(), name])
6566
}
6667

68+
const specPath = Im.List([...specPathBase, name])
69+
6770
const content = <ModelWrapper name={ name }
6871
expandDepth={ defaultModelsExpandDepth }
6972
schema={ schema || Im.Map() }
7073
displayName={displayName}
71-
specPath={Im.List([...specPathBase, name])}
74+
specPath={specPath}
7275
getComponent={ getComponent }
7376
specSelectors={ specSelectors }
7477
getConfigs = {getConfigs}
@@ -82,6 +85,7 @@ export default class Models extends Component {
8285
</span>
8386

8487
return <div id={ `model-${name}` } className="model-container" key={ `models-section-${name}` }>
88+
<span className="models-jump-to-path"><JumpToPath specPath={specPath} /></span>
8589
<ModelCollapse
8690
classes="model-box"
8791
collapsedContent={this.getCollapsedContent(name)}

src/style/_models.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ section.models
166166
.model-container
167167
{
168168
margin: 0 20px 15px;
169+
position: relative;
169170

170171
transition: all .5s;
171172

@@ -186,6 +187,13 @@ section.models
186187
{
187188
margin: 0 20px;
188189
}
190+
191+
.models-jump-to-path {
192+
position: absolute;
193+
top: 8px;
194+
right: 5px;
195+
opacity: 0.65;
196+
}
189197
}
190198

191199
.model-box

0 commit comments

Comments
 (0)