Chore: lint

This commit is contained in:
Raphael Beer 2020-03-19 01:58:28 +01:00
parent f339ed2c7f
commit 984f69a738
No known key found for this signature in database
GPG Key ID: C1AC5E018B25EF11
4 changed files with 5 additions and 16 deletions

View File

@ -8,8 +8,6 @@ config.stubs['client-only'] = '<span><slot /></span>'
config.stubs['ds-space'] = '<span><slot /></span>' config.stubs['ds-space'] = '<span><slot /></span>'
config.stubs['nuxt-link'] = '<span><slot /></span>' config.stubs['nuxt-link'] = '<span><slot /></span>'
let user, additionalConnections
describe('FollowList.vue', () => { describe('FollowList.vue', () => {
let store, mocks, getters, propsData let store, mocks, getters, propsData
@ -75,7 +73,7 @@ describe('FollowList.vue', () => {
}) })
}) })
user = { const user = {
name: 'Jenny Rostock', name: 'Jenny Rostock',
id: 'u3', id: 'u3',
followedByCount: 32, followedByCount: 32,
@ -156,7 +154,7 @@ user = {
], ],
} }
additionalConnections = { const additionalConnections = {
followedBy: [ followedBy: [
{ {
id: '9f305e7a-ae5a-4e22-8269-8b6899af674f', id: '9f305e7a-ae5a-4e22-8269-8b6899af674f',

View File

@ -12,11 +12,11 @@
<user-teaser :user="follow" /> <user-teaser :user="follow" />
</client-only> </client-only>
</ds-space> </ds-space>
<ds-space v-if="this.counts[this.type] - this.connections.length" margin="small"> <ds-space v-if="this.allConnectionsCount - this.connections.length" margin="small">
<base-button @click="fetchConnections" size="small" color="softer"> <base-button @click="fetchConnections" size="small" color="softer">
{{ {{
$t('profile.network.andMore', { $t('profile.network.andMore', {
number: this.counts[this.type] - this.connections.length, number: this.allConnectionsCount - this.connections.length,
}) })
}} }}
</base-button> </base-button>
@ -32,14 +32,12 @@
<script> <script>
import uniqBy from 'lodash/uniqBy' import uniqBy from 'lodash/uniqBy'
import UserAvatar from '~/components/_new/generic/UserAvatar/UserAvatar'
import UserTeaser from '~/components/UserTeaser/UserTeaser' import UserTeaser from '~/components/UserTeaser/UserTeaser'
import { followedByQuery, followingQuery } from '~/graphql/User' import { followedByQuery, followingQuery } from '~/graphql/User'
export default { export default {
name: 'FollowerList', name: 'FollowerList',
components: { components: {
UserAvatar,
UserTeaser, UserTeaser,
}, },
props: { props: {
@ -49,14 +47,11 @@ export default {
data() { data() {
return { return {
connections: this.user[this.type], connections: this.user[this.type],
allConnectionsCount: this.user[`${this.type}Count`],
queries: { queries: {
followedBy: followedByQuery, followedBy: followedByQuery,
following: followingQuery, following: followingQuery,
}, },
counts: {
followedBy: this.user.followedByCount,
following: this.user.followingCount,
},
} }
}, },
computed: { computed: {
@ -70,7 +65,6 @@ export default {
return uniqBy(items, field) return uniqBy(items, field)
}, },
async fetchConnections() { async fetchConnections() {
const query = this.queries[this.type]
const { data } = await this.$apollo.query({ const { data } = await this.$apollo.query({
query: this.queries[this.type], query: this.queries[this.type],
variables: { id: this.user.id }, variables: { id: this.user.id },

View File

@ -307,4 +307,3 @@ export const followingQuery = gql`
} }
} }
` `

View File

@ -215,7 +215,6 @@
<script> <script>
import uniqBy from 'lodash/uniqBy' import uniqBy from 'lodash/uniqBy'
import UserTeaser from '~/components/UserTeaser/UserTeaser'
import PostTeaser from '~/components/PostTeaser/PostTeaser.vue' import PostTeaser from '~/components/PostTeaser/PostTeaser.vue'
import HcFollowButton from '~/components/FollowButton.vue' import HcFollowButton from '~/components/FollowButton.vue'
import HcCountTo from '~/components/CountTo.vue' import HcCountTo from '~/components/CountTo.vue'
@ -244,7 +243,6 @@ const tabToFilterMapping = ({ tab, id }) => {
export default { export default {
components: { components: {
UserTeaser,
PostTeaser, PostTeaser,
HcFollowButton, HcFollowButton,
HcCountTo, HcCountTo,