31
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-06-03 14:10:47 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Roland Dalmulder
44fb6f56f3
Update manifest file for 3.0.0
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2021-03-04 20:39:00 +01:00
Roland Dalmulder
7ea6bc3678
Codestyle fix
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2021-03-04 20:28:39 +01:00
Roland Dalmulder
11508111c1
Merge pull request #315 from weeblr/314-missing-pulls
314 missing pulls
2021-03-04 20:21:30 +01:00
Weeblr
e72da7140e
Attempt at fixing formatting 2021-03-04 09:47:01 +01:00
Weeblr
485f139e8e
Added method to get PR from Github 2021-03-01 10:55:59 +01:00
Weeblr
81d7da37bb
Pull PR directly instead of Issues from Github 2021-03-01 10:52:56 +01:00
Roland Dalmulder
4f8bb489e8
Fixed version 3 tag
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2020-04-04 09:46:34 +02:00
Roland Dalmulder
fd39a1c73b
Bump version to 3.0.0-rc
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2020-04-04 09:42:22 +02:00
Roland Dalmulder
2bfa8d7c50
Update manifest files
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2020-04-04 09:28:50 +02:00
Roland Dalmulder
73f07810f2
Remove atum template
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
2020-04-04 09:00:19 +02:00
16 changed files with 87 additions and 461 deletions

View File

@ -25,7 +25,7 @@ abstract class AbstractController
* The active application
*
* @var CMSApplication
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $app;
@ -65,7 +65,7 @@ abstract class AbstractController
*
* @return CMSApplication
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getApplication()
{
@ -77,7 +77,7 @@ abstract class AbstractController
*
* @return Input
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getInput()
{

View File

@ -24,7 +24,7 @@ class DisplayController extends AbstractController
* Default ordering value
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $defaultFullOrdering = 'a.pull_id DESC';

View File

@ -211,6 +211,25 @@ class GitHub
return $this->processResponse($this->client->get($prepared['url'], $prepared['headers']));
}
/**
* Get a list of the open pull requests for a repository.
*
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
* @param integer $page The page number from which to get items.
* @param integer $limit The number of items on a page.
*
* @return Response
*
* @since 3.0.0
*/
public function getOpenPulls($user, $repo, $page = 0, $limit = 0)
{
$prepared = $this->prepareRequest("/repos/$user/$repo/pulls", $page, $limit);
return $this->processResponse($this->client->get($prepared['url'], $prepared['headers']));
}
/**
* Get an option from the connector.
*

View File

@ -14,7 +14,7 @@ use Joomla\Registry\Registry;
/**
* Base model for the patch testing component
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
abstract class AbstractModel
{
@ -22,7 +22,7 @@ abstract class AbstractModel
* The database driver.
*
* @var \JDatabaseDriver
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $db;
@ -30,7 +30,7 @@ abstract class AbstractModel
* The model state.
*
* @var Registry
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $state;
@ -40,7 +40,7 @@ abstract class AbstractModel
* @param Registry $state The model state.
* @param \JDatabaseDriver $db The database adpater.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function __construct(Registry $state = null, \JDatabaseDriver $db = null)
{
@ -53,7 +53,7 @@ abstract class AbstractModel
*
* @return \JDatabaseDriver
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getDb()
{
@ -65,7 +65,7 @@ abstract class AbstractModel
*
* @return Registry
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getState()
{
@ -79,7 +79,7 @@ abstract class AbstractModel
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function setDb(\JDatabaseDriver $db)
{
@ -93,7 +93,7 @@ abstract class AbstractModel
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function setState(Registry $state)
{

View File

@ -321,7 +321,7 @@ class PullsModel extends AbstractModel
// TODO - Option to configure the batch size
$batchSize = 100;
$pullsResponse = Helper::initializeGithub()->getOpenIssues(
$pullsResponse = Helper::initializeGithub()->getOpenPulls(
$this->getState()->get('github_user'), $this->getState()->get('github_repo'), $page, $batchSize
);
@ -370,36 +370,33 @@ class PullsModel extends AbstractModel
foreach ($pulls as $pull)
{
if (isset($pull->pull_request))
// Check if this PR is RTC and has a `PR-` branch label
$isRTC = false;
$branch = '';
foreach ($pull->labels as $label)
{
// Check if this PR is RTC and has a `PR-` branch label
$isRTC = false;
$branch = '';
foreach ($pull->labels as $label)
if ($label->name === 'RTC')
{
if ($label->name === 'RTC')
{
$isRTC = true;
}
elseif (substr($label->name, 0, 3) === 'PR-')
{
$branch = substr($label->name, 3);
}
$isRTC = true;
}
elseif (substr($label->name, 0, 3) === 'PR-')
{
$branch = substr($label->name, 3);
}
// Build the data object to store in the database
$pullData = array(
(int) $pull->number,
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->title, 150)),
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->body, 100)),
$this->getDb()->quote($pull->pull_request->html_url),
(int) $isRTC,
$this->getDb()->quote($branch),
);
$data[] = implode(',', $pullData);
}
// Build the data object to store in the database
$pullData = array(
(int) $pull->number,
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->title, 150)),
$this->getDb()->quote(HTMLHelper::_('string.truncate', $pull->body, 100)),
$this->getDb()->quote($pull->html_url),
(int) $isRTC,
$this->getDb()->quote($branch),
);
$data[] = implode(',', $pullData);
}
// If there are no pulls to insert then bail, assume we're finished

View File

@ -15,7 +15,7 @@ use PatchTester\Model\AbstractModel;
/**
* Base HTML view for the patch testing component
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
abstract class AbstractHtmlView extends AbstractView
{
@ -23,7 +23,7 @@ abstract class AbstractHtmlView extends AbstractView
* The view layout.
*
* @var string
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $layout = 'default';
@ -31,7 +31,7 @@ abstract class AbstractHtmlView extends AbstractView
* The paths queue.
*
* @var SplPriorityQueue
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $paths;
@ -41,7 +41,7 @@ abstract class AbstractHtmlView extends AbstractView
* @param AbstractModel $model The model object.
* @param SplPriorityQueue $paths The paths queue.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function __construct(AbstractModel $model, \SplPriorityQueue $paths = null)
{
@ -58,7 +58,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return string The escaped output.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function escape($output)
{
@ -71,7 +71,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return string The layout name.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getLayout()
{
@ -85,7 +85,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return mixed The layout file name if found, false otherwise.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getPath($layout)
{
@ -103,7 +103,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return SplPriorityQueue The paths queue.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function getPaths()
{
@ -117,7 +117,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return string The output of the the template script.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
* @throws \RuntimeException
*/
public function loadTemplate($tpl = null)
@ -162,7 +162,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return string The rendered view.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
* @throws RuntimeException
*/
public function render()
@ -195,7 +195,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return $this
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function setLayout($layout)
{
@ -211,7 +211,7 @@ abstract class AbstractHtmlView extends AbstractView
*
* @return $this
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function setPaths(\SplPriorityQueue $paths)
{

View File

@ -13,7 +13,7 @@ use PatchTester\Model\AbstractModel;
/**
* Base view for the patch testing component
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
abstract class AbstractView
{
@ -21,7 +21,7 @@ abstract class AbstractView
* The model object.
*
* @var AbstractModel
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected $model;
@ -30,7 +30,7 @@ abstract class AbstractView
*
* @param AbstractModel $model The model object.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function __construct(AbstractModel $model)
{
@ -44,7 +44,7 @@ abstract class AbstractView
*
* @return string The escaped output.
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
public function escape($output)
{

View File

@ -163,7 +163,7 @@ class PullsHtmlView extends DefaultHtmlView
*
* @return array
*
* @since __DEPLOY_VERSION__
* @since 3.0.0
*/
protected function getLimitOptions()
{

View File

@ -4,6 +4,4 @@
; Note : All ini files need to be saved as UTF-8
COM_PATCHTESTER="Joomla! Patch Tester"
COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES="Could not install the template overrides for the following templates: %s"
COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES="Could not remove the template overrides for the following templates: %s"
COM_PATCHTESTER_XML_DESCRIPTION="Component for pull request management testing"

View File

@ -2,12 +2,12 @@
<extension type="component" version="3.6" method="upgrade">
<name>com_patchtester</name>
<author>Joomla! Project</author>
<creationDate>01-September-2018</creationDate>
<creationDate>04-March-2021</creationDate>
<copyright>(C) 2011 - 2012 Ian MacLennan, (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>https://www.joomla.org</authorUrl>
<version>3.0.0-beta5-dev</version>
<version>3.0.0</version>
<description>COM_PATCHTESTER_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>
<install>
@ -54,6 +54,6 @@
</files>
</administration>
<updateservers>
<server type="extension" name="Patch Tester Component">https://raw.githubusercontent.com/joomla-extensions/patchtester/master/manifest.xml</server>
<server type="extension" name="Patch Tester Component">https://raw.githubusercontent.com/joomla-extensions/patchtester/3.0/manifest.xml</server>
</updateservers>
</extension>

View File

@ -6,11 +6,8 @@
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\Language\Text;
/**
* Installation class to perform additional changes during install/uninstall/update
@ -19,14 +16,6 @@ use Joomla\CMS\Language\Text;
*/
class Com_PatchtesterInstallerScript extends InstallerScript
{
/**
* Array of templates with supported overrides
*
* @var array
* @since 2.0
*/
protected $templateOverrides = array('atum');
/**
* Extension script constructor.
*
@ -51,73 +40,6 @@ class Com_PatchtesterInstallerScript extends InstallerScript
);
}
/**
* Function to perform changes during install
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function install($parent)
{
$this->copyLayouts();
}
/**
* Function to perform changes during update
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function update($parent)
{
$this->copyLayouts();
}
/**
* Function to perform changes during uninstall
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function uninstall($parent)
{
// Initialize the error array
$errorTemplates = array();
// Loop the supported templates
foreach ($this->templateOverrides as $template)
{
// Set the file paths
$tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template;
$overrideFolder = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester';
// Make sure the template is actually installed
if (is_dir($tmplRoot))
{
// If there's a failure in copying the overrides, log it to the error array
if (Folder::delete($overrideFolder))
{
$errorTemplates[] = ucfirst($template);
}
}
}
// If we couldn't remove any overrides, notify the user
if (count($errorTemplates) > 0)
{
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES', implode(', ', $errorTemplates)));
}
}
/**
* Function to perform changes during postflight
*
@ -132,49 +54,4 @@ class Com_PatchtesterInstallerScript extends InstallerScript
{
$this->removeFiles();
}
/**
* Function to copy layout overrides for core templates at install or update
*
* @return void
*
* @since 2.0
*/
private function copyLayouts()
{
// Initialize the error array
$errorTemplates = array();
// Loop the supported templates
foreach ($this->templateOverrides as $template)
{
// Set the file paths
$source = __DIR__ . '/' . $template;
$tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template;
$destination = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester';
// Make sure the template is actually installed
if (is_dir($tmplRoot))
{
// If there's a failure in copying the overrides, log it to the error array
try
{
if (Folder::copy($source, $destination, '', true))
{
$errorTemplates[] = ucfirst($template);
}
}
catch (RuntimeException $exception)
{
$errorTemplates[] = ucfirst($template);
}
}
}
// If we couldn't remove any overrides, notify the user
if (count($errorTemplates) > 0)
{
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES', implode(', ', $errorTemplates)));
}
}
}

View File

@ -1,28 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
/** @var \PatchTester\View\DefaultHtmlView $this */
HTMLHelper::_('jquery.framework');
HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'com_patchtester/fetcher.js', array('version' => 'auto', 'relative' => true));
?>
<div id="patchtester-container">
<h1 id="patchtester-progress-header"><?php echo Text::_('COM_PATCHTESTER_FETCH_INITIALIZING'); ?></h1>
<p id="patchtester-progress-message"><?php echo Text::_('COM_PATCHTESTER_FETCH_INITIALIZING_DESCRIPTION'); ?></p>
<div id="progress" class="progress">
<div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated bg-success" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" role="progressbar"></div>
</div>
<input id="patchtester-token" type="hidden" name="<?php echo Factory::getSession()->getFormToken(); ?>" value="1" />
</div>

View File

@ -1,163 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \PatchTester\View\Pulls\PullsHtmlView $this */
$searchToolsOptions = array(
'filtersHidden' => true,
'filterButton' => true,
'defaultLimit' => Factory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'selectorFieldName' => 'client_id',
'showSelector' => false,
'orderFieldSelector' => '#list_fullordering',
'showNoResults' => false,
'noResultsText' => '',
'formSelector' => '#adminForm',
);
HTMLHelper::_('behavior.core');
HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions);
HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true));
HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true));
$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC'));
$listLimit = (int) ($this->state->get('list.limit'));
$filterApplied = $this->escape($this->state->get('filter.applied'));
$filterBranch = $this->escape($this->state->get('filter.branch'));
$filterRtc = $this->escape($this->state->get('filter.rtc'));
?>
<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<div class="js-stools" role="search">
<div class="js-stools-container-bar">
<div class="btn-toolbar">
<div class="btn-group mr-2">
<div class="input-group">
<label for="filter_search" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>
</label>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="form-control" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>">
<div role="tooltip" id="filter_search-desc">
<?php echo $this->escape(Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION')); ?>
</div>
<span class="input-group-append">
<button type="submit" class="btn btn-primary" aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>">
<span class="fa fa-search" aria-hidden="true"></span>
</button>
</span>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary hasTooltip js-stools-btn-filter">
<?php echo Text::_('JFILTER_OPTIONS'); ?>
<span class="fa fa-angle-down" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-primary js-stools-btn-clear mr-2">
<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>
</button>
</div>
<div class="ordering-select">
<div class="js-stools-field-list">
<select name="list_fullordering" id="list_fullordering" class="custom-select" onchange="this.form.submit()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?>
</select>
</div>
<div class="js-stools-field-list">
<span class="sr-only">
<label id="list_limit-lbl" for="list_limit">Select number of items per page.</label>
</span>
<select name="list_limit" id="list_limit" class="custom-select" onchange="this.form.submit()">
<?php echo HTMLHelper::_('select.options', $this->getLimitOptions(), 'value', 'text', $listLimit); ?>
</select>
</div>
</div>
</div>
</div>
<!-- Filters div -->
<div class="js-stools-container-filters clearfix">
<div class="js-stools-field-filter">
<select name="filter_applied" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option>
<option value="yes"<?php if ($filterApplied == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option>
<option value="no"<?php if ($filterApplied == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_rtc" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option>
<option value="yes"<?php if ($filterRtc == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option>
<option value="no"<?php if ($filterRtc == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_branch" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?>
</select>
</div>
</div>
</div>
<div id="j-main-container" class="j-main-container">
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_PULLS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<th scope="col" style="width:5%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?>
</th>
<th scope="col" style="min-width:100px">
<?php echo Text::_('JGLOBAL_TITLE'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?>
</th>
<th scope="col" style="width:10%" class="text-center">
<?php echo Text::_('JSTATUS'); ?>
</th>
<th scope="col" style="width:15%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</th>
</tr>
</thead>
<tbody>
<?php echo $this->loadTemplate('items'); ?>
</tbody>
</table>
<?php endif; ?>
<?php echo $this->pagination->getListFooter(); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="pull_id" id="pull_id" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</div>
</form>

View File

@ -1,72 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Language\Text;
/** @var \PatchTester\View\DefaultHtmlView $this */
foreach ($this->items as $i => $item) :
$status = '';
if ($item->applied) :
$status = ' class="table-active"';
endif;
?>
<tr<?php echo $status; ?>>
<th scope="row" class="text-center">
<?php echo $item->pull_id; ?>
</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">
<a class="badge badge-info" href="<?php echo $item->pull_url; ?>" target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
</a>
</div>
<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; ?>" target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
</a>
</div>
<?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>
</div>
<?php endif; ?>
</div>
</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 badge-success"><?php echo Text::_('JYES'); ?></span>
<?php else : ?>
<span class="badge badge-secondary"><?php echo Text::_('JNO'); ?></span>
<?php endif; ?>
</td>
<td class="text-center">
<?php if ($item->applied) : ?>
<span class="badge badge-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
<?php else : ?>
<span class="badge badge-secondary"><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></span>
<?php endif; ?>
</td>
<td class="text-center">
<?php if ($item->applied) : ?>
<button class="btn btn-sm btn-success" onclick="PatchTester.submitpatch('revert', '<?php echo (int) $item->applied; ?>');"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
<?php else : ?>
<button class="btn btn-sm btn-primary" onclick="PatchTester.submitpatch('apply', '<?php echo (int) $item->pull_id; ?>');"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>
<?php endif; ?>
</td>
</tr>
<?php endforeach;

View File

@ -4,8 +4,6 @@ rm -rf build/packaging && mkdir build/packaging
rm -rf build/packages && mkdir build/packages
composer install --no-dev -o
cp -r administrator/components/com_patchtester build/packaging/admin
cp -r administrator/templates/atum/html/com_patchtester build/packaging/atum
cp -r administrator/templates/hathor/html/com_patchtester build/packaging/hathor
cp -r media/com_patchtester build/packaging/media
rm -rf build/packaging/admin/backups/*.txt
mv build/packaging/admin/patchtester.xml build/packaging/patchtester.xml

View File

@ -7,9 +7,9 @@
<type>component</type>
<version>2.0.1</version>
<client>administrator</client>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/2.0.1</infourl>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/3.0.0</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/2.0.1/com_patchtester.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/3.0.0/com_patchtester.zip</downloadurl>
</downloads>
<sha384>f54a41cbfdc672fc1f0318adc179bf25412a1a1a89c1e2720c35c62740eb35b35f43421b72085270d0b17f3c4729aa64</sha384>
<tags>
@ -22,15 +22,15 @@
<description>Joomla! CMS Patch Tester Component</description>
<element>com_patchtester</element>
<type>component</type>
<version>3.0.0-beta4</version>
<version>3.0.0</version>
<client>administrator</client>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/3.0.0-beta4</infourl>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/3.0.0</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/3.0.0-beta4/com_patchtester.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/3.0.0/com_patchtester.zip</downloadurl>
</downloads>
<sha384>dc5a4bf9d8d9f4ed9ce40d73885d543a2a8b3277e46519e8cf4759d8e1b5f0901b7d438033ffd0339afcb6d6a7536eb6</sha384>
<sha384>0cafdeb2cfbe5b509e8c885c8d96098ba52d984fb37693fc753d64c736bfe148d44742fad21bc2bec4b1c9904df1cfd3</sha384>
<tags>
<tag>beta</tag>
<tag>rc</tag>
</tags>
<targetplatform name="joomla" version="3.([789]|10)" />
</update>
@ -39,15 +39,15 @@
<description>Joomla! CMS Patch Tester Component</description>
<element>com_patchtester</element>
<type>component</type>
<version>4.0.0-beta2</version>
<version>4.0.1</version>
<client>administrator</client>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/4.0.0-beta2</infourl>
<infourl title="Patch Tester Component">https://github.com/joomla-extensions/patchtester/releases/tag/4.0.1</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/4.0.0-beta2/com_patchtester.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/joomla-extensions/patchtester/releases/download/4.0.1/com_patchtester.zip</downloadurl>
</downloads>
<sha384>ca4d133df5dc3fc6ab69e08f95b39a342f8c0d0e76272ade5957e94a93134261ff3f5c870d1d23c6d0fdc12a65b75cd5</sha384>
<sha384>8e895685840d349f0bd714eebb88a08865ee1fdde4d511624a4baedb7872ed6192c8a86a04f99d2af0e5a4c3d98dfcf3</sha384>
<tags>
<tag>beta</tag>
<tag>stable</tag>
</tags>
<targetplatform name="joomla" version="4.[0123]" />
</update>