如何在tfs2015 Update 2中使旧版扩展(tfs2013)工作? [英] How to make legacy extension (tfs2013) work in tfs2015 update 2?

查看:42
本文介绍了如何在tfs2015 Update 2中使旧版扩展(tfs2013)工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在tfs 2013下运行了该扩展程序,该扩展程序仅隐藏了积压项目的快速添加面板(请参见下面的代码).将服务器更新为tfs 2015.2.后,代码停止工作.无法使用新的VSTS扩展框架(

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)

这是JavaScript代码(HideAddPanel.js):

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();
 }
});

这是manifest.xml

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>

推荐答案

您的清单文件需要更新,以便在更特定的时间使用正确的TFS版本(14.0)加载:

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>

我将javascript代码更新为:

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.
});

这似乎对我有用.

这篇关于如何在tfs2015 Update 2中使旧版扩展(tfs2013)工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆