diff --git a/webapp/components/AvatarMenu/AvatarMenu.vue b/webapp/components/AvatarMenu/AvatarMenu.vue index 18c1676d3..061e96221 100644 --- a/webapp/components/AvatarMenu/AvatarMenu.vue +++ b/webapp/components/AvatarMenu/AvatarMenu.vue @@ -11,7 +11,7 @@ " @click.prevent="toggleMenu" > - + diff --git a/webapp/components/UserTeaser/UserTeaser.vue b/webapp/components/UserTeaser/UserTeaser.vue index 0f3bb199c..7cced8b6d 100644 --- a/webapp/components/UserTeaser/UserTeaser.vue +++ b/webapp/components/UserTeaser/UserTeaser.vue @@ -5,7 +5,7 @@
- +
{{ userSlug }} diff --git a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.spec.js b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.spec.js index 2dc27d8a1..44d35bd71 100644 --- a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.spec.js +++ b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.spec.js @@ -23,39 +23,39 @@ describe('ProfileAvatar', () => { expect(wrapper.find(BaseIcon).exists()).toBe(true) }) - describe('given a user', () => { + describe('given a profile', () => { describe('with no image', () => { beforeEach(() => { propsData = { - user: { + profile: { name: 'Matt Rider', }, } wrapper = Wrapper() }) - describe('no user name', () => { + describe('no profile name', () => { it('renders an icon', () => { - propsData = { user: { name: null } } + propsData = { profile: { name: null } } wrapper = Wrapper() expect(wrapper.find(BaseIcon).exists()).toBe(true) }) }) - describe("user name is 'Anonymous'", () => { + describe("profile name is 'Anonymous'", () => { it('renders an icon', () => { - propsData = { user: { name: 'Anonymous' } } + propsData = { profile: { name: 'Anonymous' } } wrapper = Wrapper() expect(wrapper.find(BaseIcon).exists()).toBe(true) }) }) - it('displays user initials', () => { + it('displays profile initials', () => { expect(wrapper.find('.initials').text()).toEqual('MR') }) it('displays no more than 3 initials', () => { - propsData = { user: { name: 'Ana Paula Nunes Marques' } } + propsData = { profile: { name: 'Ana Paula Nunes Marques' } } wrapper = Wrapper() expect(wrapper.find('.initials').text()).toEqual('APN') }) @@ -64,7 +64,7 @@ describe('ProfileAvatar', () => { describe('with a relative avatar url', () => { beforeEach(() => { propsData = { - user: { + profile: { name: 'Not Anonymous', avatar: { url: '/avatar.jpg', @@ -82,7 +82,7 @@ describe('ProfileAvatar', () => { describe('with an absolute avatar url', () => { beforeEach(() => { propsData = { - user: { + profile: { name: 'Not Anonymous', avatar: { url: 'https://s3.amazonaws.com/uifaces/faces/twitter/sawalazar/128.jpg', diff --git a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.story.js b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.story.js index 5ea8e863f..2b4bccd5e 100644 --- a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.story.js +++ b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.story.js @@ -31,47 +31,47 @@ storiesOf('ProfileAvatar', module) data: () => ({ user: userWithAvatar, }), - template: '', + template: '', })) .add('normal without image, anonymous user', () => ({ components: { ProfileAvatar }, data: () => ({ user: anonymousUser, }), - template: '', + template: '', })) .add('normal without image, user initials', () => ({ components: { ProfileAvatar }, data: () => ({ user: userWithoutAvatar, }), - template: '', + template: '', })) .add('small, with image', () => ({ components: { ProfileAvatar }, data: () => ({ user: userWithAvatar, }), - template: '', + template: '', })) .add('small', () => ({ components: { ProfileAvatar }, data: () => ({ user: userWithoutAvatar, }), - template: '', + template: '', })) .add('large, with image', () => ({ components: { ProfileAvatar }, data: () => ({ user: userWithAvatar, }), - template: '', + template: '', })) .add('large', () => ({ components: { ProfileAvatar }, data: () => ({ user: userWithoutAvatar, }), - template: '', + template: '', })) diff --git a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.vue b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.vue index fd428f641..e93eae9ce 100644 --- a/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.vue +++ b/webapp/components/_new/generic/ProfileAvatar/ProfileAvatar.vue @@ -5,10 +5,10 @@
@@ -25,23 +25,23 @@ export default { return value.match(/(small|large)/) }, }, - user: { + profile: { type: Object, default: null, }, }, computed: { isAnonymous() { - return !this.user || !this.user.name || this.user.name.toLowerCase() === 'anonymous' + return !this.profile || !this.profile.name || this.profile.name.toLowerCase() === 'anonymous' }, isAvatar() { // TODO may we could test as well if the image is reachable? otherwise the background gets white and the initails can not be read - return this.user && this.user.avatar + return this.profile && this.profile.avatar }, userInitials() { if (this.isAnonymous) return '' - return this.user.name.match(/\b\w/g).join('').substring(0, 3).toUpperCase() + return this.profile.name.match(/\b\w/g).join('').substring(0, 3).toUpperCase() }, }, } diff --git a/webapp/pages/group/_id/_slug.vue b/webapp/pages/group/_id/_slug.vue index 2daeb50c3..9d5c23d59 100644 --- a/webapp/pages/group/_id/_slug.vue +++ b/webapp/pages/group/_id/_slug.vue @@ -8,9 +8,9 @@ style="position: relative; height: auto; overflow: visible" > - + - + - +