Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to ImageLayers from Image mgmt pagina. #516

Merged
merged 1 commit into from
Apr 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/assets/images/icon_image_layers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 17 additions & 2 deletions app/assets/stylesheets/panamax/images.css.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'ctl_base_ui/colors';
@import 'ctl_base_ui/icons';
@import 'ctl_base_ui/mixins';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings


#images_flow {
h1 {
Expand Down Expand Up @@ -69,10 +70,24 @@ ul.images li {
border-bottom: $light_grey 1px solid;
overflow: auto;
padding-bottom: 22px;
padding-top: 22px;

.image-layers-link {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector should have depth of applicability no greater than 2, but was 3

background: image-url('icon_image_layers.svg') -10px -17px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule sets should be ordered as follows: @extends, @includes without @content, properties, @includes with @content, nested rule sets
Prefer double-quoted strings

background-size: 40px 40px;
float: left;
width: 20px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered background, background-size, float, height, width

height: 20px;
@include hide-text;

&:hover {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector should have depth of applicability no greater than 2, but was 3

background-position: -10px 3px;
}
}

h3 {
margin: 0;
padding: 22px 0 0 0;
margin: 0 0 0 25px;
padding: 0;
}

h6 {
Expand Down
5 changes: 5 additions & 0 deletions app/models/local_image.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
class LocalImage < BaseImage
PANAMAX_IMAGE_NAMES = ['centurylink/panamax-ui:latest', 'centurylink/panamax-api:latest']
IMAGE_LAYERS_BASE_URL = 'https://ImageLayers.io'

def panamax_image?
PANAMAX_IMAGE_NAMES.include?(name)
end

def image_layers_url
IMAGE_LAYERS_BASE_URL + "?images=#{name}"
end

def local?
true
end
Expand Down
4 changes: 3 additions & 1 deletion app/views/images/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
%ul.images
- @images.each do |image|
%li
%h3= image.tags.first
- il_message = "Inspect #{image.name} with ImageLayers.io"
= link_to il_message, image.image_layers_url, { class: 'image-layers-link', title: il_message, target: '_blank' }
%h3= image.name
%h6= image.tags[1..-1].try(:join, ', ')
%dl
%dt
Expand Down
6 changes: 6 additions & 0 deletions spec/features/manage_images_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@

expect(page).to have_content 'socialize_api:latest'
end

it 'can visit the image layers page for an image' do
visit '/images'

expect(page).to have_link 'Inspect socialize_api:latest with ImageLayers.io', href: 'https://ImageLayers.io?images=socialize_api:latest'
end
end
end
6 changes: 6 additions & 0 deletions spec/models/local_image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
end
end

describe '#image_layers_url' do
it 'concatenates the image layers URL with the image name' do
expect(subject.image_layers_url).to eq 'https://ImageLayers.io?images=blah/not-panamax'
end
end

describe '#docker_index_url' do
it 'is nil' do
expect(subject.docker_index_url).to be_nil
Expand Down