New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinned Query Status Bar Item #17

Merged
merged 7 commits into from Apr 25, 2016

Conversation

Projects
None yet
3 participants
@mmanela
Member

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

This comment has been minimized.

Show comment
Hide comment
@msftclas

msftclas Apr 23, 2016

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;

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;

Show outdated Hide outdated src/team-extension.ts
@@ -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";

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Preference is to alphabetize the imports

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Preference is to alphabetize the imports

Show outdated Hide outdated src/clients/witclient.ts
public ShowPinnedQueryWorkItems(): void {
this.ReportEvent(TelemetryEvents.ViewPinnedQueryWorkItems);
this.showWorkItems(this._pinnedQueryText);

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

Show outdated Hide outdated src/clients/witclient.ts
@@ -126,6 +139,16 @@ export class WitClient extends BaseClient {
);
}
public GetPinnedQueryResultCount() : Q.Promise<number> {

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

Show outdated Hide outdated src/clients/witclient.ts
Logger.LogInfo("Running pinned work item query to get count...");
Logger.LogInfo("TP: " + this._serverContext.RepoInfo.TeamProject);
return svc.GetQueryResultCount(this._serverContext.RepoInfo.TeamProject, this._pinnedQueryText);

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

Show outdated Hide outdated src/helpers/strings.ts
@@ -6,6 +6,9 @@
/* tslint:disable:variable-name */
export class Strings {

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Could you remove the extra whitespace (line)?

@@ -21,6 +21,47 @@ abstract class BaseSettings {
}
}
export interface IPinnedQuery {

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

I don't think you need to export this interface (only references is in this particular file).

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

I don't think you need to export this interface (only references is in this particular file).

@jeffyoung

This comment has been minimized.

Show comment
Hide comment
@jeffyoung

jeffyoung Apr 25, 2016

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?

Contributor

jeffyoung commented Apr 25, 2016

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

This comment has been minimized.

Show comment
Hide comment
@mmanela

mmanela Apr 25, 2016

Member

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
}
]

Member

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

This comment has been minimized.

Show comment
Hide comment
@mmanela

mmanela Apr 25, 2016

Member

Update the PR to respond to your other feedback

Member

mmanela commented Apr 25, 2016

Update the PR to respond to your other feedback

@mmanela

This comment has been minimized.

Show comment
Hide comment
@mmanela

mmanela Apr 25, 2016

Member

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

Member

mmanela commented Apr 25, 2016

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

@mmanela

This comment has been minimized.

Show comment
Hide comment
@mmanela

mmanela Apr 25, 2016

Member

Query Path support added

Member

mmanela commented Apr 25, 2016

Query Path support added

Show outdated Hide outdated README.md
```
You can also create a *global* pinned query which will be the default if you have not configured one for your account:

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

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

jeffyoung Apr 25, 2016

Contributor

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.

Show outdated Hide outdated src/helpers/strings.ts
@@ -6,6 +6,8 @@
/* tslint:disable:variable-name */
export class Strings {
static ViewYourPinnedQuery: string = "View your pinned work item query.";

This comment has been minimized.

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

It'd be great if you could change "...work item query" to "...work item query results."

@jeffyoung

jeffyoung Apr 25, 2016

Contributor

It'd be great if you could change "...work item query" to "...work item query results."

@jeffyoung

This comment has been minimized.

Show comment
Hide comment
@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Thanks for adding the query path support so quickly!

Contributor

jeffyoung commented Apr 25, 2016

Thanks for adding the query path support so quickly!

@mmanela

This comment has been minimized.

Show comment
Hide comment
@mmanela

mmanela Apr 25, 2016

Member

Update per your comments

Member

mmanela commented Apr 25, 2016

Update per your comments

@jeffyoung

This comment has been minimized.

Show comment
Hide comment
@jeffyoung

jeffyoung Apr 25, 2016

Contributor

Merging. Thanks Matt!

Contributor

jeffyoung commented Apr 25, 2016

Merging. Thanks Matt!

@jeffyoung jeffyoung merged commit fd68131 into Microsoft:master Apr 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment