Explorar o código

Update feature flag for affiliations; use it in the router; minor style adjustments.

Paulo Reis %!s(int64=8) %!d(string=hai) anos
pai
achega
a759828ece

+ 1 - 1
services/web/app/coffee/infrastructure/Features.coffee

@@ -21,6 +21,6 @@ module.exports = Features =
 			when 'templates'
 				return !Settings.overleaf?
 			when 'affiliations'
-				return !(Settings.ldap? or Settings.saml?)
+				return settings?.apis?.v1?.url?
 			else
 				throw new Error("unknown feature: #{feature}")

+ 1 - 1
services/web/app/coffee/router.coffee

@@ -116,7 +116,7 @@ module.exports = class Router
 		webRouter.post '/user/emails/confirm',
 			UserEmailsController.confirm
 
-		unless Features.externalAuthenticationSystemUsed()
+		if Features.hasFeature 'affiliations'
 			webRouter.post '/user/emails',
 				AuthenticationController.requireLogin(),
 				UserEmailsController.add

+ 4 - 4
services/web/app/views/user/settings/user-affiliations.pug

@@ -36,7 +36,7 @@ form.row(
 								a(
 									href
 									ng-click="changeAffiliation(userEmail);"
-								)  #{translate("change")}
+								) #{translate("change")}
 								| )
 							.affiliation-change-container(
 								ng-if="isChangingAffiliation(userEmail.email)"
@@ -51,19 +51,19 @@ form.row(
 										href
 										ng-click="saveAffiliationChange();"
 									) #{translate("save_or_cancel-save")}
-									|  #{translate("save_or_cancel-or" )}
+									|  #{translate("save_or_cancel-or" )} 
 									a(
 										href
 										ng-click="cancelAffiliationChange();"
 									) #{translate("save_or_cancel-cancel")}
 					td 
-						a(
+						a.affiliations-table-inline-action(
 							href
 							ng-if="!userEmail.default"
 							ng-click="setDefaultUserEmail(userEmail)"
 						)  #{translate("make_default")}
 						br
-						a(
+						a.affiliations-table-inline-action(
 							href
 							ng-if="!userEmail.default"
 							ng-click="removeUserEmail(userEmail)"

+ 1 - 1
services/web/public/coffee/main/affiliations/factories/UserAffiliationsDataService.coffee

@@ -81,7 +81,7 @@ define [
 			}
 
 		addRoleAndDepartment = (email, role, department) ->
-			$http.post "/endorse", {
+			$http.post "/user/emails/endorse", {
 				email,
 				role,
 				department,

+ 3 - 0
services/web/public/stylesheets/app/account-settings.less

@@ -26,6 +26,9 @@
 	.affiliations-table-inline-actions {
 		width: 20%;
 	}
+		.affiliations-table-inline-action {
+			text-transform: capitalize;
+		}
 	.affiliations-table-highlighted-row {
 		background-color: tint(@content-alt-bg-color, 6%);
 	}