Skip to content

Commit 46892f9

Browse files
authored
Merge pull request #47073 from phillip-kruger/dev-ui-bug-report
Dev UI: Change bug report to be a popover
2 parents cb27ee7 + 1d5a0b9 commit 46892f9

File tree

4 files changed

+52
-72
lines changed

4 files changed

+52
-72
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.quarkus.devui.deployment;
2+
3+
import io.quarkus.deployment.annotations.BuildStep;
4+
import io.quarkus.devui.runtime.reportissues.ReportIssuesJsonRPCService;
5+
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem;
6+
7+
public class ReportIssuesProcessor {
8+
@BuildStep
9+
JsonRPCProvidersBuildItem registerJsonRpcService() {
10+
return new JsonRPCProvidersBuildItem("report-issues", ReportIssuesJsonRPCService.class);
11+
}
12+
}

extensions/vertx-http/deployment/src/main/java/io/quarkus/devui/deployment/menu/ReportIssuesProcessor.java

-28
This file was deleted.

extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-header.js

+40
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ import { devuiState } from 'devui-state';
77
import { JsonRpc } from 'jsonrpc';
88
import '@vaadin/tabs';
99
import '@vaadin/confirm-dialog';
10+
import '@vaadin/popover';
11+
import '@vaadin/vertical-layout';
12+
import { popoverRenderer } from '@vaadin/popover/lit.js';
1013
import 'qwc/qwc-extension-link.js';
1114
import './qwc-theme-switch.js';
15+
1216
/**
1317
* This component represent the Dev UI Header
1418
*/
1519
export class QwcHeader extends observeState(LitElement) {
1620

1721
routerController = new RouterController(this);
22+
jsonRpc = new JsonRpc("report-issues", true);
1823

1924
static styles = css`
2025
@@ -89,6 +94,9 @@ export class QwcHeader extends observeState(LitElement) {
8994
.hidden {
9095
display:none;
9196
}
97+
.button {
98+
--vaadin-button-background: var(--lumo-base-color);
99+
}
92100
`;
93101

94102
static properties = {
@@ -125,6 +133,7 @@ export class QwcHeader extends observeState(LitElement) {
125133
<div class="right-bar">
126134
${this._renderRightSideNav()}
127135
${this._renderThemeOptions()}
136+
${this._renderBugReportButton()}
128137
</div>
129138
${this._renderReconnectPopup()}
130139
</div>`;
@@ -181,6 +190,37 @@ export class QwcHeader extends observeState(LitElement) {
181190
return html`<qwc-theme-switch></qwc-theme-switch>`;
182191
}
183192

193+
_renderBugReportButton(){
194+
return html`<vaadin-button id="bugButton" theme="icon" aria-label="Issue" title="Report an issue" class="button">
195+
<vaadin-icon icon="font-awesome-solid:bug"></vaadin-icon>
196+
</vaadin-button>
197+
<vaadin-popover
198+
for="bugButton"
199+
.position="bottom-end"
200+
${popoverRenderer(this._popoverRenderer)}
201+
></vaadin-popover>`;
202+
}
203+
204+
_popoverRenderer() {
205+
return html`<vaadin-vertical-layout>
206+
<vaadin-button theme="small tertiary" @click="${this._reportBug}" style="color: var(--lumo-body-text-color);">Report a bug</vaadin-button>
207+
<vaadin-button theme="small tertiary" @click="${this._reportFeature}" style="color: var(--lumo-body-text-color);">Request a new feature/enhancement</vaadin-button>
208+
</vaadin-vertical-layout>`;
209+
210+
}
211+
212+
_reportBug(event){
213+
event.preventDefault();
214+
this.jsonRpc.reportBug().then(e => {
215+
window.open(e.result.url, "_blank");
216+
});
217+
}
218+
219+
_reportFeature(event) {
220+
event.preventDefault();
221+
window.open("https://github.com/quarkusio/quarkus/issues/new?assignees=&labels=kind%2Fenhancement&template=feature_request.yml", "_blank");
222+
}
223+
184224
_updateHeader(event){
185225
let currentPage = this.routerController.getCurrentPage();
186226
this._selectedPageIsMax = !currentPage.includeInMenu; // TODO: introduce new property called isMaxView ?

extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qwc/qwc-report-issues.js

-44
This file was deleted.

0 commit comments

Comments
 (0)