2012-06-12 18:42:03 +00:00
|
|
|
<?php
|
2022-09-08 08:54:04 +00:00
|
|
|
|
2012-06-12 18:42:03 +00:00
|
|
|
/**
|
2014-05-03 23:48:08 +00:00
|
|
|
* Patch testing component for the Joomla! CMS
|
2013-07-13 02:26:21 +00:00
|
|
|
*
|
2018-09-01 14:32:23 +00:00
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
|
2013-07-13 02:26:21 +00:00
|
|
|
* @license GNU General Public License version 2 or later
|
2012-06-12 18:42:03 +00:00
|
|
|
*/
|
|
|
|
|
2019-08-28 01:20:49 +00:00
|
|
|
use Joomla\CMS\Language\Text;
|
2023-08-17 20:01:47 +00:00
|
|
|
use Joomla\Component\Patchtester\Administrator\View\Pulls\PullsHtmlView;
|
2019-08-28 01:20:49 +00:00
|
|
|
|
2022-09-08 08:54:04 +00:00
|
|
|
// phpcs:disable PSR1.Files.SideEffects
|
|
|
|
\defined('_JEXEC') or die;
|
|
|
|
// phpcs:enable PSR1.Files.SideEffects
|
|
|
|
|
2020-10-10 09:57:55 +00:00
|
|
|
/** @var PullsHtmlView $this */
|
2019-09-30 10:13:48 +00:00
|
|
|
|
2013-07-13 02:26:21 +00:00
|
|
|
foreach ($this->items as $i => $item) :
|
2022-09-08 08:54:04 +00:00
|
|
|
$status = '';
|
|
|
|
if ($item->applied) :
|
|
|
|
$status = ' class="table-active"';
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<tr<?php echo $status; ?>>
|
|
|
|
<th scope="row" class="text-center">
|
|
|
|
<?php echo $item->pull_id; ?>
|
|
|
|
<?php if ($item->is_draft) :
|
|
|
|
?>
|
|
|
|
<span class="badge" style="color: #FFFFFF; background-color: #6e7681">
|
|
|
|
<?php echo Text::_('COM_PATCHTESTER_IS_DRAFT'); ?>
|
|
|
|
</span>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</th>
|
|
|
|
<td>
|
|
|
|
<span><?php echo $this->escape($item->title); ?></span>
|
|
|
|
<div role="tooltip" id="tip<?php echo $i; ?>">
|
|
|
|
<?php echo $this->escape($item->description); ?>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-auto">
|
2023-08-03 18:48:24 +00:00
|
|
|
<a class="badge btn-info bg-info" href="<?php echo $item->pull_url; ?>" target="_blank">
|
2022-09-08 08:54:04 +00:00
|
|
|
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php if ($this->trackerAlias) :
|
|
|
|
?>
|
|
|
|
<div class="col-md-auto">
|
2023-08-03 18:48:24 +00:00
|
|
|
<a class="badge btn-info bg-info"
|
2022-09-08 08:54:04 +00:00
|
|
|
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
|
|
|
|
target="_blank">
|
|
|
|
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
<?php if ($item->applied) :
|
|
|
|
?>
|
|
|
|
<div class="col-md-auto">
|
2023-08-03 18:48:24 +00:00
|
|
|
<span class="badge btn-info bg-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
|
2022-09-08 08:54:04 +00:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</div>
|
|
|
|
<?php if (count($item->labels) > 0) :
|
|
|
|
?>
|
2020-07-25 14:16:38 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-auto">
|
2022-09-08 08:54:04 +00:00
|
|
|
<?php foreach ($item->labels as $label) :
|
|
|
|
?>
|
2020-07-25 14:16:38 +00:00
|
|
|
<?php
|
2022-09-08 08:54:04 +00:00
|
|
|
switch (strtolower($label->name)) {
|
|
|
|
case 'a11y':
|
|
|
|
case 'conflicting files':
|
|
|
|
case 'documentation required':
|
|
|
|
case 'information required':
|
|
|
|
case 'j3 issue':
|
|
|
|
case 'language change':
|
|
|
|
case 'mysql 5.7':
|
|
|
|
case 'needs new owner':
|
|
|
|
case 'no code attached yet':
|
|
|
|
case 'pbf':
|
|
|
|
case 'pr-3.9-dev':
|
|
|
|
case 'pr-3.10-dev':
|
|
|
|
case 'pr-4.1-dev':
|
|
|
|
case 'pr-i10n_4.0-dev':
|
|
|
|
case 'pr-staging':
|
|
|
|
case 'release blocker':
|
|
|
|
case 'rfc':
|
|
|
|
case 'test instructions missing':
|
|
|
|
case 'updates requested':
|
|
|
|
$textColor = '000000';
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$textColor = 'FFFFFF';
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2020-07-25 14:16:38 +00:00
|
|
|
?>
|
|
|
|
<span class="badge" style="color: #<?php echo $textColor; ?>; background-color: #<?php echo $label->color; ?>"><?php echo $label->name; ?></span>
|
2022-09-08 08:54:04 +00:00
|
|
|
<?php
|
|
|
|
endforeach; ?>
|
2020-07-25 14:16:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-08 08:54:04 +00:00
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</td>
|
|
|
|
<td class="d-none d-md-table-cell text-center">
|
|
|
|
<?php echo $this->escape($item->branch); ?>
|
|
|
|
</td>
|
|
|
|
<td class="d-none d-md-table-cell text-center">
|
|
|
|
<?php if ($item->is_rtc) :
|
|
|
|
?>
|
|
|
|
<span class="badge bg-success"><?php echo Text::_('JYES'); ?></span>
|
|
|
|
<?php
|
|
|
|
else :
|
|
|
|
?>
|
|
|
|
<span class="badge bg-secondary"><?php echo Text::_('JNO'); ?></span>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
<?php if ($item->applied) :
|
|
|
|
?>
|
|
|
|
<span class="badge bg-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
|
|
|
|
<?php
|
|
|
|
else :
|
|
|
|
?>
|
|
|
|
<span class="badge bg-secondary"><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></span>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</td>
|
|
|
|
<td class="text-center">
|
|
|
|
<?php if ($item->applied) :
|
|
|
|
?>
|
|
|
|
<button type="button" class="btn btn-sm btn-success submitPatch"
|
|
|
|
data-task="revert" data-id="<?php echo (int) $item->applied; ?>"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
|
|
|
|
<?php
|
|
|
|
else :
|
|
|
|
?>
|
|
|
|
<button type="button" class="btn btn-sm btn-primary submitPatch"
|
|
|
|
data-task="apply" data-id="<?php echo (int) $item->pull_id; ?>"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>
|
|
|
|
<?php
|
|
|
|
endif; ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
endforeach;
|