Use IntegrityService in feedback widget

This commit is contained in:
Alex Dima
2016-09-23 14:22:39 +03:00
parent 3ae91dec89
commit 7d4c9abf44
3 changed files with 24 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ import {Dropdown} from 'vs/base/browser/ui/dropdown/dropdown';
import {IContextViewService} from 'vs/platform/contextview/browser/contextView';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import product from 'vs/platform/product';
import {IIntegrityService} from 'vs/platform/integrity/common/integrity';
export interface IFeedback {
feedback: string;
@@ -56,10 +57,13 @@ export class FeedbackDropdown extends Dropdown {
protected requestFeatureLink: string;
protected reportIssueLink: string;
private _isPure: boolean;
constructor(
container: HTMLElement,
options: IFeedbackDropdownOptions,
@ITelemetryService protected telemetryService: ITelemetryService
@ITelemetryService protected telemetryService: ITelemetryService,
@IIntegrityService protected integrityService: IIntegrityService
) {
super(container, {
contextViewProvider: options.contextViewProvider,
@@ -69,6 +73,14 @@ export class FeedbackDropdown extends Dropdown {
}
});
this._isPure = true;
this.integrityService.isPure().then(result => {
if (!result.isPure) {
this._isPure = false;
this.$el.addClass('patched');
}
});
this.$el.addClass('send-feedback');
this.$el.title(nls.localize('sendFeedback', "Tweet Feedback"));
@@ -109,6 +121,12 @@ export class FeedbackDropdown extends Dropdown {
let $content = $('div.content').appendTo($form);
let $sentimentContainer = $('div').appendTo($content);
if (!this._isPure) {
$('span').text(nls.localize("patchedVersion1", "Your installation is corrupt.")).appendTo($sentimentContainer);
$('br').appendTo($sentimentContainer);
$('span').text(nls.localize("patchedVersion2", "Please specify this if you submit a bug.")).appendTo($sentimentContainer);
$('br').appendTo($sentimentContainer);
}
$('span').text(nls.localize("sentiment", "How was your experience?")).appendTo($sentimentContainer);
let $feedbackSentiment = $('div.feedback-sentiment').appendTo($sentimentContainer);

View File

@@ -161,6 +161,10 @@
width: 26px;
}
.monaco-shell .statusbar-item > .dropdown.send-feedback.patched > .dropdown-label.send-feedback {
background: url('smiley-patched.svg') center center no-repeat;
}
/* Theming */
.monaco-shell.vs .feedback-form {
color: black;

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><rect id="backgroundrect" width="100%" height="100%" x="0" y="0" fill="none" stroke="none"/><path fill="#fff" d="M22.938775062561035,17 c-3.866,0 -7,3.134 -7,7 s3.134,7 7,7 s7,-3.134 7,-7 s-3.134,-7 -7,-7 zm2.45,2.8 c0.5800000000000001,0 1.05,0.6270000000000001 1.05,1.4 c0,0.773 -0.47000000000000003,1.4 -1.05,1.4 c-0.5800000000000001,0 -1.05,-0.6270000000000001 -1.05,-1.4 c0,-0.773 0.47000000000000003,-1.4 1.05,-1.4 zm-4.9,0 c0.5800000000000001,0 1.05,0.6270000000000001 1.05,1.4 c0,0.773 -0.47000000000000003,1.4 -1.05,1.4 s-1.05,-0.6270000000000001 -1.05,-1.4 c0,-0.773 0.47000000000000003,-1.4 1.05,-1.4 zm6.901,5.775 c-0.6680000000000001,1.8840000000000001 -2.456,3.15 -4.451,3.15 c-1.995,0 -3.784,-1.266 -4.451,-3.149 c-0.09700000000000003,-0.273 0.04600000000000001,-0.5730000000000001 0.31900000000000006,-0.6700000000000002 c0.275,-0.09700000000000003 0.5740000000000001,0.04700000000000001 0.6700000000000002,0.32000000000000006 c0.519,1.465 1.9100000000000001,2.45 3.461,2.45 s2.941,-0.984 3.461,-2.45 c0.09700000000000003,-0.273 0.4,-0.41700000000000004 0.6700000000000002,-0.32000000000000006 c0.274,0.09600000000000003 0.41800000000000004,0.3960000000000001 0.32100000000000006,0.6690000000000002 z" id="svg_1" class="" transform="rotate(-180 15.438775062561037,15.999999999999998) "/></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB