Skip to content

N°9681 new badge "cannot be installed"#959

Merged
Timmy38 merged 4 commits into
developfrom
feature/9681_new_badge_cannot_be_installed
Jul 6, 2026
Merged

N°9681 new badge "cannot be installed"#959
Timmy38 merged 4 commits into
developfrom
feature/9681_new_badge_cannot_be_installed

Conversation

@Timmy38

@Timmy38 Timmy38 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 6, 2026 12:45
@Timmy38 Timmy38 self-assigned this Jul 6, 2026
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Jul 6, 2026

Copilot AI 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.

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.

Copilot AI review requested due to automatic review settings July 6, 2026 12:56
@Timmy38 Timmy38 merged commit fda5fe5 into develop Jul 6, 2026
1 check passed
@Timmy38 Timmy38 deleted the feature/9681_new_badge_cannot_be_installed branch July 6, 2026 12:58
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a new "cannot be installed" badge for extensions with unmet dependencies, visible in the data feature removal extension management UI. It also changes the "cannot be uninstalled" badge color from orange to yellow (both in the newer ExtensionDetailsUIBlockFactory path and the legacy setup wizard DisplayChoice() path), and adds missing purple, yellow, blue, and pink badge color constants/factory methods to the PHP layer along with CSS for purple and yellow (blue and pink already had CSS entries).

  • New orange badge ("cannot be installed") is rendered in ExtensionDetailsUIBlockFactory::MakeNotInstalled() when $aExtraFlags['cannot-be-installed'] is truthy; the data source flag is computed in DataFeatureRemovalController::GetAvailableExtensions() using $oExtension->aMissingDependencies.
  • The legacy setup wizard path (WizStepModulesChoice::DisplayChoice()) receives only the color swap (orange→yellow) for the "cannot be uninstalled" badge; the new "cannot be installed" badge is absent from this path.
  • Obsolete .setup-extension-tag SCSS rules removed; compiled setup.css regenerated accordingly.

Confidence Score: 4/5

Safe to merge with one issue to verify: when an extension cannot be installed due to missing dependencies, the UI allows the user to still toggle it on, producing a misleading combination of "to be installed" + "cannot be installed" badges simultaneously and no enforced guard.

The core badge infrastructure changes (new colors, factory methods, CSS) are clean and well-tested. The color swap for the "cannot be uninstalled" badge is consistent across both UI paths and the test snapshot. The main concern is in ExtensionDetailsUIBlockFactory::MakeNotInstalled(): when cannot-be-installed is true, the toggler is left enabled and the new badge carries no checked/unchecked CSS class, so users see "to be installed" and "cannot be installed" side-by-side when they try to select such an extension. Whether this is intentional UX or an oversight determines the real impact.

sources/Application/UI/Base/Layout/Extension/ExtensionDetailsUIBlockFactory.php — toggler disable logic and badge CSS class for the cannot-be-installed state. setup/wizardsteps/WizStepModulesChoice.php — confirm intentional omission of the badge from the wizard path.

Important Files Changed

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
Loading
%%{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
Loading

Comments Outside Diff (1)

  1. setup/wizardsteps/WizStepModulesChoice.php, line 878-881 (link)

    P2 "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 the MissingDependencyException warning 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

Comment on lines +91 to +97
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)
);

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.

P1 "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.

Copilot AI 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.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants