Commit 5ca1e81c authored by atanasova's avatar atanasova Committed by Commit bot

Fixing the hiding error bubble animation bug on second opening of create user dialog.

This bug was introduced with the fix of adding SUs with the same name. The problem is that the callback that is called when SU are refreshed does not know whether it is called after a new user is created. This causes the dialog to think that it needs to create the error bubble. For some reason the overlay is not closed after the creation of account is done, so the solution is to expose the creationInProgress, so the callback does not proceed. This requires the onSuccess callback to not change the state (otherwise the receiveSupervisedUsers callback continues to be called and cause the error).
BUG=575134

Review URL: https://codereview.chromium.org/1564063002

Cr-Commit-Position: refs/heads/master@{#369314}
parent 697bd8a6
...@@ -371,6 +371,12 @@ cr.define('options', function() { ...@@ -371,6 +371,12 @@ cr.define('options', function() {
* @private * @private
*/ */
receiveExistingSupervisedUsers_: function(supervisedUsers) { receiveExistingSupervisedUsers_: function(supervisedUsers) {
// After a supervised user has been created and the dialog has been
// hidden, this gets called again with a list including
// the just-created SU. Ignore, to prevent the "already exists" bubble
// from showing up if the overlay is already hidden.
if (!this.visible)
return;
$('import-existing-supervised-user-link').hidden = $('import-existing-supervised-user-link').hidden =
supervisedUsers.length === 0; supervisedUsers.length === 0;
if (!$('create-profile-supervised').checked) if (!$('create-profile-supervised').checked)
...@@ -406,8 +412,10 @@ cr.define('options', function() { ...@@ -406,8 +412,10 @@ cr.define('options', function() {
HTMLEscape(elide(newName, /* maxLength */ 50))); HTMLEscape(elide(newName, /* maxLength */ 50)));
this.showErrorBubble_(errorHtml, 'create', true); this.showErrorBubble_(errorHtml, 'create', true);
$('supervised-user-import-existing').onclick = if ($('supervised-user-import-existing')) {
this.getImportHandler_(supervisedUsers[i], nameIsUnique); $('supervised-user-import-existing').onclick =
this.getImportHandler_(supervisedUsers[i], nameIsUnique);
}
$('create-profile-ok').disabled = true; $('create-profile-ok').disabled = true;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment