Task: Add Hybrid for Vaadin Fusion and Flow together, but have some issues with Login recursively routes

This commit is contained in:
2021-07-25 20:04:59 +07:00
parent 85b1573391
commit 05e6fe2447
11 changed files with 54 additions and 28 deletions

View File

@@ -1,9 +1,14 @@
import { Flow } from "@vaadin/flow-frontend";
import { Route } from '@vaadin/router';
import Role from './generated/com/cubetiqs/fusion/data/Role';
import { appStore } from './stores/app-store';
import './views/home/home-view';
import './views/main-layout';
const { serverSideRoutes } = new Flow({
imports: () => import('../target/frontend/generated-flow-imports'),
});
export type ViewRoute = Route & {
title?: string;
icon?: string;
@@ -65,7 +70,11 @@ export const routes: ViewRoute[] = [
{
path: '',
component: 'main-layout',
children: [...views],
children: [
...views,
// for server-side, the next magic line sends all unmatched routes:
...serverSideRoutes, // IMPORTANT: this must be the last entry in the array
],
},
{
path: 'login',

View File

@@ -30,7 +30,7 @@ export class LoginView extends View {
action="login"
no-forgot-password
.i18n=${Object.assign(
{ header: { title: 'Fusion Management', description: 'Login using user/user or admin/admin' } },
{ header: { title: 'Fusion', description: 'Login using user/user or admin/admin' } },
loginI18nDefault
)}
>