Skip to content

Commit

Permalink
Merge pull request #1871 from LLK/release/april-2018
Browse files Browse the repository at this point in the history
[Master] April 2018 Release
  • Loading branch information
rschamp committed May 14, 2018
2 parents 4e9e791 + 1cfc5a8 commit 75ee8d7
Show file tree
Hide file tree
Showing 21 changed files with 1,522 additions and 242 deletions.
8 changes: 7 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,10 @@ type = KEYVALUEJSON
file_filter = localizations/preview-faq/<lang>.json
source_file = src/views/preview-faq/l10n.json
source_lang = en
type = KEYVALUEJSON
type = KEYVALUEJSON

[scratch-website.research-l10njson]
file_filter = localizations/research/<lang>.json
source_file = src/views/research/l10n.json
source_lang = en
type = KEYVALUEJSON
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ESLINT=./node_modules/.bin/eslint
NODE=node
NODE= NODE_OPTIONS=--max_old_space_size=8000 node
SASSLINT=./node_modules/.bin/sass-lint -v
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
TAP=./node_modules/.bin/tap
WATCH=./node_modules/.bin/watch
WEBPACK=./node_modules/.bin/webpack
WATCH= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/watch
WEBPACK= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/webpack

# ------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bin/configure-fastly.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async.auto({
if (err) throw new Error(err);
if (process.env.FASTLY_ACTIVATE_CHANGES) {
fastly.activateVersion(results.version, function (e, resp) {
if (err) throw new Error(e);
if (e) throw new Error(e);
process.stdout.write('Successfully configured and activated version ' + resp.number + '\n');
if (process.env.FASTLY_PURGE_ALL) {
fastly.purgeAll(FASTLY_SERVICE_ID, function (error) {
Expand Down
1 change: 1 addition & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"is": "Íslenska",
"it": "Italiano",
"kn": "ಭಾಷೆ-ಹೆಸರು",
"kk": "Қазақша",
"rw": "Kinyarwanda",
"ht": "Kreyòl",
"ku": "Kurdî",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@
"react-redux": "5.0.7",
"react-responsive": "3.0.0",
"react-slick": "0.16.0",
"react-string-replace": "0.4.1",
"react-telephone-input": "4.3.4",
"redux": "3.5.2",
"redux-thunk": "2.0.1",
"sass-lint": "1.5.1",
"sass-loader": "6.0.6",
"scratch-gui": "0.1.0-prerelease.20180427201459",
"scratchr2_translations": "git://github.com/LLK/scratchr2_translations.git#master",
"slick-carousel": "1.6.0",
"source-map-support": "0.3.2",
Expand Down
70 changes: 70 additions & 0 deletions src/components/forms/inplace-input.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const bindAll = require('lodash.bindall');
const React = require('react');
const PropTypes = require('prop-types');
const FRCInput = require('formsy-react-components').Input;
const FRCTextarea = require('formsy-react-components').Textarea;
const classNames = require('classnames');

require('./row.scss');
require('./inplace-input.scss');

class InplaceInput extends React.Component {
constructor (props) {
super(props);
bindAll(this, [
'handleBlur',
'setRef'
]);
}
handleBlur (name, value) {
if (this.inputRef.props.errorMessages.length === 0) {
const jsonData = {};
jsonData[name] = value;
this.props.handleUpdate(jsonData);
}
}
setRef (input) {
this.inputRef = input;
}
render () {
const {
className,
type,
handleUpdate, // eslint-disable-line no-unused-vars
...props
} = this.props;
return (
(type === 'textarea') ?
<FRCTextarea
className="inplace-textarea"
componentRef={this.setRef}
rowClassName={classNames('textarea-row no-label', className)}
onBlur={this.handleBlur}
{...props}
/> :
<FRCInput
className="inplace-input"
componentRef={this.setRef}
rowClassName={classNames(
className,
'no-label'
)}
onBlur={this.handleBlur}
{...props}
/>
);
}
}

InplaceInput.propTypes = {
className: PropTypes.string,
handleUpdate: PropTypes.func.isRequired,
type: PropTypes.string
};

InplaceInput.defaultProps = {
type: 'text',
value: ''
};

module.exports = InplaceInput;
57 changes: 57 additions & 0 deletions src/components/forms/inplace-input.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@import "../../colors";
@import "../../frameless";

.inplace-input {
transition: all .5s ease;
border: 2px dashed $ui-dark-gray;
border-radius: 5px;
background-color: transparent;
padding: 0 1rem;
color: $type-gray;

&:focus {
transition: all .5s ease;
outline: none;
border: 1px solid $ui-blue;
}

&.fail {
border: 1px solid $ui-orange;
}

&.pass {
border: 1px solid $active-dark-gray;
}

/* IE10/11-specific style resets */
&::-ms-reveal, &::-ms-clear {
display: none;
}
}

.inplace-textarea {
transition: all 1s ease;
margin-bottom: .75rem;
border: 2px dashed $ui-dark-gray;
border-radius: 5px;
background-color: $ui-light-gray;
padding: .75rem 1rem;
width: calc(100% - 2.25rem);
min-height: 20rem;
line-height: 1.75em;
color: $type-gray;
font-size: .875rem;
resize: none;

&:focus {
transition: all 1s ease;
outline: none;
border: 1px solid $ui-blue;
}

&.fail {
border: 1px solid $ui-orange;
}
}


37 changes: 0 additions & 37 deletions src/components/remixlist/remixlist.jsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/components/remixlist/remixlist.scss

This file was deleted.

30 changes: 30 additions & 0 deletions src/lib/decorate-text.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const React = require('react'); // eslint-disable-line
const reactStringReplace = require('react-string-replace');

/**
* Helper method that replaces @mentions and #hashtags in plain text
*
* @param {string} text string to convert
* @return {string} string with links for @mentions and #hashtags
*/
module.exports = text => {
let replacedText;

// Match @-mentions (username is alphanumeric, underscore and dash)
replacedText = reactStringReplace(text, /@([\w-]+)/g, (match, i) => (
<a
href={`/users/${match}`}
key={match + i}
>@{match}</a>
));

// Match hashtags
replacedText = reactStringReplace(replacedText, /(#[\w-]+)/g, (match, i) => (
<a
href={`/search/projects?q=${match}`}
key={match + i}
>{match}</a>
));

return replacedText;
};
Loading

0 comments on commit 75ee8d7

Please sign in to comment.