Cleanup comments

This commit is contained in:
Wolfgang Huß 2021-01-21 13:03:32 +01:00
parent 830eb1010c
commit 101b50486c
5 changed files with 1 additions and 267 deletions

View File

@ -34,14 +34,9 @@ describe('SearchResults', () => {
propsData = {
pageSize: 12,
}
// Wolle jest.useFakeTimers()
wrapper = Wrapper()
})
afterEach(() => {
// Wolle jest.clearAllMocks()
})
describe('mount', () => {
it('renders tab-navigation component', () => {
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', () => {
// 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"
@ -69,7 +62,6 @@ describe('SearchResults', () => {
userCount: 8,
activeTab: 'Post',
})
// Wolle await wrapper.vm.$nextTick()
})
it('shows a total of 33 results', () => {
@ -79,9 +71,6 @@ describe('SearchResults', () => {
})
it('shows tab with 25 posts found', () => {
// console.log('postTab: ', postTab.html())
// console.log('wrapper: ', wrapper)
// Wolle jest.runAllTimers()
setTimeout(() => {
expect(wrapper.find('[data-test="Post-tab"]').text()).toContain('25')
}, counterTimeout)

View File

@ -86,19 +86,7 @@
</ds-space>
</ds-grid-item>
</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 -->
<ds-grid-item v-else :row-span="7" column-span="fullWidth">
<ds-space centered>
@ -107,67 +95,6 @@
</ds-grid-item>
</masonry-grid>
</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>
</template>
@ -178,7 +105,6 @@ import HcEmpty from '~/components/Empty/Empty'
import MasonryGrid from '~/components/MasonryGrid/MasonryGrid'
import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem'
import PostTeaser from '~/components/PostTeaser/PostTeaser'
// Wolle import TabNavigation from '~/components/_new/generic/TabNavigation/TabNavigation'
import NewTabNavigation from '~/components/_new/generic/TabNavigation/NewTabNavigation'
import UserTeaser from '~/components/UserTeaser/UserTeaser'
import PaginationButtons from '~/components/_new/generic/PaginationButtons/PaginationButtons'
@ -186,7 +112,6 @@ import HcHashtag from '~/components/Hashtag/Hashtag'
export default {
components: {
// Wolle TabNavigation,
NewTabNavigation,
HcEmpty,
MasonryGrid,
@ -410,10 +335,8 @@ export default {
</script>
<style lang="scss">
// Wolle check if still needed 👇🏼
.search-results {
> .results {
/* display: inline-block;*/
padding: $space-small;
background-color: $color-neutral-80;
border-radius: 0 $border-radius-base $border-radius-base $border-radius-base;
@ -444,16 +367,8 @@ export default {
}
}
// Wolle new
.grid-total-search-results {
padding: 0;
margin: 0;
// margin-bottom: $space-x-small;
// > .base-button {
// display: block;
// width: 100%;
// margin-bottom: $space-x-small;
// }
}
</style>

View File

@ -1,25 +1,4 @@
<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">
<base-card class="ds-tab-nav">
<ul class="Tabs">
@ -34,11 +13,8 @@
]"
:data-test="tab.type + '-tab'"
>
<!-- Wolle <a :class="[tab.type + '-tab']" @click="switchTab(tab)"> -->
<a :data-test="tab.type + '-tab-click'" @click="switchTab(tab)">
<ds-space margin="small">
<!-- Wolle translate -->
<!-- <client-only placeholder="Loading..."> -->
<client-only :placeholder="$t('client-only.loading')">
<ds-number :label="tab.title">
<hc-count-to slot="count" :end-val="tab.count" />
@ -54,12 +30,10 @@
<script>
import HcCountTo from '~/components/CountTo.vue'
// Wolle import MasonryGridItem from '~/components/MasonryGrid/MasonryGridItem.vue'
export default {
components: {
HcCountTo,
// Wolle MasonryGridItem,
},
props: {
tabs: {
@ -70,11 +44,6 @@ export default {
type: String,
},
},
// Wolle computed: {
// tabWidth() {
// return 'width: ' + String(100.0 / this.tabs.length) + '%'
// },
// },
methods: {
switchTab(tab) {
if (!tab.disabled) {
@ -86,38 +55,6 @@ export default {
</script>
<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 {
cursor: pointer;
}
@ -160,7 +97,6 @@ export default {
padding: 0;
.ds-tab-nav-item {
// Wolle is this doubled?
&.ds-tab-nav-item-active {
border-bottom: 3px solid #17b53f;
&:first-child {

View File

@ -1,6 +1,5 @@
<template>
<ul class="tab-navigation">
<!-- Wolle Fix warning for 'switchTab', see below. -->
<li
v-for="tab in tabs"
:key="tab.type"
@ -15,30 +14,15 @@
:data-test="tab.type + '-tab'"
@click="$emit('switch-tab', tab.type)"
>
<!-- Wolle <ds-space :class="lowerCase('Post-tab')" margin="small"> -->
<ds-space margin="small">
<!-- <ds-number :label="tab.title"> -->
<!-- Wolle <hc-count-to slot="count" :end-val="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>
</li>
</ul>
</template>
<script>
// Wolle import HcCountTo from '~/components/CountTo.vue'
export default {
// Wolle components: {
// HcCountTo,
// },
props: {
tabs: {
type: Array,

View File

@ -110,49 +110,6 @@
<masonry-grid>
<!-- TapNavigation -->
<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 -->
<ds-grid-item :row-span="2" column-span="fullWidth">
@ -461,33 +418,6 @@ export default {
</script>
<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 {
margin: auto;
margin-top: -60px;
@ -499,26 +429,6 @@ export default {
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 {
box-shadow: $box-shadow-x-large;
}