Skip to content

Commit

Permalink
Merge branch 'master' into change-content-security-policy
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Gulyy <vgulyy@redhat.com>
  • Loading branch information
vitaliy-guliy committed Jun 23, 2020
2 parents 6516b4a + 3090899 commit b75a2f0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
5 changes: 5 additions & 0 deletions dev-packages/cli/src/download-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ export default async function downloadPlugins(options: DownloadPluginsOptions =

await mkdirpAsPromised(pluginsDir);

if (!pck.theiaPlugins) {
console.log(red('error: missing mandatory \'theiaPlugins\' property.'));
return;
}

await Promise.all(Object.keys(pck.theiaPlugins).map(async plugin => {
if (!plugin) {
return;
Expand Down
36 changes: 29 additions & 7 deletions packages/output/src/browser/output-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,42 @@ export class OutputContribution extends AbstractViewContribution<OutputWidget> i
registerCommands(registry: CommandRegistry): void {
super.registerCommands(registry);
registry.registerCommand(OutputCommands.CLEAR__WIDGET, {
isEnabled: widget => this.withWidget(widget),
isVisible: widget => this.withWidget(widget),
execute: () => this.widget.then(widget => widget.clear())
isEnabled: arg => {
if (arg instanceof Widget) {
return arg instanceof OutputWidget;
}
return this.shell.currentWidget instanceof OutputWidget;
},
isVisible: arg => {
if (arg instanceof Widget) {
return arg instanceof OutputWidget;
}
return this.shell.currentWidget instanceof OutputWidget;
},
execute: () => {
this.widget.then(widget => {
this.withWidget(widget, output => {
output.clear();
return true;
});
});
}
});
registry.registerCommand(OutputCommands.LOCK__WIDGET, {
isEnabled: widget => this.withWidget(widget, output => !output.isLocked),
isVisible: widget => this.withWidget(widget, output => !output.isLocked),
execute: () => this.widget.then(widget => widget.lock())
execute: widget => this.withWidget(widget, output => {
output.lock();
return true;
})
});
registry.registerCommand(OutputCommands.UNLOCK__WIDGET, {
isEnabled: widget => this.withWidget(widget, output => output.isLocked),
isVisible: widget => this.withWidget(widget, output => output.isLocked),
execute: () => this.widget.then(widget => widget.unlock())
execute: widget => this.withWidget(widget, output => {
output.unlock();
return true;
})
});
}

Expand Down Expand Up @@ -167,10 +190,9 @@ export class OutputContribution extends AbstractViewContribution<OutputWidget> i
}

protected withWidget(
widget: Widget | undefined,
widget: Widget | undefined = this.tryGetWidget(),
predicate: (output: OutputWidget) => boolean = () => true
): boolean | false {

return widget instanceof OutputWidget ? predicate(widget) : false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class OutputToolbarContribution implements TabBarToolbarContribution {
toolbarRegistry.registerItem({
id: OutputCommands.CLEAR__WIDGET.id,
command: OutputCommands.CLEAR__WIDGET.id,
tooltip: OutputCommands.CLEAR__WIDGET.label,
tooltip: 'Clear Output',
priority: 1,
});
toolbarRegistry.registerItem({
Expand Down
12 changes: 6 additions & 6 deletions packages/task/src/common/task-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export enum DependsOrder {
}

export enum RevealKind {
Always,
Silent,
Never
Always = 'always',
Silent = 'silent',
Never = 'never'
}

export enum PanelKind {
Shared,
Dedicated,
New
Shared = 'shared',
Dedicated = 'dedicated',
New = 'new'
}

export interface TaskOutputPresentation {
Expand Down

0 comments on commit b75a2f0

Please sign in to comment.