🎨 Site > Store > Separate into modules

This commit is contained in:
brunosimon
2017-08-14 22:43:50 +02:00
parent 0eb639a9db
commit 2b0dec5d0a
17 changed files with 178 additions and 184 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import Connexion from '@/components/connexion'
import ProjectsHub from '@/components/projects-hub'
import Projects from '@/components/projects'
import Project from '@/components/project'
export default
@@ -9,7 +9,7 @@ export default
components:
{
Connexion,
ProjectsHub,
Projects,
Project
},
@@ -24,12 +24,12 @@ export default
{
projects()
{
return this.$store.state.projects
return this.$store.state.projects.all
},
project()
{
return this.$store.state.project
return this.$store.state.projects.current
}
},
@@ -1,6 +1,6 @@
<div id="application">
{{ counter }}
<connexion></connexion>
<projects-hub></projects-hub>
<projects></projects>
<project v-if="project"></project>
</div>
+2 -2
View File
@@ -13,12 +13,12 @@ export default
{
messages()
{
return this.$store.state.chatMessages
return this.$store.state.chat.messages
},
user()
{
return this.$store.state.user
return this.$store.state.chat.user
}
},
+6 -3
View File
@@ -8,12 +8,12 @@ export default
{
project()
{
return this.$store.state.project
return this.$store.state.projects.current
},
pendingUser()
{
return this.$store.state.pendingUser
return this.$store.state.chat.pendingUser
}
},
@@ -101,7 +101,10 @@ export default
onPendingUser(value)
{
this.chatSocket.emit('update_user', value)
if(value)
{
this.chatSocket.emit('update_user', value)
}
}
}
}
+1 -29
View File
@@ -1,20 +1,5 @@
import FilesTreeFile from '@/components/files-tree-file'
import FilesTreeFolder from '@/components/files-tree-folder'
import FileTree from '@/utils/FileTree'
// const fileTree = new FileTree({ autoWash: true })
// fileTree.addFolder('./toto', { hey: 'hoy' })
// fileTree.addFolder('./toto/uhuh', { hey: 'a' })
// fileTree.addFolder('./lorem')
// fileTree.addFile('./test-1.txt')
// fileTree.addFile('./test-2.txt')
// window.setInterval(() =>
// {
// fileTree.addFile('./toto/uhuh/' + new Date())
// fileTree.removeFolder('./lorem')
// fileTree.removeFile('./test-1.txt')
// }, 1000)
export default
{
@@ -26,24 +11,11 @@ export default
FilesTreeFolder
},
data()
{
return {}
},
computed:
{
files()
{
return this.$store.state.files
return this.$store.state.files.tree
}
},
created()
{
},
methods:
{
}
}
+3 -2
View File
@@ -17,11 +17,12 @@ export default
{
project()
{
return this.$store.state.project
return this.$store.state.projects.all
},
file()
{
return this.$store.state.file
return this.$store.state.files.current
}
},
@@ -6,7 +6,7 @@ export default
{
projects()
{
return this.$store.state.projects
return this.$store.state.projects.all
}
},
+1 -1
View File
@@ -10,7 +10,7 @@ export default
{
version()
{
return this.$store.state.version
return this.$store.state.files.currentVersion
}
}
}