diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index 88a0fa2a34..7a22299aa2 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/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 diff --git a/services/web/public/src/main/project-list/left-hand-menu-promo-controller.js b/services/web/public/src/main/project-list/left-hand-menu-promo-controller.js index b89d20d3ef..d57ccc28be 100644 --- a/services/web/public/src/main/project-list/left-hand-menu-promo-controller.js +++ b/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() }))