Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix request state filter and task search task state in UI #1966

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions SingularityUI/app/components/requests/RequestsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class RequestsPage extends Component {
fetchTaskFiles: PropTypes.func,
scaleRequest: PropTypes.func,
bounceRequest: PropTypes.func,
isFetchingRequests: PropTypes.bool,
params: PropTypes.object,
router: PropTypes.object,
filter: PropTypes.shape({
Expand Down Expand Up @@ -115,7 +116,7 @@ class RequestsPage extends Component {

render() {
let displayRequests = []
if (this.props.requestsInState.length) {
if (this.props.requestsInState.length || !this.props.isFetchingRequests) {
displayRequests = filterSelector({requestsInState: this.props.requestsInState, filter: this.props.filter, requestUtilizations: this.props.requestUtilizations});
} else if (this.props.requestIds.data.length) {
const options = _.map(this.props.requestIds.data, (id) => ({
Expand All @@ -130,7 +131,7 @@ class RequestsPage extends Component {
if (this.state.loading) {
table = <Loader />;
} else if (!displayRequests.length) {
table = <div className="empty-table-message"><p>No requests found. You may not be part of the correct groups or teams to view the desired requests.</p></div>;
table = <div className="empty-table-message"><p>No requests found</p></div>;
} else {
table = (
<UITable
Expand Down Expand Up @@ -185,6 +186,7 @@ function mapStateToProps(state, ownProps) {
pathname: ownProps.location.pathname,
notFound: statusCode === 404,
requestsInState: modifiedRequests,
isFetchingRequests: state.api.requestsInState.isFetching,
requestUtilizations: state.api.requestUtilizations.data,
requestIds: state.api.requestIds,
groups: userGroups,
Expand Down
1 change: 1 addition & 0 deletions SingularityUI/app/components/taskSearch/TaskSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TaskSearch extends React.Component {

renderTags() {
const {requestId, deployId, runId, host, startedAfter, startedBefore, updatedBefore, updatedAfter, lastTaskStatus} = this.props.filter;
console.log(lastTaskStatus)
return (
<div>
{requestId && !this.props.params.requestId && this.renderTag('Request ID', requestId)}{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TaskSearchFilters extends React.Component {
handleSubmit(event) {
event.preventDefault();
if (this.props.valid) {
console.log(this.props.fields)
const result = _.mapObject(this.props.fields, (field) => field.value);
this.props.onSearch(result);
}
Expand Down Expand Up @@ -95,7 +96,7 @@ class TaskSearchFilters extends React.Component {
</div>
<div className="form-group col-md-4">
<label htmlFor="lastTaskStatus">Last Task Status</label>
<ReduxSelect options={statusOptions} optionRenderer={this.renderStatusOptions} valueRenderer={this.renderStatusOptions} {...lastTaskStatus} />
<ReduxSelect simpleValue={true} options={statusOptions} optionRenderer={this.renderStatusOptions} valueRenderer={this.renderStatusOptions} {...lastTaskStatus} />
</div>
<div className="col-md-4 text-right">

Expand Down