Help Users Avoid Duplicates on Utopian - Display Similar Contributions in the Right Side Bar

in #utopian-io6 years ago (edited)

Background

Originally I was going to help work on another feature for Utopian. @elear asked that I work on this as a contribution and said it was urgent so I gave it a go. He helped me setup the appropriate environment to run the UI and use the official API endpoint. Setting up the UI for use is far more straight forward than expected, despite the many configuration files. This is my first contribution to the Utopian project itself, and it's also a thanks to the developers of Utopian for making this possible.

Contribution

By displaying similar contributions in the side bar, users will have an easier time avoiding duplicate contribution submissions. Thereby helping free up a moderator's time as well. The look up works exactly the same way that search does, including title and body, displaying the top results.



Development

A SimilarPosts React component was created that carries the necessary functionality of handling the API call. It uses a data prop that contains the fields necessary to start the search. The same API endpoint as searching is used when invoking the API call. This ensures that the same results are received as you would from searching. The results are stored in a state and then displayed to the user.

Adjusting what data gets returned is easy to do within the created React component. An updateContributions function gets invoked with a debounce to prevent server spam with constant requests. The query happens inside of that functions and sets the state for the results to be displayed.

Pull request: https://github.com/utopian-io/utopian.io/pull/88



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Great contribution to the Utopian project brother Samuel! Excellent work yet again.

This feature looks really nice and helpful. The code looks very clean clean and readable. Great job!

Thank you for the contribution. It has been approved.

[utopian-moderator]

This post has been ranked within the top 80 most undervalued posts in the first half of Nov 15. We estimate that this post is undervalued by $5.86 as compared to a scenario in which every voter had an equal say.

See the full rankings and details in The Daily Tribune: Nov 15 - Part I. You can also read about some of our methodology, data analysis and technical details in our initial post.

If you are the author and would prefer not to receive these comments, simply reply "Stop" to this comment.

Sourcery! lol, Good work.

Hehe, you like my magic spelling?

You continue to perform great work, keep it up!

Hey @samrg472 I am @utopian-io. I have just super-voted you at 14% Power!

Suggestions https://utopian.io/rules

  • Your contribution is less informative than others in this category.

Achievements

  • I am a bot...I love developers... <3
  • You have less than 500 followers. Just gave you a gift ;)
    Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Very informative, thank you

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64006.33
ETH 3077.08
USDT 1.00
SBD 3.87