Merge pull request #2790 from overleaf/ta-sso-notifications-no-dismiss

Don't Display Dismiss Button on SSO Notifications

GitOrigin-RevId: f578f57ac348fba4375abee9d842dce34b0c4271
This commit is contained in:
Miguel Serrano 2020-05-06 12:27:19 +02:00 committed by Copybot
parent 0583f7a667
commit 7658a515ba
2 changed files with 6 additions and 5 deletions

View file

@ -97,10 +97,6 @@ include ../../_mixins/saml
.notification-action
a.btn.btn-sm.btn-info(href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}")
| #{translate('link_account')}
.notification-close
button(ng-click="dismiss(notification)").close.pull-right
span(aria-hidden="true") ×
span.sr-only #{translate("close")}
.alert.alert-info(
ng-switch-when="notification_institution_sso_linked"

View file

@ -8,7 +8,11 @@ define(['../../base'], function(App) {
$scope.samlInitPath = ExposedSettings.samlInitPath
$scope.dismiss = notification =>
$scope.dismiss = notification => {
if (!notification._id) {
notification.hide = true
return
}
$http({
url: `/notifications/${notification._id}`,
method: 'DELETE',
@ -16,6 +20,7 @@ define(['../../base'], function(App) {
'X-Csrf-Token': window.csrfToken
}
}).then(() => (notification.hide = true))
}
})
App.controller('DismissableNotificationsController', function(