@@ -79,6 +79,14 @@ export default {
}
},
methods: {
+ showTransactionLinks() {
+ if (this.visible) {
+ this.visible = false
+ } else {
+ this.updateListTransactionLinks()
+ this.visible = true
+ }
+ },
async updateListTransactionLinks() {
if (this.currentPage === 0) {
this.transactionLinks = []
@@ -110,8 +118,5 @@ export default {
this.updateListTransactionLinks()
},
},
- created() {
- this.updateListTransactionLinks()
- },
}
diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js
index d29c4dc09..917a25d70 100644
--- a/frontend/src/config/index.js
+++ b/frontend/src/config/index.js
@@ -5,10 +5,10 @@
const pkg = require('../../package')
const constants = {
- DECAY_START_TIME: new Date('2021-05-13 17:46:31'), // GMT+0
+ DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
CONFIG_VERSION: {
DEFAULT: 'DEFAULT',
- EXPECTED: 'v1.2022-03-18',
+ EXPECTED: 'v2.2022-04-07',
CURRENT: '',
},
}
@@ -28,6 +28,19 @@ const environment = {
PORT: process.env.PORT || 3000,
}
+const endpoints = {
+ GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql',
+ ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}',
+}
+
+const community = {
+ COMMUNITY_NAME: process.env.COMMUNITY_NAME || 'Gradido Entwicklung',
+ COMMUNITY_URL: process.env.COMMUNITY_URL || 'http://localhost/',
+ COMMUNITY_REGISTER_URL: process.env.COMMUNITY_REGISTER_URL || 'http://localhost/register',
+ COMMUNITY_DESCRIPTION:
+ process.env.COMMUNITY_DESCRIPTION || 'Die lokale Entwicklungsumgebung von Gradido.',
+}
+
const meta = {
META_URL: process.env.META_URL || 'http://localhost',
META_TITLE_DE: process.env.META_TITLE_DE || 'Gradido – Dein Dankbarkeitskonto',
@@ -47,11 +60,6 @@ const meta = {
META_AUTHOR: process.env.META_AUTHOR || 'Bernd Hückstädt - Gradido-Akademie',
}
-const endpoints = {
- GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql',
- ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}',
-}
-
// Check config version
constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT
if (
@@ -69,6 +77,7 @@ const CONFIG = {
...version,
...environment,
...endpoints,
+ ...community,
...meta,
}
diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js
index dce22fbd9..3d5a6a95c 100644
--- a/frontend/src/graphql/queries.js
+++ b/frontend/src/graphql/queries.js
@@ -47,12 +47,9 @@ export const transactionsQuery = gql`
transactionList(currentPage: $currentPage, pageSize: $pageSize, order: $order) {
balance {
balance
- decay
- lastBookedBalance
balanceGDT
count
linkCount
- lastBookedDate
}
transactions {
id
@@ -98,17 +95,6 @@ export const listGDTEntriesQuery = gql`
}
`
-export const communityInfo = gql`
- query {
- getCommunityInfo {
- name
- description
- registerUrl
- url
- }
- }
-`
-
export const communities = gql`
query {
communities {
diff --git a/frontend/src/layouts/DashboardLayout_gdd.vue b/frontend/src/layouts/DashboardLayout_gdd.vue
index 8b84ac10d..f65329470 100755
--- a/frontend/src/layouts/DashboardLayout_gdd.vue
+++ b/frontend/src/layouts/DashboardLayout_gdd.vue
@@ -53,11 +53,9 @@ export default {
},
data() {
return {
- logo: 'img/brand/green.png',
balance: 0,
GdtBalance: 0,
transactions: [],
- bookedBalance: 0,
transactionCount: 0,
transactionLinkCount: 0,
pending: true,
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index 3299df8d7..82d755085 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -124,16 +124,17 @@
"valid_until": "Gültig bis"
},
"gdt": {
- "calculation": "Berechnung der GradidoTransform",
+ "calculation": "Berechnung der Gradido Transform",
"contribution": "Beitrag",
"conversion": "Umrechnung",
- "conversion-gdt-euro": "Umrechnung Euro / GradidoTransform (GDT)",
+ "conversion-gdt-euro": "Umrechnung Euro / Gradido Transform (GDT)",
"credit": "Gutschrift",
"factor": "Faktor",
"formula": "Berechnungsformel",
"funding": "Zu den Förderbeiträgen",
- "gdt-received": "GradidoTransform (GDT) erhalten",
- "no-transactions": "Du hast noch keine GradidoTransform (GDT).",
+ "gdt": "Gradido Transform",
+ "gdt-received": "Gradido Transform (GDT) erhalten",
+ "no-transactions": "Du hast noch keine Gradido Transform (GDT).",
"not-reachable": "Der GDT Server ist nicht erreichbar.",
"publisher": "Dein geworbenes Mitglied hat einen Beitrag bezahlt",
"raise": "Erhöhung",
@@ -146,6 +147,7 @@
"aprox": "~",
"equal": "=",
"exclaim": "!",
+ "minus": "−",
"pipe": "|"
},
"navigation": {
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index 801bc4ca0..7288ccc97 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -124,16 +124,17 @@
"valid_until": "Valid until"
},
"gdt": {
- "calculation": "Calculation of GradidoTransform",
+ "calculation": "Calculation of Gradido Transform",
"contribution": "Contribution",
"conversion": "Conversion",
- "conversion-gdt-euro": "Conversion Euro / GradidoTransform (GDT)",
+ "conversion-gdt-euro": "Conversion Euro / Gradido Transform (GDT)",
"credit": "Credit",
"factor": "Factor",
"formula": "Calculation formula",
"funding": "To the funding contributions",
- "gdt-received": "GradidoTransform (GDT) received",
- "no-transactions": "You do not have GradidoTransform (GDT) yet.",
+ "gdt": "Gradido Transform",
+ "gdt-received": "Gradido Transform (GDT) received",
+ "no-transactions": "You do not have Gradido Transform (GDT) yet.",
"not-reachable": "The GDT Server is not reachable.",
"publisher": "A member you referred has paid a contribution",
"raise": "Increase",
@@ -146,6 +147,7 @@
"aprox": "~",
"equal": "=",
"exclaim": "!",
+ "minus": "−",
"pipe": "|"
},
"navigation": {
diff --git a/frontend/src/mixins/getCommunityInfo.js b/frontend/src/mixins/getCommunityInfo.js
deleted file mode 100644
index c6c021f9c..000000000
--- a/frontend/src/mixins/getCommunityInfo.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import { communityInfo } from '../graphql/queries'
-
-export const getCommunityInfoMixin = {
- methods: {
- getCommunityInfo() {
- if (this.$store.state.community.name === '') {
- this.$apollo
- .query({
- query: communityInfo,
- })
- .then((result) => {
- this.$store.commit('community', result.data.getCommunityInfo)
- return result.data.getCommunityInfo
- })
- .catch((error) => {
- this.toastError(error.message)
- })
- }
- },
- },
- created() {
- this.getCommunityInfo()
- },
-}
diff --git a/frontend/src/pages/Login.spec.js b/frontend/src/pages/Login.spec.js
index 3bf66920a..62c3b6c0e 100644
--- a/frontend/src/pages/Login.spec.js
+++ b/frontend/src/pages/Login.spec.js
@@ -6,17 +6,7 @@ import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue
-const apolloQueryMock = jest.fn().mockResolvedValue({
- data: {
- getCommunityInfo: {
- name: 'test12',
- description: 'test community 12',
- url: 'http://test12.test12/',
- registerUrl: 'http://test12.test12/register',
- },
- },
-})
-
+const apolloQueryMock = jest.fn()
const mockStoreDispach = jest.fn()
const mockStoreCommit = jest.fn()
const mockRouterPush = jest.fn()
@@ -39,10 +29,6 @@ describe('Login', () => {
dispatch: mockStoreDispach,
commit: mockStoreCommit,
state: {
- community: {
- name: '',
- description: '',
- },
publisherId: 12345,
},
},
@@ -73,63 +59,24 @@ describe('Login', () => {
wrapper = Wrapper()
})
- it('commits the community info to the store', () => {
- expect(mockStoreCommit).toBeCalledWith('community', {
- name: 'test12',
- description: 'test community 12',
- url: 'http://test12.test12/',
- registerUrl: 'http://test12.test12/register',
- })
- })
-
it('renders the Login form', () => {
expect(wrapper.find('div.login-form').exists()).toBeTruthy()
})
- describe('communities gives back error', () => {
- beforeEach(() => {
- apolloQueryMock.mockRejectedValue({
- message: 'Failed to get communities',
- })
- wrapper = Wrapper()
- })
-
- it('toasts an error message', () => {
- expect(toastErrorSpy).toBeCalledWith('Failed to get communities')
- })
- })
-
describe('Login header', () => {
it('has a welcome message', () => {
expect(wrapper.find('div.header').text()).toBe('site.login.heading site.login.community')
})
})
- describe('Community data already loaded', () => {
- beforeEach(() => {
- jest.clearAllMocks()
- mocks.$store.state.community = {
- name: 'Gradido Entwicklung',
- url: 'http://localhost/',
- registerUrl: 'http://localhost/register',
- description: 'Die lokale Entwicklungsumgebung von Gradido.',
- }
- wrapper = Wrapper()
- })
+ it('has a Community name', () => {
+ expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung')
+ })
- it('has a Community name', () => {
- expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung')
- })
-
- it('has a Community description', () => {
- expect(wrapper.find('.test-communitydata p').text()).toBe(
- 'Die lokale Entwicklungsumgebung von Gradido.',
- )
- })
-
- it('does not call community data update', () => {
- expect(apolloQueryMock).not.toBeCalled()
- })
+ it('has a Community description', () => {
+ expect(wrapper.find('.test-communitydata p').text()).toBe(
+ 'Die lokale Entwicklungsumgebung von Gradido.',
+ )
})
describe('links', () => {
@@ -197,13 +144,13 @@ describe('Login', () => {
await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
await wrapper.find('input[placeholder="form.password"]').setValue('1234')
await flushPromises()
- await wrapper.find('form').trigger('submit')
- await flushPromises()
apolloQueryMock.mockResolvedValue({
data: {
login: 'token',
},
})
+ await wrapper.find('form').trigger('submit')
+ await flushPromises()
})
it('calls the API with the given data', () => {
@@ -255,82 +202,86 @@ describe('Login', () => {
})
})
})
+ })
- describe('login fails', () => {
- beforeEach(() => {
+ describe('login fails', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
+ await wrapper.find('input[placeholder="form.password"]').setValue('1234')
+ await flushPromises()
+ apolloQueryMock.mockRejectedValue({
+ message: '..No user with this credentials',
+ })
+ await wrapper.find('form').trigger('submit')
+ await flushPromises()
+ })
+
+ it('hides the spinner', () => {
+ expect(spinnerHideMock).toBeCalled()
+ })
+
+ it('toasts an error message', () => {
+ expect(toastErrorSpy).toBeCalledWith('error.no-account')
+ })
+
+ describe('login fails with "User email not validated"', () => {
+ beforeEach(async () => {
apolloQueryMock.mockRejectedValue({
- message: '..No user with this credentials',
+ message: 'User email not validated',
})
+ wrapper = Wrapper()
+ jest.clearAllMocks()
+ await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
+ await wrapper.find('input[placeholder="form.password"]').setValue('1234')
+ await flushPromises()
+ await wrapper.find('form').trigger('submit')
+ await flushPromises()
})
- it('hides the spinner', () => {
- expect(spinnerHideMock).toBeCalled()
+ // Wolle: it('redirects to /thx/login', () => {
+ // expect(mockRouterPush).toBeCalledWith('/thx/login')
+ // })
+
+ it('shows error title, subtitle, login button', () => {
+ expect(wrapper.find('.test-message-headline').text()).toBe('site.thx.errorTitle')
+ expect(wrapper.find('.test-message-subtitle').text()).toBe('site.thx.activateEmail')
+ expect(wrapper.find('.test-message-button').text()).toBe('settings.password.reset')
})
- it('toasts an error message', () => {
- expect(toastErrorSpy).toBeCalledWith('error.no-account')
+ it('button link directs to /login', () => {
+ expect(wrapper.find('.test-message-button').attributes('href')).toBe('/forgot-password')
+ })
+ })
+
+ describe('login fails with "User has no password set yet"', () => {
+ beforeEach(async () => {
+ apolloQueryMock.mockRejectedValue({
+ message: 'User has no password set yet',
+ })
+ wrapper = Wrapper()
+ jest.clearAllMocks()
+ await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
+ await wrapper.find('input[placeholder="form.password"]').setValue('1234')
+ await flushPromises()
+ await wrapper.find('form').trigger('submit')
+ await flushPromises()
})
- describe('login fails with "User email not validated"', () => {
- beforeEach(async () => {
- apolloQueryMock.mockRejectedValue({
- message: 'User email not validated',
- })
- wrapper = Wrapper()
- jest.clearAllMocks()
- await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
- await wrapper.find('input[placeholder="form.password"]').setValue('1234')
- await flushPromises()
- await wrapper.find('form').trigger('submit')
- await flushPromises()
- })
+ // Wolle: it('redirects to /reset-password/login', () => {
+ // expect(mockRouterPush).toBeCalledWith('/reset-password/login')
+ // })
- // Wolle: it('redirects to /thx/login', () => {
- // expect(mockRouterPush).toBeCalledWith('/thx/login')
- // })
-
- it('shows error title, subtitle, login button', () => {
- expect(wrapper.find('.test-message-headline').text()).toBe('site.thx.errorTitle')
- expect(wrapper.find('.test-message-subtitle').text()).toBe('site.thx.activateEmail')
- expect(wrapper.find('.test-message-button').text()).toBe('settings.password.reset')
- })
-
- it('button link directs to /login', () => {
- expect(wrapper.find('.test-message-button').attributes('href')).toBe(
- '/forgot-password',
- )
- })
+ it('shows error title, subtitle, login button', () => {
+ expect(wrapper.find('.test-message-headline').text()).toBe('site.thx.errorTitle')
+ expect(wrapper.find('.test-message-subtitle').text()).toBe('site.thx.unsetPassword')
+ expect(wrapper.find('.test-message-button').text()).toBe('settings.password.reset')
})
- describe('login fails with "User has no password set yet"', () => {
- beforeEach(async () => {
- apolloQueryMock.mockRejectedValue({
- message: 'User has no password set yet',
- })
- wrapper = Wrapper()
- jest.clearAllMocks()
- await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
- await wrapper.find('input[placeholder="form.password"]').setValue('1234')
- await flushPromises()
- await wrapper.find('form').trigger('submit')
- await flushPromises()
- })
-
- // Wolle: it('redirects to /reset-password/login', () => {
- // expect(mockRouterPush).toBeCalledWith('/reset-password/login')
- // })
-
- it('shows error title, subtitle, login button', () => {
- expect(wrapper.find('.test-message-headline').text()).toBe('site.thx.errorTitle')
- expect(wrapper.find('.test-message-subtitle').text()).toBe('site.thx.unsetPassword')
- expect(wrapper.find('.test-message-button').text()).toBe('settings.password.reset')
- })
-
- it('button link directs to /login', () => {
- expect(wrapper.find('.test-message-button').attributes('href')).toBe(
- '/reset-password/login',
- )
- })
+ it('button link directs to /login', () => {
+ expect(wrapper.find('.test-message-button').attributes('href')).toBe(
+ '/reset-password/login',
+ )
})
})
})
diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue
index a84bfc1ab..c4f324f1f 100755
--- a/frontend/src/pages/Login.vue
+++ b/frontend/src/pages/Login.vue
@@ -19,9 +19,9 @@
@@ -83,7 +83,7 @@ import InputPassword from '@/components/Inputs/InputPassword'
import InputEmail from '@/components/Inputs/InputEmail'
import Message from '@/components/Message/Message'
import { login } from '@/graphql/queries'
-import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
+import CONFIG from '@/config'
export default {
name: 'Login',
@@ -92,7 +92,6 @@ export default {
InputEmail,
Message,
},
- mixins: [getCommunityInfoMixin],
data() {
return {
form: {
@@ -102,6 +101,7 @@ export default {
passwordVisible: false,
showPageMessage: false,
errorReason: null,
+ CONFIG,
}
},
methods: {
diff --git a/frontend/src/pages/Overview.spec.js b/frontend/src/pages/Overview.spec.js
index af234801e..8f0dda01d 100644
--- a/frontend/src/pages/Overview.spec.js
+++ b/frontend/src/pages/Overview.spec.js
@@ -25,12 +25,6 @@ describe('Overview', () => {
wrapper = Wrapper()
})
- it('has a status gdd-status-gdd', () => {
- expect(wrapper.find('div.gdd-status-gdd').exists()).toBeTruthy()
- })
- it('has a status gdd-status-gdt', () => {
- expect(wrapper.find('div.gdd-status-gdt').exists()).toBeTruthy()
- })
it('has a transactions table', () => {
expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy()
})
diff --git a/frontend/src/pages/Overview.vue b/frontend/src/pages/Overview.vue
index 194de793a..15e140058 100644
--- a/frontend/src/pages/Overview.vue
+++ b/frontend/src/pages/Overview.vue
@@ -1,19 +1,6 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/pages/SelectCommunity.spec.js b/frontend/src/pages/SelectCommunity.spec.js
index f8896ae15..25ec8db93 100644
--- a/frontend/src/pages/SelectCommunity.spec.js
+++ b/frontend/src/pages/SelectCommunity.spec.js
@@ -1,5 +1,5 @@
import { mount, RouterLinkStub } from '@vue/test-utils'
-import { communities, communityInfo } from '@/graphql/queries'
+import { communities } from '@/graphql/queries'
import SelectCommunity from './SelectCommunity'
import { toastErrorSpy } from '@test/testSetup'
@@ -14,45 +14,33 @@ const spinnerMock = jest.fn(() => {
}
})
-const apolloQueryMock = jest
- .fn()
- .mockResolvedValueOnce({
- data: {
- getCommunityInfo: {
- name: 'test12',
- description: 'test community 12',
- url: 'http://test12.test12/',
- registerUrl: 'http://test12.test12/register',
+const apolloQueryMock = jest.fn().mockResolvedValue({
+ data: {
+ communities: [
+ {
+ id: 1,
+ name: 'Gradido Entwicklung',
+ description: 'Die lokale Entwicklungsumgebung von Gradido.',
+ url: 'http://localhost/',
+ registerUrl: 'http://localhost/register-community',
},
- },
- })
- .mockResolvedValue({
- data: {
- communities: [
- {
- id: 1,
- name: 'Gradido Entwicklung',
- description: 'Die lokale Entwicklungsumgebung von Gradido.',
- url: 'http://localhost/',
- registerUrl: 'http://localhost/register-community',
- },
- {
- id: 2,
- name: 'Gradido Staging',
- description: 'Der Testserver der Gradido-Akademie.',
- url: 'https://stage1.gradido.net/',
- registerUrl: 'https://stage1.gradido.net/register-community',
- },
- {
- id: 3,
- name: 'Gradido-Akademie',
- description: 'Freies Institut für Wirtschaftsbionik.',
- url: 'https://gradido.net',
- registerUrl: 'https://gdd1.gradido.com/register-community',
- },
- ],
- },
- })
+ {
+ id: 2,
+ name: 'Gradido Staging',
+ description: 'Der Testserver der Gradido-Akademie.',
+ url: 'https://stage1.gradido.net/',
+ registerUrl: 'https://stage1.gradido.net/register-community',
+ },
+ {
+ id: 3,
+ name: 'Gradido-Akademie',
+ description: 'Freies Institut für Wirtschaftsbionik.',
+ url: 'https://gradido.net',
+ registerUrl: 'https://gdd1.gradido.com/register-community',
+ },
+ ],
+ },
+})
const mockStoreCommit = jest.fn()
@@ -95,12 +83,6 @@ describe('SelectCommunity', () => {
wrapper = Wrapper()
})
- it('calls the API to get the community info data', () => {
- expect(apolloQueryMock).toBeCalledWith({
- query: communityInfo,
- })
- })
-
it('calls the API to get the communities data', () => {
expect(apolloQueryMock).toBeCalledWith({
query: communities,
@@ -141,12 +123,6 @@ describe('SelectCommunity', () => {
wrapper = Wrapper()
})
- it('does not call community info data when already filled', () => {
- expect(apolloQueryMock).not.toBeCalledWith({
- query: communityInfo,
- })
- })
-
it('has a Community name', () => {
expect(wrapper.find('.card-body b').text()).toBe('Gradido Entwicklung')
})
diff --git a/frontend/src/pages/SelectCommunity.vue b/frontend/src/pages/SelectCommunity.vue
index 0535e4fe7..8702d3e2e 100644
--- a/frontend/src/pages/SelectCommunity.vue
+++ b/frontend/src/pages/SelectCommunity.vue
@@ -5,9 +5,9 @@
- {{ $store.state.community.name }}
+ {{ CONFIG.COMMUNITY_NAME }}
- {{ $store.state.community.description }}
+ {{ CONFIG.COMMUNITY_DESCRIPTION }}
@@ -49,7 +49,7 @@