Skip to content

Commit

Permalink
Merge pull request #96 from agileseason/48-age-of-issues-chart
Browse files Browse the repository at this point in the history
Age of issues chart (part I)
  • Loading branch information
blackchestnut committed Feb 12, 2022
2 parents 7da5a2d + e3d4797 commit cc80e55
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 115 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@sentry/vue": "^6.12.0",
"@uppy/aws-s3": "^1.8.0",
"@uppy/core": "^1.20.0",
"apexcharts": "^3.33.1",
"browser-cookies": "^1.2.0",
"core-js": "^3.6.5",
"delay": "^5.0.0",
Expand All @@ -26,6 +27,7 @@
"vue": "^3.0.1",
"vue-global-events": "^2.1.0",
"vue-router": "^4.0.0-0",
"vue3-apexcharts": "^1.4.1",
"vuex": "^4.0.0-beta.4",
"vuex-pathify": "^1.4.1",
"webfontloader": "^1.6.28"
Expand Down
138 changes: 39 additions & 99 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ const DOMAIN_API = {

const ENDPOINT = DOMAIN_API + '/graphql';

// id, number are important here, check if need update/remove these fields.
const ISSUE_UPDATABLE_FRAGMENT = `
id
number
title
body
labels { name color }
assignees { login url avatarUrl }
color
isBody
isClosed
isArchived
totalSubtasks
doneSubtasks
`;
const ISSUE_FRAGMENT = `
${ISSUE_UPDATABLE_FRAGMENT}
position
url
repositoryName
repositoryFullName
createdAt
createdAgo
author { login url avatarUrl }
columnId
commentsCount
ageDays
pullRequests {
id number isClosed isMerged url repositoryName
assignees { login avatarUrl }
}
`;

export default {
// ---------------------------------
// User
Expand Down Expand Up @@ -162,25 +195,7 @@ export default {
columns {
id name position isAutoAssign isAutoClose
issues {
id
number
title
position
url
repositoryName
repositoryFullName
labels { name color }
assignees { login avatarUrl }
isClosed
isBody
commentsCount
color
totalSubtasks
doneSubtasks
pullRequests {
id number isClosed isMerged url repositoryName
assignees { login avatarUrl }
}
${ISSUE_FRAGMENT}
}
}
repositories {
Expand All @@ -207,24 +222,7 @@ export default {
columns {
id name position
issues {
id
number
title
position
url
repositoryName
labels { name color }
assignees { login avatarUrl }
isClosed
isBody
commentsCount
color
totalSubtasks
doneSubtasks
pullRequests {
id number isClosed isMerged url repositoryName
assignees { login avatarUrl }
}
${ISSUE_FRAGMENT}
}
}
}
Expand Down Expand Up @@ -458,25 +456,7 @@ export default {
mutation($boardId:Int!, $id:Int!) {
action:syncIssue(input: { boardId: $boardId, id: $id }) {
issue {
id
number
title
body
position
url
repositoryName
repositoryFullName
columnId
isClosed
isArchived
createdAt
createdAgo
labels { name color }
author { login url avatarUrl }
assignees { login url avatarUrl }
color
totalSubtasks
doneSubtasks
${ISSUE_FRAGMENT}
}
errors
}
Expand Down Expand Up @@ -534,31 +514,7 @@ export default {
color: $color
}) {
issue {
id
number
title
body
position
url
repositoryName
repositoryFullName
isClosed
isArchived
createdAt
createdAgo
labels { name color }
assignees { login url avatarUrl }
author { login url avatarUrl }
columnId
isBody
commentsCount
color
totalSubtasks
doneSubtasks
pullRequests {
id number isClosed isMerged url repositoryName
assignees { login avatarUrl }
}
${ISSUE_FRAGMENT}
}
errors
}
Expand Down Expand Up @@ -586,16 +542,7 @@ export default {
color: $color
}) {
issue {
id
number
title
labels { name color }
assignees { login url avatarUrl }
color
isClosed
isArchived
totalSubtasks
doneSubtasks
${ISSUE_UPDATABLE_FRAGMENT}
}
errors
}
Expand All @@ -620,14 +567,7 @@ export default {
isArchived: $isArchived
}) {
issue {
id
number
title
labels { name color }
assignees { login url avatarUrl }
color
isClosed
isArchived
${ISSUE_UPDATABLE_FRAGMENT}
}
errors
}
Expand Down
3 changes: 3 additions & 0 deletions src/assets/icons/menu/graph.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions src/components/menu/top.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
</div>
</div>
<div class='right'>
<router-link v-if='isBoardReady' class='icon charts' :to='boardIssuesAgeChartUrl' />
<router-link v-if='isBoardReady' class='icon notes' :to='boardNotesUrl' />
<router-link v-if='isShowSettings' class='icon settings' :to='boardSettingsUrl' />
<router-link v-if='isShowNotes' class='icon notes' :to='boardNotesUrl' />
</div>
</div>
</template>
Expand Down Expand Up @@ -80,11 +81,12 @@ export default {
boardId() { return parseInt(this.$route.params.id) || 0; },
boardSettingsUrl() { return `/boards/${this.boardId}/settings`; },
boardNotesUrl() { return `/boards/${this.boardId}/notes`; },
isShowSettings() {
return this.boardId > 0 && this.isBoardLoaded && this.isBoardOwner;
},
isShowNotes() {
boardIssuesAgeChartUrl() { return `/boards/${this.boardId}/charts/age`; },
isBoardReady() {
return this.boardId > 0 && this.isBoardLoaded;
},
isShowSettings() {
return this.isBoardReady && this.isBoardOwner;
}
},
async created() {
Expand Down Expand Up @@ -276,4 +278,7 @@ export default {
&.notes
background-image: url('../../assets/icons/menu/note.svg')
&.charts
background-image: url('../../assets/icons/menu/graph.svg')
</style>
2 changes: 1 addition & 1 deletion src/components/tabs/tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {

<style scoped lang='sass'>
.tabs
margin-top: 30px
padding-top: 16px
.tab
color: #3F51B5
Expand Down
15 changes: 5 additions & 10 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Home from '../views/home';
import Invite from '../views/invite';
import Issue from '../views/issue';
import IssueNew from '../views/issue_new';
import Notes from '../views/notes';
import OAuth from '../views/oauth';
import Settings from '../views/settings';
import SharedBoard from '../views/shared_board';
Expand Down Expand Up @@ -57,7 +56,11 @@ const routes = [
}, {
path: 'notes',
name: 'notes',
component: Notes
component: () => import('../views/notes.vue')
}, {
path: 'charts/age',
name: 'issues_age_chart',
component: () => import('../views/charts/issues_age.vue')
}
],
beforeEnter: requireAuth
Expand Down Expand Up @@ -86,14 +89,6 @@ const routes = [
name: 'oauth',
component: OAuth
}
// {
// path: '/about',
// name: 'About',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
// }
];

const router = createRouter({
Expand Down
17 changes: 17 additions & 0 deletions src/views/board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@
</transition>
</router-view>
</div>

<!-- charts -->
<div
class='modal-overlay'
v-if='isLoaded'
v-show='isChartOpen'
@click.self='backToBoard'
>
<router-view v-slot='{ Component }'>
<transition name='slide' :duration='200'>
<component :is='Component' />
</transition>
</router-view>
</div>
</template>

<script>
Expand Down Expand Up @@ -90,6 +104,9 @@ export default {
},
isModalRight() {
return this.issueModalStyle === 'right';
},
isChartOpen() {
return this.$route.name === 'issues_age_chart';
}
},
async created() {
Expand Down

0 comments on commit cc80e55

Please sign in to comment.