vocatwk / CodeU-Nemo

Chat web app for CodeU
Apache License 2.0
1 stars 3 forks source link

Implemented add button and Add users button in Add users modal #91

Closed vocatwk closed 6 years ago

vocatwk commented 6 years ago

Clicking the add button next to a user's name will now select a user to be added to the group. Clicking add users will send a PUT request with the list of users selected, close the modal and clear the list. This is just getting the list of selected user's to the chat servlet, I haven't done anything with that list yet.

I'm working on adding a close icon on each tag that shows up on top of the search bar so users can deselect and having the add users button deactivated atleast until one user is selected.

I also added a header to differentiaite between changing chat privacy PUT request and adding users PUT request.

screen shot 2018-07-11 at 3 36 03 am
vocatwk commented 6 years ago

Okay, I'll try and find a better way.

vocatwk commented 6 years ago

I was thinking of disabling the add Users button when the search results are populated if the user is already a member or if it's already queued up. I could maintain a list of the ones that are queued up whenever the modal opens and find a way to clear this list when the modal closes. What do you guys think?

yebrahim commented 6 years ago

If you can maintain a list of the queued up users, so that you can check before adding the "Add" button when the search results come back, that would be a good fix. Where were you thinking of maintaining such a list?

vocatwk commented 6 years ago

Well I haven't tried it out yet(I'm about to) but I was thinking of initializing an empty list when the page first loads in chat.jsp (inside a script tag) and then adding users to it accordingly.