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

Add Feedback icon to status bar #202

Merged
merged 1 commit into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/clients/feedbackclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export class FeedbackClient {
providedEmail = email;
}
//This feedback will go no matter whether Application Insights is enabled or not.
Telemetry.SendFeedback(choice.id, { "VSCode.Feedback.Comment" : value, "VSCode.Feedback.Email" : providedEmail} );
let trimmedValue: string = value.trim();
if (trimmedValue.length > 1000) {
trimmedValue = trimmedValue.substring(0, 1000);
}
Telemetry.SendFeedback(choice.id, { "VSCode.Feedback.Comment" : trimmedValue, "VSCode.Feedback.Email" : providedEmail} );

const disposable: Disposable = window.setStatusBarMessage(Strings.ThanksForFeedback);
setInterval(() => disposable.dispose(), 1000 * 5);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Strings {
static SendAFrown: string = "Send a Frown";
static SendASmile: string = "Send a Smile";
static SendEmailPrompt: string = "(Optional) Provide your email address";
static SendFeedback: string = "Send us feedback!";
static SendFeedback: string = "Send us feedback about the Team Services extension!";
static SendFeedbackPrompt: string = "Enter your feedback here (1000 char limit)";
static NoFeedbackSent: string = "No feedback was sent.";
static ThanksForFeedback: string = "Thanks for sending feedback!";
Expand Down
13 changes: 13 additions & 0 deletions src/team-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class TeamExtension {
private _buildStatusBarItem: StatusBarItem;
private _pullRequestStatusBarItem: StatusBarItem;
private _pinnedQueryStatusBarItem: StatusBarItem;
private _feedbackStatusBarItem: StatusBarItem;
private _buildClient: BuildClient;
private _gitClient: GitClient;
private _witClient: WitClient;
Expand Down Expand Up @@ -332,6 +333,14 @@ export class TeamExtension {
this._pinnedQueryStatusBarItem.tooltip = Strings.ViewYourPinnedQuery;
this._pinnedQueryStatusBarItem.show();
}

if (!this._feedbackStatusBarItem) {
this._feedbackStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 96);
Copy link
Contributor

Choose a reason for hiding this comment

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

You should change 96 to 97. ;)

this._feedbackStatusBarItem.command = CommandNames.SendFeedback;
this._feedbackStatusBarItem.text = `$(icon octicon-megaphone)`;
this._feedbackStatusBarItem.tooltip = Strings.SendFeedback;
this._feedbackStatusBarItem.show();
}
}

public InitializeClients(repoType: RepositoryType) : void {
Expand Down Expand Up @@ -419,6 +428,10 @@ export class TeamExtension {
this._buildStatusBarItem.dispose();
this._buildStatusBarItem = undefined;
}
if (this._feedbackStatusBarItem !== undefined) {
this._feedbackStatusBarItem.dispose();
this._feedbackStatusBarItem = undefined;
}
if (this._pinnedQueryStatusBarItem !== undefined) {
this._pinnedQueryStatusBarItem.dispose();
this._pinnedQueryStatusBarItem = undefined;
Expand Down