提交 e5f650eb 编写于 作者: I isidor

report issue button skeleton

上级 159f0ea2
......@@ -1721,6 +1721,22 @@ export class ExtensionHostProfileAction extends Action {
}
}
export class ReportExtensionIssueAction extends Action {
static ID = 'workbench.extensions.action.reportExtensionIssue';
static LABEL = localize('reportExtensionIssue', "Report Issue");
constructor(
id: string = ExtensionHostProfileAction.ID, label: string = ExtensionHostProfileAction.LABEL_START,
@IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService,
) {
super(id, label, 'report-extension-issue');
}
run(extension: IExtension): TPromise<any> {
return this.extensionsWorkbenchService.reportIssue(extension);
}
}
CommandsRegistry.registerCommand('workbench.extensions.action.showExtensionsForLanguage', function (accessor: ServicesAccessor, fileExtension: string) {
const viewletService = accessor.get(IViewletService);
......
......@@ -78,6 +78,7 @@ export interface IExtensionsWorkbenchService {
setEnablement(extension: IExtension, enablementState: EnablementState): TPromise<void>;
loadDependencies(extension: IExtension): TPromise<IExtensionDependencies>;
open(extension: IExtension, sideByside?: boolean): TPromise<any>;
reportIssue(extension: IExtension): TPromise<void>;
checkForUpdates(): TPromise<void>;
allowedBadgeProviders: string[];
}
......
......@@ -38,4 +38,18 @@
.monaco-action-bar .extension-host-profile-stop {
background: url('profile-stop.svg') center center no-repeat;
}
\ No newline at end of file
}
.runtime-extensions-editor .monaco-action-bar {
padding-top: 21px;
}
.runtime-extensions-editor .monaco-action-bar .action-label {
background: #fef2c0;
border-radius: 6px;
padding: 2px;
}
.vs-dark .runtime-extensions-editor .monaco-action-bar .action-label {
background: #796926;
}
......@@ -26,7 +26,7 @@ import { append, $, addDisposableListener, addClass, toggleClass } from 'vs/base
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IMessageService, Severity } from 'vs/platform/message/common/message';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { ExtensionHostProfileAction } from 'vs/workbench/parts/extensions/browser/extensionsActions';
import { ExtensionHostProfileAction, ReportExtensionIssueAction } from 'vs/workbench/parts/extensions/browser/extensionsActions';
interface IRuntimeExtension {
......@@ -133,6 +133,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
msgIcon: HTMLElement;
msgLabel: HTMLElement;
actionbar: ActionBar;
disposables: IDisposable[];
elementDisposables: IDisposable[];
}
......@@ -155,16 +156,10 @@ export class RuntimeExtensionsEditor extends BaseEditor {
const msgLabel = append(msgContainer, $('span.msg-label'));
const actionbar = new ActionBar(element, {
animated: false,
actionItemProvider: (action: Action) => {
// TODO
// if (action.id === ManageExtensionAction.ID) {
// return (<ManageExtensionAction>action).actionItem;
// }
return null;
}
animated: false
});
actionbar.onDidRun(({ error }) => error && this._messageService.show(Severity.Error, error));
actionbar.push(new ReportExtensionIssueAction(ReportExtensionIssueAction.ID, ReportExtensionIssueAction.LABEL, this._extensionsWorkbenchService), { icon: false });
const disposables = [actionbar];
......@@ -173,6 +168,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
element,
icon,
name,
actionbar,
timeContainer,
timeIcon,
timeLabel,
......@@ -199,6 +195,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
const activationTimes = element.status.activationTimes;
let syncTime = activationTimes.codeLoadingTime + activationTimes.activateCallTime;
data.timeLabel.textContent = `${syncTime}ms`;
data.actionbar.context = element.marketplaceInfo;
let title: string;
if (activationTimes.activationEvent === '*') {
......
......@@ -435,6 +435,10 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
return this.editorService.openEditor(this.instantiationService.createInstance(ExtensionsInput, extension), null, sideByside);
}
reportIssue(extension: IExtension): TPromise<void> {
return TPromise.as(undefined);
}
private fromGallery(gallery: IGalleryExtension): Extension {
const installed = this.getInstalledExtensionMatchingGallery(gallery);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册