Skip to content

Commit

Permalink
Fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilyheart committed Apr 23, 2020
1 parent 020142a commit 0408bf2
Show file tree
Hide file tree
Showing 2 changed files with 458 additions and 458 deletions.
158 changes: 79 additions & 79 deletions scripts/hours.js
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
var hours = (function () {
let sprintHoursJSON = {};
const DECIMALPLACES = 2;

function updateData(selectedMilestone) {
let milestoneIssues;

sprintHoursJSON = {};
milestoneIssues = milestoneList[selectedMilestone].issues;

for (let i = 0; i < spentTimeList.length; i += 1) {
if (milestoneIssues.includes(spentTimeList[i].issue)) {
sprintHoursJSON[spentTimeList[i].author] = sprintHoursJSON[spentTimeList[i].author] || {assigned: "?", completed: 0};
sprintHoursJSON[spentTimeList[i].author].completed += spentTimeList[i].spent;
}
}

}

function loadHoursTable() {
let sprintHoursArr = [];

// TODO Fix this Arr to JSON - This is a messy way of setting data for DataTable
for (let person in sprintHoursJSON) {
if (sprintHoursJSON.hasOwnProperty(person)) {
sprintHoursArr.push({author: person, assigned: sprintHoursJSON[person].assigned, completed: sprintHoursJSON[person].completed});
}
}

// Reset table
if ( $.fn.dataTable.isDataTable( "#hourstable" ) ) {
$("#hourstable").dataTable().fnDestroy();
$("#hourstablerows tr").remove();
}

$("#hourstable").DataTable({
responsive: true,
data: sprintHoursArr,
columns: [
{title: "Team member", data: "author"},
{title: "Hr Assigned", data: "assigned"},
{title: "Hr Completed*", data: "completed"},
{title: "Percent Complete"}
],
columnDefs: [{
render: function ( data, type, row ) {
// return Math.round((row.completed / row.assigned) * PERCENT) + "%";
return "Coming Soon";
},
targets: 3
}, {
render: function ( data, type, row ) {
return +(data).toFixed(DECIMALPLACES);
},
targets: 2
}, {
responsivePriority: 1, targets: 0
}, {
responsivePriority: 2, targets: 2
}],
paging: false,
bInfo: false
});
}

function updateHoursData(selectedMilestone) {
updateData(selectedMilestone);
loadHoursTable();
}

return {
updateHoursData: async function(selectedMilestone) {
updateHoursData(selectedMilestone);

return;
}
};

})();
var hours = (function () {
let sprintHoursJSON = {};
const DECIMALPLACES = 2;

function updateData(selectedMilestone) {
let milestoneIssues;

sprintHoursJSON = {};
milestoneIssues = milestoneList[selectedMilestone].issues;

for (let i = 0; i < spentTimeList.length; i += 1) {
if (milestoneIssues.includes(spentTimeList[i].issue)) {
sprintHoursJSON[spentTimeList[i].author] = sprintHoursJSON[spentTimeList[i].author] || {assigned: "?", completed: 0};
sprintHoursJSON[spentTimeList[i].author].completed += spentTimeList[i].spent;
}
}

}

function loadHoursTable() {
let sprintHoursArr = [];

// TODO Fix this Arr to JSON - This is a messy way of setting data for DataTable
for (let person in sprintHoursJSON) {
if (sprintHoursJSON.hasOwnProperty(person)) {
sprintHoursArr.push({author: person, assigned: sprintHoursJSON[person].assigned, completed: sprintHoursJSON[person].completed});
}
}

// Reset table
if ( $.fn.dataTable.isDataTable( "#hourstable" ) ) {
$("#hourstable").dataTable().fnDestroy();
$("#hourstablerows tr").remove();
}

$("#hourstable").DataTable({
responsive: true,
data: sprintHoursArr,
columns: [
{title: "Team member", data: "author"},
{title: "Hr Assigned", data: "assigned"},
{title: "Hr Completed*", data: "completed"},
{title: "Percent Complete"}
],
columnDefs: [{
render: function ( data, type, row ) {
// return Math.round((row.completed / row.assigned) * PERCENT) + "%";
return "Coming Soon";
},
targets: 3
}, {
render: function ( data, type, row ) {
return +(data).toFixed(DECIMALPLACES);
},
targets: 2
}, {
responsivePriority: 1, targets: 0
}, {
responsivePriority: 2, targets: 2
}],
paging: false,
bInfo: false
});
}

function updateHoursData(selectedMilestone) {
updateData(selectedMilestone);
loadHoursTable();
}

return {
updateHoursData: async function(selectedMilestone) {
updateHoursData(selectedMilestone);

return;
}
};

})();
Loading

0 comments on commit 0408bf2

Please sign in to comment.