-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3cdc4c
commit 366997e
Showing
5 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Placeholders:Project_Planning_Kanban_KanbanBoard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
tau.mashups | ||
.addDependency("libs/jquery/jquery") | ||
.addMashup(function() { | ||
|
||
var addCommentCountIcons = function() { | ||
$('div.kanban-item').each(function() { | ||
var el = $(this); | ||
var itemType = null; | ||
var itemId = el.find('.kanban-item-id:first').html(); | ||
if (el.id().match(/kanban-item-userstory-\d+/)) { | ||
itemType = 'UserStories'; | ||
} else if (el.id().match(/kanban-item-bug-\d+/)) { | ||
itemType = 'Bugs'; | ||
} else if (el.id().match(/kanban-item-feature-\d+/)) { | ||
itemType = 'Features'; | ||
} | ||
if (itemType == null) | ||
return; | ||
/* AJAX call to the REST API to gather the due date custom field information */ | ||
$.ajax({ | ||
type: 'GET', | ||
url: appHostAndPath+'/api/v1/'+itemType+'/'+itemId+'?include=[Comments]&format=json', | ||
context: el[0], | ||
contentType: 'application/json', | ||
dataType: 'json', | ||
success: function(resp) { | ||
if (resp.Comments.length != 0) { | ||
if ($(this).find('.tasks-bugs')[0] == undefined) { | ||
/* we need to add the .tasks-bugs div */ | ||
var tbd = $('<div class="tasks-bugs"></div>'); | ||
if ($(this).find('.kanban-avatars')[0] == undefined) { | ||
/* we need to position around an avatar */ | ||
tbd.addClass('tasks-bugs-left'); | ||
} | ||
$(this).append(tbd); | ||
} | ||
$(this).find('.tasks-bugs').append('<a href="'+appHostAndPath+'/View.aspx?id='+itemId+'" class="commentCount">'+resp.Comments.length+'</a>'); | ||
} | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
var addRequiredCSS = function() { | ||
$('head').append('<style type="text/css">' + | ||
'.kanban-item .tasks-bugs .commentCount {' + | ||
'background: url("'+appHostAndPath+'/JavaScript/tau/css/images/balloon.png") no-repeat;' + | ||
'width: auto; height: 16px; display: inline-block; padding: 0 3px 0 16px;' + | ||
'font-weight: bold; text-decoration: underline;'+ | ||
'}' + | ||
'</style>'); | ||
}; | ||
|
||
/** | ||
* our main rendering - we wait for doc.ready to deal with slow-rendering browsers and clients | ||
*/ | ||
$(document).ready(function() { | ||
/* bind some CSS */ | ||
addRequiredCSS(); | ||
/* and make the magic happen */ | ||
addCommentCountIcons(); | ||
$.each(Tp.controls.kanbanboard.KanbanboardManager.getInstance().kanbanBoards, function() { | ||
/* bind to reload button */ | ||
$(this)[0].controller.uxKanbanBoardPanel.on('reload', function() { | ||
addCommentCountIcons(); | ||
}); | ||
/* and bind to when cards change columns */ | ||
$(this)[0].controller.on('statechanged', function(b, c) { | ||
addCommentCountIcons(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Kanban Board Comment Count | ||
========================== | ||
|
||
The Kanban Board comment count Mashup adds an icon with the current comment | ||
count to each of your cards in similar fashion as to the task and bug count | ||
icons. | ||
|
||
![Kanban Board Comment Counts](https://raw.github.com/TargetProcess/MashupsLibrary/master/Kanban%20Board%20Comment%20Counts/screenshot.png) | ||
|
||
|
||
[Download the Mashup's ZIP Archive](https://github.com/downloads/TargetProcess/MashupsLibrary/Kanban%20Board%20Comment%20Counts.zip) | ||
|
||
|
||
How To Install and Use the Mashup | ||
--------------------------------- | ||
|
||
1. Download the Mashup file either by cloning this repository or | ||
downloading a ZIP. | ||
2. Extract/copy the "Kanban Board Comment Counts" folder to your | ||
_<TargetProcess Install Path>/JavaScript/Mashups/_ folder. | ||
3. Open the Kanban Board | ||
4. ? | ||
5. Profit! | ||
|
||
|
||
Installing the Mashup with TargetProcess OnDemand | ||
------------------------------------------------- | ||
|
||
1. In your OnDemand site, navigate to ```Settings > (System Settings) > Mashups``` | ||
2. Click "Add New Mashup" | ||
3. In the "Name" field, enter a name unique to this Mashup - for example "Kanban Comment Count" | ||
4. In the "Placeholders" field, enter ```Project_Planning_Kanban_KanbanBoard``` | ||
5. Copy and paste the contents of the [KanbanBoardCommentCounts.js](https://raw.github.com/TargetProcess/MashupsLibrary/master/Kanban%20Board%20Comment%20Counts/KanbanBoardCommentCounts.js) file in the "Code" box. | ||
6. Click Save | ||
7. Open the Kanban Board | ||
8. ? | ||
9. PROFIT! | ||
|
||
|
||
Troubleshooting | ||
--------------- | ||
|
||
**I don't have a _JavaScript/Mashups/_ folder in my TP install path!** | ||
|
||
1. Make sure that you are running TargetProcess version 2.22 or newer. | ||
2. By default, this folder can be found at _C:\inetpub\wwwroot\TargetProcess2\wwwroot\JavaScript\Mashups_ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters