From 4a769da9676b052609143ec4df306dbde7fee45d Mon Sep 17 00:00:00 2001 From: knod Date: Sat, 24 Nov 2018 13:24:16 -0500 Subject: [PATCH 1/3] Code style cleaning in '/src/components/dev' --- src/components/dev/DevHud.js | 7 +- src/components/dev/LocalizationReport.js | 152 +++++++++++++---------- 2 files changed, 93 insertions(+), 66 deletions(-) diff --git a/src/components/dev/DevHud.js b/src/components/dev/DevHud.js index 089b4def..039a7e90 100644 --- a/src/components/dev/DevHud.js +++ b/src/components/dev/DevHud.js @@ -40,7 +40,7 @@ const DevMenu = function ({ devProps, funcs, data, state }) { } - open={ this.state.modalOpen } - onClose={ this.toggleModalOpen } + trigger = { } + open = { this.state.modalOpen } + onClose = { this.toggleModalOpen } closeIcon> - - Localization Report - + + Localization Report +

This report indicates whether keys in the 'en' localization file are present in - your chosen localization. It will also list any keys in your chosen localization + your chosen localization. It will also list any keys in your chosen localization which should be removed. indicates a check passed. + name = { `check square` } + size = { `large` } + color = { `green` } />indicates a check passed. indicates a check failed and action is needed. + name = { `window close` } + size = { `large` } + color = { `red` } />indicates a check failed and action is needed.

@@ -252,7 +272,7 @@ class LocalizationReport extends Component { @@ -261,4 +281,8 @@ class LocalizationReport extends Component { } }; -export { LocalizationReport }; +export { + LocalizationReport, + ReportItem, + ReportList, +}; From 6d9b0423efccc5fb2d89af6eb3f5ed925ae8e241 Mon Sep 17 00:00:00 2001 From: knod Date: Sat, 24 Nov 2018 13:32:59 -0500 Subject: [PATCH 2/3] Adds to existing comment --- src/components/dev/LocalizationReport.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/dev/LocalizationReport.js b/src/components/dev/LocalizationReport.js index fd7fd076..7df8ca57 100644 --- a/src/components/dev/LocalizationReport.js +++ b/src/components/dev/LocalizationReport.js @@ -76,6 +76,8 @@ class LocalizationReport extends Component { // @todo Why not do this at the top before this // component is even created? Then there wouldn't // have to be a check for null in the comparison function. + // Or do it when constructing the component. I don't think + // there's anything that would preclude that in here. componentDidMount() { // Get the list of non-EN localizations for testing let localizationKeys = Object.keys(localizations); From f4e27a01ef11695d3c1e0e345f28de1dabe0203d Mon Sep 17 00:00:00 2001 From: knod Date: Sat, 24 Nov 2018 21:19:58 -0500 Subject: [PATCH 3/3] Simplifies logic --- src/components/dev/LocalizationReport.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/dev/LocalizationReport.js b/src/components/dev/LocalizationReport.js index 7df8ca57..becf7dba 100644 --- a/src/components/dev/LocalizationReport.js +++ b/src/components/dev/LocalizationReport.js @@ -110,11 +110,7 @@ class LocalizationReport extends Component { return results; } - let pass = true; - if (filter !== `true`) { - pass = false; - } - + let pass = filter === `true`; return results.filter((result) => { return result.pass === pass; });