Display errors that happen on saving

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-12-01 15:15:51 +01:00
parent e17cd8acb4
commit 570c1bf7c4
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 12 additions and 2 deletions

View File

@ -24,6 +24,11 @@
if (_.isUndefined(data)) {
return null;
}
if (data.status && data.status === 'error') {
OC.Notification.show(data.data.message, { type: 'error' });
}
if (_.isUndefined(data.data)) {
return null;
}
@ -47,4 +52,4 @@
OC.Settings = OC.Settings || {};
OC.Settings.UserSettings = UserSettings;
})();
})();

View File

@ -67,6 +67,7 @@ script('settings', [
</div>
</div>
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if ($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>">
<?php } ?>
@ -161,7 +162,7 @@ script('settings', [
} ?>
placeholder="<?php p($l->t('Your email address')); ?>"
autocomplete="on" autocapitalize="none" autocorrect="off" />
<span class="icon-checkmark hidden"></span>
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if (!$_['displayNameChangeSupported']) { ?>
<span><?php if (isset($_['email']) && !empty($_['email'])) {
@ -196,6 +197,7 @@ script('settings', [
placeholder="<?php p($l->t('Your phone number')); ?>"
autocomplete="on" autocapitalize="none" autocorrect="off" />
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if ($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>">
<?php } ?>
@ -220,6 +222,7 @@ script('settings', [
value="<?php p($_['address']) ?>"
autocomplete="on" autocapitalize="none" autocorrect="off" />
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if ($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>">
<?php } ?>
@ -275,6 +278,7 @@ script('settings', [
} ?>
/>
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if ($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>">
<?php } ?>
@ -330,6 +334,7 @@ script('settings', [
} ?>
/>
<span class="icon-checkmark hidden"></span>
<span class="icon-error hidden" ></span>
<?php if ($_['lookupServerUploadEnabled']) { ?>
<input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>">
<?php } ?>