-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tag-guard
- Loading branch information
Showing
57 changed files
with
1,394 additions
and
338 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
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
66 changes: 66 additions & 0 deletions
66
...s/inspectit-ocelot-configurationserver-ui/src/components/views/mappings/MappingSidebar.js
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,66 @@ | ||
import React from 'react'; | ||
import { useSelector, useDispatch } from 'react-redux'; | ||
import MappingsHistoryView from './history/MappingsHistoryView'; | ||
import SidebarTypes from './SidebarTypes'; | ||
import { mappingsActions } from '../../../redux/ducks/mappings'; | ||
|
||
/** | ||
* The sidebar of the configuration view. | ||
*/ | ||
const MappingSidebar = () => { | ||
const dispatch = useDispatch(); | ||
|
||
// global state variables | ||
const currentSidebar = useSelector((state) => state.mappings.currentSidebar); | ||
|
||
const toggleHistoryView = () => { | ||
dispatch(mappingsActions.toggleHistoryView()); | ||
}; | ||
|
||
return ( | ||
<> | ||
<style jsx> | ||
{` | ||
.sidebar { | ||
display: flex; | ||
border: 0; | ||
border-radius: 0; | ||
background-color: #eee; | ||
border-left: 1px solid #ddd; | ||
background-color: #eeeeee; | ||
} | ||
.vert-button { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 1rem 0.5rem; | ||
border-radius: 0; | ||
} | ||
.vert-button i { | ||
margin-bottom: 0.5rem; | ||
} | ||
.vert-button span { | ||
writing-mode: vertical-rl; | ||
font-size: 1rem; | ||
} | ||
`} | ||
</style> | ||
|
||
<div className="sidebar"> | ||
<div className="content-container">{currentSidebar == SidebarTypes.HISTORY && <MappingsHistoryView />}</div> | ||
<div> | ||
<button | ||
className={'vert-button p-button p-togglebutton' + (currentSidebar == SidebarTypes.HISTORY ? 'p-highlight' : '')} | ||
onClick={toggleHistoryView} | ||
> | ||
<i className={'pi pi-chevron-' + (currentSidebar == SidebarTypes.HISTORY ? 'right' : 'left')} /> | ||
<span>Versioning</span> | ||
</button> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
MappingSidebar.propTypes = {}; | ||
|
||
export default MappingSidebar; |
Oops, something went wrong.