mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Rename Component from 'UserAvatar' as 'user-avatar' to 'ProfileAvatar' as 'profile-avatar'
This commit is contained in:
parent
077a63aca7
commit
615ee2991a
@ -4,5 +4,5 @@ Then("I cannot upload a picture", () => {
|
|||||||
cy.get(".base-card")
|
cy.get(".base-card")
|
||||||
.children()
|
.children()
|
||||||
.should("not.have.id", "customdropzone")
|
.should("not.have.id", "customdropzone")
|
||||||
.should("have.class", "user-avatar");
|
.should("have.class", "profile-avatar");
|
||||||
});
|
});
|
||||||
@ -42,7 +42,7 @@ describe('AvatarMenu.vue', () => {
|
|||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the UserAvatar component', () => {
|
it('renders the ProfileAvatar component', () => {
|
||||||
wrapper.find('.avatar-menu-trigger').trigger('click')
|
wrapper.find('.avatar-menu-trigger').trigger('click')
|
||||||
expect(wrapper.find('.profile-avatar').exists()).toBe(true)
|
expect(wrapper.find('.profile-avatar').exists()).toBe(true)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
"
|
"
|
||||||
@click.prevent="toggleMenu"
|
@click.prevent="toggleMenu"
|
||||||
>
|
>
|
||||||
<user-avatar :user="user" size="small" />
|
<profile-avatar :user="user" size="small" />
|
||||||
<base-icon class="dropdown-arrow" name="angle-down" />
|
<base-icon class="dropdown-arrow" name="angle-down" />
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
@ -50,12 +50,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import Dropdown from '~/components/Dropdown'
|
import Dropdown from '~/components/Dropdown'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Dropdown,
|
Dropdown,
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
placement: { type: String, default: 'top-end' },
|
placement: { type: String, default: 'top-end' },
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="user-teaser" v-if="displayAnonymous">
|
<div class="user-teaser" v-if="displayAnonymous">
|
||||||
<user-avatar v-if="showAvatar" size="small" />
|
<profile-avatar v-if="showAvatar" size="small" />
|
||||||
<span class="info anonymous">{{ $t('profile.userAnonym') }}</span>
|
<span class="info anonymous">{{ $t('profile.userAnonym') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else :class="[{ 'disabled-content': user.disabled }]" placement="top-start">
|
<div v-else :class="[{ 'disabled-content': user.disabled }]" placement="top-start">
|
||||||
<nuxt-link :to="userLink" :class="['user-teaser']">
|
<nuxt-link :to="userLink" :class="['user-teaser']">
|
||||||
<user-avatar v-if="showAvatar" :user="user" size="small" />
|
<profile-avatar v-if="showAvatar" :user="user" size="small" />
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="text">
|
<span class="text">
|
||||||
<span class="slug">{{ userSlug }}</span>
|
<span class="slug">{{ userSlug }}</span>
|
||||||
@ -26,13 +26,13 @@
|
|||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
import HcRelativeDateTime from '~/components/RelativeDateTime'
|
import HcRelativeDateTime from '~/components/RelativeDateTime'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserTeaser',
|
name: 'UserTeaser',
|
||||||
components: {
|
components: {
|
||||||
HcRelativeDateTime,
|
HcRelativeDateTime,
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
user: { type: Object, default: null },
|
user: { type: Object, default: null },
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import UserAvatar from './UserAvatar'
|
import ProfileAvatar from './ProfileAvatar'
|
||||||
import BaseIcon from '~/components/_new/generic/BaseIcon/BaseIcon'
|
import BaseIcon from '~/components/_new/generic/BaseIcon/BaseIcon'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
describe('UserAvatar', () => {
|
describe('ProfileAvatar', () => {
|
||||||
let propsData, wrapper
|
let propsData, wrapper
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
propsData = {}
|
propsData = {}
|
||||||
@ -12,7 +12,7 @@ describe('UserAvatar', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const Wrapper = () => {
|
const Wrapper = () => {
|
||||||
return mount(UserAvatar, { propsData, localVue })
|
return mount(ProfileAvatar, { propsData, localVue })
|
||||||
}
|
}
|
||||||
|
|
||||||
it('renders no image', () => {
|
it('renders no image', () => {
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { storiesOf } from '@storybook/vue'
|
import { storiesOf } from '@storybook/vue'
|
||||||
import { withA11y } from '@storybook/addon-a11y'
|
import { withA11y } from '@storybook/addon-a11y'
|
||||||
import StoryRouter from 'storybook-vue-router'
|
import StoryRouter from 'storybook-vue-router'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
import helpers from '~/storybook/helpers'
|
import helpers from '~/storybook/helpers'
|
||||||
import { user } from '~/components/UserTeaser/UserTeaser.story.js'
|
import { user } from '~/components/UserTeaser/UserTeaser.story.js'
|
||||||
import imageFile from './storybook/critical-avatar-white-background.png'
|
import imageFile from './storybook/critical-avatar-white-background.png'
|
||||||
@ -22,56 +22,56 @@ const userWithAvatar = {
|
|||||||
name: 'Jochen Image',
|
name: 'Jochen Image',
|
||||||
avatar: { url: imageFile },
|
avatar: { url: imageFile },
|
||||||
}
|
}
|
||||||
storiesOf('UserAvatar', module)
|
storiesOf('ProfileAvatar', module)
|
||||||
.addDecorator(withA11y)
|
.addDecorator(withA11y)
|
||||||
.addDecorator(helpers.layout)
|
.addDecorator(helpers.layout)
|
||||||
.addDecorator(StoryRouter())
|
.addDecorator(StoryRouter())
|
||||||
.add('normal, with image', () => ({
|
.add('normal, with image', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithAvatar,
|
user: userWithAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" />',
|
template: '<profile-avatar :user="user" />',
|
||||||
}))
|
}))
|
||||||
.add('normal without image, anonymous user', () => ({
|
.add('normal without image, anonymous user', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: anonymousUser,
|
user: anonymousUser,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" />',
|
template: '<profile-avatar :user="user" />',
|
||||||
}))
|
}))
|
||||||
.add('normal without image, user initials', () => ({
|
.add('normal without image, user initials', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithoutAvatar,
|
user: userWithoutAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" />',
|
template: '<profile-avatar :user="user" />',
|
||||||
}))
|
}))
|
||||||
.add('small, with image', () => ({
|
.add('small, with image', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithAvatar,
|
user: userWithAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" size="small"/>',
|
template: '<profile-avatar :user="user" size="small"/>',
|
||||||
}))
|
}))
|
||||||
.add('small', () => ({
|
.add('small', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithoutAvatar,
|
user: userWithoutAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" size="small"/>',
|
template: '<profile-avatar :user="user" size="small"/>',
|
||||||
}))
|
}))
|
||||||
.add('large, with image', () => ({
|
.add('large, with image', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithAvatar,
|
user: userWithAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" size="large"/>',
|
template: '<profile-avatar :user="user" size="large"/>',
|
||||||
}))
|
}))
|
||||||
.add('large', () => ({
|
.add('large', () => ({
|
||||||
components: { UserAvatar },
|
components: { ProfileAvatar },
|
||||||
data: () => ({
|
data: () => ({
|
||||||
user: userWithoutAvatar,
|
user: userWithoutAvatar,
|
||||||
}),
|
}),
|
||||||
template: '<user-avatar :user="user" size="large"/>',
|
template: '<profile-avatar :user="user" size="large"/>',
|
||||||
}))
|
}))
|
||||||
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'UserAvatar',
|
name: 'ProfileAvatar',
|
||||||
props: {
|
props: {
|
||||||
size: {
|
size: {
|
||||||
type: String,
|
type: String,
|
||||||
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 242 KiB |
@ -8,9 +8,9 @@
|
|||||||
style="position: relative; height: auto; overflow: visible"
|
style="position: relative; height: auto; overflow: visible"
|
||||||
>
|
>
|
||||||
<avatar-uploader v-if="isMyGroup" :profile="group">
|
<avatar-uploader v-if="isMyGroup" :profile="group">
|
||||||
<!-- Wolle: <user-avatar :user="user" class="profile-page-avatar" size="large"></user-avatar> -->
|
<!-- Wolle: <profile-avatar :user="user" class="profile-page-avatar" size="large"></profile-avatar> -->
|
||||||
</avatar-uploader>
|
</avatar-uploader>
|
||||||
<!-- Wolle: <user-avatar v-else :user="user" class="profile-page-avatar" size="large" /> -->
|
<!-- Wolle: <profile-avatar v-else :user="user" class="profile-page-avatar" size="large" /> -->
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<!-- Wolle: <client-only>
|
<!-- Wolle: <client-only>
|
||||||
<content-menu
|
<content-menu
|
||||||
@ -181,7 +181,7 @@ import FollowList from '~/components/features/FollowList/FollowList'
|
|||||||
import HcEmpty from '~/components/Empty/Empty'
|
import HcEmpty from '~/components/Empty/Empty'
|
||||||
import ContentMenu from '~/components/ContentMenu/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu/ContentMenu'
|
||||||
import AvatarUploader from '~/components/Uploader/AvatarUploader'
|
import AvatarUploader from '~/components/Uploader/AvatarUploader'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
||||||
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
||||||
import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
|
import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
|
||||||
@ -209,7 +209,7 @@ export default {
|
|||||||
HcCountTo,
|
HcCountTo,
|
||||||
HcBadges,
|
HcBadges,
|
||||||
HcEmpty,
|
HcEmpty,
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
ContentMenu,
|
ContentMenu,
|
||||||
AvatarUploader,
|
AvatarUploader,
|
||||||
MasonryGrid,
|
MasonryGrid,
|
||||||
|
|||||||
@ -8,9 +8,9 @@
|
|||||||
style="position: relative; height: auto; overflow: visible"
|
style="position: relative; height: auto; overflow: visible"
|
||||||
>
|
>
|
||||||
<avatar-uploader v-if="myProfile" :profile="user">
|
<avatar-uploader v-if="myProfile" :profile="user">
|
||||||
<user-avatar :user="user" class="profile-page-avatar" size="large"></user-avatar>
|
<profile-avatar :user="user" class="profile-page-avatar" size="large"></profile-avatar>
|
||||||
</avatar-uploader>
|
</avatar-uploader>
|
||||||
<user-avatar v-else :user="user" class="profile-page-avatar" size="large" />
|
<profile-avatar v-else :user="user" class="profile-page-avatar" size="large" />
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<client-only>
|
<client-only>
|
||||||
<content-menu
|
<content-menu
|
||||||
@ -179,7 +179,7 @@ import FollowList from '~/components/features/FollowList/FollowList'
|
|||||||
import HcEmpty from '~/components/Empty/Empty'
|
import HcEmpty from '~/components/Empty/Empty'
|
||||||
import ContentMenu from '~/components/ContentMenu/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu/ContentMenu'
|
||||||
import AvatarUploader from '~/components/Uploader/AvatarUploader'
|
import AvatarUploader from '~/components/Uploader/AvatarUploader'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid.vue'
|
||||||
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
||||||
import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
|
import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
|
||||||
@ -206,7 +206,7 @@ export default {
|
|||||||
HcCountTo,
|
HcCountTo,
|
||||||
HcBadges,
|
HcBadges,
|
||||||
HcEmpty,
|
HcEmpty,
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
ContentMenu,
|
ContentMenu,
|
||||||
AvatarUploader,
|
AvatarUploader,
|
||||||
MasonryGrid,
|
MasonryGrid,
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
params: { id: scope.row.id, slug: scope.row.slug },
|
params: { id: scope.row.id, slug: scope.row.slug },
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<user-avatar :user="scope.row" size="small" />
|
<profile-avatar :user="scope.row" size="small" />
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</template>
|
</template>
|
||||||
<template #name="scope">
|
<template #name="scope">
|
||||||
@ -74,11 +74,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { blockedUsers, unblockUser } from '~/graphql/settings/BlockedUsers'
|
import { blockedUsers, unblockUser } from '~/graphql/settings/BlockedUsers'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
params: { id: scope.row.id, slug: scope.row.slug },
|
params: { id: scope.row.id, slug: scope.row.slug },
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<user-avatar :user="scope.row" size="small" />
|
<profile-avatar :user="scope.row" size="small" />
|
||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</template>
|
</template>
|
||||||
<template #name="scope">
|
<template #name="scope">
|
||||||
@ -71,11 +71,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mutedUsers, unmuteUser } from '~/graphql/settings/MutedUsers'
|
import { mutedUsers, unmuteUser } from '~/graphql/settings/MutedUsers'
|
||||||
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
|
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
UserAvatar,
|
ProfileAvatar,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user