Quellcode durchsuchen

Merge remote-tracking branch 'origin/ns-check-institution'

GitOrigin-RevId: a147965b4f3294215f1396e53d184ef4919fa6cd
Douglas Lovell vor 7 Jahren
Ursprung
Commit
15061047a3

+ 1 - 1
services/web/app/views/project/list/side-bar.pug

@@ -137,7 +137,7 @@
 						href="/user/settings"
 					) Add Affiliation
 
-		.row-spaced(ng-if="hasProjects && userHasNoSubscription", ng-cloak).text-centered
+		.row-spaced(ng-if="hasProjects && userHasNoSubscription && !userOnPayingUniversity", ng-cloak).text-centered
 			hr
 			p.small #{translate("on_free_sl")}
 			p

+ 7 - 25
services/web/public/src/main/project-list/left-hand-menu-promo-controller.js

@@ -1,16 +1,3 @@
-/* eslint-disable
-    max-len,
-    no-undef,
-*/
-// TODO: This file was created by bulk-decaffeinate.
-// Fix any style issues and re-enable lint.
-/*
- * decaffeinate suggestions:
- * DS101: Remove unnecessary use of Array.from
- * DS102: Remove unnecessary code created because of implicit returns
- * DS205: Consider reworking code to avoid use of IIFEs
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
- */
 define(['base'], App =>
   App.controller('LeftHandMenuPromoController', function(
     $scope,
@@ -24,19 +11,14 @@ define(['base'], App =>
       $scope.userAffiliations = []
       return UserAffiliationsDataService.getUserEmails().then(function(emails) {
         $scope.userEmails = emails
-        return (() => {
-          const result = []
-          for (let email of Array.from(emails)) {
-            if (email.affiliation) {
-              result.push($scope.userAffiliations.push(email.affiliation))
-            } else {
-              result.push(undefined)
-            }
-          }
-          return result
-        })()
+        $scope.userAffiliations = emails
+          .filter(email => email.affiliation)
+          .map(email => email.affiliation)
+        $scope.userOnPayingUniversity = $scope.userAffiliations.some(
+          affiliation => affiliation.institution.licence !== 'free'
+        )
       })
     }
 
-    return _userHasNoAffiliation()
+    _userHasNoAffiliation()
   }))