Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] UI: improve segregation of public and internal interfaces. #8805

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,7 +16,9 @@
*
*********************************************************************/

use ILIAS\UI\Implementation\Factory as UIImplementationFactory;
declare(strict_types=1);

use ILIAS\UI\Factory as UIFactory;
use ILIAS\UI\Renderer as UIRenderer;

/**
Expand All @@ -30,7 +30,7 @@ class ilConsultationHourBookingTableGUI extends ilTable2GUI

private ilDateTime $today;
private UIRenderer $renderer;
private UIImplementationFactory $uiFactory;
private UIFactory $uiFactory;

public function __construct(object $a_parent_obj, string $a_parent_cmd, int $a_user_id)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,7 +16,9 @@
*
*********************************************************************/

use ILIAS\UI\Implementation\Factory as UIImplementationFactory;
declare(strict_types=1);

use ILIAS\UI\Factory as UIFactory;
use ILIAS\UI\Renderer as UIRenderer;

/**
Expand All @@ -30,7 +30,7 @@ class ilConsultationHoursTableGUI extends ilTable2GUI
{
private int $user_id = 0;
private UIRenderer $renderer;
private UIImplementationFactory $uiFactory;
private UIFactory $uiFactory;

public function __construct(object $a_gui, string $a_cmd, int $a_user_id)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,7 +16,9 @@
*
*********************************************************************/

use ILIAS\UI\Implementation\Factory as UIImplementationFactory;
declare(strict_types=1);

use ILIAS\UI\Factory as UIFactory;
use ILIAS\UI\Renderer as UIRenderer;

/**
Expand All @@ -32,7 +32,7 @@ class ilCalendarManageTableGUI extends ilTable2GUI
protected ilObjUser $user;

private UIRenderer $renderer;
private UIImplementationFactory $uiFactory;
private UIFactory $uiFactory;

public function __construct(object $a_parent_obj)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

use ILIAS\Refinery\Factory as RefineryFactory;
use ILIAS\HTTP\Services as HttpServices;
use ILIAS\UI\Implementation\Factory as UIImplementationFactory;
use ILIAS\UI\Factory as UIFactory;
use ILIAS\UI\Renderer as UIRenderer;

/**
Expand Down Expand Up @@ -59,7 +59,7 @@ class ilCalendarPresentationGUI
protected int $cal_period = 0;

private UIRenderer $renderer;
private UIImplementationFactory $uiFactory;
private UIFactory $uiFactory;

public function __construct($a_ref_id = 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*********************************************************************/

use ILIAS\UI\Implementation\Factory as UIImplementationFactory;
use ILIAS\UI\Factory as UIFactory;
use ILIAS\UI\Renderer as UIRenderer;

/**
Expand All @@ -30,7 +30,7 @@ class ilCourseObjectivesTableGUI extends ilTable2GUI
protected ilLOSettings $settings;

private UIRenderer $renderer;
private UIImplementationFactory $uiFactory;
private UIFactory $uiFactory;

public function __construct(object $a_parent_obj, ilObject $a_course_obj)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use ILIAS\GlobalScreen\Services;
use ILIAS\GlobalScreen\Provider\ProviderFactory;
use ILIAS\UI\Component as C;

use PHPUnit\Framework\TestCase;
use ILIAS\UI\Implementation\Component as I;
use ILIAS\UI\Implementation\Component\Counter\Factory;
Expand Down Expand Up @@ -60,7 +59,6 @@ abstract class BaseNotificationSetUp extends TestCase
*/
protected $factory;


/**
* @inheritDoc
*/
Expand All @@ -80,19 +78,21 @@ protected function setUp(): void
public function getUIFactory(): NoUIFactory
{
$factory = new class () extends NoUIFactory {
public function item(): ILIAS\UI\Component\Item\Factory
public function item(): I\Item\Factory
{
return new I\Item\Factory();
}
public function symbol(): ILIAS\UI\Component\Symbol\Factory

public function symbol(): I\Symbol\Factory
{
return new I\Symbol\Factory(
new I\Symbol\Icon\Factory(),
new I\Symbol\Glyph\Factory(),
new I\Symbol\Avatar\Factory()
);
}
public function mainControls(): C\MainControls\Factory

public function mainControls(): I\MainControls\Factory
{
return new I\MainControls\Factory(
$this->sig_gen,
Expand Down Expand Up @@ -134,6 +134,7 @@ public function getDummyNotificationsProviderWithNotifications($notifications):
$dic = $this->getDIC();
$provider = new class ($dic) extends AbstractNotificationProvider {
public array $notifications = [];

public function getNotifications(): array
{
return $this->notifications;
Expand Down
8 changes: 8 additions & 0 deletions components/ILIAS/Init/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ public function init(
$pull[\ILIAS\UI\Implementation\Component\Counter\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Button\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Listing\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Listing\Workflow\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Listing\CharacteristicValue\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Listing\Entity\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Image\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Player\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Panel\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Modal\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Dropzone\Factory::class],
Expand All @@ -84,15 +88,19 @@ public function init(
$pull[\ILIAS\UI\Implementation\Component\MessageBox\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Card\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Layout\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Layout\Page\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Layout\Alignment\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\MainControls\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Tree\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Tree\Node\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Menu\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Symbol\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Toast\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Legacy\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Launcher\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Entity\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Panel\Listing\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Panel\Secondary\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Chart\ProgressMeter\Factory::class],
$pull[\ILIAS\UI\Implementation\Component\Chart\Bar\Factory::class],
Expand Down
110 changes: 63 additions & 47 deletions components/ILIAS/Init/src/AllModernComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,53 +36,61 @@ public function __construct(
protected \ILIAS\Data\Factory $data_factory,
protected \ILIAS\UI\Factory $ui_factory,
protected \ILIAS\UI\Renderer $ui_renderer,
protected \ILIAS\UI\Component\Counter\Factory $ui_factory_counter,
protected \ILIAS\UI\Component\Button\Factory $ui_factory_button,
protected \ILIAS\UI\Component\Listing\Factory $ui_factory_listing,
protected \ILIAS\UI\Component\Image\Factory $ui_factory_image,
protected \ILIAS\UI\Component\Panel\Factory $ui_factory_panel,
protected \ILIAS\UI\Component\Modal\Factory $ui_factory_modal,
protected \ILIAS\UI\Component\Dropzone\Factory $ui_factory_dropzone,
protected \ILIAS\UI\Component\Popover\Factory $ui_factory_popover,
protected \ILIAS\UI\Component\Divider\Factory $ui_factory_divider,
protected \ILIAS\UI\Component\Link\Factory $ui_factory_link,
protected \ILIAS\UI\Component\Dropdown\Factory $ui_factory_dropdown,
protected \ILIAS\UI\Component\Item\Factory $ui_factory_item,
protected \ILIAS\UI\Component\Viewcontrol\Factory $ui_factory_viewcontrol,
protected \ILIAS\UI\Component\Chart\Factory $ui_factory_chart,
protected \ILIAS\UI\Component\Input\Factory $ui_factory_input,
protected \ILIAS\UI\Component\Table\Factory $ui_factory_table,
protected \ILIAS\UI\Component\MessageBox\Factory $ui_factory_messagebox,
protected \ILIAS\UI\Component\Card\Factory $ui_factory_card,
protected \ILIAS\UI\Component\Layout\Factory $ui_factory_layout,
protected \ILIAS\UI\Component\Maincontrols\Factory $ui_factory_maincontrols,
protected \ILIAS\UI\Component\Tree\Factory $ui_factory_tree,
protected \ILIAS\UI\Component\Menu\Factory $ui_factory_menu,
protected \ILIAS\UI\Component\Symbol\Factory $ui_factory_symbol,
protected \ILIAS\UI\Component\Toast\Factory $ui_factory_toast,
protected \ILIAS\UI\Component\Legacy\Factory $ui_factory_legacy,
protected \ILIAS\UI\Component\Launcher\Factory $ui_factory_launcher,
protected \ILIAS\UI\Component\Entity\Factory $ui_factory_entity,
protected \ILIAS\UI\Component\Panel\Listing\Factory $ui_factory_panel_listing,
protected \ILIAS\UI\Component\Modal\InterruptiveItem\Factory $ui_factory_interruptive_item,
protected \ILIAS\UI\Component\Chart\ProgressMeter\Factory $ui_factory_progressmeter,
protected \ILIAS\UI\Component\Chart\Bar\Factory $ui_factory_bar,
protected \ILIAS\UI\Component\Input\Viewcontrol\Factory $ui_factory_input_viewcontrol,
protected \ILIAS\UI\Component\Input\Container\ViewControl\Factory $ui_factory_input_container_viewcontrol,
protected \ILIAS\UI\Component\Table\Column\Factory $ui_factory_table_column,
protected \ILIAS\UI\Component\Table\Factory $ui_factory_table_action,
protected \ILIAS\UI\Component\Maincontrols\Slate\Factory $ui_factory_maincontrols_slate,
protected \ILIAS\UI\Component\Symbol\icon\Factory $ui_factory_symbol_icon,
protected \ILIAS\UI\Component\Symbol\Glyph\Factory $ui_factory_symbol_glyph,
protected \ILIAS\UI\Component\Symbol\avatar\Factory $ui_factory_symbol_avatar,
protected \ILIAS\UI\Component\Input\Container\Form\Factory $ui_factory_input_container_form,
protected \ILIAS\UI\Component\Input\Container\Filter\Factory $ui_factory_input_container_filter,
protected \ILIAS\UI\Component\Input\Field\Factory $ui_factory_input_field,
protected \ILIAS\UI\Component\Prompt\Factory $ui_prompt_factory,
protected \ILIAS\UI\Component\Prompt\State\Factory $ui_prompt_state_factory,
protected \ILIAS\UI\Component\Progress\Factory $ui_progress_factory,
protected \ILIAS\UI\Component\Progress\State\Factory $ui_progress_state_factory,
protected \ILIAS\UI\Component\Progress\State\Bar\Factory $ui_progress_state_bar_factory,
protected \ILIAS\UI\Implementation\Component\Counter\Factory $ui_factory_counter,
protected \ILIAS\UI\Implementation\Component\Button\Factory $ui_factory_button,
protected \ILIAS\UI\Implementation\Component\Listing\Factory $ui_factory_listing,
protected \ILIAS\UI\Implementation\Component\Listing\Workflow\Factory $ui_factory_listing_workflow,
protected \ILIAS\UI\Implementation\Component\Listing\CharacteristicValue\Factory $ui_factory_listing_characteristic_value,
protected \ILIAS\UI\Implementation\Component\Listing\Entity\Factory $ui_factory_listing_entity,
protected \ILIAS\UI\Implementation\Component\Image\Factory $ui_factory_image,
protected \ILIAS\UI\Implementation\Component\Player\Factory $ui_factory_player,
protected \ILIAS\UI\Implementation\Component\Panel\Factory $ui_factory_panel,
protected \ILIAS\UI\Implementation\Component\Modal\Factory $ui_factory_modal,
protected \ILIAS\UI\Implementation\Component\Dropzone\Factory $ui_factory_dropzone,
protected \ILIAS\UI\Implementation\Component\Popover\Factory $ui_factory_popover,
protected \ILIAS\UI\Implementation\Component\Divider\Factory $ui_factory_divider,
protected \ILIAS\UI\Implementation\Component\Link\Factory $ui_factory_link,
protected \ILIAS\UI\Implementation\Component\Dropdown\Factory $ui_factory_dropdown,
protected \ILIAS\UI\Implementation\Component\Item\Factory $ui_factory_item,
protected \ILIAS\UI\Implementation\Component\Viewcontrol\Factory $ui_factory_viewcontrol,
protected \ILIAS\UI\Implementation\Component\Chart\Factory $ui_factory_chart,
protected \ILIAS\UI\Implementation\Component\Input\Factory $ui_factory_input,
protected \ILIAS\UI\Implementation\Component\Table\Factory $ui_factory_table,
protected \ILIAS\UI\Implementation\Component\MessageBox\Factory $ui_factory_messagebox,
protected \ILIAS\UI\Implementation\Component\Card\Factory $ui_factory_card,
protected \ILIAS\UI\Implementation\Component\Layout\Factory $ui_factory_layout,
protected \ILIAS\UI\Implementation\Component\Layout\Page\Factory $ui_factory_layout_page,
protected \ILIAS\UI\Implementation\Component\Layout\Alignment\Factory $ui_factory_layout_alignment,
protected \ILIAS\UI\Implementation\Component\Maincontrols\Factory $ui_factory_maincontrols,
protected \ILIAS\UI\Implementation\Component\Tree\Factory $ui_factory_tree,
protected \ILIAS\UI\Implementation\Component\Tree\Node\Factory $ui_factory_tree_node,
protected \ILIAS\UI\Implementation\Component\Menu\Factory $ui_factory_menu,
protected \ILIAS\UI\Implementation\Component\Symbol\Factory $ui_factory_symbol,
protected \ILIAS\UI\Implementation\Component\Toast\Factory $ui_factory_toast,
protected \ILIAS\UI\Implementation\Component\Legacy\Factory $ui_factory_legacy,
protected \ILIAS\UI\Implementation\Component\Launcher\Factory $ui_factory_launcher,
protected \ILIAS\UI\Implementation\Component\Entity\Factory $ui_factory_entity,
protected \ILIAS\UI\Implementation\Component\Panel\Listing\Factory $ui_factory_panel_listing,
protected \ILIAS\UI\Implementation\Component\Panel\Secondary\Factory $ui_factory_panel_secondary,
protected \ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\Factory $ui_factory_interruptive_item,
protected \ILIAS\UI\Implementation\Component\Chart\ProgressMeter\Factory $ui_factory_progressmeter,
protected \ILIAS\UI\Implementation\Component\Chart\Bar\Factory $ui_factory_bar,
protected \ILIAS\UI\Implementation\Component\Input\Viewcontrol\Factory $ui_factory_input_viewcontrol,
protected \ILIAS\UI\Implementation\Component\Input\Container\ViewControl\Factory $ui_factory_input_container_viewcontrol,
protected \ILIAS\UI\Implementation\Component\Table\Column\Factory $ui_factory_table_column,
protected \ILIAS\UI\Implementation\Component\Table\Factory $ui_factory_table_action,
protected \ILIAS\UI\Implementation\Component\Maincontrols\Slate\Factory $ui_factory_maincontrols_slate,
protected \ILIAS\UI\Implementation\Component\Symbol\icon\Factory $ui_factory_symbol_icon,
protected \ILIAS\UI\Implementation\Component\Symbol\Glyph\Factory $ui_factory_symbol_glyph,
protected \ILIAS\UI\Implementation\Component\Symbol\avatar\Factory $ui_factory_symbol_avatar,
protected \ILIAS\UI\Implementation\Component\Input\Container\Form\Factory $ui_factory_input_container_form,
protected \ILIAS\UI\Implementation\Component\Input\Container\Filter\Factory $ui_factory_input_container_filter,
protected \ILIAS\UI\Implementation\Component\Input\Field\Factory $ui_factory_input_field,
protected \ILIAS\UI\Implementation\Component\Prompt\Factory $ui_prompt_factory,
protected \ILIAS\UI\Implementation\Component\Prompt\State\Factory $ui_prompt_state_factory,
protected \ILIAS\UI\Implementation\Component\Progress\Factory $ui_progress_factory,
protected \ILIAS\UI\Implementation\Component\Progress\State\Factory $ui_progress_state_factory,
protected \ILIAS\UI\Implementation\Component\Progress\State\Bar\Factory $ui_progress_state_bar_factory,
) {
}

Expand All @@ -103,7 +111,11 @@ protected function populateComponentsInLegacyEnvironment(\Pimple\Container $DIC)
$DIC['ui.factory.counter'] = fn() => $this->ui_factory_counter;
$DIC['ui.factory.button'] = fn() => $this->ui_factory_button;
$DIC['ui.factory.listing'] = fn() => $this->ui_factory_listing;
$DIC['ui.factory.listing.workflow'] = fn() => $this->ui_factory_listing_workflow;
$DIC['ui.factory.listing.characteristic_value'] = fn() => $this->ui_factory_listing_characteristic_value;
$DIC['ui.factory.listing.entity'] = fn() => $this->ui_factory_listing_entity;
$DIC['ui.factory.image'] = fn() => $this->ui_factory_image;
$DIC['ui.factory.player'] = fn() => $this->ui_factory_player;
$DIC['ui.factory.panel'] = fn() => $this->ui_factory_panel;
$DIC['ui.factory.modal'] = fn() => $this->ui_factory_modal;
$DIC['ui.factory.progress'] = fn() => $this->ui_progress_factory;
Expand All @@ -122,8 +134,11 @@ protected function populateComponentsInLegacyEnvironment(\Pimple\Container $DIC)
$DIC['ui.factory.messagebox'] = fn() => $this->ui_factory_messagebox;
$DIC['ui.factory.card'] = fn() => $this->ui_factory_card;
$DIC['ui.factory.layout'] = fn() => $this->ui_factory_layout;
$DIC['ui.factory.layout.page'] = fn() => $this->ui_factory_layout_page;
$DIC['ui.factory.layout.alignment'] = fn() => $this->ui_factory_layout_alignment;
$DIC['ui.factory.maincontrols'] = fn() => $this->ui_factory_maincontrols;
$DIC['ui.factory.tree'] = fn() => $this->ui_factory_tree;
$DIC['ui.factory.tree.node'] = fn() => $this->ui_factory_tree_node;
$DIC['ui.factory.menu'] = fn() => $this->ui_factory_menu;
$DIC['ui.factory.symbol'] = fn() => $this->ui_factory_symbol;
$DIC['ui.factory.toast'] = fn() => $this->ui_factory_toast;
Expand All @@ -133,6 +148,7 @@ protected function populateComponentsInLegacyEnvironment(\Pimple\Container $DIC)
$DIC['ui.factory.prompt'] = fn() => $this->ui_prompt_factory;
$DIC['ui.factory.prompt.state'] = fn() => $this->ui_prompt_state_factory;
$DIC['ui.factory.panel.listing'] = fn() => $this->ui_factory_panel_listing;
$DIC['ui.factory.panel.secondary'] = fn() => $this->ui_factory_panel_secondary;
$DIC['ui.factory.interruptive_item'] = fn() => $this->ui_factory_interruptive_item;
$DIC['ui.factory.progressmeter'] = fn() => $this->ui_factory_progressmeter;
$DIC['ui.factory.bar'] = fn() => $this->ui_factory_bar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
use ILIAS\LegalDocuments\ConsumerToolbox\UI;
use ILIAS\LegalDocuments\Provide;
use PHPUnit\Framework\TestCase;
use ILIAS\UI\Component\Legacy;
use ILIAS\UI\Implementation\Factory as UIFactory;
use ILIAS\UI\Implementation\Component\Legacy;
use ILIAS\UI\Implementation\FactoryInternal as UIFactory;
use ilTemplate;

require_once __DIR__ . '/../../ContainerMock.php';
Expand Down
Loading
Loading