Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 75 additions & 9 deletions deploy/App.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
timeClass.push('de-emphasis');
}

if (value.ScheduleState == 'Completed') {
divClass.push('rally-workprod-completed');
divClass.push('de-emphasis');
} else if (value.TaskRemainingTotal == '' || value.TaskRemainingTotal == 0) {
timeClass.push('de-emphasis');
}
html.push('<div class="' + divClass.join(' ') + '" id="' + divId + '">');

state = new RALLY.toolkit.renderer.StateRenderer({
Expand Down Expand Up @@ -241,6 +247,10 @@
if (item.WorkProduct && item.WorkProduct.ScheduleState == 'Accepted') {
taskClass.push('rally-task-accepted');
taskClass.push('de-emphasis');
}
if (item.WorkProduct && item.WorkProduct.ScheduleState == 'Completed') {
taskClass.push('rally-task-completed');
taskClass.push('de-emphasis');
}

html.push('<div class="' + taskClass.join(' ') + '" id="rally-task-' + item.ObjectID + '">');
Expand Down Expand Up @@ -318,6 +328,7 @@

RALLY.toolkit.Controller.prototype = {
acceptedCookieKey: 'taskboard-hide-accepted',
completedCookieKey: 'taskboard-hide-completed',
ownerCookieKey: 'taskboard-filter-by-owner',
iterationCookieKey: 'taskboard-filter-by-iteration',
projectOidCookieKey:'taskboard-current-project',
Expand Down Expand Up @@ -367,12 +378,14 @@
var i;

that.hideAcceptedControl = Dom.get('hide_accepted_control');
that.hideCompletedControl = Dom.get('hide_completed_control');
that.iterationSelect = Dom.get('change_iteration_control');

// clear out the grid container and any state-dependant vars
YAHOO.util.Dom.get('taskboard').innerHTML = '';
that.users = [];
YAHOO.util.Event.removeListener(that.hideAcceptedControl, 'click');
YAHOO.util.Event.removeListener(that.hideCompletedControl, 'click');
YAHOO.util.Event.removeListener(that.iterationSelect, 'change');


Expand Down Expand Up @@ -428,6 +441,13 @@
Event.removeListener(that.hideAcceptedControl, 'click');
Event.addListener(that.hideAcceptedControl, 'click', that.toggleAccepted, that, true);

// should we hide completed work?
if (RALLY.toolkit.Cookie.get(that.completedCookieKey) == 'true' || RALLY.toolkit.Cookie.get(that.completedCookieKey) == null) {
that.hideCompletedControl.checked = true;
that.toggleCompleted();
}
Event.removeListener(that.hideCompletedControl, 'click');
Event.addListener(that.hideCompletedControl, 'click', that.toggleCompleted, that, true);
// add users into the select that were found during the rendering
that.refreshUserSelect();

Expand Down Expand Up @@ -499,7 +519,33 @@
}
}
},

toggleCompleted: function() {
var i, len, row,
hideCompletedControl = this.hideCompletedControl || Dom.get('hide_completed_control'),
userSelect = this.userSelect || Dom.get('filter_user_control'),
hideCompleted = hideCompletedControl.checked,
workProds = Dom.getElementsByClassName('rally-workprod-completed');
RALLY.toolkit.Cookie.add(this.completedCookieKey, hideCompleted);

for (i = 0,len = workProds.length; i < len; i++) {
row = this.getParentRow(workProds[i]);

if (hideCompleted) {
Dom.addClass(row, 'completed');
} else {
Dom.removeClass(row, 'completed');
}
}

if (hideCompleted && this.numItemsVisible() == 0) {
if (userSelect.selectedIndex >= 0 && userSelect.options[userSelect.selectedIndex].value == this.allOwnersLabel) {
RALLY.toolkit.showWarning('The selected iteration contains only completed stories');
} else {
RALLY.toolkit.showWarning('The selected owner has only completed stories and/or tasks');
}
}
},
refreshUserSelect: function() {
this.userSelect = this.userSelect || Dom.get('filter_user_control');

Expand Down Expand Up @@ -704,15 +750,18 @@

items = this.view.findItems(comparator);
for (i = 0,len = items.length; i < len; i++) {
if (!(Dom.hasClass(items[i], 'hidden') || Dom.hasClass(this.getParentRow(items[i]), 'accepted') || Dom.hasClass(this.getParentRow(items[i]), 'hidden'))) {
if (!(Dom.hasClass(items[i], 'hidden')
|| Dom.hasClass(this.getParentRow(items[i]), 'accepted')
|| Dom.hasClass(this.getParentRow(items[i]), 'completed')
|| Dom.hasClass(this.getParentRow(items[i]), 'hidden'))) {
num++;
}
}
return num;
},

filterByOwner: function() {
var i, len, that = this, shown = 0, shownAccepted = 0, itemMap = {}, rows = [], items, item,
var i, len, that = this, shown = 0, shownAccepted = 0, shownCompleted = 0, itemMap = {}, rows = [], items, item,
sel = this.userSelect || Dom.get('filter_user_control'),
selected = sel.options[sel.selectedIndex];

Expand Down Expand Up @@ -762,6 +811,8 @@
} else {
if (this.hideAcceptedControl.checked && Dom.hasClass(item, 'rally-task-accepted')) {
shownAccepted++;
} else if (this.hideCompletedControl.checked && Dom.hasClass(item, 'rally-task-completed')){
shownCompleted++;
} else {
shown++;
}
Expand All @@ -772,7 +823,9 @@
if (isParentVisible(item)) {
if (this.hideAcceptedControl.checked && Dom.hasClass(item, 'hidden')) {
shownAccepted++;
} else {
} else if (this.hideCompletedControl.checked && Dom.hasClass(item, 'hidden')) {
shownCompleted++;
} else {
shown++;
}
Dom.removeClass(item, 'hidden');
Expand All @@ -786,7 +839,14 @@
RALLY.toolkit.showWarning('The selected owner has only accepted stories and/or tasks');
}
if ((shown + shownAccepted) == 0) {
RALLY.toolkit.showWarning('The selected owner does not own any stories or tasks');
RALLY.toolkit.showWarning('The selected owner does not own any accepted stories or tasks');
}

if (shown == 0 && shownCompleted > 0) {
RALLY.toolkit.showWarning('The selected owner has only Completed stories and/or tasks');
}
if ((shown + shownCompleted) == 0) {
RALLY.toolkit.showWarning('The selected owner does not own any Completed stories or tasks');
}
},

Expand Down Expand Up @@ -862,7 +922,7 @@
height: 0;
}

.hidden, .accepted {
.hidden, .accepted, .completed {
display: none;
visibility: hidden;
height: 0;
Expand Down Expand Up @@ -956,7 +1016,7 @@
right: -0.3em;
}

.rally-task-accepted {
.rally-task-accepted, .rally-task-completed {
background-color: #ececec;
border: 1px solid #cbcbcb;
}
Expand Down Expand Up @@ -1025,17 +1085,23 @@
</span>
</div>
<span id="change_iteration">
Change iteration:
Iteration:
<select id="change_iteration_control" size="1"></select>
</span>
<span id="filter_user">
Show work owned by:
Owned by:
<select id="filter_user_control" size="1"></select>
</span>
<span id="hide_accepted">
Hide accepted work:
Hide accepted:
<input type="checkbox" id="hide_accepted_control"/>
</span>
<span id="hide_completed">
Hide completed:
<input type="checkbox" id="hide_completed_control"/>
</span>
<span style="float: right;" id="info">
</span>
</div>

<div id="taskboard"></div>
Expand Down