diff --git a/services/web/app/views/user/settings/user-affiliations.pug b/services/web/app/views/user/settings/user-affiliations.pug index a08da1ab04..51b33b2ba7 100644 --- a/services/web/app/views/user/settings/user-affiliations.pug +++ b/services/web/app/views/user/settings/user-affiliations.pug @@ -14,6 +14,26 @@ mixin btnMakePrimaryDisabled(tooltip) type="button" ) #{translate("make_primary")} +mixin btnRemoveEmail() + .affiliations-table-inline-action-disabled-wrapper(ng-if="userEmail.default") + div( + tooltip=translate("please_change_primary_to_remove") + tooltip-enable="!ui.isMakingRequest" + tooltip-placement="left" + ) + button.btn.btn-sm.btn-danger(disabled) + i.fa.fa-fw.fa-trash(aria-hidden="true") + span.sr-only #{translate("please_change_primary_to_remove")} + button.btn.btn-sm.btn-danger.affiliations-table-inline-action( + ng-if="!userEmail.default" + ng-click="removeUserEmail(userEmail)" + ng-disabled="ui.isMakingRequest" + tooltip=translate("remove") + type="button" + ) + i.fa.fa-fw.fa-trash(aria-hidden="true") + span.sr-only #{translate("remove")} + form.row( ng-controller="UserAffiliationsController" name="affiliationsForm" @@ -97,15 +117,7 @@ form.row( type="button" ) #{translate("make_primary")} |   - button.btn.btn-sm.btn-danger.affiliations-table-inline-action( - ng-if="!userEmail.default" - ng-click="removeUserEmail(userEmail)" - ng-disabled="ui.isMakingRequest" - tooltip=translate("remove") - type="button" - ) - i.fa.fa-fw.fa-trash(aria-hidden="true") - span.sr-only #{translate("remove")} + +btnRemoveEmail() tr.affiliations-table-saml-row(ng-repeat-end ng-if="userEmail.affiliation && userEmail.affiliation && userEmail.ssoAvailable") td td(ng-attr-colspan="{{userEmail.samlProviderId ? '2' : '1'}}" ng-class="institutionAlreadyLinked(userEmail) ? '' : 'with-border'") diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 084fd5b8b9..223a870d58 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1341,5 +1341,6 @@ "looks_like_youre_at": "It looks like you're at <0>__institutionName__!", "add_affiliation": "Add Affiliation", "did_you_know_institution_providing_professional": "Did you know that __institutionName__ is providing <0>free __appName__ Professional features to everyone at __institutionName__?", - "add_email_to_claim_features": "Add an institutional email address to claim your features." -} \ No newline at end of file + "add_email_to_claim_features": "Add an institutional email address to claim your features.", + "please_change_primary_to_remove": "Please change your primary email in order to remove" +}