-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
capella_model_explorer/frontend/src/components/TemplateView.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
In this component we show list of template instances, and when we click on a template, we show the rendered instance next to the list. If no imnstance is selected we show a hint to select one. | ||
*/ | ||
|
||
import React, {useEffect, useState} from 'react'; | ||
import { TemplateDetails } from './TemplateDetails'; | ||
import { useLocation, useParams, Navigate } from 'react-router-dom'; | ||
import { InstanceView } from './InstanceView'; | ||
|
||
export const TemplateView = ({endpoint}) => { | ||
let { templateName, objectID } = useParams(); | ||
const location = useLocation(); | ||
|
||
useEffect(() => { | ||
}, [endpoint, templateName, objectID, location]); | ||
|
||
return ( | ||
<div className='flex flex-row h-screen'> | ||
<div className='flex-initial p-4' style={{ flexBasis: '24%'}}> | ||
<TemplateDetails endpoint={endpoint} /> | ||
</div> | ||
<div className='flex-auto p-4 overflow-auto h-full' style={{minWidth: 0}}> | ||
{ !!!objectID && <p>Select an Instance</p>} | ||
{ objectID && <InstanceView endpoint={endpoint} objectID={objectID} templateName={templateName} /> } | ||
|
||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters