Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Pinned Query Status Bar Item #17

Merged
merged 7 commits into from
Apr 25, 2016
Merged

Pinned Query Status Bar Item #17

merged 7 commits into from
Apr 25, 2016

Conversation

mmanela
Copy link
Contributor

@mmanela mmanela commented Apr 23, 2016

In the status bar we already have items for build and pull request. This pull request adds work item query there as well. I introduced the concept of a pinned query. This is a user configurable query that they will want real time feedback on.

By pinning the query you will get automatic updating of the number of items returned by it:
image

By clicking on the query you get those results. This is very useful since you can configure to quickly catch new items assigned to you or other items you want to track.

By default I use the same "my work items" query already in the code base but I let the user customize it in the user settings file with the following block:

    "team.pinnedQueries": [
        {
            "account": "your-account-name",
            "queryText": "SELECT * FROM WorkItems WHERE [System.AssignedTo] = @me AND [System.ChangedDate] > @Today - 14"
        }
    ]

@msftclas
Copy link

Hi @mmanela, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Matthew Manela). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@@ -5,7 +5,7 @@
"use strict";

import { FileSystemWatcher, StatusBarAlignment, StatusBarItem, window, workspace } from "vscode";
import { AccountSettings, Settings } from "./helpers/settings";
import { PinnedQuerySettings, AccountSettings, Settings } from "./helpers/settings";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preference is to alphabetize the imports

@jeffyoung
Copy link
Contributor

Hi Matt. Thanks for the contribution (very cool)! I wonder though if you gave any thought to having the "pinned query" be a name of a particular query instead of the WIQL? We'd have to look it up but it'd give the user more control over editing (using web access) and wouldn't require the user to craft WIQL? What do you think?

@mmanela
Copy link
Contributor Author

mmanela commented Apr 25, 2016

I agree that would be nice. I plan to eventually give that option but wanted to do this first and in the future provide both options. The complication with the query path is just that we would need to always query for that first before running the query. Not a big deal just 2 calls instead of one. I plan to do this eventually:

"team.pinnedQueries": [
{
"account": "your-account-name",
"queryPath": "My Queryes/foo/bar
}
]

@mmanela
Copy link
Contributor Author

mmanela commented Apr 25, 2016

Update the PR to respond to your other feedback

@mmanela
Copy link
Contributor Author

mmanela commented Apr 25, 2016

@jeffyoung On second thought, I will add the queryPath support now ;)

@mmanela
Copy link
Contributor Author

mmanela commented Apr 25, 2016

Query Path support added

```


You can also create a *global* pinned query which will be the default if you have not configured one for your account:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since global also works for a query path, you may just update this text to explain that you can replace your-account-name with "global" and they'll both work. That means you can remove the sample below. Since "global" was introduced earlier with regards to PAT, they should already know what to change.

@jeffyoung
Copy link
Contributor

Thanks for adding the query path support so quickly!

@mmanela
Copy link
Contributor Author

mmanela commented Apr 25, 2016

Update per your comments

@jeffyoung
Copy link
Contributor

Merging. Thanks Matt!

@jeffyoung jeffyoung merged commit fd68131 into microsoft:master Apr 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants