diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js index 093aa654cc4894d3af488896a71070f94499f40b..2ab403df7973af2bad75511f3019b595cee4c3a7 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/SchedulingUnitList.js @@ -58,6 +58,7 @@ class SchedulingUnitList extends Component{ filter: "multiselect-filter", }, workflowStatus: {name: "Workflow Status",filter: "select"}, + dataAccepted: {name: "Data Accepted", filter: 'none'}, suid: {name: "Scheduling Unit ID", tooltip: this.COMMA_SEPARATE_TOOLTIP}, priority:{name:"Priority"}, project:{name:"Project"}, @@ -120,6 +121,7 @@ class SchedulingUnitList extends Component{ columnOrders: [ "Status", "Workflow Status", + "Data Accepted", "Scheduling Unit ID", "Linked Draft ID", "Project", @@ -197,6 +199,7 @@ class SchedulingUnitList extends Component{ "Type": "filter-input-75", "Status":"filter-input-125", "workflowStatus":"filter-input-100", + "dataAccepted":"filter-input-50", "Stations (CS/RS/IS)":"filter-input-50", "Tasks content (O/P/I)":"filter-input-50", "Number of SAPs in the target observation":"filter-input-50", @@ -559,7 +562,7 @@ class SchedulingUnitList extends Component{ */ async getFilterColumns(type) { //const columnOrderToBeRemove = ['Status', 'Workflow Status', 'Observation Start Time', 'Observation End Time', 'Process Start Time', 'Process End Time' ]; - const columnDefinitionToBeRemove = ['status', 'workflowStatus', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time']; + const columnDefinitionToBeRemove = ['status', 'workflowStatus', 'dataAccepted', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time']; //For Constraint const constColDefToBeRemove = ['observation_strategy_template_name', 'duration', 'observation_strategy_template_id', 'observation_strategy_template_description', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'task_content', 'target_observation_sap', 'do_cancel', 'created_at', 'updated_at', 'priority_rank', 'priority_queue', 'output_pinned', 'draft', 'targetName','targetAngle1','targetAngle2','targetRef']; @@ -675,6 +678,7 @@ class SchedulingUnitList extends Component{ if (!this.props.project || (this.props.project && this.props.project === scheduleunit.scheduling_set.project.name)) { scheduleunit['status'] = null; scheduleunit['workflowStatus'] = null; + scheduleunit['dataAccepted'] = null; scheduleunit['observation_strategy_template_name'] = scheduleunit.observation_strategy_template?scheduleunit.observation_strategy_template.name:null; scheduleunit['observation_strategy_template_description'] = scheduleunit.observation_strategy_template?scheduleunit.observation_strategy_template.description:null; scheduleunit['draft'] = this.getLinksList(scheduleunit.scheduling_unit_blueprints_ids, 'blueprint'); @@ -708,7 +712,9 @@ class SchedulingUnitList extends Component{ 'id': `/schedulingunit/view/blueprint/${scheduleunit.id}` }; scheduleunit['scheduling_set'] = scheduleunit.draft.scheduling_set.name; - scheduleunit['workflowStatus'] = this.timelineCommonUtils.getWorkflowStatus(workflows, scheduleunit.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, scheduleunit.id); + scheduleunit['workflowStatus'] = workflowDetails.status; + scheduleunit['dataAccepted'] = workflowDetails.dataAccepted; // TODO: When time taken to load all workflow data increases, change to load individual workflow data //scheduleunit['workflowStatus'] = this.timelineCommonUtils.getWorkflowStatus(scheduleunit); scheduleunit.duration = moment.utc((scheduleunit.duration || 0)*1000).format('HH:mm:ss'); @@ -737,7 +743,9 @@ class SchedulingUnitList extends Component{ 'id': `/schedulingunit/view/blueprint/${scheduleunit.id}` }; scheduleunit['scheduling_set'] = scheduleunit.draft.scheduling_set.name; - scheduleunit['workflowStatus'] = this.timelineCommonUtils.getWorkflowStatus(workflows, scheduleunit.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, scheduleunit.id); + scheduleunit['workflowStatus'] = workflowDetails.status; + scheduleunit['dataAccepted'] = workflowDetails.dataAccepted; // TODO: When time taken to load all workflow data increases, change to load individual workflow data //scheduleunit['workflowStatus'] = this.timelineCommonUtils.getWorkflowStatus(scheduleunit); scheduleunit.duration = moment.utc((scheduleunit.duration || 0)*1000).format('HH:mm:ss'); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js index ab8d6058a522c534ffd9780e34a5231b78a7c489..d5fc0f6602d4f6676a707249870f2d4f45d3963a 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js @@ -50,7 +50,8 @@ class ViewSchedulingUnit extends Component { 'task_blueprints.process_stop_time','task_blueprints.duration','task_blueprints.relative_start_time','task_blueprints.relative_stop_time','task_blueprints.tags', 'task_blueprints.url', 'task_blueprints.do_cancel','task_blueprints.obsolete_since','task_blueprints.created_at','task_blueprints.updated_at','task_blueprints.specifications_template.id', 'task_blueprints.draft_id', 'task_blueprints.specifications_template.type_value','task_blueprints.specifications_template.schema','draft.scheduling_constraints_template.schema','draft.scheduling_constraints_template.url','task_blueprints.produced_by_ids','task_blueprints.specifications_doc', - 'draft.observation_strategy_template_id','draft.observation_strategy_template.id', ,'draft.observation_strategy_template.template'] + 'draft.observation_strategy_template_id','draft.observation_strategy_template.id','draft.observation_strategy_template.name', + 'draft.observation_strategy_template.description', 'draft.observation_strategy_template.template'] SU_DRAFT_EXPAND= 'scheduling_constraints_template,scheduling_set,task_drafts.specifications_template,task_drafts,observation_strategy_template,scheduling_unit_blueprints' SU_DRAFT_FIELDS=['id','url','created_at','status','tags','output_pinned','duration','name','on_sky_start_time','on_sky_stop_time','priority_rank','priority_queue_value','description', 'scheduling_constraints_doc','scheduling_constraints_template.schema','scheduling_constraints_template.url','observation_strategy_template_id','task_drafts.url','scheduling_constraints_template_id', @@ -59,7 +60,7 @@ class ViewSchedulingUnit extends Component { 'task_drafts.process_stop_time','task_drafts.duration','task_drafts.relative_start_time','task_drafts.relative_stop_time','task_drafts.tags','task_drafts.do_cancel', 'task_drafts.obsolete_since','task_drafts.created_at','task_drafts.updated_at','task_drafts.specifications_template.id','task_drafts.specifications_template.type_value','task_drafts.specifications_template.schema', 'task_drafts.task_blueprints_ids','task_drafts.specifications_doc','task_drafts.produced_by_ids','scheduling_unit_blueprints_ids', - 'observation_strategy_template.id','observation_strategy_template.template', + 'observation_strategy_template.id','observation_strategy_template.name','observation_strategy_template.description','observation_strategy_template.template', 'scheduling_unit_blueprints.id','scheduling_unit_blueprints.name'] @@ -368,6 +369,8 @@ class ViewSchedulingUnit extends Component { schedulingUnit = this.formatConstraintDocForUI(schedulingUnit); if (schedulingUnit.draft) { schedulingUnit['observation_strategy_template_id'] = schedulingUnit.draft.observation_strategy_template_id; + schedulingUnit['observation_strategy_template'] = { name: schedulingUnit.draft.observation_strategy_template.name, + description: schedulingUnit.draft.observation_strategy_template.description}; schedulingUnit['scheduling_set'] = schedulingUnit.draft.scheduling_set; schedulingUnit['scheduling_constraints_template'] = schedulingUnit.draft.scheduling_constraints_template } @@ -1837,6 +1840,12 @@ class ViewSchedulingUnit extends Component { { this.state.isLoading ? <AppLoader /> : this.state.scheduleunit && <> <div className="main-content"> + <div className="p-grid"> + <label className="col-lg-2 col-md-2 col-sm-12">Strategy Name</label> + <span className="p-col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.observation_strategy_template.name}</span> + <label className="col-lg-2 col-md-2 col-sm-12">Strategy Description</label> + <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.observation_strategy_template.description}</span> + </div> <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12">Name</label> <span className="p-col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.name}</span> @@ -1859,7 +1868,7 @@ class ViewSchedulingUnit extends Component { <div className="p-grid"> <label className="col-lg-2 col-md-2 col-sm-12" >Duration (HH:mm:ss)</label> <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc((this.state.scheduleunit.duration ? this.state.scheduleunit.duration : 0) * 1000).format(UIConstants.CALENDAR_TIME_FORMAT)}</span> - <label className="col-lg-2 col-md-2 col-sm-12">Template ID</label> + <label className="col-lg-2 col-md-2 col-sm-12">Strategy ID</label> <span className="col-lg-4 col-md-4 col-sm-12">{this.state.scheduleunit.observation_strategy_template_id}</span> </div> <div className="p-grid"> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/common.utils.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/common.utils.js index af20a5206363fbf89c8f12154decc058e337aea8..afbb6a2fa65638472f2a874b0737b761c7af03cc 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/common.utils.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/common.utils.js @@ -172,6 +172,25 @@ class TimelineCommonUtils { return workflowStatus; } + /** + * Function to get the current workflow details for the scheduling unit + * @param {Array} workflowProcesses - List of workflow processes filtered for the SUBs in the table view + * @param {Array} workflowTasks - List of workflow tasks filtered for the workflow processes + * @param {Number} scheduleunitId - Scheduling Unit blueprint id for which the status to be found + * @returns workflow status as Object with status, results_accepted. + */ + getWorkflowDetails(workflows, scheduleunitId) { + let workflowDetails = {}; + const suWorkflow = _.find(workflows.processes, ['su', scheduleunitId]); + const suWorkflowTasks = suWorkflow?_.filter(workflows.tasks, ['process', suWorkflow.id]):[]; + const lastWorkflowTask = suWorkflowTasks.length > 0?(_.orderBy(suWorkflowTasks, ['id'], ['desc']))[0]:null; + if (lastWorkflowTask) { + workflowDetails["dataAccepted"] = suWorkflow.results_accepted; + workflowDetails["status"] = this.WORKFLOW_STATUS_MAP[lastWorkflowTask.flow_task.toLowerCase()]; + } + return workflowDetails; + } + /** * Function to store the Last UI option atrributes as preference to consider while loading the page. * @param {Object} timelineUIAttributes - JSON object with all options and its last selected values. diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js index 8e38aeb823b105ec6e5d60784a341571449ff293..5a2984726b171c4417f9bb1da93568b0a765f822 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/view.js @@ -468,7 +468,9 @@ export class TimelineView extends Component { suBlueprint.suSet = suBlueprint.draft.scheduling_set; suBlueprint.durationInSec = suBlueprint.duration; suBlueprint.duration = UnitConverter.getSecsToHHmmss(suBlueprint.duration); - suBlueprint.workflowStatus = this.timelineCommonUtils.getWorkflowStatus(workflows, suBlueprint.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, suBlueprint.id); + suBlueprint.workflowStatus = workflowDetails.status; + suBlueprint.dataAccepted = workflowDetails.dataAccepted; suBlueprint.task_content = ""; suBlueprint.observ_template_name = suBlueprint.draft.observation_strategy_template?suBlueprint.draft.observation_strategy_template.name:null; suBlueprint.tasks = suBlueprint.task_blueprints; @@ -1392,7 +1394,9 @@ export class TimelineView extends Component { suBlueprint.suSet = suBlueprint.draft.scheduling_set; suBlueprint.durationInSec = suBlueprint.duration; suBlueprint.duration = UnitConverter.getSecsToHHmmss(suBlueprint.duration); - suBlueprint.workflowStatus = this.timelineCommonUtils.getWorkflowStatus(workflows, suBlueprint.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, suBlueprint.id); + suBlueprint.workflowStatus = workflowDetails.status; + suBlueprint.dataAccepted = workflowDetails.dataAccepted; suBlueprint.task_content = ""; suBlueprint.observ_template_name = suBlueprint.draft.observation_strategy_template?suBlueprint.draft.observation_strategy_template.name:null; suBlueprint.tasks = suBlueprint.task_blueprints; diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js index b298328bba9dd1252f0bbf2b9552a2ca10a99e8e..bb6122b733a0ccef5447bf845052a4648baefedb 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/week.view.js @@ -419,7 +419,9 @@ export class WeekTimelineView extends Component { suBlueprint.suSet = suBlueprint.draft.scheduling_set; suBlueprint.durationInSec = suBlueprint.duration; suBlueprint.duration = UnitConverter.getSecsToHHmmss(suBlueprint.duration); - suBlueprint.workflowStatus = this.timelineCommonUtils.getWorkflowStatus(workflows, suBlueprint.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, suBlueprint.id); + suBlueprint.workflowStatus = workflowDetails.status; + suBlueprint.dataAccepted = workflowDetails.dataAccepted; suBlueprint.task_content = ""; suBlueprint.observ_template_name = suBlueprint.draft.observation_strategy_template?suBlueprint.draft.observation_strategy_template.name:null; suBlueprint.tasks = suBlueprint.task_blueprints; @@ -963,7 +965,9 @@ export class WeekTimelineView extends Component { suBlueprint.suSet = suBlueprint.draft.scheduling_set; suBlueprint.durationInSec = suBlueprint.duration; suBlueprint.duration = UnitConverter.getSecsToHHmmss(suBlueprint.duration); - suBlueprint.workflowStatus = this.timelineCommonUtils.getWorkflowStatus(workflows, suBlueprint.id); + const workflowDetails = this.timelineCommonUtils.getWorkflowDetails(workflows, suBlueprint.id); + suBlueprint.workflowStatus = workflowDetails.status; + suBlueprint.dataAccepted = workflowDetails.dataAccepted; suBlueprint.task_content = ""; suBlueprint.observ_template_name = suBlueprint.draft.observation_strategy_template?suBlueprint.draft.observation_strategy_template.name:null; suBlueprint.tasks = suBlueprint.task_blueprints; diff --git a/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js b/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js index ff0363558214d7927976e42721ace047aa51a4f4..d3c00e01969975e4430cfdd58c30d7b8188f2992 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js @@ -30,6 +30,9 @@ const TimelineConstants = { workflowStatus: { name: "Workflow Status" }, + dataAccepted: { + name: "Data Accepted" + }, priority_rank: { name: "Priority" }, @@ -111,6 +114,7 @@ const TimelineConstants = { "Id","Name", "Description", "Workflow Status", + "Data Accepted", "Priority", "Project", "Stations (CS/RS/IS)",