Skip to content

Commit

Permalink
Merge branch 'master' into update_user_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
goldibex authored Oct 6, 2017
2 parents b25b39d + bf32a34 commit dbe4080
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 122 deletions.
15 changes: 9 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ find node_modules/eslint-config-airbnb -name '*.js'|xargs sed -i "s/': 2/': 1/"
"node": true,
"es6": true
},
"ecmaFeatures": {
"blockBindings": true,
"forOf": true,
"jsx": true
},
"rules": {
"max-len": 0, /*[1, 160, 4],*/
"comma-dangle": 0,
Expand All @@ -32,7 +27,9 @@ find node_modules/eslint-config-airbnb -name '*.js'|xargs sed -i "s/': 2/': 1/"
"no-undef": 2,
"camelcase": [0],
"no-console": [0],
"padded-blocks": 0,
"object-curly-spacing": [0],
"react/jsx-indent": [1,4],
"react/jsx-indent-props": [1,4],
"react/jsx-closing-bracket-location": [0],
"no-use-before-define": [0, {"functions": false, "classes": false}],
Expand All @@ -56,9 +53,15 @@ find node_modules/eslint-config-airbnb -name '*.js'|xargs sed -i "s/': 2/': 1/"
"no-confusing-arrow": 0,
"space-in-parens": 0,
"no-throw-literal": 0,
"react/sort-comp": [1, { "order": [ 'lifecycle' ] }],
"react/sort-comp": [1, { "order": [ "lifecycle" ] }],
"react/prefer-stateless-function": 0,
"react/prop-types": 0,
"radix": 0,

"jsx-a11y/href-no-hash": "off",
"jsx-a11y/anchor-is-valid": ["warn", { "aspects": ["invalidHref"] }],
"import/no-extraneous-dependencies": 0,
"import/no-unresolved": 0,
"import/extensions": 0
}
}
27 changes: 0 additions & 27 deletions newrelic.js

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"author": "Steemit, Inc.",
"license": "MIT",
"dependencies": {
"@newrelic/native-metrics": "^2.1.1",
"@steem/crypto-session": "git+https://github.com/steemit/crypto-session.git#83a90b319ce5bc6a70362d52a15a815de7e729bb",
"assert": "^1.3.0",
"autoprefixer-loader": "^3.2.0",
Expand Down Expand Up @@ -88,7 +87,6 @@
"mixpanel": "^0.5.0",
"mysql": "^2.10.2",
"net": "^1.0.2",
"newrelic": "^1.40.0",
"node-sass": "^3.4.2",
"os": "^0.1.1",
"purest": "^2.0.1",
Expand Down Expand Up @@ -157,9 +155,11 @@
"enzyme": "^2.1.0",
"escope": "^3.6.0",
"eslint": "^4.7.0",
"eslint-config-airbnb": "^6.1.0",
"eslint-plugin-babel": "^3.1.0",
"eslint-plugin-react": "^4.2.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"extract-text-webpack-plugin": "^1.0.1",
"jsdom": "^9.8.0",
"koa-webpack-dev-middleware": "^1.1.0",
Expand Down
40 changes: 24 additions & 16 deletions scripts/check_translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint guard-for-in: 0 */
/* eslint no-restricted-syntax: 0 */

const fs = require('fs');

Expand Down Expand Up @@ -31,28 +32,31 @@ function loadTranslationFiles(path) {
const translations = {};
const files = fs.readdirSync(path);
for (const filename of files) {
if (args.length > 0 && filename !== args[0]) continue;
const m = filename.match(/([\w\-]+)\.json$/);
if (!m) continue;
const lang = m[1];
translations[lang] = readTranslationKeys(path + '/' + filename);
if (args.length <= 0 || filename === args[0]) {
const m = filename.match(/([\w-]+)\.json$/);
if (m) {
const lang = m[1];
translations[lang] = readTranslationKeys(path + '/' + filename);
}
}
}
return translations;
}

function processFile(used_keys, path) {
const lines = fs.readFileSync(path, 'utf8').split(/\r?\n/);
for (const l of lines) {
const tts = l.match(/(tt\([\"\'\.\-\_\w]+)/g) || l.match(/(FormattedHTMLMessage.+id\=[\"\'\.\-\_\w]+)/g);
const tts = l.match(/(tt\(["'.\-_\w]+)/g) || l.match(/(FormattedHTMLMessage.+id=["'.\-_\w]+)/g);
if (tts) {
// if(tts.length > 1) console.log('-- tt -->', path, l, tts.length, JSON.stringify(tts, null, 4));
for (const t of tts) {
if (t === 'tt(id') continue; // this is exception
const m = t.match(/tt\([\'\"]([\.\-\_\w]+)/) || t.match(/id\=[\'\"]([\.\-\_\w]+)[\'\"]/);
if (!m) throw new Error('Wrong format: "' + t + '" in "' + l + '"');
const key = m[1];
if (used_keys[key]) used_keys[key] += 1;
else used_keys[key] = 1;
if (t !== 'tt(id') {
const m = t.match(/tt\(['"]([.\-_\w]+)/) || t.match(/id=['"]([.\-_\w]+)['"]/);
if (!m) throw new Error('Wrong format: "' + t + '" in "' + l + '"');
const key = m[1];
if (used_keys[key]) used_keys[key] += 1;
else used_keys[key] = 1;
}
}
}
}
Expand All @@ -76,12 +80,16 @@ function checkKeys(translations, used_keys) {
for (const lang in translations) {
const lang_keys = translations[lang];
for (const key in used_keys) {
if (!lang_keys[key]) console.warn('Translation key not found: ', lang, key);
errors_counter += 1;
if (!lang_keys[key]) {
console.warn('Translation key not found: ', lang, key);
errors_counter += 1;
}
}
for (const key in lang_keys) {
if (!used_keys[key]) console.warn('Unused translation: ', lang, key);
errors_counter += 1;
if (!used_keys[key]) {
console.warn('Unused translation: ', lang, key);
errors_counter += 1;
}
}
}
return errors_counter;
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/elements/ReplyEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,14 @@ export default formId => connect(

const formCategories = Set(category ? category.trim().replace(/#/g, "").split(/ +/) : [])
const rootCategory = originalPost && originalPost.category ? originalPost.category : formCategories.first()
let allCategories = Set([...formCategories.toJS(), ...rtags.hashtags])
let allCategories = Set([...formCategories.toJS()])
if(/^[-a-z\d]+$/.test(rootCategory)) allCategories = allCategories.add(rootCategory)

let postHashtags = [...rtags.hashtags]
while (allCategories.size < 5 && postHashtags.length > 0) {
allCategories = allCategories.add(postHashtags.shift())
}

// merge
const meta = isEdit ? jsonMetadata : {}
if(allCategories.size) meta.tags = allCategories.toJS(); else delete meta.tags
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/modules/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Header extends React.Component {
['hot', tt('main_menu.hot')],
['promoted', tt('g.promoted')]
];
// if (current_account_name) sort_orders.unshift(['home', tt('header_jsx.home')]);
if (current_account_name) sort_orders.unshift(['home', tt('header_jsx.home')]);
const sort_order_menu = sort_orders.filter(so => so[0] !== sort_order).map(so => ({link: sortOrderToLink(so[0], topic, current_account_name), value: so[1]}));
const selected_sort_order = sort_orders.find(so => so[0] === sort_order);

Expand Down
2 changes: 1 addition & 1 deletion src/app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@
"power_down": "Power Down",
"amount": "Amount",
"already_power_down": "You are already powering down %(AMOUNT)s %(LIQUID_TICKER)s (%(WITHDRAWN)s %(LIQUID_TICKER)s paid out so far). Note that if you change the power down amount the payout schedule will reset.",
"delegating": "You are delegating %(AMOUNT)s %(LIQUID_TICKER)s. That amount is locked up and not available to power down until the delgation is removed and a full reward period has passed.",
"delegating": "You are delegating %(AMOUNT)s %(LIQUID_TICKER)s. That amount is locked up and not available to power down until the delegation is removed and a full reward period has passed.",
"per_week": "That's ~%(AMOUNT)s %(LIQUID_TICKER)s per week.",
"warning": "Leaving less than %(AMOUNT)s %(VESTING_TOKEN)s in your account is not recommended and can leave your account in a unusable state.",
"error": "Unable to power down (ERROR: %(MESSAGE)s)"
Expand Down
9 changes: 9 additions & 0 deletions src/app/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,15 @@
"redeem_rewards": "Redeem Rewards (Transfer to Balance)",
"buy_steem_or_steem_power": "Buy STEEM or STEEM POWER"
},
"powerdown_jsx": {
"power_down": "Power Down",
"amount": "Amount",
"already_power_down": "You are already powering down %(AMOUNT)s %(LIQUID_TICKER)s (%(WITHDRAWN)s %(LIQUID_TICKER)s paid out so far). Note that if you change the power down amount the payout schedule will reset.",
"delegating": "You are delegating %(AMOUNT)s %(LIQUID_TICKER)s. That amount is locked up and not available to power down until the delegation is removed and a full reward period has passed.",
"per_week": "That's ~%(AMOUNT)s %(LIQUID_TICKER)s per week.",
"warning": "Leaving less than %(AMOUNT)s %(LIQUID_TICKER)s in your account is not recommended and can leave your account in a unusable state.",
"error": "Unable to power down (ERROR: %(MESSAGE)s)"
},
"checkloginowner_jsx": {
"your_password_permissions_were_reduced": "Your password permissions were reduced",
"if_you_did_not_make_this_change": "If you did not make this change please",
Expand Down
Loading

0 comments on commit dbe4080

Please sign in to comment.