mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1682-new-design-for-the-login-and-registration-area
This commit is contained in:
commit
865d54043e
@ -1,9 +1,9 @@
|
||||
CONFIG_VERSION=v3.2022-03-29
|
||||
CONFIG_VERSION=v4.2022-04-05
|
||||
|
||||
# Server
|
||||
PORT=4000
|
||||
JWT_SECRET=secret123
|
||||
JWT_EXPIRES_IN=10m
|
||||
JWT_EXPIRES_IN=30m
|
||||
GRAPHIQL=false
|
||||
GDT_API_URL=https://gdt.gradido.net
|
||||
|
||||
@ -41,7 +41,7 @@ EMAIL_PASSWORD=xxx
|
||||
EMAIL_SMTP_URL=gmail.com
|
||||
EMAIL_SMTP_PORT=587
|
||||
EMAIL_LINK_VERIFICATION=http://localhost/checkEmail/{optin}{code}
|
||||
EMAIL_LINK_SETPASSWORD=http://localhost/reset/{optin}
|
||||
EMAIL_LINK_SETPASSWORD=http://localhost/reset-password/{optin}
|
||||
EMAIL_LINK_FORGOTPASSWORD=http://localhost/forgot-password
|
||||
EMAIL_CODE_VALID_TIME=1440
|
||||
EMAIL_CODE_REQUEST_TIME=10
|
||||
|
||||
@ -2,7 +2,7 @@ CONFIG_VERSION=$BACKEND_CONFIG_VERSION
|
||||
|
||||
# Server
|
||||
JWT_SECRET=$JWT_SECRET
|
||||
JWT_EXPIRES_IN=10m
|
||||
JWT_EXPIRES_IN=$JWT_EXPIRES_IN
|
||||
GRAPHIQL=false
|
||||
GDT_API_URL=$GDT_API_URL
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ const constants = {
|
||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0
|
||||
CONFIG_VERSION: {
|
||||
DEFAULT: 'DEFAULT',
|
||||
EXPECTED: 'v3.2022-03-29',
|
||||
EXPECTED: 'v4.2022-04-05',
|
||||
CURRENT: '',
|
||||
},
|
||||
}
|
||||
@ -22,7 +22,7 @@ const constants = {
|
||||
const server = {
|
||||
PORT: process.env.PORT || 4000,
|
||||
JWT_SECRET: process.env.JWT_SECRET || 'secret123',
|
||||
JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '10m',
|
||||
JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN || '30m',
|
||||
GRAPHIQL: process.env.GRAPHIQL === 'true' || false,
|
||||
GDT_API_URL: process.env.GDT_API_URL || 'https://gdt.gradido.net',
|
||||
PRODUCTION: process.env.NODE_ENV === 'production' || false,
|
||||
|
||||
@ -263,6 +263,9 @@ export class TransactionResolver {
|
||||
if (recipientUser.deletedAt) {
|
||||
throw new Error('The recipient account was deleted')
|
||||
}
|
||||
if (!recipientUser.emailChecked) {
|
||||
throw new Error('The recipient account is not activated')
|
||||
}
|
||||
if (!isHexPublicKey(recipientUser.pubKey.toString('hex'))) {
|
||||
throw new Error('invalid recipient public key')
|
||||
}
|
||||
|
||||
@ -18,7 +18,23 @@ WEBHOOK_GITHUB_SECRET=secret
|
||||
WEBHOOK_GITHUB_BRANCH=master
|
||||
|
||||
# backend
|
||||
BACKEND_CONFIG_VERSION=v3.2022-03-29
|
||||
BACKEND_CONFIG_VERSION=v4.2022-04-05
|
||||
|
||||
JWT_EXPIRES_IN=30m
|
||||
GDT_API_URL=https://gdt.gradido.net
|
||||
|
||||
TYPEORM_LOGGING_RELATIVE_PATH=../deployment/bare_metal/log/typeorm.backend.log
|
||||
|
||||
KLICKTIPP=false
|
||||
KLICKTIPP_USER=
|
||||
KLICKTIPP_PASSWORD=
|
||||
KLICKTIPP_APIKEY_DE=
|
||||
KLICKTIPP_APIKEY_EN=
|
||||
|
||||
COMMUNITY_NAME="Gradido Development Stage1"
|
||||
COMMUNITY_URL=https://stage1.gradido.net/
|
||||
COMMUNITY_REGISTER_URL=https://stage1.gradido.net/register
|
||||
COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community"
|
||||
|
||||
EMAIL=true
|
||||
EMAIL_USERNAME=peter@lustig.de
|
||||
@ -26,28 +42,13 @@ EMAIL_SENDER=peter@lustig.de
|
||||
EMAIL_PASSWORD=1234
|
||||
EMAIL_SMTP_URL=smtp.lustig.de
|
||||
EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/{optin}{code}
|
||||
EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset/{optin}
|
||||
EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset-password/{optin}
|
||||
EMAIL_LINK_FORGOTPASSWORD=https://stage1.gradido.net/forgot-password
|
||||
EMAIL_CODE_VALID_TIME=1440
|
||||
EMAIL_CODE_REQUEST_TIME=10
|
||||
|
||||
TYPEORM_LOGGING_RELATIVE_PATH=../deployment/bare_metal/log/typeorm.backend.log
|
||||
|
||||
WEBHOOK_ELOPAGE_SECRET=secret
|
||||
|
||||
GDT_API_URL=https://gdt.gradido.net
|
||||
|
||||
COMMUNITY_NAME="Gradido Development Stage1"
|
||||
COMMUNITY_URL=https://stage1.gradido.net/
|
||||
COMMUNITY_REGISTER_URL=https://stage1.gradido.net/register
|
||||
COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community"
|
||||
|
||||
KLICKTIPP=false
|
||||
KLICKTIPP_USER=
|
||||
KLICKTIPP_PASSWORD=
|
||||
KLICKTIPP_APIKEY_DE=
|
||||
KLICKTIPP_APIKEY_EN=
|
||||
|
||||
# database
|
||||
DATABASE_CONFIG_VERSION=v1.2022-03-18
|
||||
|
||||
|
||||
132
docu/presentation/gradido-as-platform.drawio
Normal file
132
docu/presentation/gradido-as-platform.drawio
Normal file
@ -0,0 +1,132 @@
|
||||
<mxfile host="65bd71144e">
|
||||
<diagram id="qH1decoyufLOWHgfqT4g" name="Page-1">
|
||||
<mxGraphModel dx="888" dy="633" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0"/>
|
||||
<mxCell id="1" parent="0"/>
|
||||
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="310" y="230" width="220" height="200" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="3" value="Communities" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
|
||||
<mxGeometry x="330" y="330" width="80" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="4" value="" style="shape=flexArrow;endArrow=classic;startArrow=classic;html=1;" parent="1" edge="1">
|
||||
<mxGeometry width="100" height="100" relative="1" as="geometry">
|
||||
<mxPoint x="450" y="390" as="sourcePoint"/>
|
||||
<mxPoint x="485" y="350" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="5" value="Relationships" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="4" vertex="1" connectable="0">
|
||||
<mxGeometry x="0.2283" y="-3" relative="1" as="geometry">
|
||||
<mxPoint x="11" y="33" as="offset"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="6" value="Money<br>Creation" style="rhombus;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="430" y="240" width="80" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="7" value="<br>Money&nbsp; &nbsp; &nbsp;&nbsp;<br>Transfer&nbsp; &nbsp; &nbsp;&nbsp;" style="triangle;whiteSpace=wrap;html=1;" parent="1" vertex="1">
|
||||
<mxGeometry x="340" y="240" width="60" height="80" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="11" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
||||
<mxGeometry x="485" y="330" width="20" height="20" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="14" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1">
|
||||
<mxGeometry x="431" y="390" width="20" height="20" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="17" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="530" y="230" width="120" height="200" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="18" value="Abilities &amp;<br>Talents&nbsp;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="543" y="250" width="100" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="20" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="6" target="18">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="24" style="edgeStyle=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;dashed=1;dashPattern=1 2;" edge="1" parent="1" source="22" target="18">
|
||||
<mxGeometry relative="1" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="22" value="User Management" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="543" y="342" width="100" height="60" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="23" value="" style="endArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;dashed=1;dashPattern=1 2;" edge="1" parent="1" target="22">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="500" y="372" as="sourcePoint"/>
|
||||
<mxPoint x="530" y="310" as="targetPoint"/>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="25" value="" style="shape=or;whiteSpace=wrap;html=1;direction=south;" vertex="1" parent="1">
|
||||
<mxGeometry x="438" y="430" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="26" value="" style="shape=or;whiteSpace=wrap;html=1;direction=south;" vertex="1" parent="1">
|
||||
<mxGeometry x="559" y="430" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="27" value="" style="shape=or;whiteSpace=wrap;html=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="559" y="190" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="28" value="" style="shape=or;whiteSpace=wrap;html=1;direction=east;" vertex="1" parent="1">
|
||||
<mxGeometry x="650" y="340" width="40" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="29" value="" style="shape=or;whiteSpace=wrap;html=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="439" y="190" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="30" value="" style="shape=or;whiteSpace=wrap;html=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="333" y="190" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="31" value="" style="shape=or;whiteSpace=wrap;html=1;direction=east;" vertex="1" parent="1">
|
||||
<mxGeometry x="650" y="248" width="40" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="32" value="" style="shape=or;whiteSpace=wrap;html=1;direction=south;" vertex="1" parent="1">
|
||||
<mxGeometry x="336" y="430" width="70" height="40" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="33" value="" style="shape=or;whiteSpace=wrap;html=1;direction=west;" vertex="1" parent="1">
|
||||
<mxGeometry x="270" y="245" width="40" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="34" value="" style="shape=or;whiteSpace=wrap;html=1;direction=west;" vertex="1" parent="1">
|
||||
<mxGeometry x="270" y="335" width="40" height="70" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="36" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=west;" vertex="1" parent="1">
|
||||
<mxGeometry x="677" y="337" width="83" height="75" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="37" value="Dating App" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="740" y="330" width="100" height="100" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="38" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=west;" vertex="1" parent="1">
|
||||
<mxGeometry x="677" y="244" width="83" height="75" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="39" value="Local Area Search for Abilities &amp; Talents" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="740" y="227" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="40" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=south;" vertex="1" parent="1">
|
||||
<mxGeometry x="437" y="120" width="75" height="83" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="41" value="Micro Creations to gamify Applications" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="424" y="47" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="42" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=south;" vertex="1" parent="1">
|
||||
<mxGeometry x="330" y="120" width="75" height="83" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="43" value="Marketplace" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="317" y="47" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="44" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="436" y="457" width="75" height="83" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="45" value="Search Engine" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="424" y="507" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="46" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="333" y="456" width="75" height="83" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="47" value="Chat" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="319" y="506" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="48" value="" style="shape=dataStorage;whiteSpace=wrap;html=1;fixedSize=1;direction=north;" vertex="1" parent="1">
|
||||
<mxGeometry x="556" y="457" width="75" height="83" as="geometry"/>
|
||||
</mxCell>
|
||||
<mxCell id="49" value="Newsletter" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="544" y="507" width="100" height="103" as="geometry"/>
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
||||
BIN
docu/presentation/scope-of-gradido.odp
Normal file
BIN
docu/presentation/scope-of-gradido.odp
Normal file
Binary file not shown.
BIN
docu/presentation/scope-of-gradido.pdf
Normal file
BIN
docu/presentation/scope-of-gradido.pdf
Normal file
Binary file not shown.
@ -224,7 +224,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.form.email = this.recipientEmail ? this.recipientEmail : ''
|
||||
this.form.email = this.recipientEmail ? this.recipientEmail : this.form.email
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -23,6 +23,8 @@ describe('GddTransactionList', () => {
|
||||
return mount(GddTransactionList, { localVue, mocks })
|
||||
}
|
||||
|
||||
const decayStartBlock = new Date(2001, 8, 9)
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
@ -84,7 +86,6 @@ describe('GddTransactionList', () => {
|
||||
|
||||
describe('with transactions', () => {
|
||||
beforeEach(async () => {
|
||||
const decayStartBlock = new Date(2001, 8, 9)
|
||||
await wrapper.setProps({
|
||||
transactions: [
|
||||
{
|
||||
@ -406,78 +407,58 @@ describe('GddTransactionList', () => {
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
const transactions = Array.from({ length: 42 }, (_, idx) => {
|
||||
return {
|
||||
amount: '3.14',
|
||||
balanceDate: '2021-04-29T17:26:40+00:00',
|
||||
decay: {},
|
||||
memo: 'Kreiszahl PI',
|
||||
linkedUser: {
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
__typename: 'User',
|
||||
},
|
||||
id: idx + 1,
|
||||
typeId: 'RECEIVE',
|
||||
balance: '33.33',
|
||||
}
|
||||
})
|
||||
|
||||
let paginationButtons
|
||||
|
||||
beforeEach(async () => {
|
||||
await wrapper.setProps({
|
||||
transactions,
|
||||
transactions: Array.from({ length: 42 }, (_, idx) => {
|
||||
return {
|
||||
amount: '3.14',
|
||||
balanceDate: '2021-04-29T17:26:40+00:00',
|
||||
decay: {},
|
||||
memo: 'Kreiszahl PI',
|
||||
linkedUser: {
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
__typename: 'User',
|
||||
},
|
||||
id: idx + 1,
|
||||
typeId: 'RECEIVE',
|
||||
balance: '33.33',
|
||||
}
|
||||
}),
|
||||
transactionCount: 42,
|
||||
decayStartBlock,
|
||||
pageSize: 25,
|
||||
showPagination: true,
|
||||
decayStartBlock: new Date(),
|
||||
})
|
||||
paginationButtons = wrapper.find('div.pagination-buttons')
|
||||
})
|
||||
|
||||
it('shows the pagination buttons', () => {
|
||||
expect(paginationButtons.exists()).toBeTruthy()
|
||||
describe('next page button clicked', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
await wrapper.findComponent({ name: 'BPagination' }).vm.$emit('input', 2)
|
||||
})
|
||||
|
||||
it('emits update transactions', () => {
|
||||
expect(wrapper.emitted('update-transactions')).toEqual(
|
||||
expect.arrayContaining([[{ currentPage: 2, pageSize: 25 }]]),
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('show no pagination', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setProps({
|
||||
transactions: [],
|
||||
transactionCount: 2,
|
||||
decayStartBlock,
|
||||
pageSize: 25,
|
||||
showPagination: false,
|
||||
})
|
||||
})
|
||||
|
||||
it('has the previous button disabled', () => {
|
||||
expect(paginationButtons.find('button.previous-page').attributes('disabled')).toBe(
|
||||
'disabled',
|
||||
)
|
||||
})
|
||||
|
||||
it('shows the text "1 / 2"', () => {
|
||||
expect(paginationButtons.find('p.text-center').text()).toBe('1 math.div 2')
|
||||
})
|
||||
|
||||
it('emits update-transactions when next button is clicked', async () => {
|
||||
await paginationButtons.find('button.next-page').trigger('click')
|
||||
expect(wrapper.emitted('update-transactions')[1]).toEqual([
|
||||
{ currentPage: 2, pageSize: 25 },
|
||||
])
|
||||
})
|
||||
|
||||
it('shows text "2 / 2" when next button is clicked', async () => {
|
||||
await paginationButtons.find('button.next-page').trigger('click')
|
||||
expect(paginationButtons.find('p.text-center').text()).toBe('2 math.div 2')
|
||||
})
|
||||
|
||||
it('has next-button disabled when next button is clicked', async () => {
|
||||
await paginationButtons.find('button.next-page').trigger('click')
|
||||
expect(paginationButtons.find('button.next-page').attributes('disabled')).toBe('disabled')
|
||||
})
|
||||
|
||||
it('scrolls to top after loading next page', async () => {
|
||||
await paginationButtons.find('button.next-page').trigger('click')
|
||||
expect(scrollToMock).toBeCalled()
|
||||
})
|
||||
|
||||
it('emits update-transactions when preivous button is clicked after next buton', async () => {
|
||||
await paginationButtons.find('button.next-page').trigger('click')
|
||||
await paginationButtons.find('button.previous-page').trigger('click')
|
||||
expect(wrapper.emitted('update-transactions')[2]).toEqual([
|
||||
{ currentPage: 1, pageSize: 25 },
|
||||
])
|
||||
expect(scrollToMock).toBeCalled()
|
||||
it('shows no pagination buttons', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -63,12 +63,17 @@
|
||||
</transaction-list-item>
|
||||
</div>
|
||||
</div>
|
||||
<pagination-buttons
|
||||
<b-pagination
|
||||
v-if="showPagination"
|
||||
class="mt-3"
|
||||
pills
|
||||
size="lg"
|
||||
v-model="currentPage"
|
||||
:per-page="pageSize"
|
||||
:total-rows="transactionCount"
|
||||
></pagination-buttons>
|
||||
align="center"
|
||||
></b-pagination>
|
||||
|
||||
<div v-if="transactionCount <= 0" class="mt-4 text-center">
|
||||
<b-icon v-if="pending" icon="three-dots" animation="cylon"></b-icon>
|
||||
<div v-else>{{ $t('transaction.nullTransactions') }}</div>
|
||||
@ -78,7 +83,6 @@
|
||||
|
||||
<script>
|
||||
import TransactionListItem from '@/components/TransactionListItem'
|
||||
import PaginationButtons from '@/components/PaginationButtons'
|
||||
import TransactionDecay from '@/components/Transactions/TransactionDecay'
|
||||
import TransactionSend from '@/components/Transactions/TransactionSend'
|
||||
import TransactionReceive from '@/components/Transactions/TransactionReceive'
|
||||
@ -89,7 +93,6 @@ export default {
|
||||
name: 'gdd-transaction-list',
|
||||
components: {
|
||||
TransactionListItem,
|
||||
PaginationButtons,
|
||||
TransactionDecay,
|
||||
TransactionSend,
|
||||
TransactionReceive,
|
||||
|
||||
@ -155,8 +155,8 @@ describe('GdtTransactionList ', () => {
|
||||
describe('change of currentPage', () => {
|
||||
it('calls the API after currentPage changes', async () => {
|
||||
jest.clearAllMocks()
|
||||
wrapper.setData({ currentPage: 2 })
|
||||
await wrapper.vm.$nextTick()
|
||||
await wrapper.setData({ transactionGdtCount: 42 })
|
||||
await wrapper.findComponent({ name: 'BPagination' }).vm.$emit('input', 2)
|
||||
expect(apolloMock).toBeCalledWith(
|
||||
expect.objectContaining({
|
||||
variables: {
|
||||
@ -166,6 +166,44 @@ describe('GdtTransactionList ', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
describe('with transactionCount > pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockResolvedValue({
|
||||
data: {
|
||||
listGDTEntries: {
|
||||
count: 42,
|
||||
gdtEntries: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('shows the pagination buttons', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('with transactionCount < pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockResolvedValue({
|
||||
data: {
|
||||
listGDTEntries: {
|
||||
count: 2,
|
||||
gdtEntries: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('shows no pagination buttons', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -27,23 +27,26 @@
|
||||
></transaction>
|
||||
</div>
|
||||
</div>
|
||||
<pagination-buttons
|
||||
<b-pagination
|
||||
v-if="transactionGdtCount > pageSize"
|
||||
class="mt-3"
|
||||
pills
|
||||
size="lg"
|
||||
v-model="currentPage"
|
||||
:per-page="pageSize"
|
||||
:total-rows="transactionGdtCount"
|
||||
></pagination-buttons>
|
||||
align="center"
|
||||
></b-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listGDTEntriesQuery } from '@/graphql/queries'
|
||||
import PaginationButtons from '@/components/PaginationButtons'
|
||||
import Transaction from '@/components/Transaction.vue'
|
||||
|
||||
export default {
|
||||
name: 'gdt-transaction-list',
|
||||
components: {
|
||||
PaginationButtons,
|
||||
Transaction,
|
||||
},
|
||||
data() {
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import PaginationButtons from './PaginationButtons'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const propsData = {
|
||||
totalRows: 42,
|
||||
perPage: 12,
|
||||
value: 1,
|
||||
}
|
||||
|
||||
describe('PaginationButtons', () => {
|
||||
let wrapper
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(PaginationButtons, { localVue, mocks, propsData })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.pagination-buttons').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
describe('with active buttons', () => {
|
||||
it('emits input next page button is clicked', async () => {
|
||||
wrapper.find('button.next-page').trigger('click')
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.emitted().input[0]).toEqual([2])
|
||||
})
|
||||
|
||||
it('emits input when previous page button is clicked', async () => {
|
||||
wrapper.setProps({ value: 2 })
|
||||
wrapper.setData({ currentValue: 2 })
|
||||
await wrapper.vm.$nextTick()
|
||||
wrapper.find('button.previous-page').trigger('click')
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.emitted().input[0]).toEqual([1])
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -1,53 +0,0 @@
|
||||
<template>
|
||||
<div class="pagination-buttons" v-if="totalRows > perPage">
|
||||
<b-row class="m-4">
|
||||
<b-col class="text-right">
|
||||
<b-button class="previous-page" :disabled="!hasPrevious" @click="currentValue--">
|
||||
<b-icon icon="chevron-left" variant="primary"></b-icon>
|
||||
</b-button>
|
||||
</b-col>
|
||||
<b-col cols="3">
|
||||
<p class="text-center pt-2">{{ value }} {{ $t('math.div') }} {{ totalPages }}</p>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<b-button class="next-page" :disabled="!hasNext" @click="currentValue++">
|
||||
<b-icon icon="chevron-right" variant="primary"></b-icon>
|
||||
</b-button>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'PaginationButtons',
|
||||
props: {
|
||||
totalRows: { required: true },
|
||||
perPage: { type: Number, required: true },
|
||||
value: { type: Number, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentValue: { type: Number, default: 1 },
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasNext() {
|
||||
return this.value * this.perPage < this.totalRows
|
||||
},
|
||||
hasPrevious() {
|
||||
return this.value > 1
|
||||
},
|
||||
totalPages() {
|
||||
return Math.ceil(this.totalRows / this.perPage)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.currentValue = this.value
|
||||
},
|
||||
watch: {
|
||||
currentValue() {
|
||||
if (this.currentValue !== this.value) this.$emit('input', this.currentValue)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -143,7 +143,6 @@
|
||||
"login": "Anmeldung",
|
||||
"math": {
|
||||
"aprox": "~",
|
||||
"div": "/",
|
||||
"equal": "=",
|
||||
"exclaim": "!",
|
||||
"pipe": "|"
|
||||
|
||||
@ -143,7 +143,6 @@
|
||||
"login": "Login",
|
||||
"math": {
|
||||
"aprox": "~",
|
||||
"div": "/",
|
||||
"equal": "=",
|
||||
"exclaim": "!",
|
||||
"pipe": "|"
|
||||
|
||||
@ -85,10 +85,9 @@ describe('Send', () => {
|
||||
})
|
||||
|
||||
it('restores the previous data in the formular', () => {
|
||||
/* expect(wrapper.find('#input-group-1').find('input').vm.$el.value).toBe(
|
||||
expect(wrapper.find('#input-group-1').find('input').vm.$el.value).toBe(
|
||||
'user@example.org',
|
||||
)
|
||||
*/
|
||||
expect(wrapper.find('#input-group-2').find('input').vm.$el.value).toBe('23.45')
|
||||
expect(wrapper.find('#input-group-3').find('textarea').vm.$el.value).toBe(
|
||||
'Make the best of it!',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user