Skip to content

Commit

Permalink
Clean up / Minor fixes (1) (joomla#29)
Browse files Browse the repository at this point in the history
* fix EOF

* fix filter forms

fix default sort
sort order dropdown like table columns
fix sort state ->published

* fix manifest

lowercase name (see. joomla#37387)
indentation (spaces vs. tabs)

* cleanup component provider

component do not use SiteRouter and Category
  • Loading branch information
heelc29 authored Feb 8, 2023
1 parent 9dbac05 commit 33a794e
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 34 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_guidedtours/access.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
<action name="core.edit.state" title="JACTION_EDITSTATE" />
<action name="core.edit.own" title="JACTION_EDITOWN" />
</section>
</access>
</access>
4 changes: 2 additions & 2 deletions administrator/components/com_guidedtours/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name="permissions"
label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC"
>
>
<field
name="rules"
type="rules"
Expand All @@ -15,4 +15,4 @@
section="component"
/>
</fieldset>
</config>
</config>
10 changes: 5 additions & 5 deletions administrator/components/com_guidedtours/forms/filter_steps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
type="list"
label="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="a.title DESC"
default="a.id ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.state ASC">JSTATUS_ASC</option>
<option value="a.state DESC">JSTATUS_DESC</option>
<option value="a.type ASC">COM_GUIDEDTOURS_ORDER_TYPE_ASC</option>
<option value="a.type DESC">COM_GUIDEDTOURS_ORDER_TYPE_DESC</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
</field>

<field
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_guidedtours/forms/filter_tours.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
type="list"
label="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="a.title DESC"
default="a.ordering ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
<option value="a.state ASC">JSTATUS_ASC</option>
<option value="a.state DESC">JSTATUS_DESC</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>

<field
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_guidedtours/guidedtours.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" method="upgrade">
<name>COM_GUIDEDTOURS</name>
<name>com_guidedtours</name>
<author>Joomla! Project</author>
<creationDate>2023-02</creationDate>
<copyright>(C) 2023 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.3.0</version>
<description>COM_GUIDEDTOURS_XML_DESCRIPTION</description>
<description>COM_GUIDEDTOURS_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Component\Guidedtours</namespace>
<administration>
<filename>access.xml</filename>
Expand All @@ -23,4 +23,4 @@
<language tag="en-GB">language/en-GB/com_guidedtours.sys.ini</language>
</languages>
</administration>
</extension>
</extension>
11 changes: 3 additions & 8 deletions administrator/components/com_guidedtours/services/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@

defined('_JEXEC') or die;

use Joomla\CMS\Component\Router\RouterFactoryInterface;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\Service\Provider\CategoryFactory;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\Extension\Service\Provider\RouterFactory;
use Joomla\CMS\HTML\Registry;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\Component\Guidedtours\Administrator\Extension\GuidedtoursComponent;
Expand All @@ -28,8 +25,7 @@
*
* @since __DEPLOY_VERSION__
*/
return new class implements ServiceProviderInterface
{
return new class () implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
Expand All @@ -41,17 +37,16 @@
*/
public function register(Container $container)
{
$container->registerServiceProvider(new CategoryFactory('\\Joomla\\Component\\Guidedtours'));
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\Guidedtours'));
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Guidedtours'));
$container->registerServiceProvider(new RouterFactory('\\Joomla\\Component\\Guidedtours'));

$container->set(
ComponentInterface::class,
function (Container $container) {
$component = new GuidedtoursComponent($container->get(ComponentDispatcherFactoryInterface::class));

$component->setRegistry($container->get(Registry::class));
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
$component->setRouterFactory($container->get(RouterFactoryInterface::class));

return $component;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@

namespace Joomla\Component\Guidedtours\Administrator\Extension;

use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Component\Router\RouterServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Psr\Container\ContainerInterface;

Expand All @@ -24,11 +20,8 @@
*
* @since __DEPLOY_VERSION__
*/
class GuidedtoursComponent extends MVCComponent implements
BootableExtensionInterface,
RouterServiceInterface
class GuidedtoursComponent extends MVCComponent implements BootableExtensionInterface
{
use RouterServiceTrait;
use HTMLRegistryAwareTrait;

/**
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_system_tour.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_TOUR="System - Guided Tours Plugin"
PLG_SYSTEM_TOUR_DESCRIPTION="System Guided Tour Plugin"
PLG_SYSTEM_TOUR_DESCRIPTION="System Guided Tour Plugin"
2 changes: 1 addition & 1 deletion build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -851,4 +851,4 @@
}
}
}
}
}

0 comments on commit 33a794e

Please sign in to comment.