diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js index f7ce78a1f87e58d962e048e836b1ef85b0502e20..3eff0cd7f834dcf034040504a171b3a109d9a3ba 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js @@ -1125,9 +1125,9 @@ function Jeditor(props) { function getPipelineFrequencyResolution(channelsPerPart, isDigifil) { if (props.observationType && props.observationType.indexOf('pulsar') >= 0) { if (isDigifil) { - return singlePulseSearch?(clockValue / 1024 / (channelsPerPart/props.targetObservation.specifications_doc.beamformer.pipelines[0].coherent.settings.subbands_per_file)).toFixed(2):'N/A'; + return singlePulseSearch?(clockValue / 1024 / (channelsPerPart/props.observationTaskValue.beamformer.pipelines[0].coherent.settings.subbands_per_file)).toFixed(2):'N/A'; } else { - return filterBankEnabled?(clockValue / 1024 / (channelsPerPart/props.targetObservation.specifications_doc.beamformer.pipelines[0].coherent.settings.subbands_per_file)).toFixed(2):'N/A'; + return filterBankEnabled?(clockValue / 1024 / (channelsPerPart/props.observationTaskValue.beamformer.pipelines[0].coherent.settings.subbands_per_file)).toFixed(2):'N/A'; } } else { return 'N/A'; @@ -1142,7 +1142,7 @@ function Jeditor(props) { */ function getPipelineTimeResolution(channelsPerPart, timeIntegrationSteps) { if (props.observationType && props.observationType.indexOf('pulsar') >= 0) { - return singlePulseSearch?(1/channelsPerPart * props.targetObservation.specifications_doc.beamformer.pipelines[0].coherent.settings.time_integration_factor * timeIntegrationSteps):'N/A'; + return singlePulseSearch?(1/channelsPerPart * props.observationTaskValue.beamformer.pipelines[0].coherent.settings.time_integration_factor * timeIntegrationSteps):'N/A'; } } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/edit.js index ef3ff7c13b13fbd654f14914a23c1e9a65215d9f..a6002c06ab98d582ba0b9385c599bc484e5c8b26 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/edit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/edit.js @@ -235,6 +235,10 @@ export class TaskEdit extends Component { TaskService.getTaskDetails("draft", taskId) .then(async(task) => { if (task) { + let obsTask = {}; + if (task.task_type === 'pipeline') { + obsTask = _.find(task.predecessors, {task_type: 'observation'}); + } const taskTemplate = await TaskService.getTaskTemplate(task.specifications_template_id); const schedulingUnit = await TaskService.getSchedulingUnit("draft", task.scheduling_unit_draft_id, true); let targetTask = _.find(schedulingUnit[`task_drafts`], suTask => ( @@ -246,7 +250,7 @@ export class TaskEdit extends Component { fieldsToDisable.push('SAPs.'+ index +'.name') }) this.templateOutput[task.specifications_template_id] = task.specifications_doc; - this.setState({schedulingUnit: schedulingUnit,targetTask: targetTask, task: task, taskSchema: taskTemplate.ref_resolved_schema, isLoading: false, fieldsToDisable: fieldsToDisable}); + this.setState({observationTask: obsTask, schedulingUnit: schedulingUnit,targetTask: targetTask, task: task, taskSchema: taskTemplate.ref_resolved_schema, isLoading: false, fieldsToDisable: fieldsToDisable}); } else { this.setState({redirect: "/not-found"}); } @@ -275,6 +279,7 @@ export class TaskEdit extends Component { parentFunction: this.setEditorFunction, observationType: template.name, targetObservation: this.state.targetTask, + observationTaskValue: this.state.observationTask.specifications_doc }); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js index 617f25ead34d4112ff03cdea6aeb1b1321a0db3b..d369f422f7abc66ad133a76b41b2e2e4a7c6f4da 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/view.js @@ -208,6 +208,10 @@ export class TaskView extends Component { TaskService.getTaskDetails(taskType, taskId, this.fetchSubtask) .then(async(task) => { if (task) { + let obsTask = {}; + if (task.task_type === 'pipeline') { + obsTask = _.find(task.predecessors, {task_type: 'observation'}); + } taskType === 'blueprint' && await this.getSubtaskDetails(task.subtasks); const suId = taskType==='draft'?task.scheduling_unit_draft_id:task.scheduling_unit_blueprint_id; const taskTemplate = await TaskService.getTaskTemplate(task.specifications_template_id); @@ -222,9 +226,9 @@ export class TaskView extends Component { // TODO: Need to make it working with resolved schema // taskTemplate.schema = await UtilService.getResolvedSchema(taskTemplate.url); if(taskType === 'draft' && task.task_blueprints_ids && task.task_blueprints_ids.length > 0) { - this.setState({schedulingUnit: schedulingUnit, supath:path, targetTask: targetTask, hasBlueprint: true, task: task, taskTemplate: taskTemplate, isLoading: false, taskId: taskId, taskType: taskType}); + this.setState({observationTask: obsTask, schedulingUnit: schedulingUnit, supath:path, targetTask: targetTask, hasBlueprint: true, task: task, taskTemplate: taskTemplate, isLoading: false, taskId: taskId, taskType: taskType}); } else { - this.setState({schedulingUnit: schedulingUnit, supath:path, targetTask: targetTask, hasBlueprint: false, task: task, taskTemplate: taskTemplate, isLoading: false, taskId: taskId, taskType: taskType}); + this.setState({observationTask: obsTask, schedulingUnit: schedulingUnit, supath:path, targetTask: targetTask, hasBlueprint: false, task: task, taskTemplate: taskTemplate, isLoading: false, taskId: taskId, taskType: taskType}); } this.prepareActionMenus(); } else { @@ -970,6 +974,7 @@ export class TaskView extends Component { resolveExtRef: true, observationType: this.state.taskTemplate.name, targetObservation: this.state.targetTask, + observationTaskValue: this.state.observationTask.specifications_doc }); } diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js index 06367b75983a1a39ff752e80dbf3a761bcbde1c0..9902e34efbd028056e4a923f31445f4d272e4e3f 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js @@ -32,7 +32,7 @@ const UIConstants = { CURRENT_WORKFLOW_STAGE:['Waiting To Be Scheduled','Scheduled','QA Reporting (TO)', 'QA Reporting (SDCO)', 'PI Verification', 'Decide Acceptance','Ingesting','Unpin Data','Done'], SU_PRIORITY_QUEUE:['A','B'], TARGET_OBSERVATION_NAMES: ['target observation','parallel calibrator target and beamforming observation', - 'parallel target and beamforming observation','parallel calibrator target observation', 'beamforming observation'], + 'parallel target and beamforming observation','parallel calibrator target observation'], SU_NOT_STARTED_STATUSES: ['defined', 'schedulable', 'scheduled', 'unschedulable'], SU_ACTIVE_STATUSES: ['started', 'observing', 'observed', 'processing', 'processed', 'ingesting', 'ingested'], }