N°9681 new badge "cannot be installed"#959
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “cannot be installed” badge for extensions (to indicate missing dependencies) and expands the badge color palette, while also reassigning the “cannot be uninstalled” badge from orange to yellow to keep orange available for the new state.
Changes:
- Add new badge color schemes (yellow/purple/blue/pink) and factory helpers to create them.
- Add a new “cannot be installed” badge (label + tooltip) and wire it into extension-details rendering via an
extra_flags['cannot-be-installed']flag. - Update setup wizard HTML expectations/styles to render “cannot be uninstalled” as yellow instead of orange.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php | Updates expected badge color for “cannot be uninstalled” in setup wizard tests. |
| tests/manual-visual-tests/Backoffice/RenderAllUiBlocks.php | Adds visual samples for new badge colors. |
| sources/Application/UI/Base/Layout/Extension/ExtensionDetailsUIBlockFactory.php | Adds “cannot be installed” badge support and changes “not uninstallable” to yellow. |
| sources/Application/UI/Base/Component/Badge/BadgeUIBlockFactory.php | Adds helpers to create yellow/purple/blue/pink badges. |
| sources/Application/UI/Base/Component/Badge/Badge.php | Adds new badge color scheme constants. |
| setup/wizardsteps/WizStepModulesChoice.php | Updates setup wizard tooltip badge color for “cannot be uninstalled” to yellow. |
| dictionaries/ui/layouts/extensions-details/*.dictionary.itop.extensions-details.php | Adds localized strings for the new “cannot be installed” badge. |
| datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php | Computes and exposes the cannot-be-installed flag in extension metadata. |
| css/setup.scss | Removes legacy .setup-extension-tag styling. |
| css/backoffice/components/_badge.scss | Adds purple and yellow color definitions for badges. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
| Filename | Overview |
|---|---|
| sources/Application/UI/Base/Layout/Extension/ExtensionDetailsUIBlockFactory.php | Adds "cannot be installed" badge (orange) to MakeNotInstalled(); changes "not uninstallable" badge from orange to yellow. Toggler is not disabled when cannot-be-installed is true — user can still select the extension. |
| setup/wizardsteps/WizStepModulesChoice.php | Only the "cannot be uninstalled" badge class swapped (ibo-is-orange → ibo-is-yellow). No "cannot be installed" badge added, unlike the ExtensionDetailsUIBlockFactory path. |
| sources/Application/UI/Base/Component/Badge/BadgeUIBlockFactory.php | Added MakeYellow(), MakePurple(), MakeBlue(), and MakePink() factory methods, completing the set of factory methods for available badge colors. |
| css/backoffice/components/_badge.scss | Added purple and yellow entries to $ibo-badge-colors map. Blue and pink were already present. |
| datamodels/2.x/combodo-data-feature-removal/src/Controller/DataFeatureRemovalController.php | Added cannot-be-installed extra_flag using aMissingDependencies (a well-established iTopExtension property), gating the new badge correctly. |
| tests/php-unit-tests/unitary-tests/setup/WizStepModulesChoiceTest.php | Expected HTML in ProviderDisplayOptions updated from ibo-is-orange to ibo-is-yellow for the "cannot be uninstalled" badge, matching the production change. No test for "cannot be installed" in the wizard path (consistent with it not being implemented there). |
| css/setup.scss | Removed legacy .setup-extension-tag SCSS block (superseded by the newer ibo-badge system). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Extension with missing dependencies] --> B{Which UI path?}
B --> C[DataFeatureRemoval UI\nExtensionDetailsUIBlockFactory]
B --> D[Setup Wizard\nWizStepModulesChoice::DisplayChoice]
C --> E[GetAvailableExtensions\ncannot-be-installed = true\nif aMissingDependencies > 0]
E --> F[MakeNotInstalled called\nwith extra_flag cannot-be-installed]
F --> G[Orange badge rendered\nCANNOT BE INSTALLED]
F --> H[Toggler NOT disabled\nUser can still select it]
D --> I[ComputeChoiceFlags\nNo cannot-be-installed flag]
I --> J[DisplayChoice renders\nonly to-be-installed / not-installed badges]
J --> K[No cannot-be-installed badge shown]
style G fill:#ff9e6e
style K fill:#ffd0d0
style H fill:#ffd0d0
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Extension with missing dependencies] --> B{Which UI path?}
B --> C[DataFeatureRemoval UI\nExtensionDetailsUIBlockFactory]
B --> D[Setup Wizard\nWizStepModulesChoice::DisplayChoice]
C --> E[GetAvailableExtensions\ncannot-be-installed = true\nif aMissingDependencies > 0]
E --> F[MakeNotInstalled called\nwith extra_flag cannot-be-installed]
F --> G[Orange badge rendered\nCANNOT BE INSTALLED]
F --> H[Toggler NOT disabled\nUser can still select it]
D --> I[ComputeChoiceFlags\nNo cannot-be-installed flag]
I --> J[DisplayChoice renders\nonly to-be-installed / not-installed badges]
J --> K[No cannot-be-installed badge shown]
style G fill:#ff9e6e
style K fill:#ffd0d0
style H fill:#ffd0d0
Comments Outside Diff (1)
-
setup/wizardsteps/WizStepModulesChoice.php, line 878-881 (link)"Cannot be installed" badge missing in setup wizard path
DisplayChoice()builds badge HTML inline. This PR changed the "cannot be uninstalled" badge color here (orange → yellow), but it did not add the new "cannot be installed" badge.ExtensionDetailsUIBlockFactory::MakeNotInstalled()(used by the DataFeatureRemoval UI) will show the orange badge for extensions with missing dependencies, but users going through the regular setup wizard will never see it. Is this omission intentional — i.e. the wizard already surfaces missing-dependency errors via theMissingDependencyExceptionwarning banner, so the per-extension badge is not needed here? Was the decision to omit the "cannot be installed" badge from the setup wizard's DisplayChoice() intentional? The DataFeatureRemoval UI will show it, but the wizard won't.
Reviews (1): Last reviewed commit: "N°9681 Disable block if cannot be instal..." | Re-trigger Greptile
| if ($bCannotBeInstalled) { | ||
| $bSelected = false; | ||
| $aBadges[] = BadgeUIBlockFactory::MakeOrange( | ||
| Dict::S('UI:Layout:ExtensionsDetails:BadgeCannotBeInstalled'), | ||
| Dict::S('UI:Layout:ExtensionsDetails:BadgeCannotBeInstalled+'), | ||
| self::GetBadgeId($sCode, self::BADGE_ID_CANNOT_BE_INSTALLED) | ||
| ); |
There was a problem hiding this comment.
"Cannot be installed" badge not gated by toggle state
The new orange badge has no checked or unchecked CSS class, so it is always visible regardless of whether the extension's toggler is on or off. Every other state-dependent badge (installed, to-be-installed, not-installed) is tied to the toggle via those classes. When the extension is toggled off the user sees both "not installed" (grey) and "cannot be installed" (orange) simultaneously — arguably fine as a persistent warning — but when toggled on they see "to be installed" (cyan) and "cannot be installed" (orange) at the same time, which is contradictory.
More importantly, when $bCannotBeInstalled is true the toggler is never disabled. A user can select an extension that will silently fail to install. Consider calling $oExtensionDetails->GetToggler()->SetIsDisabled(true) (and optionally hiding it) when this flag is set, mirroring the $bMissingFromDisk pattern above.
No description provided.