
Make backgrounds list responsive Show initial collection of backgrounds Remove test data Fix "backgroundInformation is null" when navigating Fix kanban height Remove debug log Move list title to top header Add styling for title in top header Set the current list (and background) when loading settings Only load the background if it changed Make task detail view look good again Fix bottom spacing Make list and table view look good again Make pages with background at least 100vh Fix kanban height Make extra buttons look good again Move list title and view-switcher in one row Add styling for backgrounds Set background globally Add getting list background and putting it in vuex Add setting list background Move list background setting to seperate list Add search timeout to not search on every keypress Add getting thumbnails through api Add basic search for unsplash backgrounds Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/144
73 lines
1.8 KiB
JavaScript
73 lines
1.8 KiB
JavaScript
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
|
|
Vue.use(Vuex)
|
|
|
|
import {CURRENT_LIST, ERROR_MESSAGE, IS_FULLPAGE, LOADING, ONLINE} from './mutation-types'
|
|
import config from './modules/config'
|
|
import auth from './modules/auth'
|
|
import namespaces from './modules/namespaces'
|
|
import kanban from './modules/kanban'
|
|
import tasks from './modules/tasks'
|
|
import lists from './modules/lists'
|
|
import ListService from '../services/list'
|
|
|
|
export const store = new Vuex.Store({
|
|
modules: {
|
|
config,
|
|
auth,
|
|
namespaces,
|
|
kanban,
|
|
tasks,
|
|
lists,
|
|
},
|
|
state: {
|
|
loading: false,
|
|
errorMessage: '',
|
|
online: true,
|
|
isFullpage: false,
|
|
// This is used to highlight the current list in menu for all list related views
|
|
currentList: {id: 0},
|
|
background: '',
|
|
},
|
|
mutations: {
|
|
[LOADING](state, loading) {
|
|
state.loading = loading
|
|
},
|
|
[ERROR_MESSAGE](state, error) {
|
|
state.errorMessage = error
|
|
},
|
|
[ONLINE](state, online) {
|
|
state.online = online
|
|
},
|
|
[IS_FULLPAGE](state, fullpage) {
|
|
state.isFullpage = fullpage
|
|
},
|
|
[CURRENT_LIST](state, currentList) {
|
|
// Not sure if this is the right way to do it but hey, it works
|
|
if (
|
|
currentList.id !== state.currentList.id ||
|
|
(
|
|
currentList.backgroundInformation &&
|
|
currentList.backgroundInformation.unsplashId &&
|
|
currentList.backgroundInformation.unsplashId !== state.currentList.backgroundInformation.unsplashId
|
|
)
|
|
) {
|
|
if (currentList.backgroundInformation) {
|
|
const listService = new ListService()
|
|
listService.background(currentList)
|
|
.then(b => {
|
|
state.background = b
|
|
})
|
|
.catch(e => {
|
|
console.error('Error getting background image for list', currentList.id, e)
|
|
})
|
|
} else {
|
|
state.background = null
|
|
}
|
|
}
|
|
|
|
state.currentList = currentList
|
|
},
|
|
},
|
|
}) |