mirror of
https://github.com/reactos/developer-web-interface.git
synced 2024-11-23 03:49:43 +00:00
Improved UI of Pull Requests page
This commit is contained in:
parent
f53f79e23b
commit
542576fbbd
@ -54,7 +54,7 @@ const mapStateToProps = ({ builders }, ownProps) => {
|
|||||||
return {
|
return {
|
||||||
builds: ownProps.builds.map(build => ({
|
builds: ownProps.builds.map(build => ({
|
||||||
...build,
|
...build,
|
||||||
builderName: builders[build.builderid].name
|
builderName: builders[build.builderid] && builders[build.builderid].name
|
||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
DropdownItem
|
DropdownItem
|
||||||
} from 'reactstrap';
|
} from 'reactstrap';
|
||||||
import { currState, loadPulls } from '../redux/actions';
|
import { currState, loadPulls } from '../redux/actions';
|
||||||
|
import {PULL_STATE} from '../redux/constants'
|
||||||
|
|
||||||
class pullState extends React.Component {
|
class pullState extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -57,7 +58,7 @@ class pullState extends React.Component {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.props.pullState.pullsState.map(this.renderPullsState)}
|
{Object.values(PULL_STATE).map(this.renderPullsState)}
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
|
@ -3,35 +3,25 @@ import { UncontrolledCollapse, CardBody, Card, CardHeader } from 'reactstrap';
|
|||||||
import BuildDetails from './BuildDetails';
|
import BuildDetails from './BuildDetails';
|
||||||
import TestDetails from './TestDetails';
|
import TestDetails from './TestDetails';
|
||||||
|
|
||||||
|
|
||||||
function PullsCard(props) {
|
function PullsCard(props) {
|
||||||
let tog = 'toggler' + props.id;
|
let tog = 'toggler' + props.id;
|
||||||
let createdDate = new Date(props.created_at);
|
let createdDate = new Date(props.created_at);
|
||||||
let closedDate = new Date(props.closed_at);
|
let closedDate = new Date(props.closed_at);
|
||||||
let mergedDate = new Date(props.merged_at);
|
let mergedDate = new Date(props.merged_at);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className='new' type='button' id={tog}>
|
<CardHeader className='new' type='button' id={tog}>
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<div className='col-sm'>{props.number}</div>
|
<div className='col-sm-1'><a href={props.html_url}>#{props.number}</a></div>
|
||||||
<div className='col-sm'>{props.merge_commit_sha.substring(0, 7)}</div>
|
<div className='col-sm-9'>{props.title}</div>
|
||||||
<div className='col-sm'>{props.state}</div>
|
<div className='col-sm-2'>{props.user.login}</div>
|
||||||
<div className='col-sm'>{props.user.login}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<UncontrolledCollapse toggler={tog}>
|
<UncontrolledCollapse toggler={tog}>
|
||||||
<CardBody className='indent'>
|
<CardBody className='indent'>
|
||||||
<p>
|
<p style={{whiteSpace: "pre-line"}}>{props.body}</p>
|
||||||
<strong>Pull number: </strong>{' '}
|
|
||||||
<a target='_blank' rel='noreferrer noopener' href={props.html_url}>
|
|
||||||
{props.number}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<strong>Title:</strong> {props.title}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<strong>Body:</strong> {props.body}
|
|
||||||
</p>
|
|
||||||
<div className='row'>
|
<div className='row'>
|
||||||
<div className='col-sm'>
|
<div className='col-sm'>
|
||||||
<strong>Created at: </strong>
|
<strong>Created at: </strong>
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.s {
|
.s {
|
||||||
text-align: center;
|
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
}
|
}
|
||||||
.m1 {
|
.m1 {
|
||||||
@ -20,6 +19,7 @@
|
|||||||
border-bottom: 1px solid #aaa;
|
border-bottom: 1px solid #aaa;
|
||||||
margin: 10px 0px;
|
margin: 10px 0px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-tabs__tab {
|
.react-tabs__tab {
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
export const PULL_STATE = {
|
||||||
|
OPEN: 'open',
|
||||||
|
CLOSED: 'closed',
|
||||||
|
ALL: 'all',
|
||||||
|
}
|
||||||
|
|
||||||
export const COMMITS = {
|
export const COMMITS = {
|
||||||
LOAD: 'COMMITS_LOAD',
|
LOAD: 'COMMITS_LOAD',
|
||||||
LOAD_SUCCESS: 'COMMITS_LOAD_SUCCESS',
|
LOAD_SUCCESS: 'COMMITS_LOAD_SUCCESS',
|
||||||
|
@ -1,17 +1,11 @@
|
|||||||
import { PULLS } from '../constants';
|
import { PULLS, PULL_STATE } from '../constants';
|
||||||
|
|
||||||
const pullStateReducer = (
|
const pullStateReducer = (state = PULL_STATE.OPEN, action) => {
|
||||||
state = { pullsState: ['open', 'closed', 'all'], currentPullState: 'all' },
|
if (action.type === PULLS.CURRENT) {
|
||||||
action
|
return action.pullState;
|
||||||
) => {
|
}
|
||||||
if (action.type === PULLS.CURRENT) {
|
|
||||||
return {
|
|
||||||
...state,
|
|
||||||
currentPullState: action.pullState
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pullStateReducer;
|
export default pullStateReducer;
|
||||||
|
@ -3,7 +3,7 @@ import { PULLS } from '../constants';
|
|||||||
import { fetchPulls } from '../api';
|
import { fetchPulls } from '../api';
|
||||||
import { setPulls, setPullsError, setPages } from '../actions';
|
import { setPulls, setPullsError, setPages } from '../actions';
|
||||||
const getNewPage = state => parseInt(state.isLoading.newPage, 10);
|
const getNewPage = state => parseInt(state.isLoading.newPage, 10);
|
||||||
const getNewState = state => state.pullState.currentPullState;
|
const getNewState = state => state.pullState;
|
||||||
function* handlePullsLoad() {
|
function* handlePullsLoad() {
|
||||||
try {
|
try {
|
||||||
const newPage = yield select(getNewPage);
|
const newPage = yield select(getNewPage);
|
||||||
|
Loading…
Reference in New Issue
Block a user