|
@@ -1,19 +1,33 @@
|
|
|
import _ from 'lodash'
|
|
import _ from 'lodash'
|
|
|
import App from '../../../base'
|
|
import App from '../../../base'
|
|
|
|
|
+import getMeta from '../../../utils/meta'
|
|
|
|
|
|
|
|
export default App.controller('UserAffiliationsReconfirmController', function(
|
|
export default App.controller('UserAffiliationsReconfirmController', function(
|
|
|
$scope,
|
|
$scope,
|
|
|
UserAffiliationsDataService,
|
|
UserAffiliationsDataService,
|
|
|
$window
|
|
$window
|
|
|
) {
|
|
) {
|
|
|
|
|
+ const samlInitPath = ExposedSettings.samlInitPath
|
|
|
$scope.reconfirm = {}
|
|
$scope.reconfirm = {}
|
|
|
|
|
+ $scope.ui = $scope.ui || {} // $scope.ui inherited on settings page
|
|
|
|
|
+ $scope.userEmails = getMeta('ol-userEmails')
|
|
|
|
|
+ $scope.reconfirmedViaSAML = getMeta('ol-reconfirmedViaSAML')
|
|
|
|
|
+
|
|
|
// For portals:
|
|
// For portals:
|
|
|
- $scope.userEmails = window.data.userEmails
|
|
|
|
|
|
|
+ const portalAffiliation = getMeta('ol-portalAffiliation')
|
|
|
|
|
+ if (portalAffiliation) {
|
|
|
|
|
+ $scope.portalInReconfirmNotificationPeriod =
|
|
|
|
|
+ portalAffiliation && portalAffiliation.inReconfirmNotificationPeriod
|
|
|
|
|
+ $scope.userEmail = $scope.portalInReconfirmNotificationPeriod // mixin to show notification uses userEmail
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// For settings page:
|
|
// For settings page:
|
|
|
- $scope.ui = $scope.ui || {} // $scope.ui inherited on settings page
|
|
|
|
|
|
|
+ $scope.reconfirmationRemoveEmail = getMeta('ol-reconfirmationRemoveEmail')
|
|
|
|
|
+
|
|
|
// For dashboard:
|
|
// For dashboard:
|
|
|
- $scope.allInReconfirmNotificationPeriods =
|
|
|
|
|
- window.data.allInReconfirmNotificationPeriods
|
|
|
|
|
|
|
+ $scope.allInReconfirmNotificationPeriods = getMeta(
|
|
|
|
|
+ 'ol-allInReconfirmNotificationPeriods'
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
function sendReconfirmEmail(email) {
|
|
function sendReconfirmEmail(email) {
|
|
|
$scope.ui.hasError = false
|
|
$scope.ui.hasError = false
|
|
@@ -28,9 +42,6 @@ export default App.controller('UserAffiliationsReconfirmController', function(
|
|
|
.finally(() => ($scope.ui.isMakingRequest = false))
|
|
.finally(() => ($scope.ui.isMakingRequest = false))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $scope.reconfirmationRemoveEmail = $window.data.reconfirmationRemoveEmail
|
|
|
|
|
- $scope.reconfirmedViaSAML = $window.data.reconfirmedViaSAML
|
|
|
|
|
-
|
|
|
|
|
$scope.requestReconfirmation = function(obj, userEmail) {
|
|
$scope.requestReconfirmation = function(obj, userEmail) {
|
|
|
const email = userEmail.email
|
|
const email = userEmail.email
|
|
|
// For the settings page, disable other parts of affiliation UI
|
|
// For the settings page, disable other parts of affiliation UI
|
|
@@ -48,7 +59,7 @@ export default App.controller('UserAffiliationsReconfirmController', function(
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
if (ssoEnabled) {
|
|
if (ssoEnabled) {
|
|
|
- $window.location.href = `${$scope.samlInitPath}?university_id=${institutionId}&reconfirm=${location}`
|
|
|
|
|
|
|
+ $window.location.href = `${samlInitPath}?university_id=${institutionId}&reconfirm=${location}`
|
|
|
} else {
|
|
} else {
|
|
|
sendReconfirmEmail(email)
|
|
sendReconfirmEmail(email)
|
|
|
}
|
|
}
|