【问题标题】:How to make legacy extension (tfs2013) work in tfs2015 update 2?如何使旧版扩展(tfs 2013)在 tfs 2015 更新 2 中工作?
【发布时间】:2016-09-16 13:16:42
【问题描述】:

我们有这个扩展在 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>

【问题讨论】:

  • 我以“过于宽泛”为由投票结束。答案是:你重写了扩展。如果您在完成该过程时有任何具体问题,请随时提出。

标签: tfs azure-devops


【解决方案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.
});

这似乎对我有用。

【讨论】:

  • 它现在也对我有用。非常感谢您的帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-12-20
  • 1970-01-01
  • 2016-10-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多