Fix Typicalc link

This commit is contained in:
Arne Keller 2021-02-16 12:31:15 +01:00
parent 86226f896e
commit 2bbba50ddc
3 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ import edu.kit.typicalc.view.content.typeinferencecontent.MathjaxUnification;
import edu.kit.typicalc.view.main.MainViewImpl;
@Route(value = "", layout = MainViewImpl.class)
@PageTitle("Typicalc")
@PageTitle(MainViewImpl.PAGE_TITLE)
@JsModule("./src/mathjax-setup.js")
public class StartPageView extends VerticalLayout implements ControlPanelView {

View File

@ -32,12 +32,13 @@ import java.util.stream.Collectors;
@CssImport(value = "./styles/view/main/app-layout.css", themeFor = "vaadin-app-layout")
@JavaScript("./src/svg-pan-zoom.min.js")
@JavaScript("./src/tex-svg-full.js")
@PageTitle("Typicalc")
@Route(TypeInferenceView.ROUTE + "/:term")
public class MainViewImpl extends AppLayout
implements MainView, BeforeEnterObserver, HasErrorParameter<NotFoundException> {
private static final long serialVersionUID = -2411433187835906976L;
public static final String PAGE_TITLE = "Typicalc";
private final UpperBar upperBar;
/**

View File

@ -9,10 +9,8 @@ import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.icon.Icon;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.router.Location;
import edu.kit.typicalc.view.content.infocontent.StartPageView;
import edu.kit.typicalc.view.main.MainView.MainViewListener;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import java.util.Map;
@ -63,7 +61,7 @@ public class UpperBar extends HorizontalLayout {
add(new DrawerToggle(), viewTitle, inputBar, helpIcon);
setId(UPPER_BAR_ID);
getThemeList().set("dark", true); //TODO remove magic string
getThemeList().set("dark", true);
setSpacing(false);
}
@ -91,7 +89,8 @@ public class UpperBar extends HorizontalLayout {
private void routeToStartPage(Consumer<Component> setContent) {
setContent.accept(new StartPageView());
UI.getCurrent().getPage().getHistory().replaceState(null, new Location(StringUtils.EMPTY));
UI.getCurrent().getPage().setTitle(MainViewImpl.PAGE_TITLE);
UI.getCurrent().getPage().executeJs("history.pushState(null, '', $0)", "/");
}
private void onHelpIconClick() {