Skip to content

Commit

Permalink
removing cycle time and dev_at columns at .csv
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrimaia committed Nov 24, 2014
1 parent 6383eb8 commit ea48892
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
7 changes: 3 additions & 4 deletions app/js/component/data/issues_exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ define(['flight/lib/component'],
"\"" + issue.body.replace(/(\r\n|\n|\r)/g, " ") + "\"",
"\"" + _.map(issue.labels, function(label) {return label.name;}) + "\"",
issue.created_at,
issue.dev_at,
issue.closed_at,
daysBetween(issue.created_at, issue.closed_at),
daysBetween(issue.dev_at, issue.closed_at)].join(';')
daysBetween(issue.created_at, issue.closed_at)
].join(';')
});

return issuesCsv;
Expand All @@ -78,7 +77,7 @@ define(['flight/lib/component'],
};

this.csvHeader = function() {
return ["Source","Github ID","Title","Status","Kanban State","Description", "Tags", "Create at", "Dev at", "Closed at", "Lead Time", "Cycle Time"].join(';');
return ["Source","Github ID","Title","Status","Kanban State","Description", "Tags", "Create at", "Closed at", "Lead Time"].join(';');
};

this.after('initialize', function () {
Expand Down
22 changes: 11 additions & 11 deletions test/spec/component/data/issues_exporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ describeComponent('component/data/issues_exporter', function () {
];

expect(this.component.linkToCsv({'issues': issues})).toEqual("data:text/csv;charset=utf8," + encodeURIComponent(
"Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Dev at;Closed at;Lead Time;Cycle Time" +
"\npixelated-platform;90;\"sending mails\";open;1 - Ready;\"should send email\";\"1- Backlog,2- Dev\";;;;;" +
"\npixelated-user-agent;92;\"handle errors on sending mails\";open;0 - Backlog;\"If mails can't be sent by the twisted process\";\"3- QA,2- Dev\";;;;;\n"));
"Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Closed at;Lead Time" +
"\npixelated-platform;90;\"sending mails\";open;1 - Ready;\"should send email\";\"1- Backlog,2- Dev\";;;" +
"\npixelated-user-agent;92;\"handle errors on sending mails\";open;0 - Backlog;\"If mails can't be sent by the twisted process\";\"3- QA,2- Dev\";;;\n"));
});

it('creates a csv link and adds new issues to the end of it', function(){
Expand All @@ -53,9 +53,9 @@ describeComponent('component/data/issues_exporter', function () {
}
];

var contentToEncode = "Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Dev at;Closed at;Lead Time;Cycle Time" +
"\npixelated-platform;90;\"sending mails\";open;1 - Ready;\"should send email\";\"\";;;;;" +
"\npixelated-user-agent;92;\"handle errors on sending mails\";open;0 - Backlog;\"If mails can't be sent by the twisted process\";\"\";;;;;\n";
var contentToEncode = "Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Closed at;Lead Time" +
"\npixelated-platform;90;\"sending mails\";open;1 - Ready;\"should send email\";\"\";;;" +
"\npixelated-user-agent;92;\"handle errors on sending mails\";open;0 - Backlog;\"If mails can't be sent by the twisted process\";\"\";;;\n";

expect(this.component.linkToCsv({'issues': issues})).toEqual("data:text/csv;charset=utf8," + encodeURIComponent(contentToEncode));

Expand All @@ -69,7 +69,7 @@ describeComponent('component/data/issues_exporter', function () {
"body": "just testing an issue"
}];

var newIssuesToEncode = "test-issues-ramon;66;\"handle errors on sending mails\";open;1 - Backlog;\"just testing an issue\";\"\";;;;;\n";
var newIssuesToEncode = "test-issues-ramon;66;\"handle errors on sending mails\";open;1 - Backlog;\"just testing an issue\";\"\";;;\n";

expect(this.component.linkToCsv({'issues': newIssues})).toEqual("data:text/csv;charset=utf8," + encodeURIComponent(contentToEncode + newIssuesToEncode));
});
Expand Down Expand Up @@ -106,9 +106,9 @@ describeComponent('component/data/issues_exporter', function () {
];

expect(this.component.linkToCsv({'issues': issues})).toEqual("data:text/csv;charset=utf8," + encodeURIComponent(
"Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Dev at;Closed at;Lead Time;Cycle Time" +
"\ntest-issues-leadTime-0;;\"\";;;\"lead time description-0\";\"\";2014-11-18T13:29:41Z;2014-11-18T14:00:41Z;2014-11-19T13:28:41Z;0;0" +
"\ntest-issues-leadTime-1;;\"\";;;\"lead time description-1\";\"\";2014-11-18T13:29:41Z;2014-11-18T14:00:41Z;2014-11-19T13:29:41Z;1;0" +
"\ntest-issues-leadTime-3;;\"\";;;\"lead time description-3\";\"\";2014-11-18T13:29:41Z;2014-11-20T13:00:41Z;2014-11-21T13:30:41Z;3;1\n"));
"Source;Github ID;Title;Status;Kanban State;Description;Tags;Create at;Closed at;Lead Time" +
"\ntest-issues-leadTime-0;;\"\";;;\"lead time description-0\";\"\";2014-11-18T13:29:41Z;2014-11-19T13:28:41Z;0" +
"\ntest-issues-leadTime-1;;\"\";;;\"lead time description-1\";\"\";2014-11-18T13:29:41Z;2014-11-19T13:29:41Z;1" +
"\ntest-issues-leadTime-3;;\"\";;;\"lead time description-3\";\"\";2014-11-18T13:29:41Z;2014-11-21T13:30:41Z;3\n"));
});
});

0 comments on commit ea48892

Please sign in to comment.