-
-
Notifications
You must be signed in to change notification settings - Fork 421
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
Comments 💬 (backend + frontend) #1153
Conversation
- Update to node-sass to work with node v14
- Change data flow to go down from HowTo component
- Optimize UX - Integrate "Show more"
@danitrod Your work made it really easy to build on! Thanks man! If you have any suggestions/things to be changed let me know :) @davehakkens Here is the combined version of the PRs |
Visit the preview URL for this PR (updated for commit 4fb978b): https://onearmy-next--pr1153-comments-combined-hca4yv9i.web.app (expires Wed, 07 Jul 2021 05:11:49 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
yeahh nice work @tudi2d and @danitrod. Few comments from my side after some testing Minor ones |
Thank you Dave, I'll tackle on points 1 and 4 as they're more related to back-end. Point 2 I think both of us can work on, I'll add a functionality for the back-end function to crop the comment to have length 400 if it comes with more than that, but the input field in the front-end should not allow more than 400 chars as well. Is that ok @tudi2d? |
@davehakkens about 1, confirmed bug, I just accidentally deleted your test comments by deleting one of mine. I'll take a look into why that's happening. |
- Adjust current user avatar for commenting
Do you test it with that url? Doesn't seem to show any changes here.. But perhaps it has to do with the Pull requests stacked on top of eachother? |
I adjusted the styles - should look like intended now. Not sure about the error with posting things - @danitrod any idea? |
nice looking good. One last thing for you @tudi2d Would be nice if you could align the text and remove the text limed when not logged in |
How did you get that error? I'm not being able to reproduce here |
I used the version deployed on the preview URL & tried to enter a comment. |
how weird - for me this isn't happening; is there any more information in the error so I can better debug? Also if you could check what was the sent payload in the request from the network devtool that might help |
- Center not logged in text
I think, I fixed it for me - @davehakkens does it work for you now as well? The issue was, that the country was set to |
I'm testing with that url, not sure if that is the best way. But posting seems to work now. |
Woops and I found one more thing @danitrod! Sorry for not seeing this one sooner or making it more clear in the first place. 🙏 ★ as a bonus you could also make it link to the user profile. But no need. We can also do it in an issue later |
I will create an issue for the link to the profile, so it can be worked on after the PR is merged. It should be a good & easy follow up. My suggestion would be to change the "Display name" & "Username" & than let @chrismclarke review the PR maybe, as this is already becoming a bigger PR. Not sure how hard fixing the flag issue is, but in my opinion a country change is (for the most users & workspaces) probably more of an edge case. It's great, that we already catched it & if it's not easy to fix it could also be a good follow up (as it is more of an improvement, than a bug to the comments). What do you guys think? |
yeh good point, getting big indeed! Your proposal sounds good to me |
Nice catch @tudi2d ! Definitely difficult to debug, thank you. @davehakkens about updating information when the user updates, unfortunately the Firebase functions aren't deployed with the preview as far as I know, so we can't know if it's working yet - I left a note here #1146 (comment). We'll need Chris' help to check on how to test that. I agree we this PR is getting a bit overloaded, I will update the comments to use Edit: just pushed a commit to the back-end PR with the userName fix |
- Center not logged in text
Looks good! I liked, how we worked on this really asynchronously across time zones & still build it rather fast (for a free time project) - good communication & quality work from your site @danitrod! 🙂 Thanks for the feedback & testing @davehakkens! |
Sorry, I know I've been slow to review this, have got held up by a bunch of core build issues not working correctly. Will do my best to find time this week once the rest of the build is stable again. |
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.
Really nice job here, thanks so much for all you've done @danitrod and @tudi2d.
The codebase looks pretty solid to me, I think there'll likely a few minor UI changes required and be good to get some more user input before going live so I'll add a beta-tester
authwrapper to keep it only viewable by admins/beta-testers, but otherwise definitely happy to merge.
I really appreciate that you also took some time to think about challenges with things like users changing names - for me this is a major sticking point of the current database setup making these types of modules much harder to implement (than say, graphql where you could query and merge users names, countries etc. as you retrieve the comments). But I think what you've done is as good as we can hope for short term so thanks for finding a way to work in the constraints.
import { backupUser } from './backupUser' | ||
|
||
/********************************************************************* | ||
* Side-effects to be carried out on various user updates, namely: | ||
* - create user revision history | ||
* - update map pin location on change | ||
* - update howTo creator flag on change | ||
* - update userName and flag on any comments made by user |
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 didn't know you could even change username! I think this leaves us with a few challenges to figure out, but good to have included in the comment update. Longer term we will probably need a refactor to keep user id independent of user name (I can't remember why we didn't do that in the first place - possibly to make serving the avatar image easier)... but in any case good to have this here for now
@@ -11,7 +23,10 @@ export interface IHowto extends IHowtoFormInput, IModerable { | |||
cover_image: IUploadedFileMeta | |||
files: Array<IUploadedFileMeta | File | null> | |||
steps: IHowtoStep[] | |||
// Comments were added in V2, old howto's may not have the property | |||
comments?: IComment[] |
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.
Thanks for adding the comment to explain this
const user = stores.userStore.activeUser | ||
|
||
async function keyDown(e) { | ||
if (e.key === 'Enter' && !e.shiftKey && comment.trim().length) { |
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.
Nice idea to add this, would definitely expect pressing the enter key to submit. I'm not sure if you can achieve the same functionality using simple form elements (e.g. https://stackoverflow.com/questions/33211672/how-to-submit-a-form-using-enter-key-in-react-js/33212911), but happy to keep this in to be more explicit (and add the empty check)
@@ -136,6 +138,107 @@ export class HowtoStore extends ModuleStore { | |||
return needsModeration(howto, toJS(this.activeUser)) | |||
} | |||
|
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 think likely we will want to reuse comments in other pages, so might be better to try and separate out into its own store or set of methods. But happy to keep here for now and can always refactor later.
PR Checklist
master
branch mergedPR Type
Description
First implementation of the comments to be merged.
Comments can't be edited from the FE site right now - they can only be deleted. This should be ok for the first release, but could be added afterwards. Admins & comment creators are allowed to remove comments.
Combine PR #1145 & #1146
Git Issues
Closes #1127 & Closes #1128
Screenshots/Videos