Просмотр исходного кода

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

Don't Display Dismiss Button on SSO Notifications

GitOrigin-RevId: f578f57ac348fba4375abee9d842dce34b0c4271
Miguel Serrano 6 лет назад
Родитель
Сommit
7658a515ba

+ 0 - 4
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"

+ 6 - 1
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(