mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3704 from overleaf/jel-reconfirm-disable-btn
Disable "Make Primary" button when reconfirmation needed GitOrigin-RevId: df821185ce84c64ed1a8f4d413dd35ef18aa9e0c
This commit is contained in:
parent
99834f0d7e
commit
fc4f71a0c0
3 changed files with 15 additions and 7 deletions
|
@ -7,7 +7,6 @@ mixin btnMakePrimaryDisabled(tooltip)
|
|||
div(
|
||||
tooltip=tooltip
|
||||
tooltip-enable="!ui.isMakingRequest"
|
||||
ng-if="!userEmail.default && (!userEmail.confirmedAt || ui.isMakingRequest) && !institutionAlreadyLinked(userEmail)"
|
||||
)
|
||||
button.btn.btn-sm.btn-success.affiliations-table-inline-action(
|
||||
disabled
|
||||
|
@ -106,13 +105,16 @@ form.row(
|
|||
td.affiliations-table-inline-actions
|
||||
// Disabled buttons don't work with tooltips, due to pointer-events: none,
|
||||
// so create a wrapper for the tooltip
|
||||
.affiliations-table-inline-action-disabled-wrapper(ng-if="userEmail.ssoAvailable")
|
||||
+btnMakePrimaryDisabled("Please confirm your email by linking to your institutional account before making it the primary email.")
|
||||
.affiliations-table-inline-action-disabled-wrapper(ng-if="!userEmail.ssoAvailable")
|
||||
+btnMakePrimaryDisabled(translate("please_confirm_your_email_before_making_it_default"))
|
||||
span(ng-if="!userEmail.default && (!userEmail.confirmedAt || ui.isMakingRequest) && !institutionAlreadyLinked(userEmail) && !inReconfirmNotificationPeriod(userEmail)")
|
||||
.affiliations-table-inline-action-disabled-wrapper(ng-if="userEmail.ssoAvailable")
|
||||
+btnMakePrimaryDisabled(translate("please_link_before_making_primary"))
|
||||
.affiliations-table-inline-action-disabled-wrapper(ng-if="!userEmail.ssoAvailable")
|
||||
+btnMakePrimaryDisabled(translate("please_confirm_your_email_before_making_it_default"))
|
||||
.affiliations-table-inline-action-disabled-wrapper(ng-if="inReconfirmNotificationPeriod(userEmail)")
|
||||
+btnMakePrimaryDisabled(translate("please_reconfirm_your_affiliation_before_making_this_primary"))
|
||||
button.btn.btn-sm.btn-success.affiliations-table-inline-action(
|
||||
tooltip=translate("make_email_primary_description")
|
||||
ng-if="!userEmail.default && (userEmail.confirmedAt && !ui.isMakingRequest)"
|
||||
ng-if="!userEmail.default && (userEmail.confirmedAt && !ui.isMakingRequest) && !inReconfirmNotificationPeriod(userEmail)"
|
||||
ng-click="setDefaultUserEmail(userEmail)"
|
||||
type="button"
|
||||
) #{translate("make_primary")}
|
||||
|
|
|
@ -282,6 +282,10 @@ export default App.controller('UserAffiliationsController', function(
|
|||
return promise
|
||||
}
|
||||
|
||||
$scope.inReconfirmNotificationPeriod = function(emailData) {
|
||||
return _.get(emailData, ['affiliation', 'inReconfirmNotificationPeriod'])
|
||||
}
|
||||
|
||||
$scope.institutionAlreadyLinked = function(emailData) {
|
||||
const institutionId =
|
||||
emailData.affiliation &&
|
||||
|
|
|
@ -336,7 +336,7 @@
|
|||
"archive_projects": "Archive Projects",
|
||||
"archive_and_leave_projects": "Archive and Leave Projects",
|
||||
"about_to_archive_projects": "You are about to archive the following projects:",
|
||||
"please_confirm_your_email_before_making_it_default": "Please confirm your email before making it the default.",
|
||||
"please_confirm_your_email_before_making_it_default": "Please confirm your email before making it the primary.",
|
||||
"back_to_editor": "Back to the editor",
|
||||
"generic_history_error": "Something went wrong trying to fetch your project's history. If the error persists, please contact us via:",
|
||||
"unconfirmed": "Unconfirmed",
|
||||
|
@ -1348,6 +1348,8 @@
|
|||
"did_you_know_institution_providing_professional": "Did you know that __institutionName__ is providing <0>free __appName__ Professional features</0> to everyone at __institutionName__?",
|
||||
"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",
|
||||
"please_reconfirm_your_affiliation_before_making_this_primary": "Please confirm your affiliation before making this the primary.",
|
||||
"please_link_before_making_primary": "Please confirm your email by linking to your institutional account before making it the primary email.",
|
||||
"dropbox_duplicate_project_names": "We detected an update from Dropbox to <0>__projectName__</0>, but you have multiple projects with that name. We are unable to process this, so have unlinked your Dropbox account. Please ensure your project names are unique across your active, archived and trashed projects, and then re-link your Dropbox account.",
|
||||
"please_reconfirm_institutional_email": "Please take a moment to confirm your institutional email address or <0>remove it</0> from your account.",
|
||||
"need_to_add_new_primary_before_remove": "You'll need to add a new primary email address before you can remove this one.",
|
||||
|
|
Loading…
Reference in a new issue