diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index b0dfe36d4..1e8bfb621 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -114,6 +114,11 @@ "message": "hallo gradido !!", "overview": "Übersicht", "privacy_policy": "Datenschutzerklärung", + "publisher": { + "infoNoRegister": "Dies ist für die Registrieung nicht nötig!", + "infoText": "Trage hier die ID des Herausgebers ein. Wenn du keine ID hast dann bitte leer lassen.", + "publisherId": "PublisherID" + }, "send": "Senden", "settings": { "coinanimation": { diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 135729ffa..f473ff798 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -114,6 +114,11 @@ "message": "hello gradido !!", "overview": "Overview", "privacy_policy": "Privacy policy", + "publisher": { + "infoNoRegister": "This is not necessary for registration!", + "infoText": "Enter the ID of the publisher here. If you do not have an ID, please leave it blank.", + "publisherId": "PublisherID" + }, "send": "Send", "settings": { "coinanimation": { diff --git a/frontend/src/store/store.test.js b/frontend/src/store/store.test.js index 829678b44..4f25f5352 100644 --- a/frontend/src/store/store.test.js +++ b/frontend/src/store/store.test.js @@ -11,6 +11,7 @@ const { coinanimation, newsletterState, publisherId, + isAdmin, community, hasElopage, } = mutations @@ -104,6 +105,14 @@ describe('Vuex store', () => { }) }) + describe('isAdmin', () => { + it('sets the state of isAdmin', () => { + const state = { isAdmin: null } + isAdmin(state, true) + expect(state.isAdmin).toEqual(true) + }) + }) + describe('community', () => { it('sets the state of community', () => { const state = {} diff --git a/frontend/src/views/Pages/Register.spec.js b/frontend/src/views/Pages/Register.spec.js index c63de66cf..d6814bd49 100644 --- a/frontend/src/views/Pages/Register.spec.js +++ b/frontend/src/views/Pages/Register.spec.js @@ -170,6 +170,11 @@ describe('Register', () => { expect(wrapper.find('#registerCheckbox').exists()).toBeTruthy() }) + it('has PublisherId input fields', () => { + wrapper.find('.publisherCollaps').trigger('click') + expect(wrapper.find('#publisherid').exists()).toBe(true) + }) + it('has disabled submit button when not completely filled', () => { expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled') }) @@ -221,6 +226,11 @@ describe('Register', () => { wrapper.find('input[name="form.password"]').setValue('Aa123456_') wrapper.find('input[name="form.passwordRepeat"]').setValue('Aa123456_') wrapper.find('.language-switch-select').findAll('option').at(1).setSelected() + wrapper.find('#publisherid').setValue('12345') + }) + + it('commits publisherId to store', () => { + expect(mockStoreCommit).toBeCalledWith('publisherId', 12345) }) it('has enabled submit button when completely filled', () => { diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue index ea4000cff..8669781a4 100755 --- a/frontend/src/views/Pages/Register.vue +++ b/frontend/src/views/Pages/Register.vue @@ -121,8 +121,44 @@ {{ messageError }} + + + {{ $t('publisher.publisherId') }} : {{ $store.state.publisherId }} + + + + + + + + + + + + + + +
+ {{ $t('publisher.infoText') }} + {{ $t('publisher.infoNoRegister') }} +
+ +
+
+
+
+
-
+
@@ -185,6 +221,7 @@ export default { showError: false, messageError: '', register: true, + publisherId: this.$store.state.publisherId, } }, methods: { @@ -197,6 +234,9 @@ export default { getValidationState({ dirty, validated, valid = null }) { return dirty || validated ? valid : null }, + commitStore(val) { + this.$store.commit('publisherId', val) + }, async onSubmit() { this.$apollo .mutate({