[IMP] web: make model reload silent
When a request to the server takes more than 3 seconds, the blockUI then prevents the user from taking another action. For example, when you want to apply several filters quickly, the blockUI appears and, in the end, you may want to apply yet another filter. In this commit, we remove the blockUI because we believe that blocking the user makes little sense. This only makes sense when installing a new application. task-3279095 closes odoo/odoo#140042 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -41,10 +41,6 @@ export class LoadingIndicator extends Component {
|
||||
this.startShowTimer = browser.setTimeout(() => {
|
||||
if (this.state.count) {
|
||||
this.state.show = true;
|
||||
this.blockUITimer = browser.setTimeout(() => {
|
||||
this.shouldUnblock = true;
|
||||
this.uiService.block();
|
||||
}, 3000);
|
||||
}
|
||||
}, 250);
|
||||
}
|
||||
|
||||
@@ -128,51 +128,6 @@ QUnit.test("displays the loading indicator for multi rpc in debug mode", async (
|
||||
assert.strictEqual(loadingIndicator, null, "the loading indicator should not be displayed");
|
||||
});
|
||||
|
||||
QUnit.test("loading indicator blocks UI", async (assert) => {
|
||||
const env = await makeTestEnv();
|
||||
patchWithCleanup(originalBrowser, {
|
||||
setTimeout: async (callback, delay) => {
|
||||
assert.step(`set timeout ${delay}`);
|
||||
await Promise.resolve();
|
||||
callback();
|
||||
},
|
||||
});
|
||||
const ui = env.services.ui;
|
||||
ui.bus.addEventListener("BLOCK", () => {
|
||||
assert.step("block");
|
||||
});
|
||||
ui.bus.addEventListener("UNBLOCK", () => {
|
||||
assert.step("unblock");
|
||||
});
|
||||
await mount(LoadingIndicator, target, { env });
|
||||
env.bus.trigger("RPC:REQUEST", payload(1));
|
||||
await nextTick();
|
||||
env.bus.trigger("RPC:RESPONSE", payload(1));
|
||||
await nextTick();
|
||||
assert.verifySteps(["set timeout 250", "set timeout 3000", "block", "unblock"]);
|
||||
});
|
||||
|
||||
QUnit.test("loading indicator doesn't unblock ui if it didn't block it", async (assert) => {
|
||||
const env = await makeTestEnv();
|
||||
const { execRegisteredTimeouts } = mockTimeout();
|
||||
const ui = env.services.ui;
|
||||
ui.bus.addEventListener("BLOCK", () => {
|
||||
assert.step("block");
|
||||
});
|
||||
ui.bus.addEventListener("UNBLOCK", () => {
|
||||
assert.step("unblock");
|
||||
});
|
||||
await mount(LoadingIndicator, target, { env });
|
||||
env.bus.trigger("RPC:REQUEST", payload(1));
|
||||
execRegisteredTimeouts();
|
||||
env.bus.trigger("RPC:RESPONSE", payload(1));
|
||||
assert.verifySteps(["block", "unblock"]);
|
||||
env.bus.trigger("RPC:REQUEST", payload(2));
|
||||
env.bus.trigger("RPC:RESPONSE", payload(2));
|
||||
execRegisteredTimeouts();
|
||||
assert.verifySteps([]);
|
||||
});
|
||||
|
||||
QUnit.test("loading indicator is not displayed immediately", async (assert) => {
|
||||
const env = await makeTestEnv();
|
||||
const { advanceTime } = mockTimeout();
|
||||
|
||||
Reference in New Issue
Block a user