Commit fbc5a44f authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #22549 from owncloud/issue-20470-yellow-warning-for-user-and-group-errors

Use the notification instead of the disruptive popup for settings/users errors
parents 0d715c11 04da5a56
......@@ -142,8 +142,8 @@ GroupList = {
.text(result.groupname));
}
GroupList.toggleAddGroup();
}).fail(function(result, textStatus, errorThrown) {
OC.dialogs.alert(result.responseJSON.message, t('settings', 'Error creating group'));
}).fail(function(result) {
OC.Notification.showTemporary(t('settings', 'Error creating group: {message}', {message: result.responseJSON.message}));
});
},
......@@ -245,9 +245,9 @@ GroupList = {
isGroupNameValid: function (groupname) {
if ($.trim(groupname) === '') {
OC.dialogs.alert(
t('settings', 'A valid group name must be provided'),
t('settings', 'Error creating group'));
OC.Notification.showTemporary(t('settings', 'Error creating group: {message}', {
message: t('settings', 'A valid group name must be provided')
}));
return false;
}
return true;
......
......@@ -767,24 +767,24 @@ $(document).ready(function () {
var password = $('#newuserpassword').val();
var email = $('#newemail').val();
if ($.trim(username) === '') {
OC.dialogs.alert(
t('settings', 'A valid username must be provided'),
t('settings', 'Error creating user'));
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
message: t('settings', 'A valid username must be provided')
}));
return false;
}
if ($.trim(password) === '') {
OC.dialogs.alert(
t('settings', 'A valid password must be provided'),
t('settings', 'Error creating user'));
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
message: t('settings', 'A valid password must be provided')
}));
return false;
}
if(!$('#CheckboxMailOnUserCreate').is(':checked')) {
email = '';
}
if ($('#CheckboxMailOnUserCreate').is(':checked') && $.trim(email) === '') {
OC.dialogs.alert(
t('settings', 'A valid email must be provided'),
t('settings', 'Error creating user'));
OC.Notification.showTemporary( t('settings', 'Error creating user: {message}', {
message: t('settings', 'A valid email must be provided')
}));
return false;
}
......@@ -822,8 +822,10 @@ $(document).ready(function () {
}
$('#newusername').focus();
GroupList.incEveryoneCount();
}).fail(function(result, textStatus, errorThrown) {
OC.dialogs.alert(result.responseJSON.message, t('settings', 'Error creating user'));
}).fail(function(result) {
OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', {
message: result.responseJSON.message
}));
}).success(function(){
$('#newuser').get(0).reset();
});
......
Supports Markdown
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