Remove atum template

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2020-04-04 09:00:19 +02:00
parent 4e759d965b
commit 73f07810f2
No known key found for this signature in database
GPG Key ID: FD49814C56AE3AF9
6 changed files with 0 additions and 390 deletions

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

@ -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