Skip to content

Commit 0a3c068

Browse files
committed
access error notification tweak
1 parent 744a262 commit 0a3c068

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

endorsement/static/endorsement/js/notify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ var Notify = (function () {
6565
_notify(msg, 'alert-success', fade);
6666
},
6767

68-
error: function (msg) {
69-
_notify(msg, 'alert-danger', 10000);
68+
error: function (msg, fade=10000) {
69+
_notify(msg, 'alert-danger', fade);
7070
},
7171

7272
warning: function (msg) {

endorsement/static/endorsement/js/tab/office.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ var ManageOfficeAccess = (function () {
102102
var $row = _accessTableRow(accessee.mailbox, accessee.delegate);
103103

104104
_modalHide();
105-
Notify.error('Access error: ' + error);
105+
_access_error_notification('Access error' + ((error && error.length) ? ': ' + error : '.'));
106106
}).on('endorse:OfficeDelegateRevokeSuccess', function (e, context) {
107107
_modalHide();
108108
_deleteOfficeAccessDisplay(context);
@@ -111,11 +111,11 @@ var ManageOfficeAccess = (function () {
111111
var $row = _accessTableRow(context.mailbox, context.name);
112112

113113
_modalHide();
114-
Notify.error('Revoke error: ' + error);
114+
_access_error_notification('Revoke error' + ((error && error.length) ? ': ' + error : '.'));
115115
}).on('endorse:OfficeAccessResolveSuccess', function (e, data) {
116116
_resolvedAccessModal(data);
117117
}).on('endorse:OfficeAccessResolveFailure', function (e, data) {
118-
Notify.error('Access Resolve Error: ' + data);
118+
_access_error_notification('Resolve error' + ((data && data.length) ? ': ' + data : '.'));
119119
}).on('endorse:OfficeAccessTypesSuccess', function (e) {
120120
_displayOfficeAccessTypes();
121121
}).on('endorse:OfficeAccessTypesFailure', function (e, data) {
@@ -781,7 +781,10 @@ var ManageOfficeAccess = (function () {
781781
}
782782
}
783783

784-
return xhr.statusText;
784+
return xhr.statusText || "";
785+
},
786+
_access_error_notification = function (message) {
787+
Notify.error(message + '  Please try again later.', 15000);
785788
},
786789
_scrollNetIDIntoView = function (netid) {
787790
Scroll.scrollToNetid(netid, '.office-access-table');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% verbatim %}
22
<script id="notify_template" type="text/x-handlebars-template">
33
<div class="notify {{notify_class}}" role="alert">
4-
{{message}}
4+
{{{message}}}
55
</div>
66
</script>
77
{% endverbatim %}

0 commit comments

Comments
 (0)