mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-28 11:31:55 +02:00
Show university custom departments when changing affiliations; fix Features typo.
This commit is contained in:
@@ -21,6 +21,6 @@ module.exports = Features =
|
||||
when 'templates'
|
||||
return !Settings.overleaf?
|
||||
when 'affiliations'
|
||||
return settings?.apis?.v1?.url?
|
||||
return Settings?.apis?.v1?.url?
|
||||
else
|
||||
throw new Error("unknown feature: #{feature}")
|
||||
|
||||
@@ -47,6 +47,10 @@ define [
|
||||
$scope.ui.showManualUniversitySelectionUI = true
|
||||
|
||||
$scope.changeAffiliation = (userEmail) ->
|
||||
if userEmail.affiliation?.institution?.id?
|
||||
UserAffiliationsDataService.getUniversityDetails userEmail.affiliation.institution.id
|
||||
.then (universityDetails) -> $scope.affiliationToChange.university = universityDetails
|
||||
|
||||
$scope.affiliationToChange.email = userEmail.email
|
||||
$scope.affiliationToChange.role = userEmail.affiliation.role
|
||||
$scope.affiliationToChange.department = userEmail.affiliation.department
|
||||
@@ -64,6 +68,7 @@ define [
|
||||
|
||||
$scope.cancelAffiliationChange = (email) ->
|
||||
$scope.affiliationToChange.email = ""
|
||||
$scope.affiliationToChange.university = null
|
||||
$scope.affiliationToChange.role = null
|
||||
$scope.affiliationToChange.department = null
|
||||
|
||||
@@ -142,6 +147,7 @@ define [
|
||||
isBlacklistedEmail: false
|
||||
$scope.affiliationToChange =
|
||||
email: ""
|
||||
university: null
|
||||
role: null
|
||||
department: null
|
||||
_reset()
|
||||
|
||||
@@ -53,6 +53,10 @@ define [
|
||||
else
|
||||
$q.reject null
|
||||
|
||||
getUniversityDetails = (universityId) ->
|
||||
$http.get "/institutions/list/#{ universityId }"
|
||||
.then (response) -> response.data
|
||||
|
||||
addUserEmail = (email) ->
|
||||
$http.post "/user/emails", {
|
||||
email,
|
||||
@@ -110,6 +114,7 @@ define [
|
||||
getUserEmails
|
||||
getUniversitiesFromCountry
|
||||
getUniversityDomainFromPartialDomainInput
|
||||
getUniversityDetails
|
||||
addUserEmail
|
||||
addUserAffiliationWithUnknownUniversity
|
||||
addUserAffiliation
|
||||
|
||||
Reference in New Issue
Block a user