Commit 8c1a9b4ceac1b4a84a5cd8b5878f5d68e1e03839
Committed by
Paulo Meireles
1 parent
333ddfad
Exists in
master
and in
23 other branches
Saving a new metric configuration
Showing
6 changed files
with
23 additions
and
5 deletions
Show diff stats
plugins/mezuro/lib/kalibro/client/configuration_client.rb
| ... | ... | @@ -8,6 +8,10 @@ class Kalibro::Client::ConfigurationClient |
| 8 | 8 | @port.request(:save_configuration, {:configuration => configuration.to_hash}) |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | + def self.save(configuration) | |
| 12 | + new.save(configuration) | |
| 13 | + end | |
| 14 | + | |
| 11 | 15 | def configuration_names |
| 12 | 16 | @port.request(:get_configuration_names)[:configuration_name].to_a |
| 13 | 17 | end |
| ... | ... | @@ -21,4 +25,4 @@ class Kalibro::Client::ConfigurationClient |
| 21 | 25 | @port.request(:remove_configuration, {:configuration_name => configuration_name}) |
| 22 | 26 | end |
| 23 | 27 | |
| 24 | -end | |
| 25 | 28 | \ No newline at end of file |
| 29 | +end | ... | ... |
plugins/mezuro/lib/kalibro/client/port.rb
| ... | ... | @@ -11,7 +11,7 @@ class Kalibro::Client::Port |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | 13 | def service_address |
| 14 | - @service_address ||= 'http://localhost:8080/KalibroService/' | |
| 14 | + @service_address ||= 'http://valinhos.ime.usp.br:50688/KalibroService/' | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | def request(action, request_body = nil) | ... | ... |
plugins/mezuro/lib/kalibro/entities/configuration.rb
plugins/mezuro/lib/mezuro_plugin.rb
| ... | ... | @@ -9,8 +9,8 @@ class MezuroPlugin < Noosfero::Plugin |
| 9 | 9 | end |
| 10 | 10 | |
| 11 | 11 | def content_types |
| 12 | - [MezuroPlugin::ProjectContent, | |
| 13 | - MezuroPlugin::KalibroConfiguration] | |
| 12 | + # [MezuroPlugin::ProjectContent, | |
| 13 | + MezuroPlugin::KalibroConfiguration #] | |
| 14 | 14 | end |
| 15 | 15 | |
| 16 | 16 | def stylesheet? | ... | ... |
plugins/mezuro/lib/mezuro_plugin/kalibro_configuration.rb
| ... | ... | @@ -38,6 +38,7 @@ class MezuroPlugin::KalibroConfiguration < Article |
| 38 | 38 | configuration = Kalibro::Entities::Configuration.new |
| 39 | 39 | configuration.name = title |
| 40 | 40 | configuration.description = description |
| 41 | + configuration.metric_configuration = 0 | |
| 41 | 42 | configuration |
| 42 | 43 | end |
| 43 | 44 | ... | ... |
plugins/mezuro/views/cms/mezuro_plugin/_kalibro_configuration.html.erb
| ... | ... | @@ -18,3 +18,16 @@ |
| 18 | 18 | <%= required f.text_field(:name) %> |
| 19 | 19 | |
| 20 | 20 | <%= f.text_field :description %><br/> |
| 21 | + | |
| 22 | +<% @repository_types = Kalibro::Client::KalibroClient.new.supported_repository_types.sort %> | |
| 23 | +<% @selected = (@project.nil? ? @repository_types : @project.repository.type) %> | |
| 24 | +<%= required labelled_form_field _('Repository type'), | |
| 25 | + f.select(:repository_type, @repository_types, {:selected => @selected}) %><br/> | |
| 26 | + | |
| 27 | +<%= required f.text_field(:repository_url) %><br/> | |
| 28 | + | |
| 29 | +<% @configuration_names = Kalibro::Client::ConfigurationClient.new.configuration_names.sort %> | |
| 30 | +<% @selected = (@project.nil? ? @configuration_names[0] : @project.configuration_name) %> | |
| 31 | +<%= required labelled_form_field _('Configuration'), | |
| 32 | + f.select(:configuration_name, @configuration_names.sort, {:selected => @selected}) %><br/> | |
| 33 | + | ... | ... |