Skip to content

Commit

Permalink
further fix image rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Zsolt Gál committed Jun 24, 2024
1 parent d21adc0 commit 536c2ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 8 additions & 2 deletions src/Technodelight/Jira/Connector/JiraTagConverter/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@
namespace Technodelight\Jira\Connector\JiraTagConverter;

use Symfony\Component\Console\Terminal;
use Technodelight\Jira\Configuration\ApplicationConfiguration\IntegrationsConfiguration\ITermConfiguration;
use Technodelight\Jira\Console\Application;
use Technodelight\JiraTagConverter\JiraTagConverter;

class Factory
{
public function __construct(private readonly Terminal $terminal)
{
public function __construct(
private readonly Terminal $terminal,
private readonly ITermConfiguration $configuration
) {
}

public function build(array $opts = [], $setTermWidth = true)
{
if ($setTermWidth) {
$opts['terminalWidth'] = $this->terminal->getWidth();
}
// do not touch image sequences if iterm image rendering is enabled
$opts['images'] = $opts['images'] ?? !$this->configuration->renderImages();

return new JiraTagConverter($opts);
}
}
13 changes: 4 additions & 9 deletions src/Technodelight/Jira/Renderer/Issue/Renderer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Technodelight\Jira\Renderer\Issue;

use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -8,15 +10,8 @@

class Renderer implements IssueRenderer
{
/**
* @var IssueRenderer[]
*/
private $renderers;

public function __construct(array $renderers)
{
$this->renderers = $renderers;
}
/** @param IssueRenderer[] $renderers */
public function __construct(private readonly array $renderers = []) {}

public function render(OutputInterface $output, Issue $issue): void
{
Expand Down
1 change: 1 addition & 0 deletions src/Technodelight/Jira/Resources/configs/helpers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
id="technodelight.jira.connector.jira_tag_converter.factory"
class="Technodelight\Jira\Connector\JiraTagConverter\Factory">
<argument type="service" id="terminal" />
<argument type="service" id="technodelight.jira.config.integrations.iterm" />
</service>
<service id="technodelight.jira.jira_tag_converter" class="Technodelight\JiraTagConverter\JiraTagConverter">
<factory service="technodelight.jira.connector.jira_tag_converter.factory" method="build" />
Expand Down

0 comments on commit 536c2ee

Please sign in to comment.