Task: Fixed server routes loop and add server layout for vaadin flow backend from java code design and rename theme name to fusion and updated the views and add mock users for show data grid and fixed all views

This commit is contained in:
2021-07-27 09:53:06 +07:00
parent 05e6fe2447
commit 5a9930161b
13 changed files with 71 additions and 18 deletions

View File

@@ -9,6 +9,9 @@ const { serverSideRoutes } = new Flow({
imports: () => import('../target/frontend/generated-flow-imports'),
});
console.log("serverSideRoutes", serverSideRoutes)
export type ViewRoute = Route & {
title?: string;
icon?: string;
@@ -67,15 +70,6 @@ export const views: ViewRoute[] = [
},
];
export const routes: ViewRoute[] = [
{
path: '',
component: 'main-layout',
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',
component: 'login-view',
@@ -86,4 +80,18 @@ export const routes: ViewRoute[] = [
return;
},
},
{
path: '',
component: 'main-layout',
children: [
...views,
],
},
{
path: '',
component: 'server-layout',
children: [
...serverSideRoutes,
]
}
];

View File

@@ -0,0 +1,10 @@
import { html } from 'lit';
import { customElement } from 'lit/decorators.js';
import {Layout} from "./view";
@customElement('server-layout')
export class AdminView extends Layout {
render() {
return html`<><slot></slot></>`;
}
}