diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js index 6b7438a14cf3747d97fa288fdca94e940bea1ea2..f53cf5544e3f848aacb0f87be9e9209d21e5727e 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/summary.js @@ -418,9 +418,9 @@ export class SchedulingUnitSummary extends Component { <ViewTable data={schedulingUnit.task_blueprints} defaultcolumns={[{id: "ID", name: "Name", short_description: "Short Description" , - typeValue:"Type", controlId: 'Control ID', - start_time:{name:"Start Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, - stop_time:{name:"End Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, + typeValue:"Type", subtasks_ids: 'Control ID', + scheduled_start_time:{name:"Start Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, + scheduled_stop_time:{name:"End Time", format:UIConstants.CALENDAR_DATETIME_FORMAT}, status: {name:"Status", showTag: true, tagClass: 'su-$dynamic$'}, unschedulable_reason: {name:"Unschedulable Reason"}, obsolete: 'Obsolete'}]} optionalcolumns={[{actionpath: "actionpath"}]} columnclassname={[{"ID": "filter-input-50","Name":"filter-input-75","Type":"filter-input-75","Control ID":"filter-input-75", "Start Time": "filter-input-75", "End Time": "filter-input-75", diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/data/week.view.data.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/data/week.view.data.js index bcec1a5b4858fb8a1fe0e00ed3f226462c4efa2f..0600c5eabdc04282cfc86c97a5033a81c9cb4044 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/data/week.view.data.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/data/week.view.data.js @@ -1,7 +1,6 @@ import UIConstants from "../../../utils/ui.constants"; import ScheduleService from "../../../services/schedule.service"; import { - addNestedBlueprintInformation, enhanceReservations, enhanceSchedulingUnitData } from "../helpers/week.view.helper"; @@ -10,6 +9,7 @@ import AuthUtil from "../../../utils/auth.util"; import UtilService from "../../../services/util.service"; import {getSunTimingItems} from "../helpers/timeline.item.helper"; import moment from "moment/moment"; +import TaskService from "../../../services/task.service"; export async function fetchTimelineData(startTime, endTime, timelineCommonUtils, setData) { const from = startTime.format(UIConstants.CALENDAR_DATETIME_FORMAT); @@ -74,6 +74,25 @@ export async function fetchLSTShift(startTime, setHeaderSettings) { })) } +async function addNestedBlueprintInformation(suBluePrint, timelineCommonUtils) { + let missingStations = [] + for (let taskIndex = 0; taskIndex < suBluePrint.task_blueprints.length; taskIndex++) { + const task = suBluePrint.task_blueprints[taskIndex] + let subtasksSpecifications = [] + for (const subtaskId of task.subtasks_ids) { + subtasksSpecifications.push(await TaskService.getSubtaskDetails(subtaskId, "specifications_doc")) + const foundMissingStations = await TaskService.getSubtaskMissingStations(subtaskId); + missingStations = missingStations.concat(foundMissingStations.filter((item) => missingStations.indexOf(item) < 0)) + } + suBluePrint.task_blueprints[taskIndex].subtasks = subtasksSpecifications + } + suBluePrint.stations = timelineCommonUtils.getSUStations(suBluePrint); + suBluePrint.missingStations = missingStations + + const projectInfo = await ScheduleService.getSchedulingSet(suBluePrint.draft.scheduling_set_id, "project_id") + suBluePrint.project = projectInfo.project_id; +} + export async function fetchSUSummaryInformation(id, timelineCommonUtils, setSummarySettings) { let suBluePrint = await ScheduleService.getBlueprintByschedulingUnitId(id, "task_blueprints,draft") await addNestedBlueprintInformation(suBluePrint, timelineCommonUtils); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js index e2303feaa8a444d342b09abd1ae858283707e158..6d35aa46274a1498401a5d3eccfef385557be9f5 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/week.view.helper.js @@ -1,8 +1,6 @@ import moment from "moment/moment"; import UIConstants from "../../../utils/ui.constants"; -import ScheduleService from "../../../services/schedule.service"; import UtilService from "../../../services/util.service"; -import TaskService from "../../../services/task.service"; export function createGroups(startTime, amountOfGroups = 7) { const groups = [] @@ -212,24 +210,7 @@ export function enhanceReservations(reservations, timelineCommonUtils) { }) } -export async function addNestedBlueprintInformation(suBluePrint, timelineCommonUtils) {//TODO: backend requests - let missingStations = [] - for (let taskIndex = 0; taskIndex < suBluePrint.task_blueprints.length; taskIndex++) { - const task = suBluePrint.task_blueprints[taskIndex] - let subtasksSpecifications = [] - for (const subtaskId of task.subtasks_ids) { - subtasksSpecifications.push(await TaskService.getSubtaskDetails(subtaskId, "specifications_doc")) - const foundMissingStations = await TaskService.getSubtaskMissingStations(subtaskId); - missingStations = missingStations.concat(foundMissingStations.filter((item) => missingStations.indexOf(item) < 0)) - } - suBluePrint.task_blueprints[taskIndex].subtasks = subtasksSpecifications - } - suBluePrint.stations = timelineCommonUtils.getSUStations(suBluePrint); - suBluePrint.missingStations = missingStations - const projectInfo = await ScheduleService.getSchedulingSet(suBluePrint.draft.scheduling_set_id, "project_id") - suBluePrint.project = projectInfo.project_id; -} export function getCursorDateTimes(cursorTimeUTC, groupIndex, groupDate, lstShiftInSeconds, setCursorDateTimes) { const cursorTime = moment(cursorTimeUTC).format(UIConstants.CALENDAR_TIME_FORMAT);