From 5d11dcdc8468ed09026c940565f705be832cb19d Mon Sep 17 00:00:00 2001 From: omnikrll Date: Tue, 23 Aug 2016 23:38:58 -0400 Subject: [PATCH 1/4] add key property to lint message elements --- client/modules/IDE/components/EditorAccessibility.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/modules/IDE/components/EditorAccessibility.js b/client/modules/IDE/components/EditorAccessibility.js index b2e0cbe3..24c0ef95 100644 --- a/client/modules/IDE/components/EditorAccessibility.js +++ b/client/modules/IDE/components/EditorAccessibility.js @@ -9,7 +9,7 @@ class EditorAccessibility extends React.Component { if (this.props.lintMessages.length > 0) { for (let i = 0; i < this.props.lintMessages.length; i++) { messages.push( -
  • +
  • {this.props.lintMessages[i].severity} in line {this.props.lintMessages[i].line} : {this.props.lintMessages[i].message} @@ -18,7 +18,12 @@ class EditorAccessibility extends React.Component { } } else { messages.push( -

    There are no lint messages

    + // react wants dom items from an array or + // iterator to have a key property. since this + // is the only item we're pushing to the array + // and don't have a counter to include, + // let's just call it 0. +

    There are no lint messages

    ); } return ( From 9457d2e57c9409f168ff0b072dff9812abc0c3a5 Mon Sep 17 00:00:00 2001 From: omnikrll Date: Wed, 24 Aug 2016 17:54:26 -0400 Subject: [PATCH 2/4] replace for loop with forEach --- .../IDE/components/EditorAccessibility.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/client/modules/IDE/components/EditorAccessibility.js b/client/modules/IDE/components/EditorAccessibility.js index 24c0ef95..f00cebc0 100644 --- a/client/modules/IDE/components/EditorAccessibility.js +++ b/client/modules/IDE/components/EditorAccessibility.js @@ -7,22 +7,18 @@ class EditorAccessibility extends React.Component { render() { let messages = []; if (this.props.lintMessages.length > 0) { - for (let i = 0; i < this.props.lintMessages.length; i++) { + this.props.lintMessages.forEach((lintMessage, i) => { messages.push(
  • - {this.props.lintMessages[i].severity} in line - {this.props.lintMessages[i].line} : - {this.props.lintMessages[i].message} + {lintMessage.severity} in line + {lintMessage.line} : + {lintMessage.message}
  • ); - } + }); } else { messages.push( - // react wants dom items from an array or - // iterator to have a key property. since this - // is the only item we're pushing to the array - // and don't have a counter to include, - // let's just call it 0. + // no array index so let's just call it 0

    There are no lint messages

    ); } From 8a61917937fdebf2e56c19e7db4192c8a92c632f Mon Sep 17 00:00:00 2001 From: omnikrll Date: Thu, 25 Aug 2016 13:45:35 -0400 Subject: [PATCH 3/4] make 'no lint errors' p ino li --- client/modules/IDE/components/EditorAccessibility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/modules/IDE/components/EditorAccessibility.js b/client/modules/IDE/components/EditorAccessibility.js index f00cebc0..13c26753 100644 --- a/client/modules/IDE/components/EditorAccessibility.js +++ b/client/modules/IDE/components/EditorAccessibility.js @@ -19,7 +19,7 @@ class EditorAccessibility extends React.Component { } else { messages.push( // no array index so let's just call it 0 -

    There are no lint messages

    +
  • There are no lint messages
  • ); } return ( From 399e29f37b8a4e8b809b986b1e8be1409be2d61c Mon Sep 17 00:00:00 2001 From: omnikrll Date: Thu, 25 Aug 2016 13:48:52 -0400 Subject: [PATCH 4/4] remove comment --- client/modules/IDE/components/EditorAccessibility.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/modules/IDE/components/EditorAccessibility.js b/client/modules/IDE/components/EditorAccessibility.js index a39c535d..dbab82ad 100644 --- a/client/modules/IDE/components/EditorAccessibility.js +++ b/client/modules/IDE/components/EditorAccessibility.js @@ -18,7 +18,6 @@ class EditorAccessibility extends React.Component { }); } else { messages.push( - // no array index so let's just call it 0
  • There are no lint messages
  • ); }