From 7658a515bae3b42df922702ebbf6bad030426480 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 6 May 2020 12:27:19 +0200 Subject: [PATCH] Merge pull request #2790 from overleaf/ta-sso-notifications-no-dismiss Don't Display Dismiss Button on SSO Notifications GitOrigin-RevId: f578f57ac348fba4375abee9d842dce34b0c4271 --- services/web/app/views/project/list/notifications.pug | 4 ---- .../js/main/project-list/notifications-controller.js | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/services/web/app/views/project/list/notifications.pug b/services/web/app/views/project/list/notifications.pug index 724b5c80cc..f6e5190cf3 100644 --- a/services/web/app/views/project/list/notifications.pug +++ b/services/web/app/views/project/list/notifications.pug @@ -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" diff --git a/services/web/frontend/js/main/project-list/notifications-controller.js b/services/web/frontend/js/main/project-list/notifications-controller.js index bf9f3efd49..4ece25db13 100644 --- a/services/web/frontend/js/main/project-list/notifications-controller.js +++ b/services/web/frontend/js/main/project-list/notifications-controller.js @@ -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(