-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from halkeye/add-issues-tab
Add Releases and Issues Tabs to plugin site.
- Loading branch information
Showing
11 changed files
with
308 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, {useState, useEffect} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import axios from 'axios'; | ||
|
||
function PluginIssues({pluginId}) { | ||
const [isLoading, setIsLoading] = useState(false); | ||
const [issues, setIssues] = useState([]); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
setIsLoading(true); | ||
const result = await axios(`/api/plugin/${pluginId}/issues/open`); | ||
setIssues(result.data.issues || []); | ||
setIsLoading(false); | ||
}; | ||
fetchData(); | ||
return; | ||
}, []); | ||
|
||
if (isLoading) { | ||
return (<div className="spinner-border" role="status"> | ||
<span className="sr-only">Loading...</span> | ||
</div>); | ||
} | ||
|
||
return ( | ||
<div> | ||
<div className="table-responsive"> | ||
<table className="table"> | ||
<caption>List of issues</caption> | ||
<thead> | ||
<tr> | ||
<th scope="col">Key</th> | ||
<th scope="col">Summary</th> | ||
<th scope="col">Assignee</th> | ||
<th scope="col">Reporter</th> | ||
<th scope="col">Priority</th> | ||
<th scope="col">Status</th> | ||
<th scope="col">Resolution</th> | ||
<th scope="col">Created</th> | ||
<th scope="col">Updated</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{issues && issues.map(issue => { | ||
return ( | ||
<tr key={issue.key}> | ||
<th scope="row"><a href={issue.url}>{issue.key}</a></th> | ||
<td>{issue.summary}</td> | ||
<td>{issue.assignee}</td> | ||
<td>{issue.reporter}</td> | ||
<td>{issue.priority}</td> | ||
<td>{issue.status}</td> | ||
<td>{issue.resolution}</td> | ||
<td>{issue.created}</td> | ||
<td>{issue.updated}</td> | ||
</tr> | ||
); | ||
})} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
PluginIssues.propTypes = { | ||
pluginId: PropTypes.string.isRequired | ||
}; | ||
export default PluginIssues; |
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,7 @@ | ||
#pluginReleases--container { | ||
margin-top: 10px; | ||
} | ||
|
||
#pluginReleases--container .item { | ||
margin-bottom: 10px; | ||
} |
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,58 @@ | ||
import React, {useState, useEffect} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import axios from 'axios'; | ||
import ReactTimeAgo from 'react-time-ago/tooltip'; | ||
import './PluginReleases.css'; | ||
|
||
function PluginIssues({pluginId}) { | ||
const [isLoading, setIsLoading] = useState(false); | ||
const [releases, setReleases] = useState([]); | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
setIsLoading(true); | ||
const result = await axios(`/api/plugin/${pluginId}/releases`); | ||
setReleases(result.data.releases || []); | ||
setIsLoading(false); | ||
}; | ||
fetchData(); | ||
return; | ||
}, []); | ||
|
||
if (isLoading) { | ||
return (<div className="spinner-border" role="status"> | ||
<span className="sr-only">Loading...</span> | ||
</div>); | ||
} | ||
|
||
return ( | ||
<div id="pluginReleases--container" className="container"> | ||
{releases && releases.map(release => { | ||
return ( | ||
<div key={release.tag_name} className="item card"> | ||
<div className="card-header"> | ||
<h5 className="card-title d-flex justify-content-between"> | ||
<div>{release.name || release.tag_name}</div> | ||
<div> | ||
{'Released: '} | ||
<ReactTimeAgo date={new Date(release.published_at)} /> | ||
</div> | ||
</h5> | ||
</div> | ||
<div className="card-body"> | ||
<p | ||
className="card-text" | ||
dangerouslySetInnerHTML={{__html: release.bodyHTML}} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
} | ||
|
||
PluginIssues.propTypes = { | ||
pluginId: PropTypes.string.isRequired | ||
}; | ||
export default PluginIssues; |
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,8 @@ | ||
:root { | ||
--rrui-tooltip-text-color: white; | ||
--rrui-tooltip-background-color: grey; | ||
--rrui-tooltip-border-radius: 25px; | ||
--rrui-tooltip-hidden-distance: 10px; | ||
--rrui-tooltip-visible-distance: 0.5px; | ||
--rrui-tooltip-animation-duration: 0.5s; | ||
} |
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
Oops, something went wrong.