From d9aa828dd00260a70392169e62a0953caa642752 Mon Sep 17 00:00:00 2001 From: Allen Servedio Date: Sun, 15 Mar 2015 00:48:47 -0400 Subject: [PATCH 1/2] Altering the repo name to be a link that takes you to the Docker Hub page for it. Tried to follow styling for other link on card. --- src/ImageCard.react.js | 14 ++++++++++++-- styles/new-container.less | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ImageCard.react.js b/src/ImageCard.react.js index b132aec25f..7739d11963 100644 --- a/src/ImageCard.react.js +++ b/src/ImageCard.react.js @@ -5,6 +5,7 @@ var ContainerStore = require('./ContainerStore'); var metrics = require('./Metrics'); var OverlayTrigger = require('react-bootstrap').OverlayTrigger; var Tooltip = require('react-bootstrap').Tooltip; +var util = require('./Util'); var ImageCard = React.createClass({ getInitialState: function () { @@ -40,6 +41,15 @@ var ImageCard = React.createClass({ var $tagOverlay = $(this.getDOMNode()).find('.tag-overlay'); $tagOverlay.fadeOut(300); }, + handleRepoClick: function () { + var $repoUri = 'https://registry.hub.docker.com/' + if (this.props.image.is_official) { + $repoUri = $repoUri + "_/" + } else { + $repoUri = $repoUri + "u/" + } + util.exec(['open', $repoUri + this.props.image.name]); + }, render: function () { var self = this; var name; @@ -58,7 +68,7 @@ var ImageCard = React.createClass({
{namespace}
{this.props.image.name}}> - {repo} + {repo}
); @@ -67,7 +77,7 @@ var ImageCard = React.createClass({
{namespace}
{this.props.image.name}}> - {repo} + {repo}
); diff --git a/styles/new-container.less b/styles/new-container.less index 0a201ae8f3..1956f38295 100644 --- a/styles/new-container.less +++ b/styles/new-container.less @@ -186,6 +186,12 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + text-decoration: underline; + &:hover { + background-color: @brand-action; + color: white; + border-radius: 20px; + } } } .description { From 1b8e25501cb6f5a46f2d1c8b55b32f55fe08eeec Mon Sep 17 00:00:00 2001 From: Allen Servedio Date: Sat, 28 Mar 2015 21:34:22 -0400 Subject: [PATCH 2/2] Changes made in response to code review. --- src/ImageCard.react.js | 8 ++++---- styles/new-container.less | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ImageCard.react.js b/src/ImageCard.react.js index 7739d11963..29a09efebf 100644 --- a/src/ImageCard.react.js +++ b/src/ImageCard.react.js @@ -42,11 +42,11 @@ var ImageCard = React.createClass({ $tagOverlay.fadeOut(300); }, handleRepoClick: function () { - var $repoUri = 'https://registry.hub.docker.com/' + var $repoUri = 'https://registry.hub.docker.com/'; if (this.props.image.is_official) { - $repoUri = $repoUri + "_/" + $repoUri = $repoUri + "_/"; } else { - $repoUri = $repoUri + "u/" + $repoUri = $repoUri + "u/"; } util.exec(['open', $repoUri + this.props.image.name]); }, @@ -67,7 +67,7 @@ var ImageCard = React.createClass({ name = (
{namespace}
- {this.props.image.name}}> + View on DockerHub}> {repo}
diff --git a/styles/new-container.less b/styles/new-container.less index 1956f38295..a00f9c3eb3 100644 --- a/styles/new-container.less +++ b/styles/new-container.less @@ -187,11 +187,6 @@ text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; - &:hover { - background-color: @brand-action; - color: white; - border-radius: 20px; - } } } .description {