How to make legacy extension (tfs2013) work in tfs2015 update 2?

北战南征 提交于 2019-12-02 10:33:23

问题


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>

回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!