comparison client/src/application/stores/application.js @ 585:ef307bd6b5d8

refac: restructured client application To make the application more accessible for developers, the structure was reorganized. Instead of sticking to technical terminology, the application terminology is according to the domain: I.e. "map" contains everything regarding map (including store).
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 07 Sep 2018 11:13:56 +0200
parents
children c4a4dc612191
comparison
equal deleted inserted replaced
584:8b66a10aaf8a 585:ef307bd6b5d8
1 const defaultCollapseState = true;
2
3 const Application = {
4 namespaced: true,
5 state: {
6 appTitle: process.env.VUE_APP_TITLE,
7 secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL,
8 sidebar: {
9 iscollapsed: defaultCollapseState
10 },
11 countries: ["AT", "SK", "HU", "HR", "RS", "BiH", "BG", "RO", "UA"]
12 },
13 getters: {
14 countries: state => {
15 return state.countries;
16 },
17 sidebarCollapsed: state => {
18 return state.sidebar.iscollapsed;
19 },
20 appTitle: state => {
21 return state.appTitle;
22 },
23 secondaryLogo: state => {
24 return state.secondaryLogo;
25 }
26 },
27 mutations: {
28 toggleSidebar: state => {
29 state.sidebar.iscollapsed = !state.sidebar.iscollapsed;
30 },
31 resetSidebar: state => {
32 state.sidebar.iscollapsed = defaultCollapseState;
33 },
34 collapseSidebar: state => {
35 state.sidebar.iscollapsed = true;
36 }
37 },
38 actions: {}
39 };
40
41 export default Application;