TFS 2015 VSS Query Result Button - tfs

I'm trying create TFS 2015 on-prem VSS Extension. I want add button to query result button panel.
I read msdn, get example from GITHub () and try add extension to my TFS.
In this example many of buttons adding to several places (Work Item button panel, Context Menu etc), but button to query result dosen't work.
MSDN (https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/targets/overview#work) says, that target for query result button panel is ms.vss-work-web.work-item-query-results-toolbar-menu. So that vss-extension.json
{
"id": "showProperties_24",
"type": "ms.vss-web.action",
"description": "Shows the target properties for work item query results toolbar menu.",
"targets": [
"ms.vss-work-web.work-item-query-results-toolbar-menu"
],
"properties": {
"text": "Custom query results toolbar menu",
"title": "ms.vss-work-web.work-item-query-results-toolbar-menu (Custom query results toolbar action)",
"icon": "images/show-properties.png",
"group": "actions",
"uri": "main.html",
"registeredObjectId": "showProperties"
}
},
But it dosen't work
Can someone explain what is wrong

I created a new extension for query result toolbar menu with Visual Studio Team Services and TFS 2015 update 3 (refer to the source code of that sample: https://github.com/Microsoft/vsts-extension-samples/tree/master/contributions-guide). It works fine for Visual Studio Team Services.
It doesn’t work fine for TFS 2015 update 3, you can check these screenshot, for worked extension, it would load the extension, but for query result toolbar menu extension, it wouldn’t load the extension. Also, the article you provided is applied for Visual Studio Team Services, so, to conclude, it isn’t applied for TFS 2015 now. You could check it with next update for TFS on-permission.

Related

Can't load ACE editor in a firefox addon, but can in chrome

I am using ACE editor in my browser extension. It all works fine in a Chrome/Chromium browser, but when I try the extension in Firefox (latest version), only ace.define and ace.require are available (ace.edit is needed, at least, to initialize).
Here is the part of the manifest (MV2) file involved:
"content_scripts" :
[
{
"matches": ["*://example.com/*"],
"all_frames": true,
"js": [
"ace-min/ace.js",
"myscript.js"
],
"run_at": "document_end"
},
]
What could be done wrong? Both files are being read, but only a part of ace.js seems to be executed. Imagine that myscript.js contains a console.log(ace), to see which functions can I use.
Thanks in advance!
I posted an issue on the ACE's GitHub repository. The response was very quick and polite.
All is explained in this comment: https://github.com/ajaxorg/ace/issues/4898#issuecomment-1217887526
Just a side note, use noconflict ace instead of normal ace. The function you need to change is at the bottom.

Where does the Azure DevOps/TFS cache extensions data

I have developed Azure DevOps extension and published it to marketplace. Recently I have came across mandatory UI changes. While performing dev testing, I have noticed that once I install new extension (with UI changes) it still showing old UI components.
For example, let’s say I have string input named “Name” and I have replaced it with “Full Name”. I still see my old input which is “Name”.
Old :
{
"name": "name",
"type": "string",
"label": "Name",
"required": true
}
New:
{
"name": "fullName",
"type": "string",
"label": "Full Name",
"required": true
}
I removed temp files under below locations, but issue persists.
C:\Users\<< User Name >>\AppData\Local\Microsoft\Team Foundation\
<< Agent Folder >> \ _Work\
Windows Temp folder
I have changed the task id (GUID) and it seems resolving this issue. But this is not viable solution as I cannot issue new task id for already published extension.
Due to this reason I believe best option to resolve this issue is deleting cached data. Please let me know, Where does the Azure DevOps / TFS cache it’s extension data?
Thanks in Advance!
Try to clean the browser cache, and check whether you have increase the version number in the task.json.
Also, try to Delete task -- Save definition -- add task again, which should help.
For me solution with updating task version and removing browser cache didn't work. I found the DistributedTask folder in one of subfolders in the root cache folder. In my case it was cache_root_folder/<some_uuid>/Proxy/<another_uuid>/DistrebutedTask/. I dont know what these UUIDs mean and found this path just accidentally. Removing all from this folder helped.

How to set a resource in a firefox addon?

I have basically the same problem as this guy. I have a page, accessed over the web (well, local intranet, if that matters), and it needs to reference images on the client's machine. I know those images are going to be in C:\pics. Internet Explorer lets you just reference them, but I'm having trouble printing properly with internet explorer, so I want to try firefox. The answer on that question says you can create a "resource" with a firefox add-on that pages will be able to reference. However, it doesn't seem to be working. I followed the guide for how to make your first add-on and got the red border to work on mozilla sites. I tried editing that add-on to include a chrome.manifest file that just says this:
resource exposedpics file:///C:/pics
and then the page (an asp page) references exposedpics.
<img align=left border="0" src="resource:///exposedpics/<%=Request("Number")%>.jpg" style="border: 3 solid #<%=bordercolor%>" align="right" WIDTH="110" HEIGHT="110">
the page doesn't show the picture. If I go to View Image Info on the image, I'll see the address is "resource:///exposedpics/8593.jpg" (in my example where I input 8593), but it doesn't show the image here. (yes, the image does exist under c:\pics. if I go to file:///C:/pics/8593.jpg, it loads.)
so maybe I don't know how to use a chrome.manifest. (I'm not sure if I need to reference it somehow in my manifest.json, I'm not.) That stack overflow question also says it's possible to dynamically create resources. so I tried to make my manifest.json say:
{
"manifest_version": 2,
"name": "FirefoxPixExposer",
"version": "1.0",
"description": "allows websites to access C:\\pics",
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["expose.js"]
}
]
}
and expose.js says
// Import Services.jsm unless in a scope where it's already been imported
Components.utils.import("resource://gre/modules/Services.jsm");
var resProt = Services.io.getProtocolHandler("resource")
.QueryInterface(Components.interfaces.nsIResProtocolHandler);
var aliasFile = Components.classes["#mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
aliasFile.initWithPath("file:///C:/pics");
var aliasURI = Services.io.newFileURI(aliasFile);
resProt.setSubstitution("ExposedPics", aliasURI);
but the same thing happens, the image doesn't display. I did notice that if I put document.body.style.border = "5px solid red"; at the top of expose.js, I do see a border around the body, but if I move it to below the line Components.utils.import("resource://gre/modules/Services.jsm"); it doesn't show up. Therefore, I suspect the code to dynamically create a resource is broken.
What am I doing wrong? Ultimately, how can I get an image on the client's machine to show up on a page from the internet?
You are writing a WebExtensions so none of the APIs you are trying to use exist.
This includes Components.utils.import, Components.classes etc. You should read Working with files on MDN to get an idea, what is still possible.

Hide VSTS/TFS extension's Summary section when extension not added to build task

We have developed VSTS/TFS extension which consists summary page with details generated from our extension task, at the end of build.
we have added contribution similar to below in manifest file to add this summary section
{
"id": "build-status-section",
"type": "ms.vss-build-web.build-results-section",
"description": "A section contributing to our own new tab and also to existing build 'summary' tab",
"targets": [
".build-info-tab",
"ms.vss-build-web.build-results-summary-tab"
],
"properties": {
"name": "Custom Section",
"uri": "statusSection.html",
"order": 20,
"height": 500
}
}
However currently we are facing issue as even when user not add our extension task in to his build our summary page will appear in summary tab (if our extension is installed and enabled).
Is there any way to avoid displaying summary section when our task is not added to their build. Please be kind enough to help on this.
No, you can't hide the summary section.
This is because build-results-summary-tab is used for all builds. So when you install the extension, even you are not add the task you developed, the summary results will be showed for any of build results.
More details, you can refer Referencing contributions and types and the example as Targetable hub groups shows.
The work around is that you can separate build-results-summary-tab extension with the build task extension (use two extensions instead). For the accounts need to view the summary result, they can install the two extensions. Else, the accounts just need to install the extension for the build task.

How to configure for inserting spaces instead of tabs on Visual Studio Code for Mac

I begin to use Visual Studio Code. Current version is 0.3.0.
By default, Indent is inserted for tabs.
But I want to insert 4 spaces instead tabs.
I can't find the configure out the item in Preferences.
Please tell me, how to configure insert tab or space.
Approximately since version 0.9.0 this configuration is easily reachable by modifying the following parameters in the settings.json file:
// Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
"editor.tabSize": 4,
// Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened.
"editor.insertSpaces": true
For others settings and information visit the VS Code help section.
What you are looking for is in keybindings.json. From the menu Code -> Preferences -> Keyboard Shortcuts
On the right hand pane you can place your key bindings, for example:
{"key": "ctrl+t", "when": "editorTextFocus", "command": "editor.action.tab"}
though you would probably prefer something like:
{"key": "ctrl+t", "when": "editorTextFocus", "command": " "}
The problem is that it does not work as the documentation says it should!
See: Customization of Visual Studio Code
Microsoft has been notified of the behavior and tab handling preferences have also been requested.

Resources