Finally Comments NPM Library + Platform - Fixes

in #utopian-io5 years ago (edited)

finally.png

https://finallycomments.com

What is Finally Comments?
Finally Comments is an embeddable comments system powered by the Steem blockchain. The aim of this project is to promote the Steem ecosystem by breaking the comments system out of the walls of Steem based apps replacing popular comments systems like Disqus & Facebook comments plugin.


 

Today I have finally publish a number of fixes to both the Finally platform and the Javascript library. These issues have been hanging around for a couple of months. If you have followed other parts of my blog you'll know I was cycling across Europe. I have also been a little pre-occupied getting https://finally.network started.

Repository

Platform - https://github.com/code-with-sam/finallycomments
NPM Package/JS Library - https://github.com/code-with-sam/npm-finallycomments

Library Fixes - /npm-finallycomments/pull/8

screely-1538941659579.png

Universal embed code in Finally Dashboard

The primary Issue I started digging into was with the universal embed code . When initialising the javascript library it should create an iframe using the data-id attribute of the embed code. It took a little investigating to realise the url was being deconstructed and incorrect reconstructed again. Although this fix was fairly straight forward by creating a ternary statement(src/index.js#53) it lead to me discovering a number of other issues with the library.

The initialise function had been working correctly but using any other external functions when including the library directly failed. The exposed finallycomments object was incorrect. Correctly assign export object instead of finally system to call external functions (/src/index.js/#131)

While working through these fixes I oppted to add a small page that worked directly with the local library and a local version of FinallyComments platform. /test/ have placeholders to check each dynamic function and test the three types of embeds. Should be replaced with some programatic tests but this is useful for debugging. testing example functions

Threads generated via the API or Finally dashboard are created as a comment under the @finallycomments account. When displaying these comment threads the top level comment is hidden as it is a placeholder only. The settings for generated is checked to determine this. These settings values are added as html data-attributes and should therefore be checked as a string and not a boolean.

Platform Fixes /finallycomments/pull/47

When working on fixes for the platform I found I had completely missed passing the repsonse object to the relevant functions. Looking at the previous commits it seems I refacoted a set of code into a module without realising the variable scope for the response object would change. Simple fix although it always feels incorrect to pass the response object around. Perhaps the relevant data should be returned to the correct route instead 3f20f5205

Next I found issues with the beneficiary feature. First custom threads breaking when no beneficiaries were selected. Second, incorrect classes on the dashboard beneficiary inputs caused empty variables to be submitted.

There were a few smaller updates aded to keep FinallyComments running. Thanks for checking this update. If you encounter any other issues feel free to submit them via Github or directly to me on Discord [sambillingham#7927]

Sort:  

Thanks for the contribution, @sambillingham! It's cool to see you finally have time to fix these bugs. Definitely looking forward to reading more updates about the Finally Network, though 😋

I'm not sure if I understand what the test/index/html file is exactly. Everything seems to be commented out, so I'm confused.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks Amos.

The test/index was intended for debugging ad I found myself doing this anyway I left it in there. I shouldn't have left it commented out though 🙈

Thank you for your review, @amosbastian!

So far this week you've reviewed 14 contributions. Keep up the good work!

Hi @sambillingham!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.496 which ranks you at #1895 across all Steem accounts.
Your rank has improved 2 places in the last three days (old rank 1897).

In our last Algorithmic Curation Round, consisting of 291 contributions, your post is ranked at #238.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Hey, @sambillingham!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70557.88
ETH 3560.83
USDT 1.00
SBD 4.75