Skip to content

Change config UI - #8

Open
Lainow wants to merge 20 commits into
mainfrom
change-config-ui
Open

Change config UI#8
Lainow wants to merge 20 commits into
mainfrom
change-config-ui

Conversation

@Lainow

@Lainow Lainow commented May 27, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Change to the configuration interface (switch from checkboxes to “Yes”/‘No’ options with the “Inheritance” option)

Screenshots (if appropriate):

image image

@Lainow
Lainow requested a review from stonebuzz May 27, 2026 14:46
@Lainow Lainow self-assigned this May 27, 2026

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix CI

@Lainow
Lainow requested a review from Rom1-B June 4, 2026 07:51
Comment thread src/Config.php
Comment thread src/Config.php
Comment thread src/Config.php
Comment on lines +185 to +196
foreach (self::getItilConfigFields() as $field) {
$inheritance_labels[$field] = self::getInheritedValueBadge($parentConfig->fields[$field] ?? 0);
}
foreach ([
'take_requester_group_ticket',
'take_requester_group_change',
'take_requester_group_problem',
'take_technician_group_ticket',
'take_technician_group_change',
'take_technician_group_problem',
] as $field) {
$inheritance_labels[$field] = self::getInheritedValueBadgeForActorGroup($parentConfig->fields[$field] ?? 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self::getItilConfigFields already contain

'take_requester_group_ticket',
'take_requester_group_change',
'take_requester_group_problem',
'take_technician_group_ticket',
'take_technician_group_change',
'take_technician_group_problem',

The first loop at line
185 therefore generates a Yes/No badge for them (wrong — they need group-name labels), and the second explicit loop at line 188 immediately
overwrites with the correct badge.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test suite doesn't cover the grandparent → parent → child chain

Comment thread src/Config.php Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case where the child entity fields are set to Config::CONFIG_PARENT, verify that the inherited value from the parent propagates to Controller::checkTaskRequirements, and assert both the blocked (empty mandatory fields) and unblocked (filled mandatory fields) outcomes?

Comment thread src/Config.php Outdated
@Lainow
Lainow requested a review from stonebuzz June 29, 2026 13:12
Comment thread src/Config.php Outdated
@stonebuzz
stonebuzz requested a review from Rom1-B June 29, 2026 13:49
@Lainow
Lainow requested a review from stonebuzz June 30, 2026 08:12

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix lint

@Lainow
Lainow requested a review from Rom1-B June 30, 2026 09:47
Comment thread src/Config.php Outdated
Comment thread src/Config.php Outdated
Comment thread src/Controller.php Outdated
Comment thread src/Controller.php
@@ -557,9 +538,6 @@ public static function updateItemActors(CommonITILObject $item): CommonITILObjec
public static function assignTechnicianFromTask(\CommonITILTask $item): void

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assignTechnicianFromTask fetches config but never reads any field from it — the feature runs unconditionally for every task creation. Every other Controller method guards on a specific config flag (e.g. take_requester_group_ticket != 0); this one has no on/off toggle, which means users can't disable it from the UI.

Lainow and others added 3 commits July 1, 2026 11:47
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@Lainow
Lainow requested a review from Rom1-B July 1, 2026 10:07
Comment thread src/Config.php Outdated
@Lainow
Lainow requested a review from stonebuzz July 1, 2026 15:26
Comment thread tests/Units/ConfigTest.php
@Lainow
Lainow force-pushed the change-config-ui branch from c5f02ef to 4a9dd6d Compare July 3, 2026 09:20
@Lainow
Lainow requested a review from Rom1-B July 27, 2026 09:54
Comment thread tests/Units/ConfigTest.php
Comment thread src/Config.php Outdated
Comment thread templates/config.html.twig Outdated
Lainow and others added 2 commits July 28, 2026 11:22
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@Lainow
Lainow requested a review from Rom1-B July 28, 2026 09:22

@Rom1-B Rom1-B left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See preview comments

Lainow and others added 3 commits July 29, 2026 11:13
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@Lainow
Lainow requested a review from Rom1-B July 29, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants