-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Guillaume Chau
committed
Mar 17, 2018
1 parent
120c13d
commit 5a80c24
Showing
25 changed files
with
403 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ export default { | |
props: { | ||
title: { | ||
type: String, | ||
default: false | ||
default: null | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div class="nav-content"> | ||
<NavList | ||
:items="items" | ||
> | ||
<template slot-scope="props"> | ||
<slot v-bind="props"/> | ||
</template> | ||
</NavList> | ||
|
||
<div class="content vue-ui-disable-scroll"> | ||
<router-view/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
items: { | ||
type: Array, | ||
required: true | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus" scoped> | ||
@import "~@/style/imports" | ||
.nav-content | ||
width 100% | ||
height 100% | ||
display grid | ||
grid-template-columns 300px 1fr | ||
grid-template-rows 1fr | ||
grid-template-areas "nav content" | ||
> .nav-list | ||
grid-area nav | ||
> .content | ||
grid-area content | ||
overflow-x hidden | ||
overflow-y auto | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<div class="nav-list vue-ui-disable-scroll"> | ||
<div class="content"> | ||
<div | ||
v-for="item of items" | ||
:key="item.id" | ||
@click="currentRoute = item.route" | ||
> | ||
<slot | ||
:item="item" | ||
:selected="item.route === currentRoute" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { isSameRoute, isIncludedRoute } from '../util/route' | ||
export default { | ||
props: { | ||
items: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
currentRoute: { | ||
get () { | ||
const currentRoute = this.$route | ||
const item = this.items.find( | ||
item => isIncludedRoute(currentRoute, this.$router.resolve(item.route).route) | ||
) | ||
return item && item.route | ||
}, | ||
set (route) { | ||
if (!isSameRoute(this.$route, route)) { | ||
this.$router.push(route) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus" scoped> | ||
@import "~@/style/imports" | ||
.nav-list | ||
overflow-x none | ||
overflow-y auto | ||
background darken($color-light-background, 2%) | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,6 @@ export default { | |
} | ||
</script> | ||
|
||
|
||
<style lang="stylus" scoped> | ||
@import "~@/style/imports" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div | ||
class="task-item list-item" | ||
:class="{ | ||
selected | ||
}" | ||
> | ||
<div class="content"> | ||
<ItemLogo | ||
icon="assignment" | ||
v-tooltip="status" | ||
/> | ||
|
||
<ListItemInfo | ||
:name="task.name" | ||
:description="task.description || status" | ||
:selected="selected" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
task: { | ||
type: Object, | ||
required: true | ||
}, | ||
selected: { | ||
type: Boolean, | ||
default: false | ||
} | ||
}, | ||
computed: { | ||
status () { | ||
return this.$t(`types.task.status.${this.task.status}`) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="stylus" scoped> | ||
@import "~@/style/imports" | ||
.task-item | ||
padding $padding-item | ||
.content | ||
h-box() | ||
box-center() | ||
.list-item-info | ||
flex 100% 1 1 | ||
width 0 | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const cwd = require('./cwd') | ||
const folders = require('./folders') | ||
|
||
let tasks = [] | ||
|
||
function list (context) { | ||
const file = cwd.get() | ||
const pkg = folders.readPackage(file, context) | ||
tasks = [] | ||
if (pkg.scripts) { | ||
tasks = Object.keys(pkg.scripts).map( | ||
name => ({ | ||
id: `${file}${name}`, | ||
name, | ||
command: pkg.scripts[name], | ||
status: 'idle' | ||
}) | ||
) | ||
} | ||
return tasks | ||
} | ||
|
||
function findOne (id, context) { | ||
return tasks.find( | ||
t => t.id === id | ||
) | ||
} | ||
|
||
module.exports = { | ||
list, | ||
findOne | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#import "./taskFragment.gql" | ||
|
||
query task ($id: ID!) { | ||
task (id: $id) { | ||
...task | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fragment task on Task { | ||
id | ||
status | ||
name | ||
command | ||
description | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#import "./taskFragment.gql" | ||
|
||
query tasks { | ||
tasks { | ||
...task | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,3 +98,6 @@ ansi-colors('white', $vue-ui-color-light) | |
.no-margin-y | ||
margin-top 0 | ||
margin-bottom 0 | ||
|
||
.fill-height | ||
height 100% |
Oops, something went wrong.