Merge branch 'next-minor' into develop
This commit is contained in:
commit
38d92cc84b
5 changed files with 9 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -50,6 +50,7 @@ public/source.tar*
|
|||
tmp/
|
||||
|
||||
# Temporary files of every sort
|
||||
.byebug_history
|
||||
.sass-cache/
|
||||
.DS_Store
|
||||
.idea
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
## Refactor
|
||||
|
||||
## Bug fixes
|
||||
* Prefill conversation form on contacts page only with mutual contacts [#7744](https://github.com/diaspora/diaspora/pull/7744)
|
||||
|
||||
## Features
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ app.pages.Contacts = Backbone.View.extend({
|
|||
showMessageModal: function(){
|
||||
$("#conversationModal").on("modal:loaded", function() {
|
||||
var people = _.pluck(app.contacts.filter(function(contact) {
|
||||
return contact.inAspect(app.aspect.get("id"));
|
||||
return contact.person.get("relationship") === "mutual" && contact.inAspect(app.aspect.get("id"));
|
||||
}), "person");
|
||||
new app.views.ConversationsForm({prefill: people});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ describe ContactsController, :type => :controller do
|
|||
end
|
||||
|
||||
it "generates the aspects_manage_contacts_json fixture", fixture: true do
|
||||
# adds one not mutual contact
|
||||
bob.share_with(FactoryGirl.create(:person), @aspect)
|
||||
|
||||
get :index, params: {a_id: @aspect.id, page: "1"}, format: :json
|
||||
save_fixture(response.body, "aspects_manage_contacts_json")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -297,7 +297,9 @@ describe("app.pages.Contacts", function(){
|
|||
expect(app.views.ConversationsForm.prototype.initialize).toHaveBeenCalled();
|
||||
|
||||
var prefill = app.views.ConversationsForm.prototype.initialize.calls.mostRecent().args[0].prefill;
|
||||
var contacts = app.contacts.filter(function(contact) { return contact.inAspect(app.aspect.get("id")); });
|
||||
var contacts = app.contacts.filter(function(contact) {
|
||||
return contact.person.get("relationship") === "mutual" && contact.inAspect(app.aspect.get("id"));
|
||||
});
|
||||
expect(_.pluck(prefill, "id")).toEqual(contacts.map(function(contact) { return contact.person.id; }));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue