Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSV export #86

Merged
merged 4 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fuzz-roadmap",
"version": "2.2.0",
"version": "2.3.0",
"description": "A roadmapping tool that lets you forget about time estimate and focus on what matters",
"author": "Adrien D. Ahlqvist",
"bugs": "https://github.com/Armitage35/fuzzy-roadmap/issues",
Expand Down
22 changes: 21 additions & 1 deletion src/components/Modal/ExportRoadmapModal/ExportRoadmapModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<button type="button" class="bttn-primary" @click="exportJson">
<i class="fas fa-file-code"></i>
Export as .JSON</button>
<button type="button" class="bttn-primary" @click="exportCsv">
<i class="fas fa-file-csv"></i>
Export as .CSV</button>
<button type="button" class="bttn-primary" @click="exportJPG">
<i class="fas fa-file-image"></i>
Export as .PNG (beta)
Expand All @@ -24,7 +27,24 @@
export default {
props: ['epics'],
methods: {
exportJson(){
exportCsv() {
let epicInCsv = [];

for (let i = 0; i < this.epics.length; i++) {
let newItem = [];
newItem.push(this.epics[i].epicName);
newItem.push(this.epics[i].status);

epicInCsv.push(newItem);
}

let csvContent = epicInCsv.map(e => e.join(",")).join("\n");

const blob = new Blob([csvContent], {type: 'application/csv'});
this.exportRoadmap(blob, 'fuzzyRoadmap.csv')
this.exportSuccess();
},
exportJson() {
const blob = new Blob([JSON.stringify(this.epics)], {type: 'application/json'});
this.exportRoadmap(blob, 'fuzzyRoadmap.json')
this.exportSuccess();
Expand Down
3 changes: 0 additions & 3 deletions src/components/Views/Roadmap/Lane/Lane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,3 @@
}
}
</script>

<style>
</style>