From b0584f97074489bdd1f5f5a742014874325f4e95 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 8 May 2018 21:21:18 -0400 Subject: Render talenet skill similarity --- lib/render-msg.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib') diff --git a/lib/render-msg.js b/lib/render-msg.js index 2f204fc..506ccea 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -286,6 +286,7 @@ RenderMsg.prototype.message = function (cb) { case 'talenet-idea-create': return this.ideaCreate(cb) case 'talenet-idea-association': return this.ideaAssocate(cb) case 'talenet-skill-create': return this.skillCreate(cb) + case 'talenet-skill-similarity': return this.skillSimilarity(cb) case 'talenet-idea-hat': return this.ideaHat(cb) case 'talenet-idea-update': return this.ideaUpdate(cb) case 'talenet-idea-comment': @@ -1535,6 +1536,21 @@ RenderMsg.prototype.ideaCreate = function (cb) { ), cb) } +RenderMsg.prototype.skillSimilarity = function (cb) { + var self = this + var done = multicb({pluck: 1, spread: true}) + self.link(self.c.skillKey1, done()) + self.link(self.c.skillKey2, done()) + var similarity = !!self.c.similarity + done(function (err, skill1, skill2) { + self.wrapMini(h('span', + 'considers ', skill1, ' to be ', + similarity ? 'similar to ' : 'not similar to ', + skill2 + ), cb) + }) +} + RenderMsg.prototype.identitySkillAssign = function (cb) { var self = this self.link(self.c.skillKey, function (err, a) { -- cgit v1.2.3