Happifies eslint and adds an editorconfig

This commit is contained in:
Michael Weimann
2018-12-03 22:40:39 +01:00
parent 18b03550cc
commit 411cab1d45
7 changed files with 159 additions and 146 deletions

9
.editorconfig Normal file
View File

@@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
[*.{js,vue}]
indent_style = tab

View File

@@ -22,18 +22,18 @@
<template>
<div
<div
id="content"
v-bind:class="{ 'nav-hidden': navHidden, 'sidebar-hidden': sidebarHidden }">
<AppNavigation :menu="menu" />
<div id="app-content">
<Controls></Controls>
<router-view />
<AppNavigation :menu="menu" />
<div id="app-content">
<Controls />
<router-view />
</div>
<div id="app-sidebar">
<component v-bind:is="sidebarComponent" />
</div>
</div>
<div id="app-sidebar">
<component v-bind:is="sidebarComponent"></component>
</div>
</div>
</template>
@@ -49,13 +49,13 @@ export default {
components: {
AppNavigation,
Controls,
Sidebar
Sidebar
},
computed: mapState({
navHidden: state => state.nav.hidden,
sidebarHidden: state => state.sidebar.hidden,
menu: state => state.nav.menu,
sidebarComponent: state => state.sidebar.component
sidebarComponent: state => state.sidebar.component
})
}
@@ -63,35 +63,35 @@ export default {
<style lang="scss" scoped>
#content {
#app-content {
transition: margin-left 100ms ease;
}
#app-sidebar {
transition: width 100ms ease;
}
&.nav-hidden {
#content {
#app-content {
margin-left: 0;
transition: margin-left 100ms ease;
}
}
&.sidebar-hidden {
#app-sidebar {
max-width: 0;
min-width: 0;
transition: width 100ms ease;
}
&.nav-hidden {
#app-content {
margin-left: 0;
}
}
&.sidebar-hidden {
#app-sidebar {
max-width: 0;
min-width: 0;
}
}
}
}
.deck-main {
bottom: 0;
overflow: auto;
position: absolute;
top: 44px;
width: 100%;
}
.deck-main {
bottom: 0;
overflow: auto;
position: absolute;
top: 44px;
width: 100%;
}
</style>

View File

@@ -22,20 +22,20 @@
<template>
<div>
<div id="app-navigation-toggle-custom" class="icon-menu" v-on:click="toggleNav"></div>
</div>
<div>
<div id="app-navigation-toggle-custom" class="icon-menu" v-on:click="toggleNav" />
</div>
</template>
<script>
export default {
name: "Controls",
methods: {
toggleNav() {
this.$store.dispatch('nav/toggle')
}
}
name: 'Controls',
methods: {
toggleNav() {
this.$store.dispatch('nav/toggle')
}
}
}
</script>

View File

@@ -21,9 +21,9 @@
-->
<template>
<div class="deck-main">
Main
</div>
<div class="deck-main">
Main
</div>
</template>
<script>

View File

@@ -30,12 +30,12 @@ Vue.use(Vuex)
const debug = process.env.NODE_ENV !== 'production'
export default new Vuex.Store({
modules: {
nav,
sidebar
},
modules: {
nav,
sidebar
},
strict: debug,
state: {},
mutations: {},
actions: {}
state: {},
mutations: {},
actions: {}
})

View File

@@ -26,87 +26,92 @@
import { translate as t } from 'nextcloud-server/dist/l10n'
let defaultCategories = [
{
id: 'deck-boards',
classes: [],
icon: 'icon-deck',
text: t('deck', 'All boards'),
router: {
name: 'boards'
}
},
{
id: 'deck-boards-archived',
classes: [],
icon: 'icon-archive',
text: t('deck', 'Archived boards'),
router: {
name: 'boards.archived'
}
},
{
id: 'deck-boards-shared',
classes: [],
icon: 'icon-shared',
text: t('deck', 'Shared boards'),
router: {
name: 'boards.shared'
}
}
{
id: 'deck-boards',
classes: [],
icon: 'icon-deck',
text: t('deck', 'All boards'),
router: {
name: 'boards'
}
},
{
id: 'deck-boards-archived',
classes: [],
icon: 'icon-archive',
text: t('deck', 'Archived boards'),
router: {
name: 'boards.archived'
}
},
{
id: 'deck-boards-shared',
classes: [],
icon: 'icon-shared',
text: t('deck', 'Shared boards'),
router: {
name: 'boards.shared'
}
}
]
const boardActions = [
{
action: () => {},
icon: 'icon-edit',
text: t('deck', 'Edit board')
},
{
action: () => {},
icon: 'icon-archive',
text: t('deck', 'Archive board')
},
{
action: () => {},
icon: 'icon-delete',
text: t('deck', 'Delete board')
},
{
action: () => {},
icon: 'icon-settings',
text: t('deck', 'Board details')
}
{
action: () => {
},
icon: 'icon-edit',
text: t('deck', 'Edit board')
},
{
action: () => {
},
icon: 'icon-archive',
text: t('deck', 'Archive board')
},
{
action: () => {
},
icon: 'icon-delete',
text: t('deck', 'Delete board')
},
{
action: () => {
},
icon: 'icon-settings',
text: t('deck', 'Board details')
}
]
const boards = [
{
id: 'deck-board-1',
classes: [],
bullet: '#00cc00',
text: 'Example board',
router: {
name: 'board',
params: { id: 1 }
},
utils: {
actions: boardActions
}
}
{
id: 'deck-board-1',
classes: [],
bullet: '#00cc00',
text: 'Example board',
router: {
name: 'board',
params: { id: 1 }
},
utils: {
actions: boardActions
}
}
]
const addButton = {
icon: 'icon-add',
text: t('deck', 'Create new board'),
action: () => {}
icon: 'icon-add',
text: t('deck', 'Create new board'),
action: () => {
}
}
// initial state
const state = {
hidden: false,
menu: {
items: defaultCategories.concat(boards).concat([addButton]),
loading: false
}
hidden: false,
menu: {
items: defaultCategories.concat(boards).concat([addButton]),
loading: false
}
}
// getters
@@ -114,22 +119,22 @@ const getters = {}
// actions
const actions = {
toggle ({ commit }) {
commit('toggle')
}
toggle({ commit }) {
commit('toggle')
}
}
// mutations
const mutations = {
toggle (state) {
state.hidden = !state.hidden
}
toggle(state) {
state.hidden = !state.hidden
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
namespaced: true,
state,
getters,
actions,
mutations
}

View File

@@ -20,11 +20,10 @@
*
*/
// initial state
const state = {
hidden: true,
component: 'Sidebar'
hidden: true,
component: 'Sidebar'
}
// getters
@@ -32,22 +31,22 @@ const getters = {}
// actions
const actions = {
toggle ({ commit }) {
commit('toggle')
}
toggle({ commit }) {
commit('toggle')
}
}
// mutations
const mutations = {
toggle (state) {
state.hidden = !state.hidden
}
toggle(state) {
state.hidden = !state.hidden
}
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
namespaced: true,
state,
getters,
actions,
mutations
}