add bugview

This commit is contained in:
f43nd1r 2018-09-08 15:22:48 +02:00
parent bb507c1fd2
commit b1ff74767b
4 changed files with 54 additions and 4 deletions

View file

@ -18,8 +18,8 @@ plugins {
id 'java'
id 'idea'
id 'war'
id 'org.springframework.boot' version '2.0.2.RELEASE'
id 'com.devsoap.vaadin-flow' version '1.0.0.M3'
id 'org.springframework.boot' version '2.0.4.RELEASE'
id 'com.devsoap.vaadin-flow' version '1.0.0.M5'
id 'io.spring.dependency-management' version '1.0.5.RELEASE'
id 'cn.bestwu.propdeps' version '0.0.10'
}
@ -30,7 +30,7 @@ repositories {
}
vaadin {
version '10.0.1'
version '10.0.5'
}
@ -62,6 +62,10 @@ idea {
}
}
configurations {
all*.exclude module : 'slf4j-simple'
}
dependencies {
//spring
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
@ -78,7 +82,6 @@ dependencies {
compile "com.querydsl:querydsl-apt:$queryDslVersion:jpa"
//vaadin
compile "com.vaadin:vaadin-spring-boot-starter:${vaadin.version}"
compile "com.vaadin:flow:1.0.1"
compile 'com.vaadin:vaadin-icons:3.0.1'
compile 'org.jfree:jfreechart:1.5.0'
compile 'javax.servlet:javax.servlet-api:3.1.0'

1
settings.gradle Normal file
View file

@ -0,0 +1 @@
enableFeaturePreview('IMPROVED_POM_SUPPORT')

View file

@ -10,10 +10,13 @@ import com.faendir.acra.service.DataService;
import com.faendir.acra.ui.base.MyGrid;
import com.faendir.acra.ui.base.popup.Popup;
import com.faendir.acra.ui.view.app.AppView;
import com.faendir.acra.ui.view.bug.BugView;
import com.faendir.acra.util.TimeSpanRenderer;
import com.vaadin.flow.component.UI;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.html.Anchor;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.FlexComponent;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
@ -84,6 +87,12 @@ public class BugTab extends AppTab<VerticalLayout> {
checkbox.addValueChangeListener(e -> getDataService().setBugSolved(bug.getBug(), e.getValue()));
return checkbox;
}), QBug.bug.solved, "Solved").setFlexGrow(0);
bugs.addColumn(new ComponentRenderer<>(bug -> {
Anchor anchor = new Anchor();
anchor.setHref(UI.getCurrent().getRouter().getUrl(BugView.class, bug.getBug().getId()));
anchor.setText("Open");
return anchor;
}), "");
getContent().add(bugs);
getContent().setFlexGrow(1, bugs);
getContent().setSizeFull();

View file

@ -0,0 +1,37 @@
package com.faendir.acra.ui.view.bug;
import com.faendir.acra.ui.view.MainView;
import com.vaadin.flow.component.Text;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.BeforeEvent;
import com.vaadin.flow.router.HasUrlParameter;
import com.vaadin.flow.router.RoutePrefix;
import com.vaadin.flow.spring.annotation.SpringComponent;
import com.vaadin.flow.spring.annotation.UIScope;
/**
* @author lukas
* @since 08.09.18
*/
@UIScope
@SpringComponent
@RoutePrefix("bug")
@com.vaadin.flow.router.ParentLayout(MainView.class)
public class BugView extends Div implements HasUrlParameter<Integer> {
private final Text content;
private int bugId;
public BugView() {
content = new Text("");
add(content);
}
@Override
public void setParameter(BeforeEvent event, Integer parameter) {
try {
bugId = parameter;
content.setText("This is bug " + bugId);
} catch (NumberFormatException ignored) {
}
}
}