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

TMSS-360: Issue when duration property is missing is solved and column width modified.

parent 45773802
No related branches found
No related tags found
2 merge requests!260syncing cob-master with master again,!244Resolve TMSS-360
...@@ -33,7 +33,7 @@ class SchedulingUnitList extends Component{ ...@@ -33,7 +33,7 @@ class SchedulingUnitList extends Component{
}], }],
columnclassname: [{ columnclassname: [{
"Template":"filter-input-50", "Template":"filter-input-50",
"Duration":"filter-input-50", "Duration (HH:mm:ss)":"filter-input-75",
"Type": "filter-input-75", "Type": "filter-input-75",
"Status":"filter-input-100" "Status":"filter-input-100"
}], }],
...@@ -59,7 +59,7 @@ class SchedulingUnitList extends Component{ ...@@ -59,7 +59,7 @@ class SchedulingUnitList extends Component{
for( const scheduleunit of scheduleunits){ for( const scheduleunit of scheduleunits){
const blueprintdata = bluePrint.data.results.filter(i => i.draft_id === scheduleunit.id); const blueprintdata = bluePrint.data.results.filter(i => i.draft_id === scheduleunit.id);
blueprintdata.map(blueP => { blueprintdata.map(blueP => {
blueP.duration = moment.utc(blueP.duration*1000).format('HH:mm:ss'); blueP.duration = moment.utc((blueP.duration || 0)*1000).format('HH:mm:ss');
blueP.type="Blueprint"; blueP.type="Blueprint";
blueP['actionpath'] ='/schedulingunit/view/blueprint/'+blueP.id; blueP['actionpath'] ='/schedulingunit/view/blueprint/'+blueP.id;
return blueP; return blueP;
...@@ -67,7 +67,7 @@ class SchedulingUnitList extends Component{ ...@@ -67,7 +67,7 @@ class SchedulingUnitList extends Component{
output.push(...blueprintdata); output.push(...blueprintdata);
scheduleunit['actionpath']='/schedulingunit/view/draft/'+scheduleunit.id; scheduleunit['actionpath']='/schedulingunit/view/draft/'+scheduleunit.id;
scheduleunit['type'] = 'Draft'; scheduleunit['type'] = 'Draft';
scheduleunit['duration'] = moment.utc(scheduleunit.duration*1000).format('HH:mm:ss'); scheduleunit['duration'] = moment.utc((scheduleunit.duration || 0)*1000).format('HH:mm:ss');
output.push(scheduleunit); output.push(scheduleunit);
} }
this.setState({ this.setState({
......
...@@ -80,12 +80,6 @@ class ViewSchedulingUnit extends Component{ ...@@ -80,12 +80,6 @@ class ViewSchedulingUnit extends Component{
if (schedulingUnit) { if (schedulingUnit) {
this.getScheduleUnitTasks(schedule_type, schedulingUnit) this.getScheduleUnitTasks(schedule_type, schedulingUnit)
.then(tasks =>{ .then(tasks =>{
/* tasks.map(task => {
task.duration = moment.utc(task.duration*1000).format('HH:mm:ss');
task.relative_start_time = moment.utc(task.relative_start_time*1000).format('HH:mm:ss');
task.relative_stop_time = moment.utc(task.relative_stop_time*1000).format('HH:mm:ss');
return task;
});*/
this.setState({ this.setState({
scheduleunit : schedulingUnit, scheduleunit : schedulingUnit,
schedule_unit_task : tasks, schedule_unit_task : tasks,
...@@ -164,7 +158,7 @@ class ViewSchedulingUnit extends Component{ ...@@ -164,7 +158,7 @@ class ViewSchedulingUnit extends Component{
</div> </div>
<div className="p-grid"> <div className="p-grid">
<label className="col-lg-2 col-md-2 col-sm-12" >Duration (HH:mm:ss)</label> <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*1000).format('HH:mm:ss')}</span> <span className="col-lg-4 col-md-4 col-sm-12">{moment.utc((this.state.scheduleunit.duration?this.state.scheduleunit.duration:0)*1000).format('HH:mm:ss')}</span>
{this.props.match.params.type === 'blueprint' && {this.props.match.params.type === 'blueprint' &&
<label className="col-lg-2 col-md-2 col-sm-12 ">Status</label> } <label className="col-lg-2 col-md-2 col-sm-12 ">Status</label> }
{this.props.match.params.type === 'blueprint' && {this.props.match.params.type === 'blueprint' &&
......
...@@ -74,7 +74,7 @@ const ScheduleService = { ...@@ -74,7 +74,7 @@ const ScheduleService = {
taskblueprint['blueprint_draft'] = taskblueprint['draft']; taskblueprint['blueprint_draft'] = taskblueprint['draft'];
taskblueprint['relative_start_time'] = 0; taskblueprint['relative_start_time'] = 0;
taskblueprint['relative_stop_time'] = 0; taskblueprint['relative_stop_time'] = 0;
taskblueprint.duration = moment.utc(taskblueprint.duration*1000).format('HH:mm:ss'); taskblueprint.duration = moment.utc((taskblueprint.duration || 0)*1000).format('HH:mm:ss');
taskblueprintsList.push(taskblueprint); taskblueprintsList.push(taskblueprint);
}) })
} }
...@@ -102,7 +102,7 @@ const ScheduleService = { ...@@ -102,7 +102,7 @@ const ScheduleService = {
for(const key of commonkeys){ for(const key of commonkeys){
scheduletask[key] = task[key]; scheduletask[key] = task[key];
} }
scheduletask.duration = moment.utc(scheduletask.duration*1000).format('HH:mm:ss'); scheduletask.duration = moment.utc((scheduletask.duration || 0)*1000).format('HH:mm:ss');
scheduletask.relative_start_time = moment.utc(scheduletask.relative_start_time*1000).format('HH:mm:ss'); scheduletask.relative_start_time = moment.utc(scheduletask.relative_start_time*1000).format('HH:mm:ss');
scheduletask.relative_stop_time = moment.utc(scheduletask.relative_stop_time*1000).format('HH:mm:ss'); scheduletask.relative_stop_time = moment.utc(scheduletask.relative_stop_time*1000).format('HH:mm:ss');
//Fetch blueprint details for Task Draft //Fetch blueprint details for Task Draft
...@@ -121,7 +121,7 @@ const ScheduleService = { ...@@ -121,7 +121,7 @@ const ScheduleService = {
for(const key of commonkeys){ for(const key of commonkeys){
taskblueprint[key] = blueprint[key]; taskblueprint[key] = blueprint[key];
} }
taskblueprint.duration = moment.utc(taskblueprint.duration*1000).format('HH:mm:ss'); taskblueprint.duration = moment.utc((taskblueprint.duration || 0)*1000).format('HH:mm:ss');
taskblueprint.relative_start_time = moment.utc(taskblueprint.relative_start_time*1000).format('HH:mm:ss'); taskblueprint.relative_start_time = moment.utc(taskblueprint.relative_start_time*1000).format('HH:mm:ss');
taskblueprint.relative_stop_time = moment.utc(taskblueprint.relative_stop_time*1000).format('HH:mm:ss'); taskblueprint.relative_stop_time = moment.utc(taskblueprint.relative_stop_time*1000).format('HH:mm:ss');
...@@ -275,12 +275,12 @@ const ScheduleService = { ...@@ -275,12 +275,12 @@ const ScheduleService = {
for(const suDraft of suDraftList){ for(const suDraft of suDraftList){
suDraft['actionpath']='/schedulingunit/view/draft/'+suDraft.id; suDraft['actionpath']='/schedulingunit/view/draft/'+suDraft.id;
suDraft['type'] = 'Draft'; suDraft['type'] = 'Draft';
suDraft['duration'] = moment.utc(suDraft.duration*1000).format('HH:mm:ss'); suDraft['duration'] = moment.utc((suDraft.duration || 0)*1000).format('HH:mm:ss');
schedulingunitlist = schedulingunitlist.concat(suDraft); schedulingunitlist = schedulingunitlist.concat(suDraft);
//Fetch SU Blue prints for the SU Draft //Fetch SU Blue prints for the SU Draft
await this.getBlueprintsByschedulingUnitId(suDraft.id).then(suBlueprintList =>{ await this.getBlueprintsByschedulingUnitId(suDraft.id).then(suBlueprintList =>{
for(const suBlueprint of suBlueprintList.data.results){ for(const suBlueprint of suBlueprintList.data.results){
suBlueprint.duration = moment.utc(suBlueprint.duration*1000).format('HH:mm:ss'); suBlueprint.duration = moment.utc((suBlueprint.duration || 0)*1000).format('HH:mm:ss');
suBlueprint.type="Blueprint"; suBlueprint.type="Blueprint";
suBlueprint['actionpath'] = '/schedulingunit/view/blueprint/'+suBlueprint.id; suBlueprint['actionpath'] = '/schedulingunit/view/blueprint/'+suBlueprint.id;
schedulingunitlist = schedulingunitlist.concat(suBlueprint); schedulingunitlist = schedulingunitlist.concat(suBlueprint);
......
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