Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1478 from abhgupta/abhgupta-dev
Browse files Browse the repository at this point in the history
Fix for bug 916268 - re-adding properties for embedded carts
  • Loading branch information
danmcp committed Feb 27, 2013
2 parents 9a6ccae + f9ca877 commit 389e81d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
18 changes: 16 additions & 2 deletions controller/app/rest_models/rest_application.rb
Expand Up @@ -82,7 +82,7 @@ def initialize(app, domain, url, nolinks=false, applications=nil)
if cart.categories.include? "web_framework"
self.framework = cart.name
else
self.embedded[cart.name] = {info: {}}
self.embedded[cart.name] = {info: ""}
end
end

Expand Down Expand Up @@ -111,10 +111,24 @@ def initialize(app, domain, url, nolinks=false, applications=nil)

app.component_instances.each do |component_instance|
cart = CartridgeCache::find_cartridge(component_instance.cartridge_name)

# add the builder properties if this is a builder component
if cart.categories.include?("ci_builder")
self.building_with = cart.name
self.build_job_url = component_instance.component_properties["job_url"]
break

# adding the job_url and "info" property for backward compatibility
self.embedded[cart.name] = component_instance.component_properties
self.embedded[cart.name]["info"] = "Job URL: #{component_instance.component_properties['job_url']}"
else
unless cart.categories.include? "web_framework"
self.embedded[cart.name] = component_instance.component_properties

# if the component has a connection_url property, add it as "info" for backward compatibility
if component_instance.component_properties.has_key?("connection_url")
self.embedded[cart.name]["info"] = "Connection URL: #{component_instance.component_properties['connection_url']}"
end
end
end
end

Expand Down
17 changes: 15 additions & 2 deletions controller/app/rest_models/rest_application10.rb
Expand Up @@ -84,7 +84,7 @@ def initialize(app, domain, url, nolinks=false, applications=nil)
if cart.categories.include? "web_framework"
self.framework = cart.name
else
self.embedded[cart.name] = {info: {}}
self.embedded[cart.name] = {info: ""}
end
end

Expand Down Expand Up @@ -118,10 +118,23 @@ def initialize(app, domain, url, nolinks=false, applications=nil)

app.component_instances.each do |component_instance|
cart = CartridgeCache::find_cartridge(component_instance.cartridge_name)
# add the builder properties if this is a builder component
if cart.categories.include?("ci_builder")
self.building_with = cart.name
self.build_job_url = component_instance.component_properties["job_url"]
break

# adding the job_url and "info" property for backward compatibility
self.embedded[cart.name] = component_instance.component_properties
self.embedded[cart.name]["info"] = "Job URL: #{component_instance.component_properties['job_url']}"
else
unless cart.categories.include? "web_framework"
self.embedded[cart.name] = component_instance.component_properties

# if the component has a connection_url property, add it as "info" for backward compatibility
if component_instance.component_properties.has_key?("connection_url")
self.embedded[cart.name]["info"] = "Connection URL: #{component_instance.component_properties['connection_url']}"
end
end
end
end

Expand Down
17 changes: 15 additions & 2 deletions controller/app/rest_models/rest_application13.rb
Expand Up @@ -9,7 +9,7 @@ def initialize(app, domain, url, nolinks=false, applications=nil)
if cart.categories.include? "web_framework"
self.framework = cart.name
else
self.embedded[cart.name] = {info: {}}
self.embedded[cart.name] = {info: ""}
end
end

Expand Down Expand Up @@ -38,10 +38,23 @@ def initialize(app, domain, url, nolinks=false, applications=nil)

app.component_instances.each do |component_instance|
cart = CartridgeCache::find_cartridge(component_instance.cartridge_name)
# add the builder properties if this is a builder component
if cart.categories.include?("ci_builder")
self.building_with = cart.name
self.build_job_url = component_instance.component_properties["job_url"]
break

# adding the job_url and "info" property for backward compatibility
self.embedded[cart.name] = component_instance.component_properties
self.embedded[cart.name]["info"] = "Job URL: #{component_instance.component_properties['job_url']}"
else
unless cart.categories.include? "web_framework"
self.embedded[cart.name] = component_instance.component_properties

# if the component has a connection_url property, add it as "info" for backward compatibility
if component_instance.component_properties.has_key?("connection_url")
self.embedded[cart.name]["info"] = "Connection URL: #{component_instance.component_properties['connection_url']}"
end
end
end
end

Expand Down

0 comments on commit 389e81d

Please sign in to comment.