webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.js in foreman-tasks-0.17.2 vs webpack/ForemanTasks/Components/TasksDashboard/TasksDashboard.js in foreman-tasks-0.17.3
- old
+ new
@@ -12,29 +12,34 @@
import { timePropType, queryPropType } from './TasksDashboardPropTypes';
import './TasksDashboard.scss';
class TasksDashboard extends React.Component {
componentDidMount() {
- const { time, initializeDashboard, fetchTasksSummary } = this.props;
+ const {
+ time,
+ initializeDashboard,
+ fetchTasksSummary,
+ parentTaskID,
+ } = this.props;
const query = getQueryFromUrl();
initializeDashboard({
time: query.time,
query,
});
// dont fetch if time is going to be changed
if (!query.time || query.time === time) {
- fetchTasksSummary(time);
+ fetchTasksSummary(time, parentTaskID);
}
}
componentDidUpdate(prevProps) {
- const { time, fetchTasksSummary } = this.props;
+ const { time, fetchTasksSummary, parentTaskID } = this.props;
if (time !== prevProps.time) {
- fetchTasksSummary(time);
+ fetchTasksSummary(time, parentTaskID);
}
}
render() {
const { time, query, tasksSummary, updateTime, updateQuery } = this.props;
@@ -63,18 +68,20 @@
initializeDashboard: PropTypes.func,
updateTime: PropTypes.func,
updateQuery: PropTypes.func,
fetchTasksSummary: PropTypes.func,
history: PropTypes.object.isRequired,
+ parentTaskID: PropTypes.string,
};
TasksDashboard.defaultProps = {
time: TASKS_DASHBOARD_AVAILABLE_TIMES.H24,
query: {},
tasksSummary: TasksCardsGrid.defaultProps.data,
initializeDashboard: noop,
updateTime: noop,
updateQuery: noop,
fetchTasksSummary: noop,
+ parentTaskID: '',
};
export default TasksDashboard;