Skip to content

Commit

Permalink
Simple improvements acknowledging comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
anfee1 committed Apr 2, 2021
1 parent fc363da commit a5ad843
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions serving/central/src/main/webapp/components/ModelNavigator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function ModelNavigator(props) {
const modelZooData = useFetch(URL);

const [model, setModel] = useState(null);
const [modelList, setModelList] = useState([]);
const [modelList, setModelList] = useState(modelZooData);
const [nameValue, setNameValue] = useState('');
const [applicationValue, setApplicationValue] = useState('');
const [versionValue, setVersionValue] = useState('');
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function ModelNavigator(props) {
</div>
</TreeItem>
</TreeView>
<button onClick={modelFilterOnChange} > Search </button>
<button onClick={modelFilterOnChange} value={nameValue} > Search </button>
</TreeItem>
</TreeView>

Expand All @@ -199,16 +199,26 @@ export default function ModelNavigator(props) {
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
>
<TreeItem nodeId={'Models'} label={'Models'}></TreeItem>
<div>
{modelList.map(application => (
console.log(application),
application.map((model) => (
<TreeItem nodeId={model.name} label={model.name} onLabelClick={() => setModel(model)}>
</TreeItem>
))
))}
</div>
{nameValue != '' || versionValue!='' || applicationValue!=''
?<div>
{
modelList.map(application => (
application.map((model) => (
<TreeItem nodeId={model.name} label={model.name} onLabelClick={() => setModel(model)}>
</TreeItem>
))
))}
</div>
:
modelZooData.map((application) => (
<TreeItem nodeId={application.key} label={application.title}>
{application.models.map((model) => (
<TreeItem nodeId={model.name} label={model.name} onLabelClick={() => setModel(model)}>
</TreeItem>
))}
</TreeItem>
))
}

</TreeView>
</div>
Expand Down

0 comments on commit a5ad843

Please sign in to comment.