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 TaskListItem from './TaskListItem';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
import HistoryNav from '../classes/HistoryNav';
|
||||||
import { _, interpolate } from '../classes/gettext';
|
import { _, interpolate } from '../classes/gettext';
|
||||||
|
|
||||||
class TaskList extends React.Component {
|
class TaskList extends React.Component {
|
||||||
|
@ -19,6 +20,8 @@ class TaskList extends React.Component {
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
this.historyNav = new HistoryNav(props.history);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
tasks: [],
|
tasks: [],
|
||||||
error: "",
|
error: "",
|
||||||
|
@ -54,6 +57,10 @@ class TaskList extends React.Component {
|
||||||
|
|
||||||
this.taskListRequest =
|
this.taskListRequest =
|
||||||
$.getJSON(this.props.source, json => {
|
$.getJSON(this.props.source, json => {
|
||||||
|
if (json.length === 1){
|
||||||
|
this.historyNav.addToQSList("project_task_expanded", json[0].id);
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
tasks: json
|
tasks: json
|
||||||
});
|
});
|
||||||
|
@ -67,7 +74,7 @@ class TaskList extends React.Component {
|
||||||
.always(() => {
|
.always(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
loading: false
|
loading: false
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue