Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
7d6623d0
Unverified
Commit
7d6623d0
authored
Apr 07, 2018
by
Benjamin Neff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove contacts page on profiles
closes #7769
parent
4fa92c18
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1 addition
and
151 deletions
+1
-151
Changelog.md
Changelog.md
+1
-0
app/assets/javascripts/app/pages/profile.js
app/assets/javascripts/app/pages/profile.js
+0
-4
app/assets/javascripts/app/router.js
app/assets/javascripts/app/router.js
+0
-1
app/assets/javascripts/app/views/profile_header_view.js
app/assets/javascripts/app/views/profile_header_view.js
+0
-7
app/assets/templates/profile_header_tpl.jst.hbs
app/assets/templates/profile_header_tpl.jst.hbs
+0
-17
app/controllers/people_controller.rb
app/controllers/people_controller.rb
+0
-25
app/controllers/photos_controller.rb
app/controllers/photos_controller.rb
+0
-1
app/models/contact.rb
app/models/contact.rb
+0
-11
app/views/people/contacts.haml
app/views/people/contacts.haml
+0
-32
config/locales/javascript/javascript.en.yml
config/locales/javascript/javascript.en.yml
+0
-1
config/routes.rb
config/routes.rb
+0
-1
features/desktop/contacts.feature
features/desktop/contacts.feature
+0
-17
spec/controllers/people_controller_spec.rb
spec/controllers/people_controller_spec.rb
+0
-34
No files found.
Changelog.md
View file @
7d6623d0
# 0.7.5.0
## Refactor
*
Remove the 'make contacts in this aspect visible to each other' option
[
#7769
](
https://github.com/diaspora/diaspora/pull/7769
)
## Bug fixes
*
Prefill conversation form on contacts page only with mutual contacts
[
#7744
](
https://github.com/diaspora/diaspora/pull/7744
)
...
...
app/assets/javascripts/app/pages/profile.js
View file @
7d6623d0
...
...
@@ -24,9 +24,6 @@ app.pages.Profile = app.views.Base.extend({
if
(
app
.
hasPreload
(
"
photos_count
"
))
{
this
.
photos
=
app
.
parsePreload
(
"
photos_count
"
);
}
if
(
app
.
hasPreload
(
"
contacts_count
"
))
{
this
.
contacts
=
app
.
parsePreload
(
"
contacts_count
"
);
}
this
.
streamCollection
=
_
.
has
(
opts
,
"
streamCollection
"
)
?
opts
.
streamCollection
:
null
;
this
.
streamViewClass
=
_
.
has
(
opts
,
"
streamView
"
)
?
opts
.
streamView
:
null
;
...
...
@@ -70,7 +67,6 @@ app.pages.Profile = app.views.Base.extend({
return
new
app
.
views
.
ProfileHeader
({
model
:
this
.
model
,
photos
:
this
.
photos
,
contacts
:
this
.
contacts
});
},
...
...
app/assets/javascripts/app/router.js
View file @
7d6623d0
...
...
@@ -20,7 +20,6 @@ app.Router = Backbone.Router.extend({
"
p/:id(/)
"
:
"
singlePost
"
,
"
people(/)
"
:
"
peopleSearch
"
,
"
people/:id(/)
"
:
"
profile
"
,
"
people/:id/contacts(/)
"
:
"
profile
"
,
"
people/:id/photos(/)
"
:
"
photos
"
,
"
posts/:id(/)
"
:
"
singlePost
"
,
"
profile/edit(/)
"
:
"
settings
"
,
...
...
app/assets/javascripts/app/views/profile_header_view.js
View file @
7d6623d0
...
...
@@ -14,7 +14,6 @@ app.views.ProfileHeader = app.views.Base.extend({
initialize
:
function
(
opts
)
{
this
.
photos
=
_
.
has
(
opts
,
'
photos
'
)
?
opts
.
photos
:
null
;
this
.
contacts
=
_
.
has
(
opts
,
'
contacts
'
)
?
opts
.
contacts
:
null
;
this
.
model
.
on
(
"
change
"
,
this
.
render
,
this
);
$
(
"
#mentionModal
"
).
on
(
"
modal:loaded
"
,
this
.
mentionModalLoaded
.
bind
(
this
));
$
(
"
#mentionModal
"
).
on
(
"
hidden.bs.modal
"
,
this
.
mentionModalHidden
);
...
...
@@ -24,13 +23,11 @@ app.views.ProfileHeader = app.views.Base.extend({
return
_
.
extend
({},
this
.
defaultPresenter
(),
{
show_profile_btns
:
this
.
_shouldShowProfileBtns
(),
show_photos
:
this
.
_shouldShowPhotos
(),
show_contacts
:
this
.
_shouldShowContacts
(),
is_blocked
:
this
.
model
.
isBlocked
(),
is_sharing
:
this
.
model
.
isSharing
(),
is_receiving
:
this
.
model
.
isReceiving
(),
is_mutual
:
this
.
model
.
isMutual
(),
has_tags
:
this
.
_hasTags
(),
contacts
:
this
.
contacts
,
photos
:
this
.
photos
});
},
...
...
@@ -51,10 +48,6 @@ app.views.ProfileHeader = app.views.Base.extend({
return
(
this
.
photos
&&
this
.
photos
>
0
);
},
_shouldShowContacts
:
function
()
{
return
(
this
.
contacts
&&
this
.
contacts
>
0
);
},
showMentionModal
:
function
()
{
app
.
helpers
.
showModal
(
"
#mentionModal
"
);
},
...
...
app/assets/templates/profile_header_tpl.jst.hbs
View file @
7d6623d0
...
...
@@ -82,22 +82,5 @@
</a>
</li>
{{/if}}
{{#if
show_contacts
}}
<li
{{#
isCurrentPage
'personContacts'
guid
}}
class=
"active"
{{/
isCurrentPage
}}
>
{{#if
is_own_profile
}}
<a
href=
"
{{
urlTo
'contacts'
}}
"
id=
"contacts_link"
>
<i
class=
"entypo-users"
></i>
{{
t
'profile.contacts'
}}
<div
class=
"badge badge-default"
>
{{
contacts
}}
</div>
</a>
{{else}}
<a
href=
"
{{
urlTo
'personContacts'
guid
}}
"
id=
"contacts_link"
>
<i
class=
"entypo-users"
></i>
{{
t
'profile.contacts'
}}
<div
class=
"badge badge-default"
>
{{
contacts
}}
</div>
</a>
{{/if}}
</li>
{{/if}}
</div>
</div>
app/controllers/people_controller.rb
View file @
7d6623d0
...
...
@@ -77,7 +77,6 @@ class PeopleController < ApplicationController
end
gon
.
preloads
[
:person
]
=
@presenter
.
as_json
gon
.
preloads
[
:photos_count
]
=
Photo
.
visible
(
current_user
,
@person
).
count
(
:all
)
gon
.
preloads
[
:contacts_count
]
=
Contact
.
contact_contacts_for
(
current_user
,
@person
).
count
(
:all
)
respond_with
@presenter
,
layout:
"with_header"
end
...
...
@@ -123,30 +122,6 @@ class PeopleController < ApplicationController
end
end
def
contacts
respond_to
do
|
format
|
format
.
json
{
head
:not_acceptable
}
format
.
any
do
@person
=
Person
.
find_by_guid
(
params
[
:person_id
])
if
@person
@contact
=
current_user
.
contact_for
(
@person
)
@contacts_of_contact
=
Contact
.
contact_contacts_for
(
current_user
,
@person
)
gon
.
preloads
[
:person
]
=
PersonPresenter
.
new
(
@person
,
current_user
).
as_json
gon
.
preloads
[
:photos_count
]
=
Photo
.
visible
(
current_user
,
@person
).
count
(
:all
)
gon
.
preloads
[
:contacts_count
]
=
@contacts_of_contact
.
count
(
:all
)
@contacts_of_contact
=
@contacts_of_contact
.
paginate
(
page:
params
[
:page
],
per_page:
(
params
[
:limit
]
||
15
))
@hashes
=
hashes_for_people
@contacts_of_contact
,
@aspects
respond_with
@person
,
layout:
"with_header"
else
flash
[
:error
]
=
I18n
.
t
"people.show.does_not_exist"
redirect_to
people_path
end
end
end
end
private
def
find_person
...
...
app/controllers/photos_controller.rb
View file @
7d6623d0
...
...
@@ -31,7 +31,6 @@ class PhotosController < ApplicationController
format
.
all
do
gon
.
preloads
[
:person
]
=
@presenter
.
as_json
gon
.
preloads
[
:photos_count
]
=
Photo
.
visible
(
current_user
,
@person
).
count
(
:all
)
gon
.
preloads
[
:contacts_count
]
=
Contact
.
contact_contacts_for
(
current_user
,
@person
).
count
(
:all
)
render
"people/show"
,
layout:
"with_header"
end
format
.
mobile
{
render
"people/show"
}
...
...
app/models/contact.rb
View file @
7d6623d0
...
...
@@ -61,17 +61,6 @@ class Contact < ApplicationRecord
end
end
def
self
.
contact_contacts_for
(
user
,
person
)
return
none
unless
user
if
person
==
user
.
person
user
.
contact_people
else
contact
=
user
.
contact_for
(
person
)
contact
.
try
(
:contacts
)
||
none
end
end
# Follows back if user setting is set so
def
receive
(
_recipient_user_ids
)
user
.
share_with
(
person
,
user
.
auto_follow_back_aspect
)
if
user
.
auto_follow_back
&&
!
receiving
...
...
app/views/people/contacts.haml
deleted
100644 → 0
View file @
4fa92c18
-
content_for
:page_title
do
=
@person
.
name
.container-fluid
#profile_container
.row
.col-md-3
.sidebar.profile-sidebar
#profile
-# here be JS
.col-md-9
.profile_header
-# more JS
.stream-container
#people-stream
.stream
-
@hashes
.
each
do
|
hash
|
=
render
partial:
'people/person'
,
locals:
hash
=
will_paginate
@contacts_of_contact
,
renderer:
WillPaginate
::
ActionView
::
BootstrapLinkRenderer
-
if
user_signed_in?
&&
@person
#new_status_message_pane
=
render
'shared/modal'
,
path:
new_status_message_path
(
:person_id
=>
@person
.
id
),
title:
t
(
'status_messages.new.mentioning'
,
person:
@person
.
name
),
id:
'mentionModal'
-
if
@contact
.conversations-form-container
#new_conversation_pane
=
render
'shared/modal'
,
path:
new_conversation_path
(
:contact_id
=>
@contact
.
id
,
name:
@contact
.
person
.
name
,
modal:
true
),
title:
t
(
'conversations.index.new_conversation'
),
id:
'conversationModal'
config/locales/javascript/javascript.en.yml
View file @
7d6623d0
...
...
@@ -233,7 +233,6 @@ en:
gender
:
"
Gender"
born
:
"
Birthday"
photos
:
"
Photos"
contacts
:
"
Contacts"
posts
:
"
Posts"
conversation
:
...
...
config/routes.rb
View file @
7d6623d0
...
...
@@ -164,7 +164,6 @@ Rails.application.routes.draw do
resources
:people
,
only:
%i(show index)
do
resources
:status_messages
,
only:
%i(new create)
resources
:photos
,
except:
%i(new update)
get
:contacts
get
:stream
get
:hovercard
...
...
features/desktop/contacts.feature
deleted
100644 → 0
View file @
4fa92c18
@javascript
Feature
:
show contacts
Background
:
Given following users exist
:
|
username
|
email
|
|
Bob
Jones
|
bob@bob.bob
|
|
Alice
Smith
|
alice@alice.alice
|
|
Robert
Grimm
|
robert@grimm.grimm
|
And
I sign in as
"robert@grimm.grimm"
And
I am on
"alice@alice.alice"
's page
And
I add the person to my
"Unicorns"
aspect
Scenario
:
see own contacts on profile
When
I am on
"robert@grimm.grimm"
's page
And
I press the first
"#contacts_link"
Then
I should be on the contacts page
spec/controllers/people_controller_spec.rb
View file @
7d6623d0
...
...
@@ -580,40 +580,6 @@ describe PeopleController, :type => :controller do
end
end
describe
'#contacts'
do
it
'assigns the contacts of a person'
do
contact
=
alice
.
contact_for
(
bob
.
person
)
contacts
=
contact
.
contacts
get
:contacts
,
params:
{
person_id:
bob
.
person
.
to_param
}
expect
(
assigns
(
:contacts_of_contact
).
to_a
).
to
eq
(
contacts
.
to_a
)
expect
(
response
).
to
be_success
end
it
'shows an error when invalid person id'
do
get
:contacts
,
params:
{
person_id:
"foo"
}
expect
(
flash
[
:error
]).
to
be_present
expect
(
response
).
to
redirect_to
people_path
end
it
"displays the correct number of photos"
do
16
.
times
do
|
i
|
eve
.
post
(
:photo
,
:user_file
=>
uploaded_photo
,
:to
=>
eve
.
aspects
.
first
.
id
,
:public
=>
true
)
end
get
:contacts
,
params:
{
person_id:
eve
.
person
.
to_param
}
expect
(
response
.
body
).
to
include
',"photos_count":16'
eve
.
post
(
:photo
,
:user_file
=>
uploaded_photo
,
:to
=>
eve
.
aspects
.
first
.
id
,
:public
=>
false
)
get
:contacts
,
params:
{
person_id:
eve
.
person
.
to_param
}
expect
(
response
.
body
).
to
include
',"photos_count":16'
# eve is not sharing with alice
end
it
"returns a 406 for json format"
do
get
:contacts
,
params:
{
person_id:
"foo"
},
format: :json
expect
(
response
.
code
).
to
eq
(
"406"
)
end
end
describe
'#diaspora_id?'
do
it
'returns true for pods on urls'
do
expect
(
@controller
.
send
(
:diaspora_id?
,
"ilya_123@pod.geraspora.de"
)).
to
be
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment