mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
rename community page to contributions page to prevent confusion with cross-community stuff
This commit is contained in:
parent
a40ae18f2b
commit
ec90cb4a36
@ -26,7 +26,12 @@
|
||||
<span class="ms-2">{{ $t('navigation.transactions') }}</span>
|
||||
</div>
|
||||
</BNavItem>
|
||||
<BNavItem ref="communityLink" to="/community" class="mb-3" active-class="active-route">
|
||||
<BNavItem
|
||||
ref="contributionsLink"
|
||||
to="/contributions"
|
||||
class="mb-3"
|
||||
active-class="active-route"
|
||||
>
|
||||
<div class="sidebar-menu-item-wrapper">
|
||||
<i-mdi-people-group class="svg-icon" />
|
||||
<span class="ms-2">{{ $t('creation') }}</span>
|
||||
@ -97,7 +102,7 @@ const props = defineProps({
|
||||
const emit = defineEmits(['closeSidebar'])
|
||||
|
||||
const route = useRoute()
|
||||
const communityLink = ref(null)
|
||||
const contributionsLink = ref(null)
|
||||
|
||||
const transactionClass = computed(() => {
|
||||
if (route.path === '/gdt') {
|
||||
@ -109,8 +114,8 @@ const transactionClass = computed(() => {
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
const link = [...communityLink.value.$el.children][0]
|
||||
if (route.path.includes('community')) {
|
||||
const link = [...contributionsLink.value.$el.children][0]
|
||||
if (route.path.includes('contributions')) {
|
||||
link.classList.add('active-route')
|
||||
link.classList.add('router-link-exact-active')
|
||||
} else {
|
||||
|
||||
@ -316,7 +316,7 @@
|
||||
},
|
||||
"openHours": "Offene Stunden",
|
||||
"pageTitle": {
|
||||
"community": "Gradido schöpfen",
|
||||
"contributions": "Gradido schöpfen",
|
||||
"gdt": "Deine GDT Transaktionen",
|
||||
"information": "{community}",
|
||||
"overview": "Willkommen {name}",
|
||||
|
||||
@ -316,7 +316,7 @@
|
||||
},
|
||||
"openHours": "Open Hours",
|
||||
"pageTitle": {
|
||||
"community": "Create Gradido",
|
||||
"contributions": "Create Gradido",
|
||||
"gdt": "Your GDT transactions",
|
||||
"information": "{community}",
|
||||
"overview": "Welcome {name}",
|
||||
|
||||
@ -276,7 +276,7 @@
|
||||
},
|
||||
"openHours": "Open Hours",
|
||||
"pageTitle": {
|
||||
"community": "Create Gradido",
|
||||
"contributions": "Cuchara Gradido",
|
||||
"gdt": "Tu GDT Transacciones",
|
||||
"information": "{community}",
|
||||
"overview": "Welcome {name}",
|
||||
|
||||
@ -284,7 +284,7 @@
|
||||
},
|
||||
"openHours": "Heures ouverte",
|
||||
"pageTitle": {
|
||||
"community": "Ma communauté",
|
||||
"contributions": "Ma communauté",
|
||||
"gdt": "Vos transactions GDT",
|
||||
"information": "{community}",
|
||||
"overview": "Bienvenue {name}",
|
||||
|
||||
@ -276,7 +276,7 @@
|
||||
},
|
||||
"openHours": "Open Hours",
|
||||
"pageTitle": {
|
||||
"community": "Create Gradido",
|
||||
"contributions": "Gradido scoop",
|
||||
"gdt": "Your GDT transactions",
|
||||
"information": "{community}",
|
||||
"overview": "Welcome {name}",
|
||||
|
||||
@ -4,7 +4,7 @@ import { mount } from '@vue/test-utils'
|
||||
import { BTab, BTabs } from 'bootstrap-vue-next'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import Community from './Community'
|
||||
import Contributions from './Contributions'
|
||||
|
||||
// Mock external dependencies
|
||||
vi.mock('vue-router', () => ({
|
||||
@ -56,7 +56,7 @@ vi.mock('@/components/Contributions/ContributionListAll', () => ({
|
||||
},
|
||||
}))
|
||||
|
||||
describe('Community', () => {
|
||||
describe('Contributions', () => {
|
||||
let wrapper
|
||||
let mockRouter
|
||||
let mockToast
|
||||
@ -76,7 +76,7 @@ describe('Community', () => {
|
||||
onResult: mockCountContributionsInProgress,
|
||||
}))
|
||||
|
||||
wrapper = mount(Community, {
|
||||
wrapper = mount(Contributions, {
|
||||
global: {
|
||||
mocks: {
|
||||
$t: (key) => key, // Mock $t function
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="community-page">
|
||||
<div class="contributions-page">
|
||||
<div>
|
||||
<BTabs :model-value="tabIndex" no-nav-style borderless align="center">
|
||||
<BTab no-body lazy>
|
||||
@ -33,7 +33,7 @@ import { countContributionsInProgress } from '@/graphql/contributions.graphql'
|
||||
import { useAppToast } from '@/composables/useToast'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const COMMUNITY_TABS = ['contribute', 'contributions', 'community']
|
||||
const CONTRIBUTION_TABS = ['contribute', 'own_contributions', 'all_contributions']
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@ -58,8 +58,8 @@ handleInProgressContributionFound(({ data }) => {
|
||||
if (data) {
|
||||
if (data.countContributionsInProgress > 0) {
|
||||
tabIndex.value = 1
|
||||
if (route.params.tab !== 'contributions') {
|
||||
router.push({ params: { tab: 'contributions' } })
|
||||
if (route.params.tab !== 'own_contributions') {
|
||||
router.push({ params: { tab: 'own_contributions' } })
|
||||
}
|
||||
toastInfo(t('contribution.alert.answerQuestionToast'))
|
||||
}
|
||||
@ -67,7 +67,7 @@ handleInProgressContributionFound(({ data }) => {
|
||||
})
|
||||
|
||||
const updateTabIndex = () => {
|
||||
const index = COMMUNITY_TABS.indexOf(route.params.tab)
|
||||
const index = CONTRIBUTION_TABS.indexOf(route.params.tab)
|
||||
tabIndex.value = index > -1 ? index : 0
|
||||
}
|
||||
// after a edit contribution was saved, jump to contributions tab
|
||||
@ -76,7 +76,7 @@ function handleContributionUpdated() {
|
||||
itemData.value = null
|
||||
tabIndex.value = 1
|
||||
router.push({
|
||||
params: { tab: 'contributions', page: editContributionPage.value },
|
||||
params: { tab: 'own_contributions', page: editContributionPage.value },
|
||||
hash: `#contributionListItem-${contributionItemId}`,
|
||||
})
|
||||
}
|
||||
@ -57,22 +57,22 @@ const routes = [
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/community',
|
||||
component: () => import('@/pages/Community'),
|
||||
path: '/contributions',
|
||||
component: () => import('@/pages/Contributions'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'community',
|
||||
pageTitle: 'contributions',
|
||||
},
|
||||
redirect: (to) => {
|
||||
return { path: '/community/contribute' }
|
||||
return { path: '/contributions/contribute' }
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/community/:tab/:page?',
|
||||
component: () => import('@/pages/Community.vue'),
|
||||
path: '/contributions/:tab/:page?',
|
||||
component: () => import('@/pages/Contributions.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
pageTitle: 'community',
|
||||
pageTitle: 'contributions',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user