mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Cleanup
This commit is contained in:
parent
245be52ac8
commit
7888d93a7f
@ -33,7 +33,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isPopoverOpen: false,
|
isPopoverOpen: false,
|
||||||
developperNoAutoClosing: true, // Wolle // stops automatic closing of menu for developper purposes: default is 'false'
|
developperNoAutoClosing: false, // stops automatic closing of menu for developper purposes: default is 'false'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<following-filter />
|
<following-filter />
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-menu-options">
|
<div class="filter-menu-options">
|
||||||
<h2 class="title">{{ $t('filter-menu.order-by') }}</h2> <!-- Wolle -->
|
<h2 class="title">{{ $t('filter-menu.order-by') }}</h2>
|
||||||
<date-sort-filter />
|
<date-sort-filter />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -24,23 +24,6 @@ describe('PostIndex', () => {
|
|||||||
store = new Vuex.Store({
|
store = new Vuex.Store({
|
||||||
getters: {
|
getters: {
|
||||||
'posts/filter': () => ({}),
|
'posts/filter': () => ({}),
|
||||||
// Wolle
|
|
||||||
// 'posts/orderOptions': () => () => [
|
|
||||||
// {
|
|
||||||
// key: 'store.posts.orderBy.oldest.label',
|
|
||||||
// label: 'store.posts.orderBy.oldest.label',
|
|
||||||
// icon: 'sort-amount-asc',
|
|
||||||
// value: 'createdAt_asc',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// key: 'store.posts.orderBy.newest.label',
|
|
||||||
// label: 'store.posts.orderBy.newest.label',
|
|
||||||
// icon: 'sort-amount-desc',
|
|
||||||
// value: 'createdAt_desc',
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// 'posts/selectedOrder': () => () => 'createdAt_desc',
|
|
||||||
// 'posts/orderIcon': () => 'sort-amount-desc',
|
|
||||||
'posts/orderBy': () => 'createdAt_desc',
|
'posts/orderBy': () => 'createdAt_desc',
|
||||||
'auth/user': () => {
|
'auth/user': () => {
|
||||||
return { id: 'u23' }
|
return { id: 'u23' }
|
||||||
@ -119,11 +102,6 @@ describe('PostIndex', () => {
|
|||||||
localVue,
|
localVue,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Wolle it('calls store when using order by menu', () => {
|
|
||||||
// wrapper.findAll('li').at(0).trigger('click')
|
|
||||||
// expect(mutations['posts/SELECT_ORDER']).toHaveBeenCalledWith({}, 'createdAt_asc')
|
|
||||||
// })
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -97,7 +97,6 @@ import HcEmpty from '~/components/Empty/Empty'
|
|||||||
import PostTeaser from '~/components/PostTeaser/PostTeaser.vue'
|
import PostTeaser from '~/components/PostTeaser/PostTeaser.vue'
|
||||||
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'
|
||||||
// Wolle import { mapGetters, mapMutations } from 'vuex'
|
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import { filterPosts } from '~/graphql/PostQuery.js'
|
import { filterPosts } from '~/graphql/PostQuery.js'
|
||||||
import UpdateQuery from '~/components/utils/UpdateQuery'
|
import UpdateQuery from '~/components/utils/UpdateQuery'
|
||||||
@ -130,24 +129,8 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
postsFilter: 'posts/filter',
|
postsFilter: 'posts/filter',
|
||||||
// Wolle care for the store !!! orderOptions: 'posts/orderOptions',
|
|
||||||
orderBy: 'posts/orderBy',
|
orderBy: 'posts/orderBy',
|
||||||
// Wolle selectedOrder: 'posts/selectedOrder',
|
|
||||||
// Wolle sortingIcon: 'posts/orderIcon',
|
|
||||||
}),
|
}),
|
||||||
// Wolle selected: {
|
|
||||||
// get() {
|
|
||||||
// return this.selectedOrder(this)
|
|
||||||
// },
|
|
||||||
// set({ value }) {
|
|
||||||
// this.offset = 0
|
|
||||||
// this.posts = []
|
|
||||||
// this.selectOrder(value)
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// Wolle sortingOptions() {
|
|
||||||
// return this.orderOptions(this)
|
|
||||||
// },
|
|
||||||
finalFilters() {
|
finalFilters() {
|
||||||
let filter = this.postsFilter
|
let filter = this.postsFilter
|
||||||
if (this.hashtag) {
|
if (this.hashtag) {
|
||||||
@ -164,9 +147,6 @@ export default {
|
|||||||
},
|
},
|
||||||
watchQuery: ['hashtag'],
|
watchQuery: ['hashtag'],
|
||||||
methods: {
|
methods: {
|
||||||
// Wolle ...mapMutations({
|
|
||||||
// selectOrder: 'posts/SELECT_ORDER',
|
|
||||||
// }),
|
|
||||||
clearSearch() {
|
clearSearch() {
|
||||||
this.$router.push({ path: '/' })
|
this.$router.push({ path: '/' })
|
||||||
this.hashtag = null
|
this.hashtag = null
|
||||||
|
|||||||
@ -7,25 +7,11 @@ import clone from 'lodash/clone'
|
|||||||
|
|
||||||
const defaultFilter = {}
|
const defaultFilter = {}
|
||||||
|
|
||||||
// Wolle const orderOptions = {
|
|
||||||
// createdAt_asc: {
|
|
||||||
// value: 'createdAt_asc',
|
|
||||||
// key: 'store.posts.orderBy.oldest.label',
|
|
||||||
// icon: 'sort-amount-asc',
|
|
||||||
// },
|
|
||||||
// createdAt_desc: {
|
|
||||||
// value: 'createdAt_desc',
|
|
||||||
// key: 'store.posts.orderBy.newest.label',
|
|
||||||
// icon: 'sort-amount-desc',
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
|
|
||||||
export const state = () => {
|
export const state = () => {
|
||||||
return {
|
return {
|
||||||
filter: {
|
filter: {
|
||||||
...defaultFilter,
|
...defaultFilter,
|
||||||
},
|
},
|
||||||
// Wolle order: orderOptions.createdAt_desc,
|
|
||||||
order: 'createdAt_desc',
|
order: 'createdAt_desc',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +64,6 @@ export const mutations = {
|
|||||||
state.filter = filter
|
state.filter = filter
|
||||||
},
|
},
|
||||||
TOGGLE_ORDER(state, value) {
|
TOGGLE_ORDER(state, value) {
|
||||||
// Wolle state.order = orderOptions[value]
|
|
||||||
state.order = value
|
state.order = value
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -102,24 +87,7 @@ export const getters = {
|
|||||||
filteredByEmotions(state) {
|
filteredByEmotions(state) {
|
||||||
return get(state.filter, 'emotions_some.emotion_in') || []
|
return get(state.filter, 'emotions_some.emotion_in') || []
|
||||||
},
|
},
|
||||||
// Wolle orderOptions: (state) => ({ $t }) =>
|
|
||||||
// Object.values(orderOptions).map((option) => {
|
|
||||||
// return {
|
|
||||||
// ...option,
|
|
||||||
// label: $t(option.key),
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// Wolle selectedOrder: (state) => ({ $t }) => {
|
|
||||||
// return {
|
|
||||||
// ...state.order,
|
|
||||||
// label: $t(state.order.key),
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
orderBy(state) {
|
orderBy(state) {
|
||||||
// return state.order.value
|
|
||||||
return state.order
|
return state.order
|
||||||
},
|
},
|
||||||
// Wolle orderIcon(state) {
|
|
||||||
// return state.order.icon
|
|
||||||
// },
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,35 +80,9 @@ describe('getters', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// Wolle describe('orderByOptions', () => {
|
|
||||||
// it('returns all options regardless of current state', () => {
|
|
||||||
// const $t = jest.fn((t) => t)
|
|
||||||
// expect(getters.orderOptions()({ $t })).toEqual([
|
|
||||||
// {
|
|
||||||
// key: 'store.posts.orderBy.oldest.label',
|
|
||||||
// label: 'store.posts.orderBy.oldest.label',
|
|
||||||
// icon: 'sort-amount-asc',
|
|
||||||
// value: 'createdAt_asc',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// key: 'store.posts.orderBy.newest.label',
|
|
||||||
// label: 'store.posts.orderBy.newest.label',
|
|
||||||
// icon: 'sort-amount-desc',
|
|
||||||
// value: 'createdAt_desc',
|
|
||||||
// },
|
|
||||||
// ])
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
|
|
||||||
describe('orderBy', () => {
|
describe('orderBy', () => {
|
||||||
it('returns value for graphql query', () => {
|
it('returns value for graphql query', () => {
|
||||||
state = {
|
state = {
|
||||||
// Wolle order: {
|
|
||||||
// key: 'store.posts.orderBy.newest.label',
|
|
||||||
// label: 'store.posts.orderBy.newest.label',
|
|
||||||
// icon: 'sort-amount-desc',
|
|
||||||
// value: 'createdAt_desc',
|
|
||||||
// },
|
|
||||||
order: 'createdAt_desc',
|
order: 'createdAt_desc',
|
||||||
}
|
}
|
||||||
expect(getters.orderBy(state)).toEqual('createdAt_desc')
|
expect(getters.orderBy(state)).toEqual('createdAt_desc')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user