-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
feat: verified icon in usernames #1205
feat: verified icon in usernames #1205
Conversation
Visit the preview URL for this PR (updated for commit 27bf097): https://onearmy-next--pr1205-verified-everywhere-qog5kwt8.web.app (expires Sat, 19 Mar 2022 00:34:51 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
👋 @danitrod would you be able to rebase this PR to resolve merge conflicts? |
Sure @thisislawatts, done! |
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
I see tests are failing, will have a look at that later today |
Alright, looks like all set now! |
@@ -126,6 +129,9 @@ export class Howto extends React.Component< | |||
<> | |||
<HowtoDescription | |||
howto={activeHowto} | |||
verified={this.injected.userStore.verifiedUsers.some( | |||
user => user.userName === this.store.activeHowto?._createdBy, | |||
)} |
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.
question: Can we move the verified state to the HowTo document rather than perform this look up?
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.
I don't recall any specific reason why I did this, it's been a while but maybe I just didn't think it through enough. If we move this logic to the store and have the verified state in every HowTo doc, it would certainly be a lot more efficient and only perform the search once 😅
@danitrod I missed the original conversation around this feature. Did we consider how So this change would a new query of N records to the following routes:
Things I either don't know or understand:
|
I don't have the basis to answer that right now as well, would have to study a bit more on how Firebase works. I don't remember if I talked with Chris about the implications on charges for this logic. Sorry, been some rough few months over here. Hopefully at the beginning of next year I'll be able to dedicate some more time into the project and help figuring this out. |
Thanks for the speedy response @danitrod, of course look after yourself first. This discussion can wait 🤗 |
I have a good feeling this will finally be the week to unblock this PR! This just leaves a few small tasks
I'm working on the DB bindings now and will link the relevant PR when open |
…into pr/danitrod/1205
PR Checklist
master
branch mergedPR Type
Description
Adding verified icon to usernames in howto listings, howto pages, howto comments, events, research listings and research pages.
The approach chosen was to create a
fetchAllVerifiedUsers
method in theuserStore
, which queries the database for all users who meet thebadges.verified == 1
condition and stores the list in averifiedUsers
prop. Based on that list, each component that displays usernames basically checks if the username is on the list to display a badge along.Note: I changed the value type of
badges.verified
fromboolean
tonumber
, having the number be 0 or 1. The reason is that boolean was causing problems with Dexie as booleans are not indexable (ref: https://stackoverflow.com/a/56661425/10736715). I added a comment explaining this in the model definition.Git Issues
Closes #1163