This repository has been archived by the owner on Oct 17, 2018. It is now read-only.
-
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.
Added drawing of connections between services and resources
- Loading branch information
Showing
9 changed files
with
154 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import ReactDOM from "react-dom"; | ||
import PropTypes from 'prop-types'; | ||
|
||
class DOMRef extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
componentDidMount() { | ||
let node = ReactDOM.findDOMNode(this); | ||
this.props.domRef(this.props, node); | ||
} | ||
|
||
componentWillUnmount() { | ||
this.props.domRef(this.props, null); | ||
} | ||
|
||
render() { | ||
return this.props.children; | ||
} | ||
} | ||
|
||
DOMRef.propTypes = { | ||
domRef: PropTypes.func, | ||
}; | ||
|
||
DOMRef.defaultProps = { | ||
domRef: ()=>{}, | ||
}; | ||
|
||
export default DOMRef; |
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 |
---|---|---|
@@ -1,34 +1,31 @@ | ||
import React from 'react'; | ||
import ReactDOM from "react-dom"; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
import _ from "lodash"; | ||
|
||
import { Icon } from 'semantic-ui-react' | ||
|
||
import Item from './Item' | ||
|
||
import './IconItem.css'; | ||
|
||
const IconItem = (props) => ( | ||
<Icon | ||
<Item {...props}><Icon | ||
name={props.icon} | ||
className={classNames('topo-item', 'topo-item-icon', 'selectable', {'selected': props.selected})} | ||
bordered={props.selected} | ||
size="huge" | ||
onClick={() => props.onSelect(props)} | ||
/> | ||
/></Item> | ||
); | ||
|
||
IconItem.propTypes = { | ||
icon: PropTypes.string.isRequired, | ||
klass: PropTypes.string.isRequired, | ||
selected: PropTypes.bool, | ||
onSelect: PropTypes.func, | ||
belongsTo: PropTypes.string, | ||
}; | ||
|
||
IconItem.defaultProps = { | ||
icon: 'question circle outline', | ||
selected: false, | ||
onSelect: ()=>{}, | ||
belongsTo: null, | ||
}; | ||
|
||
export default IconItem; |
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,27 @@ | ||
import React from 'react'; | ||
import ReactDOM from "react-dom"; | ||
import PropTypes from 'prop-types'; | ||
|
||
import DOMRef from './DOMRef' | ||
|
||
const Item = (props) => ( | ||
<DOMRef domRef={(bp, node) => props.domRef(props, node)}>{props.children}</DOMRef> | ||
); | ||
|
||
Item.propTypes = { | ||
type: PropTypes.string.isRequired, | ||
klass: PropTypes.string.isRequired, | ||
domRef: PropTypes.func, | ||
selected: PropTypes.bool, | ||
onSelect: PropTypes.func, | ||
belongsTo: PropTypes.string, | ||
}; | ||
|
||
Item.defaultProps = { | ||
domRef: ()=>{}, | ||
selected: false, | ||
onSelect: ()=>{}, | ||
belongsTo: null, | ||
}; | ||
|
||
export default Item; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
import _ from 'lodash'; | ||
|
||
import { Card, Icon } from 'semantic-ui-react' | ||
|
||
import Item from './Item' | ||
|
||
import './Service.css'; | ||
|
||
const Service = (props) => ( | ||
<Card | ||
<Item {...props}><Card | ||
className={classNames('topo-item', 'topo-service', 'selectable', {'selected': props.selected})} | ||
color={props.selected?'red':'grey'} | ||
color={props.selected ? 'red' : 'grey'} | ||
onClick={() => props.onSelect(props)} | ||
> | ||
<Card.Content textAlign="left"> | ||
<Icon name={props.icon} className="floatleft" size="big" /> | ||
<Icon name={props.icon} className="floatleft" size="big"/> | ||
<Card.Header>{props.name}</Card.Header> | ||
<Card.Meta>Service / Deployment / Build</Card.Meta> | ||
</Card.Content> | ||
</Card> | ||
</Card></Item> | ||
); | ||
|
||
Service.propTypes = { | ||
name: PropTypes.string.isRequired, | ||
icon: PropTypes.string.isRequired, | ||
type: PropTypes.string.isRequired, | ||
selected: PropTypes.bool, | ||
onSelect: PropTypes.func, | ||
belongsTo: PropTypes.string, | ||
}; | ||
|
||
Service.defaultProps = { | ||
icon: 'cogs', | ||
klass: 'service', | ||
selected: false, | ||
onSelect: ()=>{}, | ||
belongsTo: null, | ||
}; | ||
|
||
export default Service; |
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