Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Fixup: Hide Plugins view from upstream (#425)
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Guliy <vgulyy@redhat.com>
  • Loading branch information
vitaliy-guliy authored and AndrienkoAleksandr committed Sep 3, 2019
1 parent bb78be1 commit 1165020
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
********************************************************************************/

import { injectable, inject } from 'inversify';
import { CommandRegistry, CommandContribution } from '@theia/core/lib/common';
import { MenuModelRegistry, CommandRegistry, CommandContribution } from '@theia/core/lib/common';
import { MessageService, Command } from '@theia/core/lib/common';
import { ChePluginRegistry } from '../../common/che-protocol';
import { ChePluginManager } from './che-plugin-manager';
import { QuickInputService } from '@theia/core/lib/browser';
import { CommonMenus, QuickInputService } from '@theia/core/lib/browser';
import { MonacoQuickOpenService } from '@theia/monaco/lib/browser/monaco-quick-open-service';
import { QuickOpenModel, QuickOpenItem, QuickOpenMode } from '@theia/core/lib/browser/quick-open/quick-open-model';
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';

function cmd(id: string, label: string): Command {
return {
Expand Down Expand Up @@ -59,6 +60,23 @@ export class ChePluginCommandContribution implements CommandContribution {
@inject(ChePluginManager)
protected readonly chePluginManager: ChePluginManager;

/**
* TEMPORARY SOLUTION
*
* Following code removes 'View/Plugins' menu item and the command that displays/hides Plugins view.
* In the future we will try to refactor Che Plugins view and move it to the 'plugin-ext'.
*/
constructor(
@inject(MenuModelRegistry) menuModelRegistry: MenuModelRegistry,
@inject(CommandRegistry) commandRegistry: CommandRegistry,
@inject(FrontendApplicationStateService) stateService: FrontendApplicationStateService
) {
stateService.reachedState('initialized_layout').then(() => {
menuModelRegistry.unregisterMenuAction('pluginsView:toggle', CommonMenus.VIEW_VIEWS);
commandRegistry.unregisterCommand('pluginsView:toggle');
});
}

registerCommands(commands: CommandRegistry): void {
commands.registerCommand(ChePluginManagerCommands.CHANGE_REGISTRY, {
execute: () => this.changePluginRegistry()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import { CommandRegistry as PhosphorCommandRegistry } from '@phosphor/commands';
import { Emitter, Event } from '@theia/core/lib/common';
import { ChePluginManager } from './che-plugin-manager';
import { ChePluginManagerCommands, ChePluginCommandContribution } from './che-plugin-command-contribution';
import { MenuModelRegistry, CommandRegistry } from '@theia/core/lib/common';
import { CommonMenus } from '@theia/core/lib/browser';

@injectable()
export class ChePluginMenu {
Expand All @@ -34,20 +32,6 @@ export class ChePluginMenu {

protected readonly menuClosed = new Emitter<void>();

/**
* TEMPORARY SOLUTION
*
* Following code removes 'View/Plugins' menu item and the command that displays/hides Plugins view.
* In the future we will try to refactor Che Plugins view and move it to the 'plugin-ext'.
*/
constructor(
@inject(MenuModelRegistry) menuModelRegistry: MenuModelRegistry,
@inject(CommandRegistry) commandRegistry: CommandRegistry
) {
menuModelRegistry.unregisterMenuAction('pluginsView:toggle', CommonMenus.VIEW_VIEWS);
commandRegistry.unregisterCommand('pluginsView:toggle');
}

get onMenuClosed(): Event<void> {
return this.menuClosed.event;
}
Expand Down

0 comments on commit 1165020

Please sign in to comment.