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 support for hyperlinks in terminal #20

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
20 changes: 19 additions & 1 deletion src/Command/WeeklyReportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,31 @@ private function formatIssuesTable(array $issues)
$table->setColumnStyle(0, $rightAligned);
$table->setHeaders(array('issue id', 'issue summary'));

$issueWidth = 0;
foreach ($issues as $type => $issue) {
$table->addRow(array($issue['iss_id'], $issue['iss_summary']));
$issueId = $this->renderIssueLink($issue['iss_id']);
$table->addRow(array($issueId, $issue['iss_summary']));
}
$table->setColumnWidth(0, 10);

$table->setColumnWidths(array(10, 0, 30));

$table->render();
}

/**
* @see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#the-escape-sequence
* @see https://github.com/symfony/symfony/pull/29668
* @see https://github.com/symfony/console/commit/20e4894521056ff6aa059015143bb971d475469a#diff-5871b25b12684413fc82089739d41411 symfony 4.2+
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line exceeds 120 characters; contains 145 characters

* @see https://github.com/symfony/console/commit/4f04cf84d6b0ce4beae6d1ed7767043636d7bfab#diff-5871b25b12684413fc82089739d41411 4.3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line exceeds 120 characters; contains 138 characters

* @see https://youtrack.jetbrains.com/issue/IDEA-204536
*/
private function renderIssueLink($issue_id, $issue_link1 = '')
{
$issue_link = 'http://example.com';
return "\e]8;;{$issue_link}\e\\{$issue_id}\e]8;;\e\\";
}

private function formatIssueStatuses(array $data)
{
$this->output->writeln('Issues by status:');
Expand Down