-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
6587727
commit 53ebd21
Showing
12 changed files
with
224 additions
and
5 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
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,78 @@ | ||
<script> | ||
import { mapGetters } from "vuex"; | ||
import { get } from "lodash"; | ||
import colors from "vuetify/lib/util/colors"; | ||
import SprintService from "@/services/scrum/sprint-service"; | ||
import BaseChart from "@/components/common/BaseChart"; | ||
import { truncate } from "@/filters"; | ||
export default { | ||
name: "SprintGanttChart", | ||
extends: BaseChart, | ||
props: { | ||
sprintId: { | ||
type: String, | ||
required: true | ||
}, | ||
height: { | ||
type: Number, | ||
default: null | ||
} | ||
}, | ||
data() { | ||
return { | ||
constructorType: "ganttChart", | ||
service: SprintService, | ||
fetchFunctionName: "ganttChartData" | ||
}; | ||
}, | ||
computed: { | ||
...mapGetters("scrum", ["riskLevelsMap"]), | ||
localChartOptions() { | ||
const userStories = get(this.chartData, "user_stories", []); | ||
return { | ||
title: { | ||
text: this.chartData.name | ||
}, | ||
legend: { enabled: false }, | ||
xAxis: { | ||
min: new Date(this.chartData.start_date).getTime(), | ||
max: new Date(this.chartData.end_date).getTime() | ||
}, | ||
series: [ | ||
{ | ||
name: this.chartData.name, | ||
data: userStories.map(userStory => ({ | ||
name: truncate(userStory.name), | ||
start: new Date(userStory.start_date).getTime(), | ||
end: new Date(userStory.end_date).getTime(), | ||
completed: userStory.current_progress / 100, | ||
color: this.getUserStoryColour(userStory) | ||
})) | ||
} | ||
] | ||
}; | ||
} | ||
}, | ||
methods: { | ||
buildFetchFunctionArgs() { | ||
return [this.sprintId]; | ||
}, | ||
getUserStoryColour(userStory) { | ||
if (userStory.risk_level !== 0) { | ||
return this.riskLevelsMap[userStory.risk_level].colour; | ||
} | ||
if (userStory.validated) { | ||
return colors.green.base; | ||
} | ||
if (!userStory.current_progress) { | ||
return colors.grey.base; | ||
} | ||
return colors.blue.base; | ||
} | ||
} | ||
}; | ||
</script> |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,75 @@ | ||
<template> | ||
<v-container fluid> | ||
<ContextBreadcrumbs :items="breadcrumbs" /> | ||
<v-card class="mt-2"> | ||
<v-toolbar flat> | ||
<v-toolbar-title class="text-h6"> Diagrama de Gantt </v-toolbar-title> | ||
<v-spacer></v-spacer> | ||
<v-tooltip bottom> | ||
<template #activator="{ on, attrs }"> | ||
<v-btn icon :to="{ name: 'sprint-kanban', params: { sprintId } }" v-bind="attrs" v-on="on"> | ||
<v-icon>mdi-teach</v-icon> | ||
</v-btn> | ||
</template> | ||
<span> | ||
Kanban | ||
</span> | ||
</v-tooltip> | ||
<v-tooltip bottom> | ||
<template #activator="{ on, attrs }"> | ||
<v-btn icon :to="{ name: 'sprint-chart', params: { sprintId } }" v-bind="attrs" v-on="on"> | ||
<v-icon>mdi-fire</v-icon> | ||
</v-btn> | ||
</template> | ||
<span> | ||
Diagrama de quemado (Burn-down/up) | ||
</span> | ||
</v-tooltip> | ||
<v-divider vertical inset></v-divider> | ||
<v-btn icon :disabled="loading" @click="getChartData"> | ||
<v-icon>mdi-refresh</v-icon> | ||
</v-btn> | ||
</v-toolbar> | ||
<v-card-text> | ||
<SprintGanttChart ref="chart" :sprint-id="sprintId" :reactive-filters="false" /> | ||
</v-card-text> | ||
</v-card> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters } from "vuex"; | ||
import BreadcrumbsContextMixin from "@/mixins/scrum/breadcrumbs-context-mixin"; | ||
import SprintGanttChart from "@/components/scrum/charts/SprintGanttChart"; | ||
export default { | ||
name: "SprintGantt", | ||
components: { SprintGanttChart }, | ||
mixins: [BreadcrumbsContextMixin], | ||
computed: { | ||
...mapGetters(["loading"]), | ||
breadcrumbs() { | ||
if (this.contextItem) { | ||
return [ | ||
{ | ||
text: "Sprints", | ||
to: { name: "sprints" }, | ||
exact: true | ||
}, | ||
{ text: this.contextItem.name, disabled: false, link: false }, | ||
{ text: "Diagrama de Gantt", disabled: true } | ||
]; | ||
} else { | ||
return []; | ||
} | ||
} | ||
}, | ||
methods: { | ||
getChartData() { | ||
this.$refs.chart.getChartData(); | ||
} | ||
} | ||
}; | ||
</script> |
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