-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
INTLY-997: Add github repo and last commit date to walkthrough overvi…
…ew (#445) * prelim changes for metadata * add redux * working version * fix test * add get details by id * final changes by id * fix tests
- Loading branch information
1 parent
ec2b386
commit 7d2d170
Showing
10 changed files
with
169 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { Card, CardBody, TextContent } from '@patternfly/react-core'; | ||
import { connect, reduxActions } from '../../redux'; | ||
|
||
class WalkthroughDetails extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {}; | ||
} | ||
|
||
render() { | ||
const { walkthroughInfo } = this.props; | ||
return ( | ||
<Card> | ||
<CardBody> | ||
<TextContent className="integr8ly-walkthrough-resources pf-u-pl-md"> | ||
<h2>About this walkthrough</h2> | ||
<h3>Details</h3> | ||
<div className="pf-u-pb-sm"> | ||
<div className="pf-u-display-flex pf-u-justify-content-space-between"> | ||
<div>Source: </div> | ||
<div> | ||
{walkthroughInfo.type === 'path' ? ( | ||
<div>---</div> | ||
) : ( | ||
<div> | ||
<a href={walkthroughInfo.gitUrl} target="_blank" rel="noopener noreferrer"> | ||
{walkthroughInfo.gitUrl === 'https://github.com/integr8ly/tutorial-web-app-walkthroughs.git' | ||
? 'Red Hat' | ||
: 'Community'} | ||
</a> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
<div className="pf-u-display-flex pf-u-justify-content-space-between"> | ||
<div>Last updated: </div> | ||
<div> | ||
{walkthroughInfo.type === 'path' ? ( | ||
<div>---</div> | ||
) : ( | ||
<div>{new Date(walkthroughInfo.commitDate).toLocaleDateString()}</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</TextContent> | ||
</CardBody> | ||
</Card> | ||
); | ||
} | ||
} | ||
|
||
WalkthroughDetails.propTypes = { | ||
walkthroughInfo: PropTypes.object | ||
}; | ||
|
||
WalkthroughDetails.defaultProps = { | ||
walkthroughInfo: { data: {} } | ||
}; | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
getWalkthroughInfo: id => dispatch(reduxActions.walkthroughActions.getWalkthroughInfo(id)) | ||
}); | ||
|
||
const mapStateToProps = state => ({ | ||
...state.walkthroughServiceReducers | ||
}); | ||
|
||
const ConnectedWalkthroughDetails = connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(WalkthroughDetails); | ||
|
||
export { ConnectedWalkthroughDetails as default, WalkthroughDetails }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
const GET_WALKTHROUGH_SERVICE = 'GET_WALKTHROUGH_SERVICE'; | ||
const GET_WALKTHROUGH = 'GET_WALKTHROUGH'; | ||
const GET_WALKTHROUGHS = 'GET_WALKTHROUGHS'; | ||
export { GET_WALKTHROUGH, GET_WALKTHROUGHS, GET_WALKTHROUGH_SERVICE }; | ||
const GET_WALKTHROUGH_INFO = 'GET_WALKTHROUGH_INFO'; | ||
|
||
export { GET_WALKTHROUGH, GET_WALKTHROUGHS, GET_WALKTHROUGH_INFO, GET_WALKTHROUGH_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