getElopageLink to data and props elopageUri

This commit is contained in:
ogerly 2021-12-10 10:03:53 +01:00
parent d6b32b6ba5
commit b874abb4f8
5 changed files with 25 additions and 12 deletions

View File

@ -68,6 +68,15 @@ describe('Navbar', () => {
it('has first nav-item "members_area" in navbar', () => { it('has first nav-item "members_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('members_area') expect(wrapper.findAll('.nav-item').at(7).text()).toEqual('members_area')
}) })
it('has a link to the members area', () => {
expect(wrapper.findAll('.nav-item').at(7).text()).toContain('members_area')
expect(wrapper.findAll('.nav-item').at(7).find('a').attributes('href')).toBe(
'https://elopage.com/s/gradido/basic-de/payment?locale=en&prid=111&pid=123&firstName=User&lastName=Example&email=user@example.org',
)
})
it('has first nav-item "admin_area" in navbar', () => { it('has first nav-item "admin_area" in navbar', () => {
expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('admin_area') expect(wrapper.findAll('.nav-item').at(8).text()).toEqual('admin_area')
}) })

View File

@ -49,7 +49,7 @@
{{ $t('site.navbar.my-profil') }} {{ $t('site.navbar.my-profil') }}
</b-nav-item> </b-nav-item>
<br /> <br />
<b-nav-item class="mb-3" @click="$emit('getElopageLink')"> <b-nav-item :href="elopageUri" class="mb-3" target="_blank">
<b-icon icon="link45deg" aria-hidden="true"></b-icon> <b-icon icon="link45deg" aria-hidden="true"></b-icon>
{{ $t('members_area') }} {{ $t('members_area') }}
<b-badge v-if="!$store.state.hasElopage" pill variant="danger">!</b-badge> <b-badge v-if="!$store.state.hasElopage" pill variant="danger">!</b-badge>
@ -78,6 +78,10 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
elopageUri: {
type: String,
required: false,
},
}, },
data() { data() {
return { return {

View File

@ -14,7 +14,7 @@
</b-nav> </b-nav>
<hr /> <hr />
<b-nav vertical class="w-100"> <b-nav vertical class="w-100">
<b-nav-item class="mb-3" @click="$emit('get-elopage-link')"> <b-nav-item class="mb-3" :href="elopageUri" target="_blank">
<b-icon icon="link45deg" aria-hidden="true"></b-icon> <b-icon icon="link45deg" aria-hidden="true"></b-icon>
{{ $t('members_area') }} {{ $t('members_area') }}
<b-badge v-if="!$store.state.hasElopage" pill variant="danger">!</b-badge> <b-badge v-if="!$store.state.hasElopage" pill variant="danger">!</b-badge>
@ -35,5 +35,11 @@
<script> <script>
export default { export default {
name: 'sidebar', name: 'sidebar',
props: {
elopageUri: {
type: String,
required: false,
},
},
} }
</script> </script>

View File

@ -138,9 +138,7 @@ describe('DashboardLayoutGdd', () => {
) )
}) })
it('has a logout button', () => {
expect(wrapper.findAll('ul').at(3).text()).toBe('logout')
})
describe('logout', () => { describe('logout', () => {
beforeEach(async () => { beforeEach(async () => {

View File

@ -4,19 +4,14 @@
class="main-navbar" class="main-navbar"
:balance="balance" :balance="balance"
:visible="visible" :visible="visible"
:elopageUri="elopageUri"
@set-visible="setVisible" @set-visible="setVisible"
@get-elopage-link="getElopageLink"
@admin="admin" @admin="admin"
@logout="logout" @logout="logout"
/> />
<div class="content-gradido"> <div class="content-gradido">
<div class="d-none d-sm-none d-md-none d-lg-flex shadow-lg" style="width: 300px"> <div class="d-none d-sm-none d-md-none d-lg-flex shadow-lg" style="width: 300px">
<sidebar <sidebar class="main-sidebar" :elopageUri="elopageUri" @admin="admin" @logout="logout" />
class="main-sidebar"
@getElopageLink="getElopageLink"
@admin="admin"
@logout="logout"
/>
</div> </div>
<div class="main-page ml-2 mr-2" style="width: 100%" @click="visible = false"> <div class="main-page ml-2 mr-2" style="width: 100%" @click="visible = false">
@ -64,6 +59,7 @@ export default {
transactionCount: 0, transactionCount: 0,
pending: true, pending: true,
visible: false, visible: false,
elopageUri: this.getElopageLink(),
} }
}, },
methods: { methods: {