From 7f0ffb8b0a5d9245af673ae99f3e367bf523614c Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 22 Aug 2016 23:10:10 +0200 Subject: [PATCH 1/3] Fix invitation link on people search page --- app/assets/javascripts/app/router.js | 15 +++++++++------ config/locales/diaspora/en.yml | 2 +- features/desktop/invitations.feature | 11 +++++++++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index d7bb3042c..160123505 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -18,7 +18,7 @@ app.Router = Backbone.Router.extend({ "mentions(/)": "stream", "notifications(/)": "notifications", "p/:id(/)": "singlePost", - "people(/)": "pageWithAspectMembershipDropdowns", + "people(/)": "peopleSearch", "people/:id(/)": "profile", "people/:id/contacts(/)": "profile", "people/:id/photos(/)": "photos", @@ -137,6 +137,14 @@ app.Router = Backbone.Router.extend({ new app.views.Notifications({el: "#notifications_container"}); }, + peopleSearch: function() { + this._loadContacts(); + this.renderAspectMembershipDropdowns($(document)); + $(".invitations-link").click(function() { + app.helpers.showModal("#invitationsModal"); + }); + }, + photos: function(guid) { this._loadContacts(); this.renderPage(function() { @@ -214,11 +222,6 @@ app.Router = Backbone.Router.extend({ app.contacts = new app.collections.Contacts(app.parsePreload("contacts")); }, - pageWithAspectMembershipDropdowns: function() { - this._loadContacts(); - this.renderAspectMembershipDropdowns($(document)); - }, - renderAspectMembershipDropdowns: function($context) { $context.find(".aspect_membership_dropdown.placeholder").each(function() { var personId = $(this).data("personId"); diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 117005596..8d952a298 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1044,7 +1044,7 @@ en: invitations: invites: "Invites" invite_your_friends: "Invite your friends" - by_email: "By email" + by_email: "Invite people by email" share_this: "Share this link via email, blog, or social networks!" public_explain: control_your_audience: "Control your audience" diff --git a/features/desktop/invitations.feature b/features/desktop/invitations.feature index 0d7059bf9..5aafd11df 100644 --- a/features/desktop/invitations.feature +++ b/features/desktop/invitations.feature @@ -48,3 +48,14 @@ Feature: Invitations And I press "Send an invitation" Then I should have 1 Devise email delivery And I should not see "change your notification settings" in the last sent email + + Scenario: sends an invitation from the people search page + When I sign in as "alice@alice.alice" + And I search for "test" + Then I should see "Users matching test" within "#search_title" + When I click on selector "#invitations-button" + And I fill in the following: + | email_inviter_emails | alex@example.com | + And I press "Send an invitation" + Then I should have 1 Devise email delivery + And I should not see "change your notification settings" in the last sent email From 5b5e3e2c2902307e2f58042dcb5c3e59fba2b07c Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 22 Aug 2016 23:36:32 +0200 Subject: [PATCH 2/3] Display images inline in profile bio --- app/assets/templates/profile_sidebar_tpl.jst.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/templates/profile_sidebar_tpl.jst.hbs b/app/assets/templates/profile_sidebar_tpl.jst.hbs index 69cc76d83..f7345c899 100644 --- a/app/assets/templates/profile_sidebar_tpl.jst.hbs +++ b/app/assets/templates/profile_sidebar_tpl.jst.hbs @@ -11,7 +11,7 @@ {{#if bio}}
  • {{t 'profile.bio'}}

    -
    {{fmtText bio}}
    +
    {{fmtText bio}}
  • {{/if}} {{#if location}} From 6d8b7b49cbd77cf6e1773288fab3eac1956387ce Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Mon, 22 Aug 2016 23:59:07 +0200 Subject: [PATCH 3/3] Remove started sharing notifications where the contact doesn't exist The same as #7009 but now all of them ;) --- ...39_remove_started_sharing_notifications_without_contact.rb} | 3 ++- db/schema.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename db/migrate/{20160820181334_remove_started_sharing_notifications_without_contact.rb => 20160822212739_remove_started_sharing_notifications_without_contact.rb} (81%) diff --git a/db/migrate/20160820181334_remove_started_sharing_notifications_without_contact.rb b/db/migrate/20160822212739_remove_started_sharing_notifications_without_contact.rb similarity index 81% rename from db/migrate/20160820181334_remove_started_sharing_notifications_without_contact.rb rename to db/migrate/20160822212739_remove_started_sharing_notifications_without_contact.rb index 0d9d6c0bb..70a62f68f 100644 --- a/db/migrate/20160820181334_remove_started_sharing_notifications_without_contact.rb +++ b/db/migrate/20160822212739_remove_started_sharing_notifications_without_contact.rb @@ -5,7 +5,8 @@ class RemoveStartedSharingNotificationsWithoutContact < ActiveRecord::Migration def up Notification.where(type: "Notifications::StartedSharing", target_type: "Person") .joins("INNER JOIN people ON people.id = notifications.target_id") - .joins("LEFT OUTER JOIN contacts ON contacts.person_id = people.id") + .joins("LEFT OUTER JOIN contacts ON contacts.person_id = people.id " \ + "AND contacts.user_id = notifications.recipient_id") .delete_all("contacts.id IS NULL") end end diff --git a/db/schema.rb b/db/schema.rb index 334178c49..593703cb4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160820181334) do +ActiveRecord::Schema.define(version: 20160822212739) do create_table "account_deletions", force: :cascade do |t| t.string "diaspora_handle", limit: 255