mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-25 19:42:15 +00:00
Merge pull request #595 from sharelatex/as-fix-share-emails
Fix UX issues in email autocompletion in share modal
This commit is contained in:
commit
1b144ed183
2 changed files with 9 additions and 3 deletions
|
@ -71,6 +71,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
|
||||||
focus-on="open"
|
focus-on="open"
|
||||||
display-property="display"
|
display-property="display"
|
||||||
add-on-paste="true"
|
add-on-paste="true"
|
||||||
|
add-on-enter="false"
|
||||||
replace-spaces-with-dashes="false"
|
replace-spaces-with-dashes="false"
|
||||||
type="email"
|
type="email"
|
||||||
)
|
)
|
||||||
|
@ -146,6 +147,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
|
||||||
| #{translate("cannot_invite_non_user")}
|
| #{translate("cannot_invite_non_user")}
|
||||||
span(ng-switch-when="cannot_invite_self")
|
span(ng-switch-when="cannot_invite_self")
|
||||||
| #{translate("cannot_invite_self")}
|
| #{translate("cannot_invite_self")}
|
||||||
|
span(ng-switch-when="invalid_email")
|
||||||
|
| #{translate("invalid_email")}
|
||||||
span(ng-switch-default)
|
span(ng-switch-default)
|
||||||
| #{translate("generic_something_went_wrong")}
|
| #{translate("generic_something_went_wrong")}
|
||||||
button.btn.btn-default(
|
button.btn.btn-default(
|
||||||
|
|
|
@ -39,7 +39,7 @@ define [
|
||||||
$scope.autocompleteContacts = data.contacts or []
|
$scope.autocompleteContacts = data.contacts or []
|
||||||
for contact in $scope.autocompleteContacts
|
for contact in $scope.autocompleteContacts
|
||||||
if contact.type == "user"
|
if contact.type == "user"
|
||||||
if contact.last_name == "" and contact.first_name = contact.email.split("@")[0]
|
if contact.last_name == "" and contact.first_name == contact.email.split("@")[0]
|
||||||
# User has not set their proper name so use email as canonical display property
|
# User has not set their proper name so use email as canonical display property
|
||||||
contact.display = contact.email
|
contact.display = contact.email
|
||||||
else
|
else
|
||||||
|
@ -127,10 +127,13 @@ define [
|
||||||
# with new collaborator information.
|
# with new collaborator information.
|
||||||
addNextMember()
|
addNextMember()
|
||||||
, 0
|
, 0
|
||||||
.catch () ->
|
.catch (err) ->
|
||||||
$scope.state.inflight = false
|
$scope.state.inflight = false
|
||||||
$scope.state.error = true
|
$scope.state.error = true
|
||||||
$scope.state.errorReason = null
|
if err.status? and err.status == 400
|
||||||
|
$scope.state.errorReason = 'invalid_email'
|
||||||
|
else
|
||||||
|
$scope.state.errorReason = null
|
||||||
|
|
||||||
$timeout addMembers, 50 # Give email list a chance to update
|
$timeout addMembers, 50 # Give email list a chance to update
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue