-
Notifications
You must be signed in to change notification settings - Fork 283
N°8955 add UI block for uninstallation #797
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
Merged
Timmy38
merged 13 commits into
feature/uninstallation
from
feature/8955_add_UIBlock_for_uninstallation
Feb 27, 2026
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8bacd62
N°8955 New UIBlocks for setup
Timmy38 43f9aaf
N°8955 New UIBlocks for setup
Timmy38 a4a33f1
N°8955 Fix indentation
Timmy38 3fc7a4c
N°8955 New UIBlocks for setup
Timmy38 37b66a5
N°8955 small fixes
Timmy38 a862dce
N°8955 Remove unused file
Timmy38 34c9710
N°8955 Fix code style, remove unused use
Timmy38 b5632a7
N°8955 remove unused use
Timmy38 f106c98
N°8955 Remove fixed width, add dynamic display for force uninstall me…
Timmy38 7b7f78b
N°8955 Generate translation files for all languages
Timmy38 ee69d74
N°8955 Add badges to subblocks list
Timmy38 1fde723
N°8955 fix dictionaries
Timmy38 2f1c220
N°8955 Add dictionary entry
Timmy38 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * @copyright Copyright (C) 2010-2024 Combodo SAS | ||
| * @license http://opensource.org/licenses/AGPL-3.0 | ||
| */ | ||
|
|
||
| $ibo-badge--spacing-left--with-same-block: $ibo-spacing-200 !default; | ||
|
|
||
| .ibo-badge + .ibo-badge { | ||
| margin-left: $ibo-badge--spacing-left--with-same-block; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| $ibo-badge--padding-x : $ibo-spacing-200 !default; | ||
| $ibo-badge--padding-y : $ibo-spacing-100 !default; | ||
| $ibo-badge--border-radius : $ibo-border-radius-400 !default; | ||
|
|
||
| $ibo-badge-colors: ( | ||
| 'primary': ($ibo-color-primary-100, $ibo-color-primary-900), | ||
| 'secondary': ($ibo-color-secondary-100, $ibo-color-secondary-900), | ||
| 'neutral': ($ibo-color-secondary-100, $ibo-color-secondary-900), | ||
| 'information': ($ibo-color-information-100, $ibo-color-information-900), | ||
| 'success': ($ibo-color-success-100, $ibo-color-success-900), | ||
| 'failure': ($ibo-color-danger-100, $ibo-color-danger-900), | ||
| 'warning': ($ibo-color-warning-100,$ibo-color-warning-900), | ||
| 'danger': ($ibo-color-danger-100,$ibo-color-danger-900), | ||
| 'grey' : ($ibo-color-grey-100, $ibo-color-grey-900), | ||
| 'blue-grey': ($ibo-color-blue-grey-100, $ibo-color-blue-grey-900), | ||
| 'blue': ($ibo-color-blue-100, $ibo-color-blue-900), | ||
| 'cyan': ($ibo-color-cyan-100, $ibo-color-cyan-900), | ||
| 'green': ($ibo-color-green-100, $ibo-color-green-900), | ||
| 'orange' : ($ibo-color-orange-100, $ibo-color-orange-900), | ||
| 'red': ($ibo-color-red-100, $ibo-color-red-900), | ||
| 'pink': ($ibo-color-pink-100, $ibo-color-pink-900), | ||
| ) !default; | ||
|
|
||
|
|
||
|
|
||
| .ibo-badge { | ||
| display: inline-block; | ||
| white-space: nowrap; | ||
| padding : $ibo-badge--padding-y $ibo-badge--padding-x; | ||
| border-radius : $ibo-badge--border-radius; | ||
| @extend %ibo-font-ral-med-50; | ||
|
|
||
| @each $sColor, $aColorValues in $ibo-badge-colors { | ||
| $bg-color: nth($aColorValues, 1); | ||
| $text-color: nth($aColorValues, 2); | ||
| &.ibo-is-#{$sColor} { | ||
| background-color: $bg-color; | ||
| color: $text-color; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @import "extension-details"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| $ibo-extension-details--information--metadata--padding: $ibo-spacing-200 !default; | ||
| $ibo-extension-details--information--metadata--delimiter: "-" !default; | ||
| $ibo-extension-details--information--metadata--color: $ibo-color-grey-700 !default; | ||
| $ibo-extension-details--actions--button--padding-y: 3px !default; | ||
| $ibo-extension-details--actions--button--padding-x: $ibo-button--padding-x !default; | ||
|
|
||
| .ibo-extension-details { | ||
| display: inline-flex; | ||
| flex-direction: row; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .ibo-extension-details--information { | ||
| flex-grow: 1; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .ibo-extension-details--actions { | ||
| display: flex; | ||
| } | ||
|
|
||
| .ibo-extension-details--information--label { | ||
| @extend %ibo-font-ral-med-150; | ||
| } | ||
|
|
||
| .ibo-extension-details--information--metadata { | ||
| @extend %ibo-font-ral-med-100; | ||
| color: $ibo-extension-details--information--metadata--color; | ||
| } | ||
|
|
||
| .ibo-extension-details--information--description { | ||
| @extend %ibo-font-ral-med-100; | ||
| } | ||
|
|
||
| .ibo-extension-details--information--metadata span + span:before { | ||
| content: $ibo-extension-details--information--metadata--delimiter; | ||
| padding-left: $ibo-extension-details--information--metadata--padding; | ||
| padding-right: $ibo-extension-details--information--metadata--padding; | ||
| } | ||
|
|
||
| .ibo-extension-details:has(input:checked) .ibo-badge.unchecked, .ibo-extension-details:has(input:not(:checked)) .ibo-badge.checked { | ||
| display: none; | ||
| } | ||
|
|
||
| .ibo-extension-details--actions > button { | ||
| padding: $ibo-extension-details--actions--button--padding-y $ibo-extension-details--actions--button--padding-x; | ||
| } | ||
|
|
||
| .ibo-extension-details--actions:has(.toggler-install:not(:disabled)) .ibo-popover-menu--section a[data-resource-id="force_uninstall"] { | ||
| display: none; | ||
| } |
17 changes: 17 additions & 0 deletions
17
dictionaries/ui/layouts/extensions-details/en.dictionary.itop.extensions-details.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?php | ||
| /** | ||
| * Localized data | ||
| * | ||
| * @copyright Copyright (C) 2010-2026 Combodo SAS | ||
| * @license https://opensource.org/licenses/AGPL-3.0 | ||
| * | ||
| */ | ||
|
|
||
| Dict::Add('EN US', 'English', 'English', [ | ||
| 'UI:Layout:ExtensionsDetails:BadgeInstalled' => 'installed', | ||
| 'UI:Layout:ExtensionsDetails:BadgeToBeInstalled' => 'to be installed', | ||
| 'UI:Layout:ExtensionsDetails:BadgeNotInstalled' => 'not installed', | ||
| 'UI:Layout:ExtensionsDetails:BadgeToBeUninstalled' => 'to be uninstalled', | ||
| 'UI:Layout:ExtensionsDetails:BadgeNotUninstallable' => 'cannot be uninstalled', | ||
| 'UI:Layout:ExtensionsDetails:BadgeMissingFromDisk' => 'missing from disk', | ||
| ]); | ||
17 changes: 17 additions & 0 deletions
17
dictionaries/ui/layouts/extensions-details/fr.dictionary.itop.extensions-details.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?php | ||
| /** | ||
| * Localized data | ||
| * | ||
| * @copyright Copyright (C) 2010-2026 Combodo SAS | ||
| * @license https://opensource.org/licenses/AGPL-3.0 | ||
| * | ||
| */ | ||
|
|
||
| Dict::Add('FR FR', 'French', 'Français', [ | ||
| 'UI:Layout:ExtensionsDetails:BadgeInstalled' => 'installé', | ||
| 'UI:Layout:ExtensionsDetails:BadgeToBeInstalled' => 'va être installé', | ||
| 'UI:Layout:ExtensionsDetails:BadgeNotInstalled' => 'pas installé', | ||
| 'UI:Layout:ExtensionsDetails:BadgeToBeUninstalled' => 'va être désinstallé', | ||
| 'UI:Layout:ExtensionsDetails:BadgeNotUninstallable' => 'non désinstallable', | ||
| 'UI:Layout:ExtensionsDetails:BadgeMissingFromDisk' => 'supprimé du disque', | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| <?php | ||
|
|
||
| namespace Combodo\iTop\Application\UI\Base\Component\Badge; | ||
|
|
||
| use Combodo\iTop\Application\UI\Base\UIBlock; | ||
|
|
||
| class Badge extends UIBlock | ||
| { | ||
| public const BLOCK_CODE = 'ibo-badge'; | ||
| public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/badge/layout'; | ||
|
|
||
| /** @var string ENUM_COLOR_SCHEME_NEUTRAL */ | ||
| public const ENUM_COLOR_SCHEME_NEUTRAL = 'neutral'; | ||
| /** @var string ENUM_COLOR_SCHEME_VALIDATION */ | ||
| public const ENUM_COLOR_SCHEME_VALIDATION = 'success'; | ||
| /** @var string ENUM_COLOR_SCHEME_DESTRUCTIVE */ | ||
| public const ENUM_COLOR_SCHEME_DESTRUCTIVE = 'danger'; | ||
| /** @var string ENUM_COLOR_SCHEME_PRIMARY */ | ||
| public const ENUM_COLOR_SCHEME_PRIMARY = 'primary'; | ||
| /** @var string ENUM_COLOR_SCHEME_SECONDARY */ | ||
| public const ENUM_COLOR_SCHEME_SECONDARY = 'secondary'; | ||
| /** @var string ENUM_COLOR_SCHEME_GREEN */ | ||
| public const ENUM_COLOR_SCHEME_GREEN = 'green'; | ||
| /** @var string ENUM_COLOR_SCHEME_RED */ | ||
| public const ENUM_COLOR_SCHEME_RED = 'red'; | ||
| /** @var string ENUM_COLOR_SCHEME_CYAN */ | ||
| public const ENUM_COLOR_SCHEME_CYAN = 'cyan'; | ||
| /** @var string DEFAULT_COLOR_SCHEME */ | ||
| public const ENUM_COLOR_SCHEME_GREY = 'grey'; | ||
| /** @var string DEFAULT_COLOR_SCHEME */ | ||
| public const ENUM_COLOR_SCHEME_BLUE_GREY = 'blue-grey'; | ||
| /** @var string DEFAULT_COLOR_SCHEME */ | ||
| public const ENUM_COLOR_SCHEME_ORANGE = 'orange'; | ||
| /** @var string DEFAULT_COLOR_SCHEME */ | ||
| public const DEFAULT_COLOR_SCHEME = self::ENUM_COLOR_SCHEME_NEUTRAL; | ||
| private string $sLabel; | ||
| private string $sColor; | ||
| private string $sTooltip; | ||
|
|
||
| public function __construct(string $sLabel, string $sColor = self::DEFAULT_COLOR_SCHEME, string $sTooltip = '', string $sId = null) | ||
| { | ||
| parent::__construct($sId); | ||
|
|
||
| $this->sLabel = $sLabel; | ||
| $this->sColor = $sColor; | ||
| $this->sTooltip = $sTooltip; | ||
| } | ||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| public function GetTooltip(): string | ||
| { | ||
| return $this->sTooltip; | ||
| } | ||
|
|
||
| /** | ||
| * @param string $sTooltip | ||
| */ | ||
| public function SetTooltip(string $sTooltip) | ||
| { | ||
| $this->sTooltip = $sTooltip; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| public function GetLabel(): string | ||
| { | ||
| return $this->sLabel; | ||
| } | ||
|
|
||
| /** | ||
| * @param string $sLabel | ||
| * | ||
| * @return $this | ||
| */ | ||
| public function SetLabel(string $sLabel) | ||
| { | ||
| $this->sLabel = $sLabel; | ||
| return $this; | ||
| } | ||
|
|
||
| /** | ||
| * @return string | ||
| */ | ||
| public function GetColor(): string | ||
| { | ||
| return $this->sColor; | ||
| } | ||
|
|
||
| /** | ||
| * @param string $sColor | ||
| * | ||
| * @return $this | ||
| */ | ||
| public function SetColor(string $sColor) | ||
| { | ||
| $this->sColor = $sColor; | ||
| return $this; | ||
| } | ||
| } |
41 changes: 41 additions & 0 deletions
41
sources/Application/UI/Base/Component/Badge/BadgeUIBlockFactory.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
|
|
||
| namespace Combodo\iTop\Application\UI\Base\Component\Badge; | ||
|
|
||
| use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory; | ||
|
|
||
| class BadgeUIBlockFactory extends AbstractUIBlockFactory | ||
| { | ||
| /** @inheritDoc */ | ||
| public const TWIG_TAG_NAME = 'UIBadge'; | ||
| /** @inheritDoc */ | ||
| public const UI_BLOCK_CLASS_NAME = Badge::class; | ||
|
|
||
| public static function MakeNeutral(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_NEUTRAL, $sTooltip, $sId); | ||
| } | ||
| public static function MakeGrey(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_BLUE_GREY, $sTooltip, $sId); | ||
| } | ||
|
|
||
| public static function MakeRed(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_RED, $sTooltip, $sId); | ||
| } | ||
| public static function MakeCyan(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_CYAN, $sTooltip, $sId); | ||
| } | ||
|
|
||
| public static function MakeGreen(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_GREEN, $sTooltip, $sId); | ||
| } | ||
|
|
||
| public static function MakeOrange(string $sLabel, string $sTooltip = '', ?string $sId = null) | ||
| { | ||
| return new Badge($sLabel, Badge::ENUM_COLOR_SCHEME_ORANGE, $sTooltip, $sId); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.