Merge branch 'master' into adminCreateMultiplePendingCreations

This commit is contained in:
Hannes Heine 2022-01-03 08:11:59 +01:00 committed by GitHub
commit 03bcf0ea7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 27 deletions

View File

@ -30,6 +30,13 @@ loadAllRules(i18n)
addNavigationGuards(router, store, apolloProvider.defaultClient)
if (!store) {
setTimeout(
window.location.assign('https://github.com/gradido/gradido/tree/master/support#cookies'),
5000,
)
}
/* eslint-disable no-new */
new Vue({
el: '#app',

View File

@ -78,32 +78,41 @@ export const actions = {
},
}
export const store = new Vuex.Store({
plugins: [
createPersistedState({
storage: window.localStorage,
}),
],
state: {
email: '',
language: null,
firstName: '',
lastName: '',
username: '',
description: '',
token: null,
isAdmin: false,
coinanimation: true,
newsletterState: null,
community: {
name: '',
let store
try {
store = new Vuex.Store({
plugins: [
createPersistedState({
storage: window.localStorage,
}),
],
state: {
email: '',
language: null,
firstName: '',
lastName: '',
username: '',
description: '',
token: null,
isAdmin: false,
coinanimation: true,
newsletterState: null,
community: {
name: '',
description: '',
},
hasElopage: false,
publisherId: null,
},
hasElopage: false,
publisherId: null,
},
getters: {},
// Syncronous mutation of the state
mutations,
actions,
})
getters: {},
// Syncronous mutation of the state
mutations,
actions,
})
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
}
export { store }

View File

@ -1,4 +1,8 @@
import { mutations, actions } from './store'
import Vuex from 'vuex'
import Vue from 'vue'
jest.mock('vuex')
const {
language,
@ -298,4 +302,25 @@ describe('Vuex store', () => {
})
})
})
describe('creation of store fails', () => {
const consoleErrorMock = jest.fn()
const warnHandler = Vue.config.warnHandler
beforeEach(() => {
Vue.config.warnHandler = (w) => {}
// eslint-disable-next-line no-console
console.error = consoleErrorMock
Vuex.Store = () => {
throw new Error('no-cookies-allowed')
}
})
afterEach(() => {
Vue.config.warnHandler = warnHandler
})
it.skip('logs an error message', () => {
expect(consoleErrorMock).toBeCalledWith('no-cookies-allowed')
})
})
})

6
support/README.md Normal file
View File

@ -0,0 +1,6 @@
## Cookies
Die Gradido Wallet benötigt Zugriff auf die local strorage des
Browsers. Bitte stelle sicher, dass in deinem Browser Cookies für die
Gradido Wallet erlaubt sind.