Fix small bugs.

master 0.1.0
Lio Novelli 2022-05-15 13:04:50 +02:00
parent 25d8092836
commit ede6dc9c24
2 changed files with 11 additions and 7 deletions

View File

@ -145,6 +145,7 @@ class InvoiceCommand extends Command
if ($input->getOption('list-reports')) {
$list = $this->youtrack->listReports();
$output->writeln(var_export($list, TRUE));
return Command::SUCCESS;
}
if ($input->hasParameterOption('--report') || $input->hasParameterOption('-r')) {
if ($report = $input->getOption('report')) {

View File

@ -49,6 +49,16 @@ class ReportCommand extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) :int {
if ($timeRange = $input->getOption('time-range')) {
// @TODO: Implement time range option:
// - Request workTime items from tracking service
// - Filter them, join by issue, project ...
if ($output->isVerbose()) {
$output->writeln("Time range: {$timeRange}");
}
$output->writeln('<error>This option is not supported yet.</error>');
return Command::FAILURE;
}
$reports = $this->trackingService->listReports();
// Could just parse a csv file or actually get workItems from youtrack ...
if ($input->hasParameterOption('--report') || $input->hasParameterOption('-r')) {
@ -73,13 +83,6 @@ class ReportCommand extends Command {
elseif ($report = $this->config->get('tracking_service.youtrack.report.default')) {
$this->trackingService->setReportId($report);
}
elseif ($timeRange = $input->getParameterOption('time-range')) {
// @TODO: Implement time range option:
// - Request workTime items from tracking service
// - Filter them, join by issue, project ...
$output->writeln('<error>This option is not supported yet.</error>');
return Command::FAILURE;
}
// Currently we only support csv download.
$report_id = $this->trackingService->getReportId();
$report_name = $reports[$report_id];