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 ff31431a266bbd792212f491dc3562b26c24277c..de3a2b59a22ea273e838eae9f0e358cf5a66b1fe 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js @@ -49,12 +49,15 @@ class ViewSchedulingUnit extends Component { 'task_blueprints.short_description','task_blueprints.on_sky_start_time','task_blueprints.on_sky_stop_time','task_blueprints.process_start_time', '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', + 'task_blueprints.specifications_template.type_value','task_blueprints.specifications_template.schema', + 'draft.scheduling_constraints_template.schema','draft.scheduling_constraints_template.ref_resolved_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.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','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', + 'scheduling_constraints_doc','scheduling_constraints_template.schema','scheduling_constraints_template.ref_resolved_schema','scheduling_constraints_template.url', + 'observation_strategy_template_id','task_drafts.url','scheduling_constraints_template_id', 'updated_at','scheduling_set.url','scheduling_set.name','scheduling_set.project_id','task_drafts.status','task_drafts.task_type','task_drafts.id','task_drafts.subtasks_ids', 'task_drafts.name','task_drafts.description','task_drafts.short_description','task_drafts.on_sky_start_time','task_drafts.on_sky_stop_time','task_drafts.process_start_time', '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', @@ -1958,7 +1961,7 @@ class ViewSchedulingUnit extends Component { <span className="p-float-label"> {this.state.schedulingUnitTasks && this.state.schedulingUnitTasks.length > 0 && <> - {this.props.match.params.type === 'draft' && + {this.props.match.params.type === 'draft' && this.state.taskDraftPermission && <> <button className="p-link" href="#" style={{ pointerEvents: this.props.disabled ? 'none' : 'auto', marginLeft: '8px' }} onClick={this.confirmDeleteTasks} title={this.state.taskDraftPermission.delete?"Delete selected Task(s)": `${this.access_denied_message} to delete Task(s)`} > diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/parser.utility.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/parser.utility.js index 57cb647e5f510e9637f7ba69bca452769bc63cfe..cb76bc64dba87a8d6be08e3348f323034fb0e7da 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/utils/parser.utility.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/parser.utility.js @@ -17,8 +17,12 @@ const ParserUtility = { let paramProp = {}; for (const paramPath of paramPaths) { let property = taskTemplateSchema.properties[paramPath]; - if (!property && taskFilters && taskFilters.data.actions.POST) { - property = taskFilters.data.actions.POST[paramPath]; + if (!property) { + if (taskFilters && taskFilters.data?.actions?.POST) { + property = taskFilters.data.actions.POST[paramPath]; + } else { + property = {type: "string"}; + } } if (property) { let rootPath = paramPaths.slice(0, pathIndex) @@ -35,8 +39,13 @@ const ParserUtility = { paramProp = paramProp.properties[path]; } } else { - if (paramProp.type === "array" && paramProp.items && paramProp.items.properties && paramProp.items.properties[path]) { + if (paramProp.type === "array" && paramProp.items.properties && paramProp.items.properties[path]) { paramProp = paramProp.items.properties[path]; + } else if (paramProp.type === "array" && paramProp.items['$ref']) { + paramProp = $templateRefs.get(paramProp.items['$ref']); + if (paramProp.properties && paramProp.properties[path]) { + paramProp = paramProp.properties[path]; + } } else if (paramProp.type === "object" && paramProp.properties && paramProp.properties[path]) { paramProp = paramProp.properties[path]; } else {