From 93e8271f231e0b78993f8c4c40526539a1aa54c7 Mon Sep 17 00:00:00 2001 From: piedram Date: Wed, 9 Aug 2023 15:04:11 -0400 Subject: [PATCH] Reassign Case page Task(s) not displaying --- .../app/queue/BlockedAdvanceToJudgeView.jsx | 17 +++++------ client/app/queue/selectors.js | 28 +++++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/client/app/queue/BlockedAdvanceToJudgeView.jsx b/client/app/queue/BlockedAdvanceToJudgeView.jsx index 19453157749..e4d0a7d14eb 100644 --- a/client/app/queue/BlockedAdvanceToJudgeView.jsx +++ b/client/app/queue/BlockedAdvanceToJudgeView.jsx @@ -11,7 +11,7 @@ import COPY from '../../COPY'; import { onReceiveAmaTasks } from './QueueActions'; import { requestSave, resetSuccessMessages, highlightInvalidFormItems } from './uiReducer/uiActions'; import { taskActionData } from './utils'; -import { taskById, appealWithDetailSelector, allHearingTasksForAppeal } from './selectors'; +import { taskById, appealWithDetailSelector, allHearingTasksForAppeal, getAllHiaringChildren } from './selectors'; import QueueFlowPage from './components/QueueFlowPage'; import SearchableDropdown from '../components/SearchableDropdown'; @@ -254,12 +254,8 @@ class BlockedAdvanceToJudgeView extends React.Component { } render = () => { - const { highlightFormItems, appeal } = this.props; - let blockingTasks; - - if (!appeal.isLegacyAppeal) { - blockingTasks = this.actionData().blocking_tasks; - } + const { highlightFormItems, appeal, currentChildren } = this.props; + const blockingTasks = appeal.isLegacyAppeal ? currentChildren : this.actionData().blocking_tasks; return {this.warningModal()} @@ -277,7 +273,7 @@ class BlockedAdvanceToJudgeView extends React.Component {
{COPY.BLOCKED_SPECIAL_CASE_MOVEMENT_PAGE_SUBTITLE}

{COPY.BLOCKED_SPECIAL_CASE_MOVEMENT_PAGE_TASKS_HEADER}

- {(!appeal.isLegacyAppeal) && } +

{COPY.BLOCKED_SPECIAL_CASE_MOVEMENT_PAGE_REASONING_HEADER}

{ highlightFormItems: state.ui.highlightFormItems, task: taskById(state, { taskId: ownProps.taskId }), allHearingTasks: allHearingTasksForAppeal(state, { appealId: appeal?.externalId }), - appeal: appealWithDetailSelector(state, ownProps) + appeal: appealWithDetailSelector(state, ownProps), + currentChildren: getAllHiaringChildren(state, ownProps) }; }; diff --git a/client/app/queue/selectors.js b/client/app/queue/selectors.js index 1c154bff39a..833c4b8c014 100644 --- a/client/app/queue/selectors.js +++ b/client/app/queue/selectors.js @@ -252,6 +252,34 @@ export const getAttorneyTasksForJudgeTask = createSelector( } ); +export const getAllHiaringChildren = createSelector( + [getAmaTasks], + (amaTasks) => { + const legacyAttorneyJudgeTaskTypes = [ + 'HearingTask', + 'ScheduleHearingTask' + ]; + const childrenTasks = []; + + for (const key in amaTasks) { + // eslint-disable-next-line no-prototype-builtins + if (amaTasks.hasOwnProperty(key)) { + if (legacyAttorneyJudgeTaskTypes.includes(amaTasks[key].type)) { + amaTasks[key].assigned_to_name = amaTasks[key].assignedTo.isOrganization ? + amaTasks[key].assignedTo.name : + amaTasks[key].ownedBy; + amaTasks[key].assigned_to_email = amaTasks[key].assignedTo.isOrganization ? + amaTasks[key].assignedTo.name : + amaTasks[key].assignedBy.firstName; + + childrenTasks.push(amaTasks[key]); + } + } + } + + return childrenTasks; + }); + // Get all task trees for all Attorney Type Tasks found with the JudgeDecisionReviewTaskId as their parentId export const getTaskTreesForAttorneyTasks = createSelector( [getAllTasksForAppeal, getAttorneyTasksForJudgeTask],