31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-03 22:20:48 +00:00

Do not show a link to the issue tracker if there is none. Fixes #298

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2020-10-10 11:57:55 +02:00
parent 6ac62486ea
commit 545b3806e7
No known key found for this signature in database
GPG Key ID: E11DEC58660B9E9A
2 changed files with 10 additions and 7 deletions

View File

@ -32,7 +32,7 @@ class PullsHtmlView extends DefaultHtmlView
* @var array
* @since 3.0.0
*/
protected $branches = array();
protected $branches = [];
/**
* Array containing environment errors
@ -40,7 +40,7 @@ class PullsHtmlView extends DefaultHtmlView
* @var array
* @since 2.0
*/
protected $envErrors = array();
protected $envErrors = [];
/**
* Array of open pull requests
@ -167,7 +167,7 @@ class PullsHtmlView extends DefaultHtmlView
*/
protected function getLimitOptions()
{
return array(
return [
5 => Text::_('J5'),
10 => Text::_('J10'),
15 => Text::_('J15'),
@ -179,7 +179,7 @@ class PullsHtmlView extends DefaultHtmlView
200 => Text::_('J200'),
500 => Text::_('J500'),
0 => Text::_('JALL'),
);
];
}
/**
@ -191,11 +191,11 @@ class PullsHtmlView extends DefaultHtmlView
*/
protected function getSortFields()
{
return array(
return [
'a.title ASC' => Text::_('JGLOBAL_TITLE_ASC'),
'a.title DESC' => Text::_('JGLOBAL_TITLE_DESC'),
'a.pull_id ASC' => Text::_('COM_PATCHTESTER_PULL_ID_ASC'),
'a.pull_id DESC' => Text::_('COM_PATCHTESTER_PULL_ID_DESC'),
);
];
}
}

View File

@ -7,8 +7,9 @@
*/
use Joomla\CMS\Language\Text;
use PatchTester\View\Pulls\PullsHtmlView;
/** @var \PatchTester\View\DefaultHtmlView $this */
/** @var PullsHtmlView $this */
foreach ($this->items as $i => $item) :
$status = '';
@ -32,6 +33,7 @@ foreach ($this->items as $i => $item) :
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
</a>
</div>
<?php if ($this->trackerAlias) : ?>
<div class="col-md-auto">
<a class="badge badge-info"
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
@ -39,6 +41,7 @@ foreach ($this->items as $i => $item) :
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
</a>
</div>
<?php endif; ?>
<?php if ($item->applied) : ?>
<div class="col-md-auto">
<span class="badge badge-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>