From 852bcfcbfbb1cd204e4033bb79ab04e4b74dad7b Mon Sep 17 00:00:00 2001 From: French Ben Date: Mon, 13 Jun 2016 14:19:25 -0700 Subject: [PATCH] made all self this Signed-off-by: French Ben --- src/components/ImageCard.react.js | 38 +++++++++++++--------- src/components/NewContainerSearch.react.js | 11 +++---- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/components/ImageCard.react.js b/src/components/ImageCard.react.js index 0115f7671c..0d3a056d68 100644 --- a/src/components/ImageCard.react.js +++ b/src/components/ImageCard.react.js @@ -99,7 +99,6 @@ var ImageCard = React.createClass({ shell.openExternal(repoUri); }, render: function () { - var self = this; var name; if (this.props.image.namespace === 'library') { name = ( @@ -134,17 +133,26 @@ var ImageCard = React.createClass({ imgsrc = 'https://kitematic.com/recommended/kitematic_html.png'; } var tags; - if (self.state.loading) { + if (this.state.loading) { tags = ; - } else if (self.state.tags.length === 0) { + } else if (this.state.tags.length === 0) { tags =
No Tags
; } else { - var tagDisplay = self.state.tags.map(function (tag) { - let t = tag.name; - if (t === self.state.chosenTag) { - return
{t}
; + var tagDisplay = this.state.tags.map((tag) => { + let t = ''; + if (tag.name) { + t = tag.name; } else { - return
{t}
; + t = tag; + } + let key = t; + if (typeof key === 'undefined') { + key = this.props.image.name; + } + if (t === this.state.chosenTag) { + return
{t}
; + } else { + return
{t}
; } }); tags = ( @@ -172,10 +180,10 @@ var ImageCard = React.createClass({ {this.state.chosenTag} -
+
-
+
CREATE
@@ -190,7 +198,7 @@ var ImageCard = React.createClass({
{this.props.image.inUse ?

To delete, remove all containers
using the above image

: null }
- +
); @@ -205,10 +213,10 @@ var ImageCard = React.createClass({ {pullCount} -
+
-
+
CREATE
@@ -223,7 +231,7 @@ var ImageCard = React.createClass({ VIEW ON DOCKER HUB
- +
); @@ -234,7 +242,7 @@ var ImageCard = React.createClass({

Please select an image tag.

{tags} -
+
diff --git a/src/components/NewContainerSearch.react.js b/src/components/NewContainerSearch.react.js index fac25935b4..83272a2182 100644 --- a/src/components/NewContainerSearch.react.js +++ b/src/components/NewContainerSearch.react.js @@ -250,10 +250,12 @@ module.exports = React.createClass({ let tags = image.tags.join('-'); image.star_count = 0; image.is_local = true; - console.log('Img: %o', image); const key = `local-${image.name}-${index}`; - console.log('User img key: %o', key); - return (); + let imageCard = null; + if (image.name !== '') { + imageCard = (); + } + return imageCard; }); let userImageResults = userImageItems.length ? (
@@ -282,12 +284,10 @@ module.exports = React.createClass({ } else if (repos.length) { let recommendedItems = repos.filter(repo => repo.is_recommended).map((image, index) => { const key = `rec-${image.name}-${index}`; - console.log('Rec img key: %o', key); return (); }); let otherItems = repos.filter(repo => !repo.is_recommended && !repo.is_user_repo).map((image, index) => { const key = `other-${image.name}-${index}`; - console.log('Other img key: %o', key); return (); }); @@ -302,7 +302,6 @@ module.exports = React.createClass({ let userRepoItems = repos.filter(repo => repo.is_user_repo).map((image, index) => { const key = `usr-${image.name}-${index}`; - console.log('User img key: %o', key); return (); }); let userRepoResults = userRepoItems.length ? (