update demo data for actions

This commit is contained in:
Géry Debongnie
2019-03-01 12:58:26 +01:00
parent 470154f8f9
commit 0e9edd4d17
3 changed files with 133 additions and 24 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
export type RPC = (route: string, params: any) => Promise<any>;
export const rpc: RPC = async function(route, params) {
console.log("RPC", route, params);
const delay = Math.random() * 1000;
return new Promise(resolve => setTimeout(resolve, delay));
return (<any>window).demoData.mockAjax(route, params);
};
@@ -26,11 +26,28 @@ export interface ActWindowInfo extends CommonActionInfo {
view: string;
}
export interface ActionDescription {
interface BaseActionDescription {
id: number;
type: "ir.actions.act_window" | "ir.actions.client";
target: "current";
name: string;
}
interface ClientActionDescription extends BaseActionDescription {
type: "ir.actions.client";
tag: string;
}
interface ActWindowActionDescription extends BaseActionDescription {
type: "ir.actions.act_window";
views: [false | number, string][];
domain: false | string;
res_id: number;
res_model: string;
context: Object | string;
}
export type ActionDescription =
| ClientActionDescription
| ActWindowActionDescription;
export type ActionInfo = ClientActionInfo | ActWindowInfo;
export type ActionStack = ActionInfo[];