[FIX] web: warn is show when a client action is a function

Before this commit, if we use some client action like: reload, logout, ...
in the console a warning is show, because the action are function and not
AbstractAction.

After this commit, if the client action is not an function and not
a AbstractAction the warning is show.

X-original-commit: 122b76594aeb2c5d923d13c040c2da2048133aac
This commit is contained in:
Romeo Fragomeli
2019-10-14 12:11:22 +00:00
committed by fw-bot
parent c737dd5001
commit 3e5cc15d16
@@ -420,9 +420,6 @@ var ActionManager = Widget.extend({
console.error("Could not find client action " + action.tag, action);
return Promise.reject();
}
if (!(ClientAction.prototype instanceof AbstractAction)) {
console.warn('The client action ' + action.tag + ' should be an instance of AbstractAction!');
}
if (!(ClientAction.prototype instanceof Widget)) {
// the client action might be a function, which is executed and
// whose returned value might be another action to execute
@@ -432,6 +429,9 @@ var ActionManager = Widget.extend({
}
return Promise.resolve();
}
if (!(ClientAction.prototype instanceof AbstractAction)) {
console.warn('The client action ' + action.tag + ' should be an instance of AbstractAction!');
}
var controllerID = _.uniqueId('controller_');