From d8b0371413ffacb796e29779bc83634d01dc1ebe Mon Sep 17 00:00:00 2001 From: patte
Date: Wed, 11 Apr 2018 18:26:14 +0200 Subject: [PATCH 1/9] feat(repulik): parse comment.content to mdast --- servers/republik/graphql/resolvers/Comment.js | 20 +++++-- .../graphql/resolvers/Discussion/comments.js | 2 - servers/republik/graphql/schema-types.js | 5 +- servers/republik/lib/remark.js | 37 +++++++++++++ servers/republik/package.json | 5 ++ yarn.lock | 54 ++++++++++++++++++- 6 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 servers/republik/lib/remark.js diff --git a/servers/republik/graphql/resolvers/Comment.js b/servers/republik/graphql/resolvers/Comment.js index 341a75fa3..f855349a4 100644 --- a/servers/republik/graphql/resolvers/Comment.js +++ b/servers/republik/graphql/resolvers/Comment.js @@ -2,6 +2,7 @@ const { Roles } = require('@orbiting/backend-modules-auth') const { transformUser } = require('@orbiting/backend-modules-auth') const crypto = require('crypto') const { portrait: getPortrait } = require('./User') +const remark = require('../../lib/remark') const { DISPLAY_AUTHOR_SECRET @@ -10,6 +11,11 @@ if (!DISPLAY_AUTHOR_SECRET) { throw new Error('missing required DISPLAY_AUTHOR_SECRET') } +const textForComment = ({ userId, content, published, adminUnpublished }, user) => + (!published || adminUnpublished) && (!user || userId !== user.id) + ? null + : content + module.exports = { discussion: ({ discussionId }, args, { pgdb }) => pgdb.public.discussions.findOne({ id: discussionId }), @@ -22,10 +28,16 @@ module.exports = { ? adminUnpublished : null, - content: ({ userId, content, published, adminUnpublished }, args, { user, t }) => - (!published || adminUnpublished) && (!user || userId !== user.id) - ? null - : content, + content: (comment, args, { user }) => { + const text = textForComment(comment, user) + if (!text) { + return text + } + return remark.parse(text) + }, + + text: (comment, args, { user }) => + textForComment(comment, user), score: comment => comment.upVotes - comment.downVotes, diff --git a/servers/republik/graphql/resolvers/Discussion/comments.js b/servers/republik/graphql/resolvers/Discussion/comments.js index e1241b056..a18a34c86 100644 --- a/servers/republik/graphql/resolvers/Discussion/comments.js +++ b/servers/republik/graphql/resolvers/Discussion/comments.js @@ -11,7 +11,6 @@ const _ = { const { published: getPublished, adminUnpublished: getAdminUnpublished, - content: getContent, author: getAuthor, displayAuthor: getDisplayAuthor } = require('../Comment') @@ -181,7 +180,6 @@ const decorateTree = async (_comment, coveredComments, discussion, context) => { ...c, published: getPublished(c, {}, context), adminUnpublished: getAdminUnpublished(c, {}, context), - content: getContent(c, {}, context), author: getAuthor(c, {}, preResolvedContext), displayAuthor: getDisplayAuthor(c, {}, preResolvedContext) } diff --git a/servers/republik/graphql/schema-types.js b/servers/republik/graphql/schema-types.js index 90127e95e..1a0cfed1d 100644 --- a/servers/republik/graphql/schema-types.js +++ b/servers/republik/graphql/schema-types.js @@ -303,8 +303,9 @@ type Comment { parent: Comment parentIds: [ID!]! comments: CommentConnection! - # maybe becomes mdast/JSON later - content: String + # mdast + content: JSON + text: String published: Boolean! adminUnpublished: Boolean upVotes: Int! diff --git a/servers/republik/lib/remark.js b/servers/republik/lib/remark.js new file mode 100644 index 000000000..f02687dd2 --- /dev/null +++ b/servers/republik/lib/remark.js @@ -0,0 +1,37 @@ +const unified = require('unified') +const remarkParse = require('remark-parse') +const remarkBreaks = require('remark-breaks') +const remarkStripHTML = require('remark-strip-html') +const select = require('unist-util-select') + +// https://github.com/remarkjs/remark/tree/master/packages/remark-parse#turning-off-a-tokenizer +delete remarkParse.Parser.prototype.blockTokenizers.table + +// TODO: move into it's own package - with tests +const isJSLink = /^javascript:/ +function remarkRemoveJSLinks (_, options = {}) { + return (ast) => { + select(ast, 'link').forEach((node) => { + if (isJSLink.test(node.url)) { + node.type = 'text' + node.value = node.children[0].value + delete node.url + delete node.title + delete node.children + } + }) + } +} + +const parser = unified() + .use(remarkParse, { + position: false, + commonmark: true, + gfm: true, + footnotes: false + }) + .use(remarkBreaks) + .use(remarkStripHTML) + .use(remarkRemoveJSLinks) + +module.exports.parse = md => parser.runSync(parser.parse(md)) diff --git a/servers/republik/package.json b/servers/republik/package.json index 5a431cabb..8aabdeda1 100644 --- a/servers/republik/package.json +++ b/servers/republik/package.json @@ -27,9 +27,14 @@ "lodash": "^4.17.5", "moment": "^2.22.0", "openpgp": "^3.0.3", + "remark-breaks": "^1.0.0", + "remark-parse": "^5.0.0", + "remark-strip-html": "^1.0.0", "sharp": "^0.20.1", "slugify": "^1.2.9", "stripe": "^5.8.0", + "unified": "^6.1.6", + "unist-util-select": "^1.5.0", "uuid": "^3.2.1" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index c60c15ed8..1d8fcd30f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -801,6 +801,10 @@ body-parser@1.18.2, body-parser@^1.18.2: raw-body "2.3.2" type-is "~1.6.15" +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -1442,6 +1446,10 @@ css-in-js-utils@^2.0.0: dependencies: hyphenate-style-name "^1.0.2" +css-selector-parser@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-1.3.0.tgz#5f1ad43e2d8eefbfdc304fcd39a521664943e3eb" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -4660,6 +4668,12 @@ npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" +nth-check@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + dependencies: + boolbase "~1.0.0" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -4916,7 +4930,7 @@ parse-database-url@~0.3.0: dependencies: mongodb-uri ">= 0.9.7" -parse-entities@^1.0.2, parse-entities@^1.1.1: +parse-entities@^1.0.2, parse-entities@^1.1.0, parse-entities@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.1.tgz#8112d88471319f27abae4d64964b122fe4e1b890" dependencies: @@ -5584,6 +5598,10 @@ registry-url@^3.0.3: dependencies: rc "^1.0.1" +remark-breaks@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/remark-breaks/-/remark-breaks-1.0.0.tgz#f7d701d14cf6cf6f225ff93f1c3a10b3c353a9a3" + remark-frontmatter@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-1.2.0.tgz#67905d178c0fe531ed12c57b98759f101fc2c1b5" @@ -5611,6 +5629,26 @@ remark-parse@^4.0.0: vfile-location "^2.0.0" xtend "^4.0.1" +remark-parse@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-5.0.0.tgz#4c077f9e499044d1d5c13f80d7a98cf7b9285d95" + dependencies: + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^1.1.0" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^1.0.0" + vfile-location "^2.0.0" + xtend "^4.0.1" + remark-stringify@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-4.0.0.tgz#4431884c0418f112da44991b4e356cfe37facd87" @@ -5630,6 +5668,10 @@ remark-stringify@^4.0.0: unherit "^1.0.4" xtend "^4.0.1" +remark-strip-html@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/remark-strip-html/-/remark-strip-html-1.0.0.tgz#32d6394157291afebc93268e97d8cf3b690d4746" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -6745,7 +6787,7 @@ unherit@^1.0.4: inherits "^2.0.1" xtend "^4.0.1" -unified@^6.1.5: +unified@^6.1.5, unified@^6.1.6: version "6.1.6" resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.6.tgz#5ea7f807a0898f1f8acdeefe5f25faa010cc42b1" dependencies: @@ -6802,6 +6844,14 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" +unist-util-select@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/unist-util-select/-/unist-util-select-1.5.0.tgz#a93c2be8c0f653827803b81331adec2aa24cd933" + dependencies: + css-selector-parser "^1.1.0" + debug "^2.2.0" + nth-check "^1.0.1" + unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" From 0cbf7bc0c4941653c78ddeb1ae7aa8c6f247b172 Mon Sep 17 00:00:00 2001 From: patte
Date: Wed, 11 Apr 2018 18:57:03 +0200 Subject: [PATCH 2/9] refactor(republik): comment.content mdast parsing: don't remove JSLinks, neither strip html --- servers/republik/lib/remark.js | 20 -------------------- servers/republik/package.json | 2 -- yarn.lock | 26 -------------------------- 3 files changed, 48 deletions(-) diff --git a/servers/republik/lib/remark.js b/servers/republik/lib/remark.js index f02687dd2..eff63ac8d 100644 --- a/servers/republik/lib/remark.js +++ b/servers/republik/lib/remark.js @@ -1,28 +1,10 @@ const unified = require('unified') const remarkParse = require('remark-parse') const remarkBreaks = require('remark-breaks') -const remarkStripHTML = require('remark-strip-html') -const select = require('unist-util-select') // https://github.com/remarkjs/remark/tree/master/packages/remark-parse#turning-off-a-tokenizer delete remarkParse.Parser.prototype.blockTokenizers.table -// TODO: move into it's own package - with tests -const isJSLink = /^javascript:/ -function remarkRemoveJSLinks (_, options = {}) { - return (ast) => { - select(ast, 'link').forEach((node) => { - if (isJSLink.test(node.url)) { - node.type = 'text' - node.value = node.children[0].value - delete node.url - delete node.title - delete node.children - } - }) - } -} - const parser = unified() .use(remarkParse, { position: false, @@ -31,7 +13,5 @@ const parser = unified() footnotes: false }) .use(remarkBreaks) - .use(remarkStripHTML) - .use(remarkRemoveJSLinks) module.exports.parse = md => parser.runSync(parser.parse(md)) diff --git a/servers/republik/package.json b/servers/republik/package.json index 8aabdeda1..86eca88b4 100644 --- a/servers/republik/package.json +++ b/servers/republik/package.json @@ -29,12 +29,10 @@ "openpgp": "^3.0.3", "remark-breaks": "^1.0.0", "remark-parse": "^5.0.0", - "remark-strip-html": "^1.0.0", "sharp": "^0.20.1", "slugify": "^1.2.9", "stripe": "^5.8.0", "unified": "^6.1.6", - "unist-util-select": "^1.5.0", "uuid": "^3.2.1" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index 1d8fcd30f..e65001dc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -801,10 +801,6 @@ body-parser@1.18.2, body-parser@^1.18.2: raw-body "2.3.2" type-is "~1.6.15" -boolbase@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -1446,10 +1442,6 @@ css-in-js-utils@^2.0.0: dependencies: hyphenate-style-name "^1.0.2" -css-selector-parser@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/css-selector-parser/-/css-selector-parser-1.3.0.tgz#5f1ad43e2d8eefbfdc304fcd39a521664943e3eb" - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -4668,12 +4660,6 @@ npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2: gauge "~2.7.3" set-blocking "~2.0.0" -nth-check@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" - dependencies: - boolbase "~1.0.0" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -5668,10 +5654,6 @@ remark-stringify@^4.0.0: unherit "^1.0.4" xtend "^4.0.1" -remark-strip-html@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/remark-strip-html/-/remark-strip-html-1.0.0.tgz#32d6394157291afebc93268e97d8cf3b690d4746" - remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -6844,14 +6826,6 @@ unist-util-remove-position@^1.0.0: dependencies: unist-util-visit "^1.1.0" -unist-util-select@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/unist-util-select/-/unist-util-select-1.5.0.tgz#a93c2be8c0f653827803b81331adec2aa24cd933" - dependencies: - css-selector-parser "^1.1.0" - debug "^2.2.0" - nth-check "^1.0.1" - unist-util-stringify-position@^1.0.0, unist-util-stringify-position@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" From 7b801556ab6ef9d477728a47a47a8c81f1fdffb0 Mon Sep 17 00:00:00 2001 From: patte
Date: Wed, 25 Apr 2018 13:25:28 +0200 Subject: [PATCH 3/9] feat(republik-discussion): mdast-html content in notification emails --- servers/republik/graphql/resolvers/Comment.js | 4 ++-- servers/republik/lib/Notifications.js | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/servers/republik/graphql/resolvers/Comment.js b/servers/republik/graphql/resolvers/Comment.js index f855349a4..edbaceed7 100644 --- a/servers/republik/graphql/resolvers/Comment.js +++ b/servers/republik/graphql/resolvers/Comment.js @@ -28,8 +28,8 @@ module.exports = { ? adminUnpublished : null, - content: (comment, args, { user }) => { - const text = textForComment(comment, user) + content: (comment, args, context) => { + const text = textForComment(comment, context && context.user) if (!text) { return text } diff --git a/servers/republik/lib/Notifications.js b/servers/republik/lib/Notifications.js index 58dcc92aa..a10be78ed 100644 --- a/servers/republik/lib/Notifications.js +++ b/servers/republik/lib/Notifications.js @@ -1,6 +1,12 @@ -const { displayAuthor: getDisplayAuthor } = require('../graphql/resolvers/Comment') +const { + displayAuthor: getDisplayAuthor, + content: getContent +} = require('../graphql/resolvers/Comment') const { transformUser } = require('@orbiting/backend-modules-auth') +const commentSchema = require('@project-r/styleguide/lib/templates/Comment/email').default() +const { renderEmail } = require('mdast-react-render/lib/email') + const { DEFAULT_MAIL_FROM_ADDRESS, DEFAULT_MAIL_FROM_NAME, @@ -79,6 +85,9 @@ const submitComment = async (comment, discussion, context) => { context ) + const contentMdast = getContent(comment) + const htmlContent = renderEmail(contentMdast, commentSchema, { doctype: '' }) + const shortBody = comment.content.length > 128 ? `${comment.content.substring(0, 128)}...` : comment.content @@ -120,7 +129,7 @@ const submitComment = async (comment, discussion, context) => { subject: isTopLevelComment ? t('api/comment/notification/new/email/subject', subjectParams) : t('api/comment/notification/answer/email/subject', subjectParams), - templateName: 'cf_comment_notification_new', + templateName: 'cf_comment_notification_new_mdast', globalMergeVars: [ { name: 'NAME', content: user.name @@ -138,7 +147,7 @@ const submitComment = async (comment, discussion, context) => { content: `${discussionUrl}?mute=1` }, { name: 'CONTENT', - content: comment.content + content: htmlContent }, { name: 'URL', content: commentUrl From 6be3b38562a67c72cf14a4b925425e69253d1d58 Mon Sep 17 00:00:00 2001 From: patte
Date: Mon, 30 Apr 2018 17:06:46 +0200 Subject: [PATCH 4/9] feat(republik): disable bubbling sort for DATE/createdAt --- .../graphql/resolvers/Discussion/comments.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/servers/republik/graphql/resolvers/Discussion/comments.js b/servers/republik/graphql/resolvers/Discussion/comments.js index a18a34c86..1630d096a 100644 --- a/servers/republik/graphql/resolvers/Discussion/comments.js +++ b/servers/republik/graphql/resolvers/Discussion/comments.js @@ -61,11 +61,12 @@ const measureTree = comment => { // recursively sort tree // each node with children gets a topValue based on // node[sortKey] || topChild[topValue] || topChild[sortKey] -// thus topValue bubbles up the tree, ensuring consistent sorting. -const deepSortTree = (comment, ascDesc, sortKey, topValue, topIds) => { +// thus topValue bubbles up the tree +// this behaviour can be disabled with the last param set to false +const deepSortTree = (comment, ascDesc, sortKey, topValue, topIds, bubbleSort = true) => { const { comments } = comment if (comments.nodes.length > 0) { - comments.nodes.forEach(c => deepSortTree(c, ascDesc, sortKey, topValue, topIds)) + comments.nodes.forEach(c => deepSortTree(c, ascDesc, sortKey, topValue, topIds, bubbleSort)) comment.comments = { ...comments, nodes: comments.nodes.sort( @@ -77,10 +78,12 @@ const deepSortTree = (comment, ascDesc, sortKey, topValue, topIds) => { const firstChild = comment.comments.nodes[0] comment.topValue = topIds && topIds.includes(comment.id) ? topValue - : [ - comment[sortKey], - firstChild.topValue || firstChild[sortKey] - ].sort((a, b) => ascDesc(a, b))[0] + : bubbleSort + ? [ + comment[sortKey], + firstChild.topValue || firstChild[sortKey] + ].sort((a, b) => ascDesc(a, b))[0] + : null } } return comment @@ -294,6 +297,8 @@ module.exports = async (discussion, args, context, info) => { 'HOT': 'hotness' } const sortKey = sortKeyMap[orderBy] + const bubbleSort = sortKey !== 'createdAt' // bubbling values for sort is disabled for createdAt + const compare = (a, b) => // topValue set by deepSortTree // index for stable sort ascDesc(a.topValue || a[sortKey], b.topValue || b[sortKey]) || ascending(a.index, b.index) @@ -316,7 +321,8 @@ module.exports = async (discussion, args, context, info) => { topValue, focusComment && focusComment.parentIds ? [...focusComment.parentIds, focusComment.id] - : null + : null, + bubbleSort ) if (exceptIds) { // exceptIds are always on first level From 2c30b5e43b9e02db92efc360226e9465830557c7 Mon Sep 17 00:00:00 2001 From: patte
Date: Wed, 2 May 2018 11:42:09 +0200 Subject: [PATCH 5/9] fix(republik): bump styleguide --- packages/documents/package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/documents/package.json b/packages/documents/package.json index 877e1460e..533ae3170 100644 --- a/packages/documents/package.json +++ b/packages/documents/package.json @@ -23,7 +23,7 @@ "isomorphic-unfetch": "^2.0.0" }, "dependencies": { - "@project-r/styleguide": "^5.71.7", + "@project-r/styleguide": "^5.73.0", "@project-r/template-newsletter": "^1.5.0", "apollo-modules-node": "^0.1.4", "check-env": "^1.3.0", diff --git a/yarn.lock b/yarn.lock index e65001dc9..ec50f709d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27,9 +27,9 @@ stringify-entities "^1.3.1" unified "^6.1.5" -"@project-r/styleguide@^5.71.7": - version "5.71.7" - resolved "https://registry.yarnpkg.com/@project-r/styleguide/-/styleguide-5.71.7.tgz#868c529557c2d75b9d8adbefdd32c571d5579d46" +"@project-r/styleguide@^5.73.0": + version "5.73.0" + resolved "https://registry.yarnpkg.com/@project-r/styleguide/-/styleguide-5.73.0.tgz#356213599aa04064e54c09933cf9eac5b3f86ed6" dependencies: react-icons "^2.2.7" From c70f55f8ea12bb6ff01fe53995ae3f316aea842f Mon Sep 17 00:00:00 2001 From: patte
Date: Wed, 2 May 2018 11:54:30 +0200
Subject: [PATCH 6/9] fix(republik): add styleguide dependency to republik
---
servers/republik/package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/servers/republik/package.json b/servers/republik/package.json
index 86eca88b4..6a4de3036 100644
--- a/servers/republik/package.json
+++ b/servers/republik/package.json
@@ -8,6 +8,7 @@
"private": true,
"license": "AGPL-3.0",
"dependencies": {
+ "@project-r/styleguide": "^5.73.0",
"@slack/client": "^4.1.0",
"apollo-modules-node": "^0.1.4",
"d3-array": "^1.2.1",
From 5dc42b8283539db42b0849b635b98191a89ce0b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Pf=C3=A4nder?=
Date: Thu, 3 May 2018 15:42:33 +0200
Subject: [PATCH 8/9] fix(republik): notifications use
cf_comment_notification_new instead of _mdast
---
servers/republik/lib/Notifications.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/servers/republik/lib/Notifications.js b/servers/republik/lib/Notifications.js
index a10be78ed..3b41cb27a 100644
--- a/servers/republik/lib/Notifications.js
+++ b/servers/republik/lib/Notifications.js
@@ -129,7 +129,7 @@ const submitComment = async (comment, discussion, context) => {
subject: isTopLevelComment
? t('api/comment/notification/new/email/subject', subjectParams)
: t('api/comment/notification/answer/email/subject', subjectParams),
- templateName: 'cf_comment_notification_new_mdast',
+ templateName: 'cf_comment_notification_new',
globalMergeVars: [
{ name: 'NAME',
content: user.name
From a37e8898ee9b4d8df03fd1e8ece6591157067092 Mon Sep 17 00:00:00 2001
From: patte
Date: Thu, 3 May 2018 15:45:13 +0200
Subject: [PATCH 9/9] fix(republik): bump styleguide
---
packages/documents/package.json | 2 +-
yarn.lock | 6 ------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/packages/documents/package.json b/packages/documents/package.json
index 533ae3170..dc121d2ec 100644
--- a/packages/documents/package.json
+++ b/packages/documents/package.json
@@ -23,7 +23,7 @@
"isomorphic-unfetch": "^2.0.0"
},
"dependencies": {
- "@project-r/styleguide": "^5.73.0",
+ "@project-r/styleguide": "^5.75.0",
"@project-r/template-newsletter": "^1.5.0",
"apollo-modules-node": "^0.1.4",
"check-env": "^1.3.0",
diff --git a/yarn.lock b/yarn.lock
index 3730250ee..c1a7e6bfb 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -27,12 +27,6 @@
stringify-entities "^1.3.1"
unified "^6.1.5"
-"@project-r/styleguide@^5.73.0":
- version "5.73.0"
- resolved "https://registry.yarnpkg.com/@project-r/styleguide/-/styleguide-5.73.0.tgz#356213599aa04064e54c09933cf9eac5b3f86ed6"
- dependencies:
- react-icons "^2.2.7"
-
"@project-r/styleguide@^5.75.0":
version "5.75.0"
resolved "https://registry.yarnpkg.com/@project-r/styleguide/-/styleguide-5.75.0.tgz#ebe3307233d5117b0471337b6cb2646cf6e3eccb"