Skip to content

Commit

Permalink
Actually filter tasks by application
Browse files Browse the repository at this point in the history
Signed-off-by: David Zager <david.j.zager@gmail.com>
  • Loading branch information
djzager committed Feb 8, 2023
1 parent 1b4d0f9 commit 70e2332
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ export const ApplicationsTableAddons: React.FC = () => {
// Here we want all tasks that don't belong to admin/windup
const { tasks } = useFetchAllTasks({ notAddons: ["admin", "windup"] });
const getTasksForApplication = (application: Application) => {
tasks.filter((task: Task) => {
task.application?.id === application.id;
const filteredTasks = tasks.filter((task: Task) => {
return task.application?.id === application.id;
});
return tasks.sort((a, b) => {
return filteredTasks.sort((a, b) => {
if (a?.createTime && b?.createTime) {
return a.createTime > b.createTime ? 1 : -1;
}
Expand Down Expand Up @@ -315,7 +315,7 @@ export const ApplicationsTableAddons: React.FC = () => {
<div className="pf-c-table__expandable-row-content">
<ApplicationListExpandedAreaAddons
application={item}
tasks={getTasksForApplication(item)}
tasks={appTasks}
/>
</div>,
],
Expand Down

0 comments on commit 70e2332

Please # to comment.