Skip to content
Snippets Groups Projects
Commit 92c29c32 authored by Ramesh Kumar's avatar Ramesh Kumar
Browse files

TMSS-312: Updated function names.

parent 4180ae56
No related branches found
No related tags found
1 merge request!206Resolve TMSS-312
......@@ -62,11 +62,11 @@ class ViewSchedulingUnit extends Component{
componentDidMount(){
let schedule_id = this.state.scheduleunitId;
let schedule_type = this.state.scheduleunitType;
if (schedule_type, schedule_id) {
if (schedule_type && schedule_id) {
this.getScheduleUnit(schedule_type, schedule_id)
.then(schedulingUnit =>{
if (schedulingUnit) {
this.getScheduleUnitTaskOrBlueprintById(schedule_type, schedulingUnit)
this.getScheduleUnitTasks(schedule_type, schedulingUnit)
.then(tasks =>{
/* tasks.map(task => {
task.duration = moment.utc(task.duration*1000).format('HH:mm:ss');
......@@ -85,15 +85,15 @@ class ViewSchedulingUnit extends Component{
isLoading: false,
});
}
})
});
}
}
getScheduleUnitTaskOrBlueprintById(type, scheduleunit){
getScheduleUnitTasks(type, scheduleunit){
if(type === 'draft')
return ScheduleService.getScheduleTasksBySchedulingUnitId(scheduleunit.id);
return ScheduleService.getTasksBySchedulingUnit(scheduleunit.id);
else
return ScheduleService.getScheduleUnitTaskBlueprintBySchedulingUnitId(scheduleunit);
return ScheduleService.getTaskBlueprintsBySchedulingUnit(scheduleunit);
}
getScheduleUnit(type, id){
if(type === 'draft')
......
......@@ -205,7 +205,7 @@ export class TaskView extends Component {
}
{this.state.taskType === 'blueprint' &&
// <Link className="col-lg-4 col-md-4 col-sm-12" to={ { pathname:'/task/view', state: {id: this.state.task.draft_id, type: 'draft'}}}>{this.state.task.draftObject.name}</Link>
<Link className="col-lg-4 col-md-4 col-sm-12" to={ { pathname:`/task/view/draft/${this.state.task.draft_id}`}}>{this.state.task.draftObject.name}</Link>
<Link to={ { pathname:`/task/view/draft/${this.state.task.draft_id}`}}>{this.state.task.draftObject.name}</Link>
}
</div>
</div>
......
import axios from 'axios'
import _ from 'lodash';
import moment from 'moment';
import TaskService from './task.service';
......@@ -64,7 +63,7 @@ const ScheduleService = {
});
return res;
},
getScheduleUnitTaskBlueprintBySchedulingUnitId: async function(scheduleunit){
getTaskBlueprintsBySchedulingUnit: async function(scheduleunit){
// there no single api to fetch associated task_blueprint, so iteare the task_blueprint id to fetch associated task_blueprint
let taskblueprintsList = [];
if(scheduleunit.task_blueprints_ids){
......@@ -83,9 +82,8 @@ const ScheduleService = {
}
return taskblueprintsList;
},
getScheduleTasksBySchedulingUnitId: async function(id){
getTasksBySchedulingUnit: async function(id){
let scheduletasklist=[];
let taskblueprints = [];
// Common keys for Task and Blueprint
let commonkeys = ['id','created_at','description','name','tags','updated_at','url','do_cancel','relative_start_time','relative_stop_time','start_time','stop_time','duration'];
await this.getTasksDraftBySchedulingUnitId(id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment