mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Cleanup comments
This commit is contained in:
parent
830eb1010c
commit
101b50486c
@ -34,14 +34,9 @@ describe('SearchResults', () => {
|
|||||||
propsData = {
|
propsData = {
|
||||||
pageSize: 12,
|
pageSize: 12,
|
||||||
}
|
}
|
||||||
// Wolle jest.useFakeTimers()
|
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
// Wolle jest.clearAllMocks()
|
|
||||||
})
|
|
||||||
|
|
||||||
describe('mount', () => {
|
describe('mount', () => {
|
||||||
it('renders tab-navigation component', () => {
|
it('renders tab-navigation component', () => {
|
||||||
expect(wrapper.find('.tab-navigation').exists()).toBe(true)
|
expect(wrapper.find('.tab-navigation').exists()).toBe(true)
|
||||||
@ -54,8 +49,6 @@ describe('SearchResults', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Wolle beforeEach(jest.useFakeTimers)
|
|
||||||
|
|
||||||
describe('result contains 25 posts, 8 users and 0 hashtags', () => {
|
describe('result contains 25 posts, 8 users and 0 hashtags', () => {
|
||||||
// we couldn't get it running with "jest.runAllTimers()" and so we used "setTimeout"
|
// we couldn't get it running with "jest.runAllTimers()" and so we used "setTimeout"
|
||||||
// time is a bit more then 3000 milisec see "webapp/components/CountTo.vue"
|
// time is a bit more then 3000 milisec see "webapp/components/CountTo.vue"
|
||||||
@ -69,7 +62,6 @@ describe('SearchResults', () => {
|
|||||||
userCount: 8,
|
userCount: 8,
|
||||||
activeTab: 'Post',
|
activeTab: 'Post',
|
||||||
})
|
})
|
||||||
// Wolle await wrapper.vm.$nextTick()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('shows a total of 33 results', () => {
|
it('shows a total of 33 results', () => {
|
||||||
@ -79,9 +71,6 @@ describe('SearchResults', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('shows tab with 25 posts found', () => {
|
it('shows tab with 25 posts found', () => {
|
||||||
// console.log('postTab: ', postTab.html())
|
|
||||||
// console.log('wrapper: ', wrapper)
|
|
||||||
// Wolle jest.runAllTimers()
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
expect(wrapper.find('[data-test="Post-tab"]').text()).toContain('25')
|
expect(wrapper.find('[data-test="Post-tab"]').text()).toContain('25')
|
||||||
}, counterTimeout)
|
}, counterTimeout)
|
||||||
|
|||||||
@ -86,19 +86,7 @@
|
|||||||
</ds-space>
|
</ds-space>
|
||||||
</ds-grid-item>
|
</ds-grid-item>
|
||||||
</template>
|
</template>
|
||||||
<!-- Wolle <template v-else-if="$apollo.loading">
|
|
||||||
<ds-grid-item column-span="fullWidth">
|
|
||||||
<ds-space centered>
|
|
||||||
<ds-spinner size="base"></ds-spinner>
|
|
||||||
</ds-space>
|
|
||||||
</ds-grid-item>
|
|
||||||
</template> -->
|
|
||||||
<!-- Wolle double! -->
|
|
||||||
<!-- Wolle <template v-else>
|
|
||||||
<ds-grid-item column-span="fullWidth">
|
|
||||||
<hc-empty margin="xx-large" icon="file" />
|
|
||||||
</ds-grid-item>
|
|
||||||
</template> -->
|
|
||||||
<!-- no results -->
|
<!-- no results -->
|
||||||
<ds-grid-item v-else :row-span="7" column-span="fullWidth">
|
<ds-grid-item v-else :row-span="7" column-span="fullWidth">
|
||||||
<ds-space centered>
|
<ds-space centered>
|
||||||
@ -107,67 +95,6 @@
|
|||||||
</ds-grid-item>
|
</ds-grid-item>
|
||||||
</masonry-grid>
|
</masonry-grid>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
|
|
||||||
<!-- Wolle old -->
|
|
||||||
<!-- <tab-navigation :tabs="tabOptions" :activeTab="activeTab" @switch-tab="switchTab" />
|
|
||||||
<section
|
|
||||||
:class="['results', activeTab === 'User' && '--user', !activeResourceCount > 0 && '--empty']"
|
|
||||||
>
|
|
||||||
<hc-empty
|
|
||||||
v-if="!activeResourceCount || searchCount === 0"
|
|
||||||
icon="tasks"
|
|
||||||
:message="$t('search.no-results', { search })"
|
|
||||||
/>
|
|
||||||
<template>
|
|
||||||
<pagination-buttons
|
|
||||||
v-if="activeResourceCount > pageSize"
|
|
||||||
:hasNext="hasNext"
|
|
||||||
:showPageCounter="true"
|
|
||||||
:hasPrevious="hasPrevious"
|
|
||||||
:activePage="activePage"
|
|
||||||
:activeResourceCount="activeResourceCount"
|
|
||||||
:key="'Top'"
|
|
||||||
:pageSize="pageSize"
|
|
||||||
@back="previousResults"
|
|
||||||
@next="nextResults"
|
|
||||||
/>
|
|
||||||
<masonry-grid v-if="activeTab === 'Post'">
|
|
||||||
<masonry-grid-item v-for="resource in activeResources" :key="resource.key">
|
|
||||||
<post-teaser :post="resource" />
|
|
||||||
</masonry-grid-item>
|
|
||||||
</masonry-grid>
|
|
||||||
|
|
||||||
<ul v-if="activeTab === 'User'" class="user-list">
|
|
||||||
<li v-for="resource in activeResources" :key="resource.key" class="item">
|
|
||||||
<base-card :wideContent="true">
|
|
||||||
<user-teaser :user="resource" />
|
|
||||||
</base-card>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul v-if="activeTab === 'Hashtag'" class="hashtag-list">
|
|
||||||
<li v-for="resource in activeResources" :key="resource.key" class="item">
|
|
||||||
<base-card :wideContent="true">
|
|
||||||
<hc-hashtag :id="resource.id" />
|
|
||||||
</base-card>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<pagination-buttons
|
|
||||||
v-if="activeResourceCount > pageSize"
|
|
||||||
:hasNext="hasNext"
|
|
||||||
:hasPrevious="hasPrevious"
|
|
||||||
:activePage="activePage"
|
|
||||||
:showPageCounter="true"
|
|
||||||
:activeResourceCount="activeResourceCount"
|
|
||||||
:key="'Bottom'"
|
|
||||||
:pageSize="pageSize"
|
|
||||||
:srollTo="'#search-results'"
|
|
||||||
@back="previousResults"
|
|
||||||
@next="nextResults"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</section> -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -178,7 +105,6 @@ import HcEmpty from '~/components/Empty/Empty'
|
|||||||
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid'
|
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid'
|
||||||
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem'
|
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem'
|
||||||
import PostTeaser from '~/components/PostTeaser/PostTeaser'
|
import PostTeaser from '~/components/PostTeaser/PostTeaser'
|
||||||
// Wolle import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
|
|
||||||
import NewTabNavigation from '~/components/_new/generic/TabNavigation/NewTabNavigation'
|
import NewTabNavigation from '~/components/_new/generic/TabNavigation/NewTabNavigation'
|
||||||
import UserTeaser from '~/components/UserTeaser/UserTeaser'
|
import UserTeaser from '~/components/UserTeaser/UserTeaser'
|
||||||
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
|
||||||
@ -186,7 +112,6 @@ import HcHashtag from '~/components/Hashtag/Hashtag'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
// Wolle TabNavigation,
|
|
||||||
NewTabNavigation,
|
NewTabNavigation,
|
||||||
HcEmpty,
|
HcEmpty,
|
||||||
MasonryGrid,
|
MasonryGrid,
|
||||||
@ -410,10 +335,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// Wolle check if still needed 👇🏼
|
|
||||||
.search-results {
|
.search-results {
|
||||||
> .results {
|
> .results {
|
||||||
/* display: inline-block;*/
|
|
||||||
padding: $space-small;
|
padding: $space-small;
|
||||||
background-color: $color-neutral-80;
|
background-color: $color-neutral-80;
|
||||||
border-radius: 0 $border-radius-base $border-radius-base $border-radius-base;
|
border-radius: 0 $border-radius-base $border-radius-base $border-radius-base;
|
||||||
@ -444,16 +367,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wolle new
|
|
||||||
.grid-total-search-results {
|
.grid-total-search-results {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
// margin-bottom: $space-x-small;
|
|
||||||
|
|
||||||
// > .base-button {
|
|
||||||
// display: block;
|
|
||||||
// width: 100%;
|
|
||||||
// margin-bottom: $space-x-small;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,25 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- Wolle siehe TabNavigator <ul class="tab-navigation">
|
|
||||||
<li
|
|
||||||
v-for="tab in tabs"
|
|
||||||
:key="tab.type"
|
|
||||||
:class="[
|
|
||||||
activeTab === tab.type && '--active',
|
|
||||||
tab.disabled && '--disabled',
|
|
||||||
'tab',
|
|
||||||
tab.type + '-tab',
|
|
||||||
]"
|
|
||||||
:style="tabWidth"
|
|
||||||
role="button"
|
|
||||||
:data-test="tab.type + '-tab'"
|
|
||||||
@click="$emit('switch-tab', tab.type)"
|
|
||||||
>
|
|
||||||
<ds-space margin="small">
|
|
||||||
{{ tab.count }}
|
|
||||||
</ds-space>
|
|
||||||
</li>
|
|
||||||
</ul> -->
|
|
||||||
<!-- Wolle <ds-grid-item class="tab-navigation" :row-span="3" column-span="fullWidth"> -->
|
|
||||||
<ds-grid-item class="tab-navigation" :row-span="tabs.length" column-span="fullWidth">
|
<ds-grid-item class="tab-navigation" :row-span="tabs.length" column-span="fullWidth">
|
||||||
<base-card class="ds-tab-nav">
|
<base-card class="ds-tab-nav">
|
||||||
<ul class="Tabs">
|
<ul class="Tabs">
|
||||||
@ -34,11 +13,8 @@
|
|||||||
]"
|
]"
|
||||||
:data-test="tab.type + '-tab'"
|
:data-test="tab.type + '-tab'"
|
||||||
>
|
>
|
||||||
<!-- Wolle <a :class="[tab.type + '-tab']" @click="switchTab(tab)"> -->
|
|
||||||
<a :data-test="tab.type + '-tab-click'" @click="switchTab(tab)">
|
<a :data-test="tab.type + '-tab-click'" @click="switchTab(tab)">
|
||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<!-- Wolle translate -->
|
|
||||||
<!-- <client-only placeholder="Loading..."> -->
|
|
||||||
<client-only :placeholder="$t('client-only.loading')">
|
<client-only :placeholder="$t('client-only.loading')">
|
||||||
<ds-number :label="tab.title">
|
<ds-number :label="tab.title">
|
||||||
<hc-count-to slot="count" :end-val="tab.count" />
|
<hc-count-to slot="count" :end-val="tab.count" />
|
||||||
@ -54,12 +30,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HcCountTo from '~/components/CountTo.vue'
|
import HcCountTo from '~/components/CountTo.vue'
|
||||||
// Wolle import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
HcCountTo,
|
HcCountTo,
|
||||||
// Wolle MasonryGridItem,
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
tabs: {
|
tabs: {
|
||||||
@ -70,11 +44,6 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Wolle computed: {
|
|
||||||
// tabWidth() {
|
|
||||||
// return 'width: ' + String(100.0 / this.tabs.length) + '%'
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
methods: {
|
methods: {
|
||||||
switchTab(tab) {
|
switchTab(tab) {
|
||||||
if (!tab.disabled) {
|
if (!tab.disabled) {
|
||||||
@ -86,38 +55,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// Wolle clean up
|
|
||||||
// .tab-navigation {
|
|
||||||
// display: flex;
|
|
||||||
// margin-top: $space-small;
|
|
||||||
|
|
||||||
// > .tab {
|
|
||||||
// font-weight: $font-weight-bold;
|
|
||||||
// padding: $space-x-small $space-small;
|
|
||||||
// margin-right: $space-xx-small;
|
|
||||||
// border-radius: $border-radius-base $border-radius-base 0 0;
|
|
||||||
// background: $color-neutral-100;
|
|
||||||
// cursor: pointer;
|
|
||||||
|
|
||||||
// &.--active {
|
|
||||||
// background: $color-neutral-80;
|
|
||||||
// border: none;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &.--disabled {
|
|
||||||
// background: $background-color-disabled;
|
|
||||||
// border: $border-size-base solid $color-neutral-80;
|
|
||||||
// border-bottom: none;
|
|
||||||
// pointer-events: none;
|
|
||||||
// cursor: default;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &:hover:not(.--active) {
|
|
||||||
// background: $color-neutral-85;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
.pointer {
|
.pointer {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@ -160,7 +97,6 @@ export default {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
.ds-tab-nav-item {
|
.ds-tab-nav-item {
|
||||||
// Wolle is this doubled?
|
|
||||||
&.ds-tab-nav-item-active {
|
&.ds-tab-nav-item-active {
|
||||||
border-bottom: 3px solid #17b53f;
|
border-bottom: 3px solid #17b53f;
|
||||||
&:first-child {
|
&:first-child {
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul class="tab-navigation">
|
<ul class="tab-navigation">
|
||||||
<!-- Wolle Fix warning for 'switchTab', see below. -->
|
|
||||||
<li
|
<li
|
||||||
v-for="tab in tabs"
|
v-for="tab in tabs"
|
||||||
:key="tab.type"
|
:key="tab.type"
|
||||||
@ -15,30 +14,15 @@
|
|||||||
:data-test="tab.type + '-tab'"
|
:data-test="tab.type + '-tab'"
|
||||||
@click="$emit('switch-tab', tab.type)"
|
@click="$emit('switch-tab', tab.type)"
|
||||||
>
|
>
|
||||||
<!-- Wolle <ds-space :class="lowerCase('Post-tab')" margin="small"> -->
|
|
||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<!-- <ds-number :label="tab.title"> -->
|
|
||||||
<!-- Wolle <hc-count-to slot="count" :end-val="tab.count" /> -->
|
|
||||||
{{ tab.count }}
|
{{ tab.count }}
|
||||||
<!-- </ds-number> -->
|
|
||||||
<!-- <client-only placeholder="Loading...">
|
|
||||||
<ds-number :label="tab.title">
|
|
||||||
Wolle <hc-count-to slot="count" :end-val="tab.count" />
|
|
||||||
{{ tab.count }}
|
|
||||||
</ds-number>
|
|
||||||
</client-only> -->
|
|
||||||
</ds-space>
|
</ds-space>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Wolle import HcCountTo from '~/components/CountTo.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// Wolle components: {
|
|
||||||
// HcCountTo,
|
|
||||||
// },
|
|
||||||
props: {
|
props: {
|
||||||
tabs: {
|
tabs: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|||||||
@ -110,49 +110,6 @@
|
|||||||
<masonry-grid>
|
<masonry-grid>
|
||||||
<!-- TapNavigation -->
|
<!-- TapNavigation -->
|
||||||
<new-tab-navigation :tabs="tabOptions" :activeTab="tabActive" @switch-tab="handleTab" />
|
<new-tab-navigation :tabs="tabOptions" :activeTab="tabActive" @switch-tab="handleTab" />
|
||||||
<!-- Wolle <ds-grid-item class="profile-top-navigation" :row-span="3" column-span="fullWidth">
|
|
||||||
<base-card class="ds-tab-nav">
|
|
||||||
<ul class="Tabs">
|
|
||||||
<li class="Tabs__tab pointer" :class="{ active: tabActive === 'post' }">
|
|
||||||
<a @click="handleTab('post')">
|
|
||||||
<ds-space margin="small">
|
|
||||||
<client-only placeholder="Loading...">
|
|
||||||
<ds-number :label="$t('common.post', null, user.contributionsCount)">
|
|
||||||
<hc-count-to slot="count" :end-val="user.contributionsCount" />
|
|
||||||
</ds-number>
|
|
||||||
</client-only>
|
|
||||||
</ds-space>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="Tabs__tab pointer" :class="{ active: tabActive === 'comment' }">
|
|
||||||
<a @click="handleTab('comment')">
|
|
||||||
<ds-space margin="small">
|
|
||||||
<client-only placeholder="Loading...">
|
|
||||||
<ds-number :label="$t('profile.commented')">
|
|
||||||
<hc-count-to slot="count" :end-val="user.commentedCount" />
|
|
||||||
</ds-number>
|
|
||||||
</client-only>
|
|
||||||
</ds-space>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
class="Tabs__tab pointer"
|
|
||||||
:class="{ active: tabActive === 'shout' }"
|
|
||||||
v-if="myProfile || user.showShoutsPublicly"
|
|
||||||
>
|
|
||||||
<a @click="handleTab('shout')">
|
|
||||||
<ds-space margin="small">
|
|
||||||
<client-only placeholder="Loading...">
|
|
||||||
<ds-number :label="$t('profile.shouted')">
|
|
||||||
<hc-count-to slot="count" :end-val="user.shoutedCount" />
|
|
||||||
</ds-number>
|
|
||||||
</client-only>
|
|
||||||
</ds-space>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</base-card>
|
|
||||||
</ds-grid-item> -->
|
|
||||||
|
|
||||||
<!-- feed -->
|
<!-- feed -->
|
||||||
<ds-grid-item :row-span="2" column-span="fullWidth">
|
<ds-grid-item :row-span="2" column-span="fullWidth">
|
||||||
@ -461,33 +418,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
// Wolle .pointer {
|
|
||||||
// cursor: pointer;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Wolle .Tabs {
|
|
||||||
// position: relative;
|
|
||||||
// background-color: #fff;
|
|
||||||
// height: 100%;
|
|
||||||
// display: flex;
|
|
||||||
// margin: 0;
|
|
||||||
// padding: 0;
|
|
||||||
// list-style: none;
|
|
||||||
|
|
||||||
// &__tab {
|
|
||||||
// text-align: center;
|
|
||||||
// height: 100%;
|
|
||||||
// flex-grow: 1;
|
|
||||||
|
|
||||||
// &:hover {
|
|
||||||
// border-bottom: 2px solid #c9c6ce;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// &.active {
|
|
||||||
// border-bottom: 2px solid #17b53f;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
.profile-avatar.user-avatar {
|
.profile-avatar.user-avatar {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: -60px;
|
margin-top: -60px;
|
||||||
@ -499,26 +429,6 @@ export default {
|
|||||||
right: $space-x-small;
|
right: $space-x-small;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Wolle .profile-top-navigation {
|
|
||||||
// position: sticky;
|
|
||||||
// top: 53px;
|
|
||||||
// z-index: 2;
|
|
||||||
// }
|
|
||||||
// Wolle .ds-tab-nav.base-card {
|
|
||||||
// padding: 0;
|
|
||||||
|
|
||||||
// .ds-tab-nav-item {
|
|
||||||
// &.ds-tab-nav-item-active {
|
|
||||||
// border-bottom: 3px solid #17b53f;
|
|
||||||
// &:first-child {
|
|
||||||
// border-bottom-left-radius: $border-radius-x-large;
|
|
||||||
// }
|
|
||||||
// &:last-child {
|
|
||||||
// border-bottom-right-radius: $border-radius-x-large;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
.profile-post-add-button {
|
.profile-post-add-button {
|
||||||
box-shadow: $box-shadow-x-large;
|
box-shadow: $box-shadow-x-large;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user