Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Introduce port plug-in widget
Browse files Browse the repository at this point in the history
 - move modal dialogs to classic notification
 - add missing no option in redirect dialog
 - handle internal endpoints (private ports)
 - Add ports widget in addition to dialog popup of port plug-in
 - display public and private ports
 - allow to open in a new tab or preview url
 - filtering plugin's endpoints (default = true)

Fixes eclipse-che/che#17972
Fixes eclipse-che/che#17993

Change-Id: I5dd802ea51d6a10be525a169e03632f37480a5ac
Signed-off-by: Florent Benoit <[email protected]>
  • Loading branch information
benoitf authored and monaka committed Nov 5, 2020
1 parent 6473150 commit 15176e2
Show file tree
Hide file tree
Showing 34 changed files with 2,527 additions and 491 deletions.
33 changes: 33 additions & 0 deletions plugins/ports-plugin/__mocks__/@theia/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2019 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/

/**
* Mock of @theia/plugin module
* @author Florent Benoit
*/
const theia: any = {};
export class EventEmitter {
constructor() {

}
fire() {

}
}

export enum TreeItemCollapsibleState {
None,
Collapsed,
Expanded
}

theia.EventEmitter = EventEmitter;
theia.TreeItemCollapsibleState = TreeItemCollapsibleState;
module.exports = theia;
93 changes: 92 additions & 1 deletion plugins/ports-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,97 @@
"activationEvents": [
"*"
],
"contributes": {
"viewsContainers": {
"right": [
{
"id": "endpoints",
"title": "Endpoints",
"icon": "resources/plug.svg"
}
]
},
"views": {
"endpoints": [
{
"id": "endpoints"
}
]
},
"commands": [
{
"command": "portPlugin.filterOutPlugins",
"title": "Hide plug-in endpoints",
"icon": {
"light": "resources/light/filter.svg",
"dark": "resources/dark/filter.svg"
}
},
{
"command": "portPlugin.filterInPlugins",
"title": "Show plug-in endpoints",
"icon": {
"light": "resources/light/bullseye.svg",
"dark": "resources/dark/bullseye.svg"
}
},
{
"command": "portPlugin.openNewTabPort",
"title": "Open in a new tab",
"icon": {
"light": "resources/light/external-link.svg",
"dark": "resources/dark/external-link.svg"
}
},
{
"command": "portPlugin.copyClipboardUrl",
"title": "Copy endpoint URL to clipboard",
"icon": {
"light": "resources/light/clipboard.svg",
"dark": "resources/dark/clipboard.svg"
}
},
{
"command": "portPlugin.preview",
"title": "Open in preview",
"icon": {
"light": "resources/light/eye.svg",
"dark": "resources/dark/eye.svg"
}
}
],
"menus": {
"view/title": [
{
"command": "portPlugin.filterInPlugins",
"when": "view == endpoints && !portPluginShowPlugins",
"group": "navigation"
},
{
"command": "portPlugin.filterOutPlugins",
"when": "view == endpoints && portPluginShowPlugins",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "portPlugin.openNewTabPort",
"when": "view == endpoints && viewItem == publicHttpsEndpointOnline || view == endpoints && viewItem == publicHttpPortOnline",
"group": "inline"
},
{
"command": "portPlugin.preview",
"when": "view == endpoints && viewItem == publicHttpsEndpointOnline",
"group": "inline"
},
{
"command": "portPlugin.copyClipboardUrl",
"when": "view == endpoints && viewItem == publicHttpEndpointOnline || view == endpoints && viewItem == publicHttpsEndpointOnline || view == endpoints && viewItem == publicPortOnline || view == endpoints && viewItem == publicDevfilePortOffline",
"group": "inline"
}
]
}
},
"dependencies": {},
"devDependencies": {
"@eclipse-che/plugin": "latest",
Expand All @@ -38,7 +129,7 @@
"theiaPlugin": "next"
},
"theiaPlugin": {
"backend": "lib/ports-plugin.js"
"backend": "lib/main.js"
},
"jest": {
"collectCoverage": true,
Expand Down
53 changes: 53 additions & 0 deletions plugins/ports-plugin/resources/dark/bullseye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions plugins/ports-plugin/resources/dark/clipboard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions plugins/ports-plugin/resources/dark/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions plugins/ports-plugin/resources/dark/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 15176e2

Please sign in to comment.