[Git][noosfero/noosfero][api] 10 commits: Highlight block fix

Rodrigo Souto rodrigo at colivre.coop.br
Mon Jul 20 20:17:04 BRT 2015


Will do.

Bráulio Bhavamitra escreveu isso ai:
> rodrigo, when you and the api team have some time, please take a look at
> the tests of the api branch, there are many more failures when compared to
> master.
> 
> https://travis-ci.org/noosfero/noosfero/builds
> 
> cheers,
> bráulio
> 
> On Mon, Jul 20, 2015 at 2:55 PM, Rodrigo Souto <gitlab at gitlab.com> wrote:
> 
> >  Rodrigo Souto pushed to branch api at Noosfero / noosfero
> > <https://gitlab.com/noosfero/noosfero> Commits:
> >
> >    - *26f01247
> >    <https://gitlab.com/noosfero/noosfero/commit/26f01247e119233f175ac5ad470ab183787417ca>*
> >    by Tallys Martins *at 2015-07-16T16:17:38Z*
> >
> >    Highlight block fix
> >
> >     - Hightlight block links no longer break when noosfero is under a subdir
> >
> >    Signed-off-by: Andre Bernardes <andrebsguedes at gmail.com>
> >    Signed-off-by: Tallys Martins <tallysmartins at yahoo.com.br>
> >
> >     - *84003a1c
> >    <https://gitlab.com/noosfero/noosfero/commit/84003a1cfb29f9b6c547e05d39bf1dafb3dec7ba>*
> >    by Antonio Terceiro *at 2015-07-16T16:18:08Z*
> >
> >    Merge branch 'softwarepublico/noosfero-highlight_block_fix'
> >
> >    Closes merge request !623
> >
> >     - *4812b285
> >    <https://gitlab.com/noosfero/noosfero/commit/4812b285453a2d3801d7da45793010233a33eda6>*
> >    by Gabriela Navarro *at 2015-07-16T13:24:24Z*
> >
> >    Fix JS behaviour to show categories when noosfero is in a subdir environment
> >
> >    Signed-off-by: Fabio Teixeira <fabio1079 at gmail.com>
> >    Signed-off-by: Gabriela Navarro <navarro1703 at gmail.com>
> >
> >     - *2238acd5
> >    <https://gitlab.com/noosfero/noosfero/commit/2238acd557747b831ab246c4a59cb8d2a8c61368>*
> >    by Antonio Terceiro *at 2015-07-16T19:19:22Z*
> >
> >    Merge branch 'fix_javascript_categories' into 'master'
> >
> >    Fix JS behaviour to show categories when noosfero is in a subdir environment
> >
> >    The admin page to edit or remove a category breaks when noosfero is a subdir app. We are using the method to get the Noosfero.root to add to the address
> >
> >    See merge request !624
> >
> >     - *3dc4f1e6
> >    <https://gitlab.com/noosfero/noosfero/commit/3dc4f1e6d73f6f30057b6548d3c5daa6305febb9>*
> >    by Joenio Costa *at 2015-07-17T23:15:28Z*
> >
> >    allow run the "quick-start" script from everywhere
> >
> >    change current directory to the noosfero's root at the beginning of
> >    the script execution
> >
> >     - *549bf1dc
> >    <https://gitlab.com/noosfero/noosfero/commit/549bf1dc1623087ddceb3b42a6dd12be71f5dcc6>*
> >    by Antonio Terceiro *at 2015-07-18T12:04:48Z*
> >
> >    Merge branch 'quick-start-out-of-noosfero-dir' into 'master'
> >
> >    allow run the "quick-start" script from everywhere
> >
> >    change current directory to the noosfero's root at the beginning of
> >    the script execution
> >
> >    See merge request !627
> >
> >     - *33eb3f78
> >    <https://gitlab.com/noosfero/noosfero/commit/33eb3f78dbb51d3111c556e1d5d4acee9720c429>*
> >    by Braulio Bhavamitra *at 2015-07-19T20:49:13Z*
> >
> >    travis: remove workaround and fix selenium concurrent run
> >
> >     - *1a1eab27
> >    <https://gitlab.com/noosfero/noosfero/commit/1a1eab27432e2839c9eb33b0cc1dd5a9ac047d42>*
> >    by Braulio Bhavamitra *at 2015-07-19T20:49:14Z*
> >
> >    sub_organizations: add missed timestamps (fix unit tests)
> >
> >     - *e833fc77
> >    <https://gitlab.com/noosfero/noosfero/commit/e833fc77060d5f80d0827677a472bb8949d40e9f>*
> >    by Leandro Nunes dos Santos *at 2015-07-20T14:11:23Z*
> >
> >    refactoring display_filter to filter all article of friends marked as show_to_followers
> >
> >     - *02d5269c
> >    <https://gitlab.com/noosfero/noosfero/commit/02d5269c396935cf2ed39aeb9efe34ae2a1aa23e>*
> >    by Rodrigo Souto *at 2015-07-20T14:48:59Z*
> >
> >    Merge branch 'master' into api
> >
> >
> > 12 changed files:
> >
> >    -  .travis.yml <#14eac9ae57aff85b_diff-0>
> >    -  app/models/article.rb <#14eac9ae57aff85b_diff-1>
> >    -  app/models/highlights_block.rb <#14eac9ae57aff85b_diff-2>
> >    -  plugins/event/lib/event_plugin/event_block.rb
> >    <#14eac9ae57aff85b_diff-3>
> >    -  + plugins/event/test/test_helper.rb  <#14eac9ae57aff85b_diff-4>
> >    -  plugins/event/test/unit/event_block_test.rb
> >    <#14eac9ae57aff85b_diff-5>
> >    -  plugins/event/test/unit/event_plugin_test.rb
> >    <#14eac9ae57aff85b_diff-6>
> >    -
> >    plugins/sub_organizations/db/migrate/20150508153119_add_timestamp_to_relation.rb
> >    <#14eac9ae57aff85b_diff-7>
> >    -  public/javascripts/manage-categories.js <#14eac9ae57aff85b_diff-8>
> >    -  script/quick-start <#14eac9ae57aff85b_diff-9>
> >    -  test/unit/article_test.rb <#14eac9ae57aff85b_diff-10>
> >    -  test/unit/highlights_block_test.rb <#14eac9ae57aff85b_diff-11>
> >
> > Changes:
> >  * .travis.yml *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-0>
> > ------------------------------
> >
> > --- a/.travis.yml+++ b/.travis.yml@@ -19,13 +19,6 @@ addons:       - libsqlite3-dev
> >        - libxslt1-dev
> >
> > -before_install:
> > -# FIXME: workaround while https://github.com/travis-ci/travis-ci/issues/4210 is open-  - rm config/initializers/default_icon_theme.rb-# selenium support-  - export DISPLAY=:99.0
> > -  - sh -e /etc/init.d/xvfb start-
> >  before_script:
> >    - mkdir -p tmp/pids log
> >    - bundle check || bundle install
> >
> >
> >   * app/models/article.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-1>
> > ------------------------------
> >
> > --- a/app/models/article.rb+++ b/app/models/article.rb@@ -506,9 +506,9 @@ class Article < ActiveRecord::Base     where(
> >        [
> >         "published = ? OR last_changed_by_id = ? OR profile_id = ? OR ?-        OR  (show_to_followers = ? AND ? AND profile_id = ?)", true, user.id, user.id,+        OR  (show_to_followers = ? AND ? AND profile_id IN (?))", true, user.id, user.id,         profile.nil? ?  false : user.has_permission?(:view_private_content, profile),-        true, user.follows?(profile), (profile.nil? ? nil : profile.id)+        true, (profile.nil? ? true : user.follows?(profile)),  ( profile.nil? ? (user.friends.select('profiles.id')) : [profile.id])       ]
> >      )
> >    }
> >
> >
> >   * app/models/highlights_block.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-2>
> > ------------------------------
> >
> > --- a/app/models/highlights_block.rb+++ b/app/models/highlights_block.rb@@ -12,6 +12,7 @@ class HighlightsBlock < Block     block.images.each do |i|
> >        i[:image_id] = i[:image_id].to_i
> >        i[:position] = i[:position].to_i+      i[:address] = Noosfero.root + i[:address]  unless Noosfero.root.nil?       begin
> >          file = UploadedFile.find(i[:image_id])
> >          i[:image_src] = file.public_filename
> >
> >
> >   * plugins/event/lib/event_plugin/event_block.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-3>
> > ------------------------------
> >
> > --- a/plugins/event/lib/event_plugin/event_block.rb+++ b/plugins/event/lib/event_plugin/event_block.rb@@ -26,8 +26,8 @@ class EventPlugin::EventBlock < Block   end
> >
> >    def events(user = nil)-    events = events_source.events
> > -    events = events.published.order('start_date')+    events = events_source.events.order('start_date')
> > +    events = user.nil? ? events.public : events.display_filter(user,nil)
> >      if future_only
> >        events = events.where('start_date >= ?', Date.today)
> >
> >
> >   * plugins/event/test/test_helper.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-4>
> > ------------------------------
> >
> > --- /dev/null+++ b/plugins/event/test/test_helper.rb@@ -0,0 +1 @@+require_relative '../../../test/test_helper'
> >
> >
> >   * plugins/event/test/unit/event_block_test.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-5>
> > ------------------------------
> >
> > --- a/plugins/event/test/unit/event_block_test.rb+++ b/plugins/event/test/unit/event_block_test.rb@@ -1,6 +1,6 @@-require File.dirname(__FILE__) + '/../../../../test/test_helper'+require_relative '../test_helper'
> > -class EventPlugin::EventBlockTest < ActiveSupport::TestCase+class EventBlockTest < ActiveSupport::TestCase
> >    def setup
> >      @env = Environment.default@@ -165,7 +165,7 @@ class EventPlugin::EventBlockTest < ActiveSupport::TestCase
> >    def visibility_content_test_from_a_profile(profile)
> >      @block.box.owner = @env-    ev = fast_create Event, :name => '2 de Julho', :profile_id => profile.id+    ev = Event.create!(:name => '2 de Julho', :profile => profile)     @block.all_env_events = true
> >
> >      # Do not list event from private profile for non logged visitor
> >
> >
> >   * plugins/event/test/unit/event_plugin_test.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-6>
> > ------------------------------
> >
> > --- a/plugins/event/test/unit/event_plugin_test.rb+++ b/plugins/event/test/unit/event_plugin_test.rb@@ -1,4 +1,4 @@-require File.dirname(__FILE__) + '/../../../../test/test_helper'+require_relative '../test_helper'
> >  class EventPluginTest < ActiveSupport::TestCase
> >
> >
> >
> >   *
> > plugins/sub_organizations/db/migrate/20150508153119_add_timestamp_to_relation.rb
> > *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-7>
> > ------------------------------
> >
> > --- a/plugins/sub_organizations/db/migrate/20150508153119_add_timestamp_to_relation.rb+++ b/plugins/sub_organizations/db/migrate/20150508153119_add_timestamp_to_relation.rb@@ -2,5 +2,7 @@ class AddTimestampToRelation < ActiveRecord::Migration   def change
> >      add_column :sub_organizations_plugin_relations, :created_at, :datetime
> >      add_column :sub_organizations_plugin_relations, :updated_at, :datetime+    add_column :sub_organizations_plugin_approve_paternity_relations, :created_at, :datetime
> > +    add_column :sub_organizations_plugin_approve_paternity_relations, :updated_at, :datetime   end
> >  end
> >
> >
> >   * public/javascripts/manage-categories.js *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-8>
> > ------------------------------
> >
> > --- a/public/javascripts/manage-categories.js+++ b/public/javascripts/manage-categories.js@@ -2,7 +2,7 @@   fetch_sub_items = function(sub_items, category){
> >      loading_for_button($("#category-loading-"+category)[0]);
> >      $.ajax({-      url: "/admin/categories/get_children",+      url: noosfero_root() + "/admin/categories/get_children",       dataType: "html",
> >        data: {id: category},
> >        success: function(data, st, ajax){
> >
> >
> >   * script/quick-start *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-9>
> > ------------------------------
> >
> > --- a/script/quick-start+++ b/script/quick-start@@ -61,6 +61,8 @@ setup_rubygems_path() {   fi
> >  }
> >  +# change current directory to the noosfero's root
> > +cd "$(dirname $0)/../"
> >  force_install=false
> >  if test "$1" = '--force-install'; then
> >
> >
> >   * test/unit/article_test.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-10>
> > ------------------------------
> >
> > --- a/test/unit/article_test.rb+++ b/test/unit/article_test.rb@@ -1971,6 +1971,19 @@ class ArticleTest < ActiveSupport::TestCase     assert_equal [a], Article.display_filter(user, p)
> >    end
> >  +  should 'display_filter show person private content to friends when no profile is passed as parameter' do
> > +    user = create_user('someuser').person
> > +    p = fast_create(Person)
> > +    user.add_friend(p)
> > +    user.stubs(:has_permission?).with(:view_private_content, p).returns(false)
> > +    Article.delete_all
> > +    a = fast_create(Article, :published => false, :show_to_followers => true, :profile_id => p.id)
> > +    fast_create(Article, :published => false, :show_to_followers => false, :profile_id => p.id)
> > +    fast_create(Article, :published => false, :show_to_followers => false, :profile_id => p.id)
> > +    assert_equal [a], Article.display_filter(user, nil)
> > +  end
> > +
> > +   should 'display_filter show community private content to members' do
> >      user = create_user('someuser').person
> >      p = fast_create(Community)
> >
> >
> >   * test/unit/highlights_block_test.rb *
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e#diff-11>
> > ------------------------------
> >
> > --- a/test/unit/highlights_block_test.rb+++ b/test/unit/highlights_block_test.rb@@ -119,6 +119,19 @@ class HighlightsBlockTest < ActiveSupport::TestCase     block.featured_images
> >    end
> >  +  should 'return correct sub-dir address' do
> > +    Noosfero.stubs(:root).returns("/social")
> > +    f1 = mock()
> > +    f1.expects(:public_filename).returns('address')
> > +    UploadedFile.expects(:find).with(1).returns(f1)
> > +    block = HighlightsBlock.new
> > +    i1 = {:image_id => 1, :address => '/address', :position => 3, :title => 'address'}
> > +    block.images = [i1]
> > +    block.save!
> > +    block.reload
> > +    assert_equal block.images.first[:address], "/social/address"
> > +  end
> > +   [Environment, Profile].each do |klass|
> >      should "choose between owner galleries when owner is #{klass.name}" do
> >        owner = fast_create(klass)
> >
> >
> >   —
> > View it on GitLab
> > <https://gitlab.com/noosfero/noosfero/compare/95efd89f36ff0a5c14ebe94232cac43e871ae835...02d5269c396935cf2ed39aeb9efe34ae2a1aa23e>
> >
> > _______________________________________________
> > Noosfero-dev mailing list
> > Noosfero-dev at listas.softwarelivre.org
> > http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/noosfero-dev
> >
> >
> 
> 
> -- 
> "Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
> ideologia. Morra por sua ideologia" P.R. Sarkar
> 
> EITA - Educação, Informação e Tecnologias para Autogestão
> http://cirandas.net/brauliobo
> http://eita.org.br
> 
> "Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é meu
> lar e todos nós somos cidadãos deste cosmo. Este universo é a imaginação da
> Mente Macrocósmica, e todas as entidades estão sendo criadas, preservadas e
> destruídas nas fases de extroversão e introversão do fluxo imaginativo
> cósmico. No âmbito pessoal, quando uma pessoa imagina algo em sua mente,
> naquele momento, essa pessoa é a única proprietária daquilo que ela
> imagina, e ninguém mais. Quando um ser humano criado mentalmente caminha
> por um milharal também imaginado, a pessoa imaginada não é a propriedade
> desse milharal, pois ele pertence ao indivíduo que o está imaginando. Este
> universo foi criado na imaginação de Brahma, a Entidade Suprema, por isso
> a propriedade deste universo é de Brahma, e não dos microcosmos que também
> foram criados pela imaginação de Brahma. Nenhuma propriedade deste mundo,
> mutável ou imutável, pertence a um indivíduo em particular; tudo é o
> patrimônio comum de todos."
> Restante do texto em
> http://cirandas.net/brauliobo/blog/a-problematica-de-hoje-em-dia

> _______________________________________________
> Noosfero-dev mailing list
> Noosfero-dev at listas.softwarelivre.org
> http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/noosfero-dev


-- 
Rodrigo Souto <rodrigo at colivre.coop.br> :: 55 71 8131-7714
Colivre - Cooperativa de Tecnologias Livres
http://www.colivre.coop.br/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150720/0c897b42/attachment.pgp>


More information about the Noosfero-dev mailing list