From 12b06165190a08d2aa9fac1e750d184937a2ab8f Mon Sep 17 00:00:00 2001 From: mjansen Date: Wed, 13 May 2026 12:37:27 +0200 Subject: [PATCH 1/3] Component/Activities: Fix interface and implementations --- components/ILIAS/Component/src/Activities/Activity.php | 2 +- components/ILIAS/Setup/src/Activities/GetStatus.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/ILIAS/Component/src/Activities/Activity.php b/components/ILIAS/Component/src/Activities/Activity.php index 1baf108fd747..497b72e17232 100644 --- a/components/ILIAS/Component/src/Activities/Activity.php +++ b/components/ILIAS/Component/src/Activities/Activity.php @@ -21,10 +21,10 @@ namespace ILIAS\Component\Activities; use ILIAS\Component\Dependencies\Name; -use ILIAS\UI\Component\Input\Control\Form\FormInput; use ILIAS\Data\Result; use ILIAS\Data\Text; use ILIAS\Data\Description; +use ILIAS\UI\Component\Input\Container\Form\FormInput; /** * An Activity is an action on the domain layer action of a component. diff --git a/components/ILIAS/Setup/src/Activities/GetStatus.php b/components/ILIAS/Setup/src/Activities/GetStatus.php index 6c6728d064d1..b5fd7e10a381 100644 --- a/components/ILIAS/Setup/src/Activities/GetStatus.php +++ b/components/ILIAS/Setup/src/Activities/GetStatus.php @@ -20,10 +20,9 @@ namespace ILIAS\Setup\Activities; -use ILIAS\Component\Dependencies\Name; -use ILIAS\UI\Component\Input\Control\Form\FormInput; use ILIAS\Data\Result; use ILIAS\Data\Text; +use ILIAS\UI\Component\Input\Container\Form\FormInput; /** * This is a stub... @@ -34,7 +33,7 @@ public function getDescription(): Text\SimpleDocumentMarkdown { } - public function getInputDescription(): \ILIAS\UI\Component\Input\Control\Form\FormInput + public function getInputDescription(): FormInput { } From 026c40ed01771fc7d86bb7af1c99adcee4226ae3 Mon Sep 17 00:00:00 2001 From: Ahmed Hamouda Date: Mon, 26 Jan 2026 16:24:30 +0100 Subject: [PATCH 2/3] correct type hints and imports in Activities component --- .../src/Activities/ObjectActivity.php | 59 +++++++++++++++++++ .../Component/src/Activities/Repository.php | 4 +- .../src/Activities/StaticRepository.php | 2 + 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 components/ILIAS/Component/src/Activities/ObjectActivity.php diff --git a/components/ILIAS/Component/src/Activities/ObjectActivity.php b/components/ILIAS/Component/src/Activities/ObjectActivity.php new file mode 100644 index 000000000000..26a4fcbc474e --- /dev/null +++ b/components/ILIAS/Component/src/Activities/ObjectActivity.php @@ -0,0 +1,59 @@ + where keys are the name + * @return \Iterator where keys are the name */ public function getActivitiesByName(string $name_matcher, ?ActivityType $type = null, ?Range $range = null): \Iterator; } diff --git a/components/ILIAS/Component/src/Activities/StaticRepository.php b/components/ILIAS/Component/src/Activities/StaticRepository.php index 4e094fc7798f..ec08aa6e62e7 100644 --- a/components/ILIAS/Component/src/Activities/StaticRepository.php +++ b/components/ILIAS/Component/src/Activities/StaticRepository.php @@ -20,6 +20,8 @@ namespace ILIAS\Component\Activities; +use ILIAS\Data\Range; + class StaticRepository implements Repository { protected array $activities = []; From 915714b291803312e48245ab8ca69ec413a5b60e Mon Sep 17 00:00:00 2001 From: Fabian Schmid Date: Tue, 16 Jun 2026 09:14:05 +0200 Subject: [PATCH 3/3] Component/Activities: give FieldFactory to Input Description Replicates Essential-ILIAS-27/ILIAS-Slim PR #72 on top of the upstream Activities fixes: pass a FieldFactory to getInputDescription() and an InputFactory to maybePerformAs(). Adapts the ObjectActivity interface accordingly to keep its declaration compatible with Activity. --- components/ILIAS/Component/src/Activities/Activity.php | 6 ++++-- .../ILIAS/Component/src/Activities/ObjectActivity.php | 5 +++-- components/ILIAS/Setup/src/Activities/GetStatus.php | 9 ++++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/components/ILIAS/Component/src/Activities/Activity.php b/components/ILIAS/Component/src/Activities/Activity.php index 497b72e17232..d74cb4b16658 100644 --- a/components/ILIAS/Component/src/Activities/Activity.php +++ b/components/ILIAS/Component/src/Activities/Activity.php @@ -25,6 +25,8 @@ use ILIAS\Data\Text; use ILIAS\Data\Description; use ILIAS\UI\Component\Input\Container\Form\FormInput; +use ILIAS\UI\Component\Input\Factory as InputFactory; +use ILIAS\UI\Component\Input\Field\Factory as FieldFactory; /** * An Activity is an action on the domain layer action of a component. @@ -46,7 +48,7 @@ public function getType(): ActivityType; public function getDescription(): Text\SimpleDocumentMarkdown; - public function getInputDescription(): FormInput; // might better be ILIAS/UI/Input/Input, but we would need to promote many properties there before. + public function getInputDescription(FieldFactory $f): FormInput; // might better be ILIAS/UI/Input/Input, but we would need to promote many properties there before. public function getOutputDescription(Description\Factory $f): Description\Description; @@ -76,5 +78,5 @@ public function perform(mixed $parameters): mixed; * is allowed to perform the action as requested and, if so, then attempts to * performs it. Wraps the result and possible errors in the `Result` type. */ - public function maybePerformAs(int $usr_id, array $raw_parameters): Result; + public function maybePerformAs(InputFactory $input_factory, int $usr_id, array $raw_parameters): Result; } diff --git a/components/ILIAS/Component/src/Activities/ObjectActivity.php b/components/ILIAS/Component/src/Activities/ObjectActivity.php index 26a4fcbc474e..15186026cbd0 100644 --- a/components/ILIAS/Component/src/Activities/ObjectActivity.php +++ b/components/ILIAS/Component/src/Activities/ObjectActivity.php @@ -21,6 +21,7 @@ namespace ILIAS\Component\Activities; use ILIAS\UI\Component\Input\Container\Form\FormInput; +use ILIAS\UI\Component\Input\Field\Factory as FieldFactory; use ILIAS\UI\Component\Input\Input; /** @@ -39,7 +40,7 @@ interface ObjectActivity extends Activity * For an ObjectActivity, this needs to return an input with one field named * "id" that can accept a string value. */ - public function getInputDescription(): FormInput; + public function getInputDescription(FieldFactory $f): FormInput; /** * Works just like `getInputDescription` but checks if that description @@ -47,7 +48,7 @@ public function getInputDescription(): FormInput; * * @throws \LogicException if there is no "id" field in the Input. */ - public function getCheckedInputDescription(): Input; + public function getCheckedInputDescription(FieldFactory $f): Input; /** * To allow consumers to build an understanding of internal object structure of diff --git a/components/ILIAS/Setup/src/Activities/GetStatus.php b/components/ILIAS/Setup/src/Activities/GetStatus.php index b5fd7e10a381..136d6e5ffe4d 100644 --- a/components/ILIAS/Setup/src/Activities/GetStatus.php +++ b/components/ILIAS/Setup/src/Activities/GetStatus.php @@ -22,7 +22,10 @@ use ILIAS\Data\Result; use ILIAS\Data\Text; +use ILIAS\Data\Description; use ILIAS\UI\Component\Input\Container\Form\FormInput; +use ILIAS\UI\Component\Input\Factory as InputFactory; +use ILIAS\UI\Component\Input\Field\Factory as FieldFactory; /** * This is a stub... @@ -33,11 +36,11 @@ public function getDescription(): Text\SimpleDocumentMarkdown { } - public function getInputDescription(): FormInput + public function getInputDescription(FieldFactory $f): FormInput { } - public function getOutputDescription(\ILIAS\Data\Description\Factory $f): \ILIAS\Data\Description\Description + public function getOutputDescription(Description\Factory $f): Description\Description { } @@ -49,7 +52,7 @@ public function perform(mixed $parameters): mixed { } - public function maybePerformAs(int $usr_id, array $raw_parameters): Result + public function maybePerformAs(InputFactory $input_factory, int $usr_id, array $raw_parameters): Result { } }