Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Collecting user objects to send email or any operations on the user mentioned. #15

Closed
sallampalli opened this issue Oct 31, 2015 · 1 comment

Comments

@sallampalli
Copy link

Hi , this is a cool component, I have a question - It would be nice if there is a capability to collect the users mentioned in a text area, so that any capabilities on the user can be done. For instance, just like github as I am typing, I can use the @ symbol and the user search opens up, so I can select the user. But after I click "Submit new issue", if I have to send email to those users by saying "You have been mentioned in this issue". Also, the search dropdown can be a User object, I might use the object variables to do these operations, but I might only use the full name for display purpose. Not sure if this can be done with existing features.

I am hopeful we can use the onSelect function in the config, but lets say I collect the user objects in an array , the problem is when the backspace or clear that name, I cant remove that name from that array right ?

@aurbano
Copy link
Owner

aurbano commented Nov 2, 2015

Hey @sallampalli

For the first issue: You can collect them as they are selected obviously, but as you've said, it wouldn't be in sync if the user deletes it. I've made a plunkr demoing that: http://embed.plnkr.co/5eypln4BFYp7wRW3ffLb/

I don't think keeping a tab on that sort of thing should be this directive's objective, since once the object has been autocompleted, the directive no longer knows how long it's supposed to be (the trigger is usually smaller), so that's something you'd want to do with a custom regex or similar.
Specially if you're using that data on the server, you can't trust the client to send you a valid list of mentions.

As to using a User object, absolutely. The directives allows you to attach any extra data to the items, which can be then accessed from the onSelect function. Take a look at the plunkr above, on the console you can see the argument passed to the onSelect function.

@aurbano aurbano closed this as completed Nov 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants