diff --git a/frontend/src/components/Menu/Sidebar.spec.js b/frontend/src/components/Menu/Sidebar.spec.js index bd107d40b..c1f8c8fc7 100644 --- a/frontend/src/components/Menu/Sidebar.spec.js +++ b/frontend/src/components/Menu/Sidebar.spec.js @@ -37,66 +37,104 @@ describe('Sidebar', () => { expect(wrapper.findAll('.nav-item')).toHaveLength(8) }) - it('has first nav-item "navigation.overview" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(0).text()).toEqual('navigation.overview') + describe('navigation Navbar (general elements)', () => { + it('has first nav-item "navigation.overview" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(0).text()).toEqual('navigation.overview') + }) + + it('has first nav-item "navigation.send" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(1).text()).toEqual('navigation.send') + }) + + it('has first nav-item "navigation.transactions" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(2).text()).toEqual('navigation.transactions') + }) + + it('has first nav-item "navigation.community" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(3).text()).toContain('navigation.community') + }) + + it('has first nav-item "navigation.profile" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(4).text()).toEqual('navigation.profile') + }) + + it('has first nav-item "navigation.profile" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.profile') + }) }) - it('has first nav-item "navigation.send" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(1).text()).toEqual('navigation.send') + describe('navigation Navbar (user has an elopage account)', () => { + it('has eight b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(8) + }) + + it('has a link to the members area', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') + expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('#') + }) + + it('has first nav-item "navigation.admin_area" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area') + }) + + it('has first nav-item "navigation.logout" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') + }) }) - it('has first nav-item "navigation.transactions" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(2).text()).toEqual('navigation.transactions') + describe('navigation Navbar (user has no elopage account)', () => { + beforeAll(() => { + mocks.$store.state.hasElopage = false + wrapper = Wrapper() + }) + + it('has seven b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(7) + }) + + it('has first nav-item "navigation.admin_area" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.admin_area') + }) + + it('has first nav-item "community.community" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('community.community') + }) + + it('has a link to the members area', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') + expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('#') + }) + + it('has first nav-item "navigation.admin_area" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area') + }) + + it('has first nav-item "navigation.logout" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') + }) }) - it('has first nav-item "navigation.community" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(3).text()).toContain('navigation.community') - }) + describe('navigation Navbar (user has no elopage account)', () => { + beforeAll(() => { + mocks.$store.state.hasElopage = false + wrapper = Wrapper() + }) - it('has first nav-item "navigation.profile" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(4).text()).toEqual('navigation.profile') - }) - }) + it('has seven b-nav-item in the navbar', () => { + expect(wrapper.findAll('.nav-item')).toHaveLength(7) + }) - describe('navigation Navbar (user has an elopage account)', () => { - it('has eight b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(8) - }) + it('has first nav-item "navigation.admin_area" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.admin_area') + }) - it('has a link to the members area', () => { - expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.members_area') - expect(wrapper.findAll('.nav-item').at(5).find('a').attributes('href')).toBe('#') - }) + it('has first nav-item "community.community" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('community.community') + }) - it('has first nav-item "navigation.admin_area" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('navigation.admin_area') - }) - - it('has first nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') - }) - }) - - describe('navigation Navbar (user has no elopage account)', () => { - beforeAll(() => { - mocks.$store.state.hasElopage = false - wrapper = Wrapper() - }) - - it('has seven b-nav-item in the navbar', () => { - expect(wrapper.findAll('.nav-item')).toHaveLength(7) - }) - - it('has first nav-item "navigation.admin_area" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(5).text()).toEqual('navigation.admin_area') - }) - - it('has first nav-item "community.community" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(6).text()).toEqual('community.community') - }) - - it('has first nav-item "navigation.logout" in navbar', () => { - expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') + it('has first nav-item "navigation.logout" in navbar', () => { + expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('navigation.logout') + }) }) }) }) diff --git a/frontend/src/components/Menu/Sidebar.vue b/frontend/src/components/Menu/Sidebar.vue index e6bb4c6d9..deeecb564 100644 --- a/frontend/src/components/Menu/Sidebar.vue +++ b/frontend/src/components/Menu/Sidebar.vue @@ -24,6 +24,10 @@ {{ $t('navigation.profile') }} + + + {{ $t('navigation.info') }} +
diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 97c51df9e..fdbbd1e93 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -176,8 +176,8 @@ export const listContributionLinks = gql` maxAmount } } - ` - +` + export const listContributions = gql` query( $currentPage: Int = 1 diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index d5fb21bc9..1db4d75a6 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -28,12 +28,11 @@ "current-community": "Aktuelle Gemeinschaft", "members": "Mitglieder", "moderators": "Moderatoren", + "myContributions": "Meine Beiträge zum Gemeinwohl", "openContributionLinks": "öffentliche Beitragslinklist", "openContributionLinkText": "Folgende automatische Schöpfungen werden zur Zeit durch die Gemeinschaft '{_name_}' bereitgestellt.", "other-communities": "Weitere Gemeinschaften", "statistic": "Statistik", - "myContributions": "Meine Beiträge zum Gemeinwohl", - "other-communities": "Weitere Gemeinschaften", "submitContribution": "Beitrag einreichen", "switch-to-this-community": "zu dieser Gemeinschaft wechseln" }, @@ -227,6 +226,7 @@ "navigation": { "admin_area": "Adminbereich", "community": "Gemeinschaft", + "info": "Info", "logout": "Abmelden", "members_area": "Mitgliederbereich", "overview": "Übersicht", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 202420b32..8c6caf7df 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -28,12 +28,11 @@ "current-community": "Current community", "members": "Members", "moderators": "Moderators", + "myContributions": "My contributions to the common good", "openContributionLinks": "open Contribution links list", "openContributionLinkText": "The following automatic creations are currently provided by the '{_name_}' community.", "other-communities": "Other communities", "statistic": "Statistics", - "myContributions": "My contributions to the common good", - "other-communities": "Other communities", "submitContribution": "Submit contribution", "switch-to-this-community": "Switch to this community" }, @@ -227,6 +226,7 @@ "navigation": { "admin_area": "Admin Area", "community": "Community", + "info": "Info", "logout": "Logout", "members_area": "Members area", "overview": "Overview", diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index e1c8c9683..64aca6156 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -1,59 +1,4 @@ - diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index 540ef9d69..bd8f67524 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -45,6 +45,13 @@ const routes = [ requiresAuth: true, }, }, + { + path: '/info', + component: () => import('@/pages/InfoStatistic.vue'), + meta: { + requiresAuth: true, + }, + }, { path: '/login/:code?', component: () => import('@/pages/Login.vue'),