Update on KnackSteem Development

in #utopian-io5 years ago

Repository

https://github.com/knacksteem/knacksteem.org

Pull Request

https://github.com/knacksteem/knacksteem.org/pull/63

This PR add a new tagging feature for the knacksteem editor, which uses tag validation on the first tag to be apart of the knacksteem category. Also with this PR the following issues were fixed.

https://github.com/knacksteem/knacksteem.org/issues/55

https://github.com/knacksteem/knacksteem.org/issues/59

https://github.com/knacksteem/knacksteem.org/issues/57

A simple validation for the tags below

/**
 * @method checkTags -- method to validate tags for any error
 * 
 * @param {Array} rule -- all rules to validate
 * 
 * @param {Array} value -- all values from tag selection
 * 
 * @param {Function} callback -- callback funtion
 */

checkTags = (rule, value, callback) => {
    
    if (!value || value.length < 1 || value.length > 4) {
      callback('You have to add 1 to 4 tags');
    };

    if (value){
      const {isComment} = this.props;
      const {categories} = this.props.articles;
      if (!isComment && categories.map(elem => elem.key).indexOf(value[0]) === -1) {
        callback('first tag must be any of the following; graphics, art, vlog, knack, techtrends ');
      }   
    }

    value
      .map(tag => ({ tag, valid: /^[a-z0-9]+(-[a-z0-9]+)*$/.test(tag) }))
      .filter(tag => !tag.valid)
      .map(tag => callback(`Tag ${tag.tag} is invalid`));

    callback();
};

If there are no values, or the values in the array are less than for, we initiate a callback. that informs the user.Next we also check if the tag is a valid tag with the regex matching.

What's next?

Integration of Voting Slider and fixing some bugs on the repo.

Commits

https://github.com/knacksteem/knacksteem.org/pull/63/commits/4bbffdbc39e28852e3db3908662ddc6447874fc7

https://github.com/knacksteem/knacksteem.org/pull/63/commits/3663453d7f65f1f623294d481a509a7749eecfe2

https://github.com/knacksteem/knacksteem.org/pull/63/commits/20ee2367ca544e3e555ab22ad72c3298b517cbbf

Github Account

https://github.com/ogbiyoyosky

Sort:  
  • I would suggest that you could have listed the issues in English and referred to their url within the sentence or paragraph. Don't hesitate to elaborate and explain the issues and the fixes.
  • Is that console.log wanted or left over from debugging?
  • Are you saving that because you think you will use it in the future?

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]

Thank you for your review, @helo! Keep up the good work!

Congratulations @sirfreeman! You received a personal award!

1 Year on Steemit

Click here to view your Board of Honor

Do not miss the last post from @steemitboard:

Saint Nicholas challenge for good boys and girls

Support SteemitBoard's project! Vote for its witness and get one more award!

Hey, @sirfreeman!

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.31
TRX 0.11
JST 0.034
BTC 66765.98
ETH 3234.00
USDT 1.00
SBD 4.23