-
Notifications
You must be signed in to change notification settings - Fork 291
N°9681 new badge "cannot be installed" #959
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ class ExtensionDetailsUIBlockFactory extends AbstractUIBlockFactory | |
| private const BADGE_ID_TO_BE_UNINSTALLED = 'to-be-uninstalled'; | ||
| private const BADGE_ID_NOT_UNINSTALLABLE = 'not-uninstallable'; | ||
| private const BADGE_ID_MISSING_FROM_DISK = 'missing-from-disk'; | ||
| private const BADGE_ID_CANNOT_BE_INSTALLED = 'cannot-be-installed'; | ||
|
|
||
| public static function MakeInstalled(string $sCode, string $sLabel, string $sDescription = '', array $aMetaData = [], array $aExtraFlags = [], string $sAbout = '') | ||
| { | ||
|
|
@@ -69,6 +70,7 @@ public static function MakeNotInstalled(string $sCode, string $sLabel, string $s | |
| { | ||
| $aBadges = []; | ||
| $bUninstallable = $aExtraFlags['uninstallable'] ?? true; | ||
| $bCannotBeInstalled = $aExtraFlags['cannot-be-installed'] ?? false; | ||
| $bSelected = $aExtraFlags['selected'] ?? false; | ||
| $bDisabled = $aExtraFlags['disabled'] ?? false; | ||
| self::AddExtraBadges($aBadges, $bUninstallable, false, $sCode); | ||
|
|
@@ -86,8 +88,19 @@ public static function MakeNotInstalled(string $sCode, string $sLabel, string $s | |
| ); | ||
| $oBadgeToBeUninstalled->AddCSSClass('checked'); | ||
| $aBadges[] = $oBadgeToBeUninstalled; | ||
| 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) | ||
| ); | ||
|
Comment on lines
+91
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new orange badge has no More importantly, when |
||
| } | ||
| $oExtensionDetails = new ExtensionDetails($sCode, $sLabel, $sDescription, $aMetaData, $aBadges, $sAbout); | ||
|
|
||
| if ($bCannotBeInstalled) { | ||
| $oExtensionDetails->GetToggler()->SetIsDisabled(true); | ||
| } | ||
| if ($bSelected) { | ||
| $oExtensionDetails->GetToggler()->SetIsToggled(true); | ||
| } | ||
|
|
@@ -102,7 +115,7 @@ public static function MakeNotInstalled(string $sCode, string $sLabel, string $s | |
| private static function AddExtraBadges(array &$aBadges, bool $bUninstallable, bool $bMissingFromDisk, string $sCode) | ||
| { | ||
| if (!$bUninstallable) { | ||
| $aBadges[] = BadgeUIBlockFactory::MakeOrange( | ||
| $aBadges[] = BadgeUIBlockFactory::MakeYellow( | ||
| Dict::S('UI:Layout:ExtensionsDetails:BadgeNotUninstallable'), | ||
| Dict::S('UI:Layout:ExtensionsDetails:BadgeNotUninstallable+'), | ||
| self::GetBadgeId($sCode, self::BADGE_ID_NOT_UNINSTALLABLE) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.