We had this extension working under tfs 2013 that simply hides the quick add panel for backlog items (see code below). The code stopped working after we updated the server to tfs 2015.2. The new framework for VSTS extensions cannot be used (see previous question)
Here is the javascript code (HideAddPanel.js):
TFS.module("HideAddPanel", [], function () { });
$(function () {
$bLogTitleValue=$(".team-name").text();
if ($bLogTitleValue.toLowerCase().indexOf("ticketmaster") >= 0)
{
$(".panel-region").hide();
}
else
{
$(".panel-region").show();
}
});
Here is manifest.xml
<WebAccess version="12.0">
<plugin moreinfo="http://mypage.com" name="Hide Add Panel" vendor="myvendor" version="1.0">
<modules>
<module loadAfter="TFS.Core" namespace="HideAddPanel"></module>
</modules>
</plugin>
</WebAccess>
Your manifest needs to be updated to load at a more specific time and with the right TFS version (14.0
):
<WebAccess version="14.0">
<plugin moreinfo="http://mypage.com" name="Hide Add Panel" vendor="myvendor" version="1.0">
<modules>
<module loadAfter="TFS.Agile.TaskBoard" namespace="HideAddPanel.js"></module>
<module loadAfter="TFS.Agile.Boards.Controls" namespace="HideAddPanel.js"></module>
</modules>
</plugin>
</WebAccess>
And I updated the javascript code to:
TFS.module("HideAddPanel", [ "VSS\\Utils\\Core",
"VSS\\Utils\\UI"], function () {
$(".panel-region").hide();
$("#mi_51").hide(); // Hides the New button.
});
This seems to work for me.
来源:https://stackoverflow.com/questions/37326940/how-to-make-legacy-extension-tfs2013-work-in-tfs2015-update-2