Fix #89: Always use username in sidebar
This commit is contained in:
parent
ca30b5ef69
commit
fbb256bc9b
|
@ -4,6 +4,8 @@ Changelog
|
||||||
0.6 (Unreleased)
|
0.6 (Unreleased)
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
- Always use username in sidebar (#89)
|
||||||
|
|
||||||
|
|
||||||
0.5.2 (2018-02-26)
|
0.5.2 (2018-02-26)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -89,6 +89,7 @@ export default {
|
||||||
logger.default.info('Successfully fetched user profile')
|
logger.default.info('Successfully fetched user profile')
|
||||||
let data = response.data
|
let data = response.data
|
||||||
commit('profile', data)
|
commit('profile', data)
|
||||||
|
commit('username', data.username)
|
||||||
dispatch('favorites/fetch', null, {root: true})
|
dispatch('favorites/fetch', null, {root: true})
|
||||||
Object.keys(data.permissions).forEach(function (key) {
|
Object.keys(data.permissions).forEach(function (key) {
|
||||||
// this makes it easier to check for permissions in templates
|
// this makes it easier to check for permissions in templates
|
||||||
|
|
|
@ -176,6 +176,7 @@ describe('store/auth', () => {
|
||||||
action: store.actions.fetchProfile,
|
action: store.actions.fetchProfile,
|
||||||
expectedMutations: [
|
expectedMutations: [
|
||||||
{ type: 'profile', payload: profile },
|
{ type: 'profile', payload: profile },
|
||||||
|
{ type: 'username', payload: profile.username },
|
||||||
{ type: 'permission', payload: {key: 'admin', status: true} }
|
{ type: 'permission', payload: {key: 'admin', status: true} }
|
||||||
],
|
],
|
||||||
expectedActions: [
|
expectedActions: [
|
||||||
|
|
Loading…
Reference in New Issue