New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue avatars in list #641

Merged
merged 9 commits into from Sep 26, 2018

Conversation

Projects
2 participants
@sleepypioneer
Member

sleepypioneer commented Sep 25, 2018

Fix #604 Proposed code for adding avatars in list without needing to check contact.photo using contact.url?photo.

I condensed the two divs and set them to return values based on if an url was returned or not.

I removed the filter as it was simpler to return this.contact.displayName.charAt(0)or '' for the initial value.

@skjnldsv

This comment has been minimized.

Member

skjnldsv commented on src/components/ContentList/ContentListItem.vue in f94704b Sep 12, 2018

You can leave it to contact.url.
We will set all things directly since this is also the same url to download the contact. :)

@sleepypioneer sleepypioneer added this to the 3.0.0 milestone Sep 25, 2018

@sleepypioneer sleepypioneer self-assigned this Sep 25, 2018

@sleepypioneer sleepypioneer requested a review from skjnldsv Sep 25, 2018

@sleepypioneer sleepypioneer added this to 👩‍💻 In progress in Rails Girls Summer of Code 2018 via automation Sep 25, 2018

@@ -48,6 +45,16 @@ export default {
} catch (e) {
return 'grey'
}
},
avatarUrl() {
return 'url(' + this.contact.url + '?photo' + ')'

This comment has been minimized.

@skjnldsv

skjnldsv Sep 25, 2018

Member

Small tip, with latest javascript you can do

`url(${this.contact.url}?photo)`

This comment has been minimized.

@sleepypioneer

sleepypioneer Sep 25, 2018

Member

Cool very nice, anything else here to change?

This comment has been minimized.

@skjnldsv

skjnldsv Sep 25, 2018

Member

I'll rebase your branch in a second :)

Jessica and others added some commits Sep 25, 2018

@skjnldsv

This comment has been minimized.

Member

skjnldsv commented Sep 25, 2018

  • hum, I get no letters :/
    capture d ecran_2018-09-25_18-35-06
  • background-size needs a fix
    capture d ecran_2018-09-25_18-37-41
Use inner div for avatar
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv

I finally wanted to try something, so I changed the behaviour a bit :)
I'll let you take a look tomorrow!

return `url(${this.contact.url}?photo)`
},
initial() {
if (this.avatarUrl) {

This comment has been minimized.

@skjnldsv

skjnldsv Sep 25, 2018

Member

A contact always have an url. You cannot assume the contact have a picture or not.
If a contact does NOT have an url, that means it's a local contact (present on the store only and not created on the server yet) that have not yet been pushed to the server. So in that case, yes we can assume it doesn't have an url. Though I'll suggest checking the contact.dav property to check if this is a local contact or not.

@skjnldsv

This comment has been minimized.

Member

skjnldsv commented Sep 25, 2018

capture d ecran_2018-09-25_18-55-08

@skjnldsv skjnldsv removed the 2. developing label Sep 25, 2018

@sleepypioneer

This comment has been minimized.

Member

sleepypioneer commented Sep 26, 2018

Nice work 🎖 sorry for the messy errors.

@sleepypioneer sleepypioneer merged commit 309dbc5 into vue Sep 26, 2018

Rails Girls Summer of Code 2018 automation moved this from 👩‍💻 In progress to 🎉 Done! Sep 26, 2018

@sleepypioneer sleepypioneer deleted the vue-avatars-in-list branch Sep 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment