-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync single user picker with Address Book in award/smite dialogs #3684
Conversation
9f2277b
to
ab66da3
Compare
737355f
to
4128ea7
Compare
2662619
to
94aa383
Compare
4128ea7
to
a741d5c
Compare
2d2aafd
to
8bf7e4d
Compare
@willm30 Maybe my expectation is wrong? Empty address book, with 1 contributor & 1 watcher |
@danbr Did you refresh the browser after deactivating the address book? For me, I need to do this first, then the updates propagate and the form shows all users. (Incidentally, I would like to open an issue to update the fetch-policies of the relevant queries so a browser refresh isn't needed after adding a member to the address book to see the updated address book). |
@willm30 Thanks for the suggestion. I re-setup, and did several page refreshes and the behaviour remained the same with only 1 address shown. When she is available, i will ask @chinins to test, perhaps it will work for her. |
verifiedUsers={ | ||
(isWhitelistActivated && verifiedUsers) || subscribedUsers | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danbr Hmm, interesting. I am unable to reproduce. With a contributor and a watcher, I add the watcher to the address book, then deactivate the address book via the toggle switch, and after a browser refresh on the ColonyHome page I can see both users in the Award/Smite and CreatePayment dialogs.
This is where I implement the check for whether the whitelist is activated. It should pass the form (and therefore the Single User Picker) all users (i.e subscribedUsers
) if isWhitelistActivated
is false (even if there is a member added to the address book). Maybe you can spot something I'm overlooking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@willm30 Finally, I deleted my local branch and now its behaving as expected, thankfully!! I'll review the code next....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Working well..... Nice job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my direct comments.
src/modules/dashboard/components/Dialogs/CreatePaymentDialog/CreatePaymentDialog.tsx
Outdated
Show resolved
Hide resolved
...ponents/Dialogs/AwardAndSmiteDialogs/ManageReputationContainer/ManageReputationContainer.tsx
Outdated
Show resolved
Hide resolved
src/modules/dashboard/components/ColonyHomeActions/ColonyHomeActions.tsx
Outdated
Show resolved
Hide resolved
...ponents/Dialogs/AwardAndSmiteDialogs/ManageReputationContainer/ManageReputationContainer.tsx
Outdated
Show resolved
Hide resolved
...ponents/Dialogs/AwardAndSmiteDialogs/ManageReputationContainer/ManageReputationContainer.tsx
Outdated
Show resolved
Hide resolved
d2f0ff6
to
cbbef22
Compare
@chinins Have updated and restored the Memebrs Query to the component. Please review when you get a moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works well for me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working as expected! Nice job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice - much cleaner, I prefer it this way.
cbbef22
to
422cd5a
Compare
Description
This PR ensures that when the Address Book is enabled, the single user picker in the Award/Smite dialogs shows verified members instead of all members. When the Address Book is inactive, or no members have been added, the single user picker in both components should show all colony members.
Note: this was already happening in the Create Payment dialog. I have extracted this logic for reuse in the Award/Smite components.
To test:
SingleUserPicker
in the Award/Smite show all users in the colony.SingleUserPicker
only shows those members.SingleUserPicker
is showing all users again.Changes 🏗
CreatePaymentDialog.tsx
: Extracted theverifiedUsers
logic for reuse in award/smite.ManageReputationContainer.tsx
: Added theColonyMembers
prop so that when the component loads,ColonyMembers
is defined. This ensures that the selected user doesn't rerender after the component has been opened and therefore avoids a "flashing" in the ui. Also added theverifiedUsers
logic.ColonyHomeActions.tsx
: I moved the ColonyMembers query here because this contains the loading component nearest to the ManageReputation Container.useSelectedUser.ts
: updated to take an array ofAnyUser
(making it compatible with an array of verified or subscribed users)Additions
verifiedRecipients.ts
: Extracted logic for filtering subscribed (i.e. all) users by whether they're verified or not.Resolves #3641
Note: The issue says that this should apply to all
SingleUserPicker
instances however after checking this with Arren we agreed that it should only apply to the Payments and Award/Smite dialogs for now (see issue comments).