diff --git a/Changelog.md b/Changelog.md index d5ffa1c36..990ec6996 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,6 +10,7 @@ * Force Typhoeus/cURL to use the CA bundle we query via the config. Also add a setting for extra verbose output. * Validate input on sending invitations, validate email format, send correct ones. [#3748](https://github.com/diaspora/diaspora/pull/3748), [#3271](https://github.com/diaspora/diaspora/issues/3271) +* moved Aspects JS initializer to the correct place so aspect selection / deselection works again [#3737] (https://github.com/diaspora/diaspora/pull/3737) # 0.0.2.0 diff --git a/app/assets/javascripts/pages/aspects-index.js b/app/assets/javascripts/pages/streams-aspects.js similarity index 80% rename from app/assets/javascripts/pages/aspects-index.js rename to app/assets/javascripts/pages/streams-aspects.js index c25257759..6b85b63a2 100644 --- a/app/assets/javascripts/pages/aspects-index.js +++ b/app/assets/javascripts/pages/streams-aspects.js @@ -1,4 +1,4 @@ -Diaspora.Pages.AspectsIndex = function() { +Diaspora.Pages.StreamsAspects = function() { var self = this; this.subscribe("page/ready", function(evt, document) { diff --git a/app/assets/javascripts/widgets/aspect-navigation.js b/app/assets/javascripts/widgets/aspect-navigation.js index e04170c5d..a6e9d095a 100644 --- a/app/assets/javascripts/widgets/aspect-navigation.js +++ b/app/assets/javascripts/widgets/aspect-navigation.js @@ -43,6 +43,12 @@ this.perform = function() { if (self.noneSelected()) { + // clear the posts + app.page.collection.reset(); + app.page.render(); + + // toggle the button + this.calculateToggleText(); return; } else { window.location = self.generateURL(); // hella hax diff --git a/features/aspect_navigation.feature b/features/aspect_navigation.feature index 9611d7ba8..056eea243 100644 --- a/features/aspect_navigation.feature +++ b/features/aspect_navigation.feature @@ -7,11 +7,13 @@ Feature: Aspect navigation on the left menu Background: Given a user with username "bob" And I sign in as "bob@bob.bob" + And I have an aspect called "Others" Scenario: All aspects are selected by default When I go to the aspects page Then I should see "Besties" aspect selected Then I should see "Unicorns" aspect selected + Then I should see "Others" aspect selected Scenario: Aspects selection is remembered through site navigation When I go to the aspects page @@ -20,3 +22,12 @@ Feature: Aspect navigation on the left menu And I go to the aspects page Then I should see "Besties" aspect selected Then I should see "Unicorns" aspect unselected + Then I should see "Others" aspect unselected + + Scenario: Aspects selection can include one or more aspects + When I go to the aspects page + And I select only "Besties" aspect + And I select "Unicorns" aspect as well + Then I should see "Besties" aspect selected + Then I should see "Unicorns" aspect selected + Then I should see "Others" aspect unselected diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index 58770a555..b20f24edb 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -26,6 +26,14 @@ When /^I select only "([^"]*)" aspect$/ do |aspect_name| step %{I wait for the ajax to finish} end +When /^I select "([^"]*)" aspect as well$/ do |aspect_name| + within('#aspect_nav') do + click_link aspect_name + end + + step %{I wait for the ajax to finish} +end + When /^I should see "([^"]*)" aspect selected$/ do |aspect_name| aspect = @me.aspects.where(:name => aspect_name).first within("#aspect_nav") do