From 6343a0d621736cd1ec23986ef9fa185017ec3251 Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 21 Jul 2017 16:01:43 -0300 Subject: [PATCH 1/7] Adding tooltip to badges too --- .../src/components/Comment.css | 1 + .../client/components/Tag.css | 22 ++++++++ .../client/components/Tag.js | 51 +++++++++++++++---- .../client/components/Tooltip.js | 5 +- 4 files changed, 66 insertions(+), 13 deletions(-) diff --git a/client/coral-embed-stream/src/components/Comment.css b/client/coral-embed-stream/src/components/Comment.css index 7eb2ece71..713655914 100644 --- a/client/coral-embed-stream/src/components/Comment.css +++ b/client/coral-embed-stream/src/components/Comment.css @@ -16,6 +16,7 @@ } .comment { + position: relative; padding-left: 15px; } diff --git a/plugins/talk-plugin-featured-comments/client/components/Tag.css b/plugins/talk-plugin-featured-comments/client/components/Tag.css index 8874bfa0c..88a019b5d 100644 --- a/plugins/talk-plugin-featured-comments/client/components/Tag.css +++ b/plugins/talk-plugin-featured-comments/client/components/Tag.css @@ -17,4 +17,26 @@ margin: 0px 5px; padding: 5px 5px; border-radius: 2px; +} + +.tag.on { + background-color: #1862a7; + cursor: pointer; +} + +.tooltip { + top: 36px; + left: auto; + right: 10px; +} + +.tooltip::before{ + left: auto; + right: 16px; +} + +.tooltip::after{ + left: auto; + right: 16px; + top: -20px; } \ No newline at end of file diff --git a/plugins/talk-plugin-featured-comments/client/components/Tag.js b/plugins/talk-plugin-featured-comments/client/components/Tag.js index 8e1cb428d..b7ee8cd6b 100644 --- a/plugins/talk-plugin-featured-comments/client/components/Tag.js +++ b/plugins/talk-plugin-featured-comments/client/components/Tag.js @@ -1,16 +1,45 @@ import React from 'react'; +import cn from 'classnames'; import styles from './Tag.css'; +import Tooltip from './Tooltip'; import {t} from 'plugin-api/beta/client/services'; import {isTagged} from 'plugin-api/beta/client/utils'; -export default (props) => ( - - { - isTagged(props.comment.tags, 'FEATURED') ? ( - - {t('talk-plugin-featured-comments.featured')} - - ) : null - } - -); +export default class Tag extends React.Component { + constructor() { + super(); + + this.state = { + tooltip: false + }; + + } + + showTooltip = () => { + this.setState({ + tooltip: true + }); + } + + hideTooltip = () => { + this.setState({ + tooltip: false + }); + } + + render() { + const {tooltip} = this.state; + return( +
+ { + isTagged(this.props.comment.tags, 'FEATURED') ? ( + + {t('talk-plugin-featured-comments.featured')} + + ) : null + } + {tooltip && } +
+ ); + } +} diff --git a/plugins/talk-plugin-featured-comments/client/components/Tooltip.js b/plugins/talk-plugin-featured-comments/client/components/Tooltip.js index c57336d05..f98d4c0d5 100644 --- a/plugins/talk-plugin-featured-comments/client/components/Tooltip.js +++ b/plugins/talk-plugin-featured-comments/client/components/Tooltip.js @@ -1,10 +1,11 @@ import React from 'react'; +import cn from 'classnames'; import styles from './Tooltip.css'; import {t} from 'plugin-api/beta/client/services'; import {Icon} from 'plugin-api/beta/client/components/ui'; -export default () => ( -
+export default ({className = ''}) => ( +

{t('talk-plugin-featured-comments.featured_comments')}: From 25bccde40f194268bf8aa193303360874ebee2af Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Fri, 21 Jul 2017 16:08:18 -0300 Subject: [PATCH 2/7] fix --- .../src/routes/Moderation/components/StorySearch.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/coral-admin/src/routes/Moderation/components/StorySearch.css b/client/coral-admin/src/routes/Moderation/components/StorySearch.css index 2df130ec4..973d97c24 100644 --- a/client/coral-admin/src/routes/Moderation/components/StorySearch.css +++ b/client/coral-admin/src/routes/Moderation/components/StorySearch.css @@ -74,7 +74,7 @@ cursor: pointer; display: block; text-decoration: none; - height: 50px; + min-height: 50px; box-sizing: border-box; transition: background-color 400ms; From 3e09d28308221e4cbf31c85101b706ea56db44d3 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 25 Jul 2017 10:01:05 +1000 Subject: [PATCH 3/7] Bumped node version, replaced bcrypt -> bcryptjs --- Dockerfile | 6 ++---- circle.yml | 2 +- models/user.js | 2 +- package.json | 4 ++-- services/users.js | 2 +- yarn.lock | 16 ++++++---------- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f67da95b..2bb68fd4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:7.10.1 +FROM node:latest # Create app directory RUN mkdir -p /usr/src/app @@ -13,11 +13,9 @@ EXPOSE 5000 COPY . /usr/src/app # Install app dependencies and build static assets. -RUN yarn global add node-gyp && \ - yarn install --frozen-lockfile && \ +RUN yarn install --frozen-lockfile && \ cli plugins reconcile && \ yarn build && \ - yarn install --production && \ yarn cache clean # Ensure the runtime of the container is in production mode. diff --git a/circle.yml b/circle.yml index 69f95c9b4..134c1728c 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 7.10.1 + version: 8 services: - docker - redis diff --git a/models/user.js b/models/user.js index b19a87b0a..450819d53 100644 --- a/models/user.js +++ b/models/user.js @@ -1,5 +1,5 @@ const mongoose = require('../services/mongoose'); -const bcrypt = require('bcrypt'); +const bcrypt = require('bcryptjs'); const Schema = mongoose.Schema; const uuid = require('uuid'); const TagLinkSchema = require('./schema/tag_link'); diff --git a/package.json b/package.json index 9cb065320..e8a9159c2 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "accepts": "^1.3.3", "app-module-path": "^2.2.0", "async": "^2.5.0", - "bcrypt": "^1.0.2", + "bcryptjs": "^2.4.3", "body-parser": "^1.17.1", "bowser": "^1.7.0", "cli-table": "^0.3.1", @@ -215,6 +215,6 @@ "webpack": "^2.3.1" }, "engines": { - "node": "^7.10.1" + "node": "^8" } } diff --git a/services/users.js b/services/users.js index 13dddaf04..3bdc5148b 100644 --- a/services/users.js +++ b/services/users.js @@ -1,6 +1,6 @@ const assert = require('assert'); const uuid = require('uuid'); -const bcrypt = require('bcrypt'); +const bcrypt = require('bcryptjs'); const url = require('url'); const jwt = require('jsonwebtoken'); const Wordlist = require('./wordlist'); diff --git a/yarn.lock b/yarn.lock index 710b89fa2..d2177f384 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1181,13 +1181,9 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bcrypt@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt/-/bcrypt-1.0.2.tgz#d05fc5d223173e0e28ec381c0f00cc25ffaf2736" - dependencies: - bindings "1.2.1" - nan "2.5.0" - node-pre-gyp "0.6.32" +bcryptjs@^2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb" big.js@^3.1.3: version "3.1.3" @@ -1197,7 +1193,7 @@ binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" -bindings@1.2.1, bindings@^1.2.1: +bindings@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.2.1.tgz#14ad6113812d2d37d72e67b4cacb4bb726505f11" @@ -5445,7 +5441,7 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@2.5.0, nan@^2.0.0, nan@^2.3.0, nan@^2.4.0: +nan@^2.0.0, nan@^2.3.0, nan@^2.4.0: version "2.5.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8" @@ -5562,7 +5558,7 @@ node-libs-browser@^2.0.0: util "^0.10.3" vm-browserify "0.0.4" -node-pre-gyp@0.6.32, node-pre-gyp@^0.6.29, node-pre-gyp@^0.6.4: +node-pre-gyp@^0.6.29, node-pre-gyp@^0.6.4: version "0.6.32" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.32.tgz#fc452b376e7319b3d255f5f34853ef6fd8fe1fd5" dependencies: From c8f3be4bf546ec77a2ab9b321f5f56d57384f0b5 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 25 Jul 2017 10:03:50 +1000 Subject: [PATCH 4/7] fixed docker version number --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2bb68fd4f..498261049 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:latest +FROM node:8 # Create app directory RUN mkdir -p /usr/src/app From e292475f1e7933cb61c2b18aa9e16fda37b275de Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 25 Jul 2017 10:20:54 +1000 Subject: [PATCH 5/7] Added yarn global add node-gyp back --- Dockerfile | 3 ++- circle.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 498261049..2dbd7bbbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,8 @@ EXPOSE 5000 COPY . /usr/src/app # Install app dependencies and build static assets. -RUN yarn install --frozen-lockfile && \ +RUN yarn global add node-gyp && \ + yarn install --frozen-lockfile && \ cli plugins reconcile && \ yarn build && \ yarn cache clean diff --git a/circle.yml b/circle.yml index 134c1728c..c06ec4aea 100644 --- a/circle.yml +++ b/circle.yml @@ -20,6 +20,7 @@ dependencies: # - sudo service mongod restart # Install node dependencies. + - yarn global add node-gyp - yarn --version - yarn cache_directories: From 9ffe542234b4adc46cb012f5689ecd8b9409f8e9 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 25 Jul 2017 10:51:29 +1000 Subject: [PATCH 6/7] added some forcing logic to circle --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index c06ec4aea..de7742621 100644 --- a/circle.yml +++ b/circle.yml @@ -20,8 +20,8 @@ dependencies: # - sudo service mongod restart # Install node dependencies. - - yarn global add node-gyp - yarn --version + - yarn global add node-gyp --force - yarn cache_directories: - ~/.cache/yarn From b8bd997fed96ce998bd6d15f8f8d99685edfa9a8 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Tue, 25 Jul 2017 11:39:36 +1000 Subject: [PATCH 7/7] removed yarn cache --- circle.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/circle.yml b/circle.yml index de7742621..373b45012 100644 --- a/circle.yml +++ b/circle.yml @@ -23,8 +23,6 @@ dependencies: - yarn --version - yarn global add node-gyp --force - yarn - cache_directories: - - ~/.cache/yarn post: # Build the static assets. - yarn build