kopia lustrzana https://github.com/OpenDroneMap/WebODM
Automatically expand task in project if there's a single task
rodzic
8976aa51e3
commit
5fc886028e
|
@ -3,6 +3,7 @@ import '../css/TaskList.scss';
|
|||
import TaskListItem from './TaskListItem';
|
||||
import PropTypes from 'prop-types';
|
||||
import $ from 'jquery';
|
||||
import HistoryNav from '../classes/HistoryNav';
|
||||
import { _, interpolate } from '../classes/gettext';
|
||||
|
||||
class TaskList extends React.Component {
|
||||
|
@ -19,6 +20,8 @@ class TaskList extends React.Component {
|
|||
constructor(props){
|
||||
super(props);
|
||||
|
||||
this.historyNav = new HistoryNav(props.history);
|
||||
|
||||
this.state = {
|
||||
tasks: [],
|
||||
error: "",
|
||||
|
@ -54,6 +57,10 @@ class TaskList extends React.Component {
|
|||
|
||||
this.taskListRequest =
|
||||
$.getJSON(this.props.source, json => {
|
||||
if (json.length === 1){
|
||||
this.historyNav.addToQSList("project_task_expanded", json[0].id);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
tasks: json
|
||||
});
|
||||
|
@ -67,7 +74,7 @@ class TaskList extends React.Component {
|
|||
.always(() => {
|
||||
this.setState({
|
||||
loading: false
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue