如何在tfs2015 update 2中使旧版扩展(tfs2013)工作?

时间:2016-05-19 14:54:23

标签: tfs azure-devops tfs2013

我们在tfs 2013下使用此扩展程序,只是隐藏了积压项目的快速添加面板(请参阅下面的代码)。我们将服务器更新为tfs 2015.2后,代码停止工作。无法使用新的VSTS扩展框架(see previous question

这是javascript代码(HideAddPanel.js):

TFS.module("HideAddPanel", [], function () { });
$(function () { 
 $bLogTitleValue=$(".team-name").text();
 if ($bLogTitleValue.toLowerCase().indexOf("ticketmaster") >= 0)
 {
      $(".panel-region").hide();
 }
 else
 {
     $(".panel-region").show();
 }
});

这是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 个答案:

答案 0 :(得分:1)

您的清单需要更新,以便在更具体的时间加载并使用正确的TFS版本(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>

我将javascript代码更新为:

TFS.module("HideAddPanel", [ "VSS\\Utils\\Core",
        "VSS\\Utils\\UI"], function () { 
   $(".panel-region").hide();
   $("#mi_51").hide(); // Hides the New button.
});

这似乎对我有用。