mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
refactoring: implement actionmanager, and router
So we now have a working SPA!
This commit is contained in:
@@ -1,28 +1,36 @@
|
||||
import { QWeb } from "./core/qweb_vdom";
|
||||
import { WEnv } from "./core/widget";
|
||||
import { actions, Action } from "./services/actions";
|
||||
import { ActionManager } from "./services/action_manager";
|
||||
import Ajax from "./services/ajax";
|
||||
import Router from "./services/router";
|
||||
import { Ajax } from "./services/ajax";
|
||||
import { Router } from "./services/router";
|
||||
|
||||
export interface Menu {
|
||||
title: string;
|
||||
actionID: number;
|
||||
}
|
||||
|
||||
export interface Env extends WEnv {
|
||||
actionManager: ActionManager;
|
||||
actions: Action[];
|
||||
ajax: Ajax;
|
||||
router: Router;
|
||||
menus: Menu[];
|
||||
}
|
||||
|
||||
export function makeEnvironment(): Env {
|
||||
const qweb = new QWeb();
|
||||
const router = new Router();
|
||||
const ajax = new Ajax();
|
||||
const actionManager = new ActionManager();
|
||||
const actionManager = new ActionManager(router);
|
||||
const menus = [
|
||||
{ title: "Discuss", actionID: 1 },
|
||||
{ title: "CRM", actionID: 2 }
|
||||
];
|
||||
|
||||
return {
|
||||
qweb,
|
||||
ajax,
|
||||
router,
|
||||
actionManager,
|
||||
actions
|
||||
menus
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user