From ea48892569460dcd3b3f4386b3879c0f5625e7e7 Mon Sep 17 00:00:00 2001 From: Rodrigo Maia Date: Mon, 24 Nov 2014 14:55:02 -0200 Subject: [PATCH] removing cycle time and dev_at columns at .csv --- app/js/component/data/issues_exporter.js | 7 +++--- .../component/data/issues_exporter.spec.js | 22 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/js/component/data/issues_exporter.js b/app/js/component/data/issues_exporter.js index 77c67cb..b2de1f5 100644 --- a/app/js/component/data/issues_exporter.js +++ b/app/js/component/data/issues_exporter.js @@ -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; @@ -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 () { diff --git a/test/spec/component/data/issues_exporter.spec.js b/test/spec/component/data/issues_exporter.spec.js index 3e54f75..138e4bf 100644 --- a/test/spec/component/data/issues_exporter.spec.js +++ b/test/spec/component/data/issues_exporter.spec.js @@ -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(){ @@ -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)); @@ -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)); }); @@ -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")); }); });