Skip to content

Commit

Permalink
HotFix: changes to preferences table
Browse files Browse the repository at this point in the history
- handling empty preferences
  • Loading branch information
Athithyaa committed Dec 8, 2016
1 parent 3935c17 commit fd9a897
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions static/js/prefMatrix.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ class PreferenceMatrix extends React.Component {
else
return false;
});
var Title = " ";
var Title = "Not Assigned/Eliminated";
if(aP)
Title = aP["Title"];
var pref = this.sProjPrefs.find( (pe) => pe["stuapp"] == re["id"]);
this.colHeaders.map( (ce) => {
var iter = ["1","2","3","4","5"];
var val = iter.find( (con) => ce["id"]==pref["ProjectPreference"+con]);
if(val)
prefCols.push(<td>{val}</td>);
else
if(pref) {
this.colHeaders.map((ce) => {
var iter = ["1", "2", "3", "4", "5"];
var val = iter.find((con) => ce["id"] == pref["ProjectPreference" + con]);
if (val)
prefCols.push(<td>{val}</td>);
else
prefCols.push(<td>&nbsp;</td>);
});
}else{
this.colHeaders.map((ce) => {
prefCols.push(<td>&nbsp;</td>);
});
});
}
return(<tr style={{textAlign:"center"}}>
<td id={re["id"]}> {re["LastName"] + " " + re["FirstName"]} </td>
<td> {Title} </td>
Expand Down

0 comments on commit fd9a897

Please sign in to comment.