-
Notifications
You must be signed in to change notification settings - Fork 289
N°9455 - Feature removal - console screen behavior #924
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
Open
eespie
wants to merge
4
commits into
develop
Choose a base branch
from
feature/uninstallation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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 |
|---|---|---|
|
|
@@ -24,6 +24,15 @@ | |
| class WizStepWelcome extends WizardStep | ||
| { | ||
| protected $bCanMoveForward; | ||
| private array $aInfo; | ||
| private array $aWarnings; | ||
| private array $aErrors; | ||
|
|
||
| public function __construct(WizardController $oWizard, $sCurrentState) | ||
| { | ||
| parent::__construct($oWizard, $sCurrentState); | ||
| $this->CheckInstallation(); | ||
| } | ||
|
|
||
| public function GetTitle() | ||
| { | ||
|
|
@@ -66,39 +75,14 @@ public function Display(SetupPage $oPage): void | |
| EOF | ||
| ); | ||
| $oPage->add('<h1>'.ITOP_APPLICATION.' Installation Wizard</h1>'); | ||
| $aResults = SetupUtils::CheckPhpAndExtensions(); | ||
| $this->bCanMoveForward = true; | ||
| $aInfo = []; | ||
| $aWarnings = []; | ||
| $aErrors = []; | ||
| foreach ($aResults as $oCheckResult) { | ||
| switch ($oCheckResult->iSeverity) { | ||
| case CheckResult::ERROR: | ||
| $aErrors[] = $oCheckResult->sLabel; | ||
| $this->bCanMoveForward = false; | ||
| break; | ||
|
|
||
| case CheckResult::WARNING: | ||
| $aWarnings[] = $oCheckResult->sLabel; | ||
| break; | ||
|
|
||
| case CheckResult::INFO: | ||
| $aInfo[] = $oCheckResult->sLabel; | ||
| break; | ||
|
|
||
| case CheckResult::TRACE: | ||
| SetupLog::Ok($oCheckResult->sLabel); | ||
| break; | ||
| } | ||
| } | ||
| $sStyle = 'style="display:none;overflow:auto;"'; | ||
| $sToggleButtons = '<button type="button" id="show_details" class="ibo-button ibo-is-alternative ibo-is-neutral" onclick="$(\'#details\').toggle(); $(this).toggle(); $(\'#hide_details\').toggle();"><span class="ibo-button--icon fa fa-caret-down"></span><span class="ibo-button--label">Show details</span></button><button type="button" id="hide_details" class="ibo-button ibo-is-alternative ibo-is-neutral" style="display:none;" onclick="$(\'#details\').toggle(); $(this).toggle(); $(\'#show_details\').toggle();"><span class="ibo-button--icon fa fa-caret-up"></span><span class="ibo-button--label">Hide details</span></button>'; | ||
| if (count($aErrors) > 0) { | ||
| if (count($this->aErrors) > 0) { | ||
| $sStyle = 'style="overflow:auto;"'; | ||
| $sTitle = count($aErrors).' Error(s), '.count($aWarnings).' Warning(s).'; | ||
| $sTitle = count($this->aErrors).' Error(s), '.count($this->aWarnings).' Warning(s).'; | ||
| $sH2Class = 'text-error'; | ||
| } elseif (count($aWarnings) > 0) { | ||
| $sTitle = count($aWarnings).' Warning(s) '.$sToggleButtons; | ||
| } elseif (count($this->aWarnings) > 0) { | ||
| $sTitle = count($this->aWarnings).' Warning(s) '.$sToggleButtons; | ||
| $sH2Class = 'text-warning'; | ||
| } else { | ||
| $sTitle = 'Ok. '.$sToggleButtons; | ||
|
|
@@ -110,13 +94,13 @@ public function Display(SetupPage $oPage): void | |
| <div id="details" $sStyle> | ||
| HTML | ||
| ); | ||
| foreach ($aErrors as $sText) { | ||
| foreach ($this->aErrors as $sText) { | ||
| $oPage->error($sText); | ||
| } | ||
| foreach ($aWarnings as $sText) { | ||
| foreach ($this->aWarnings as $sText) { | ||
| $oPage->warning($sText); | ||
| } | ||
| foreach ($aInfo as $sText) { | ||
| foreach ($this->aInfo as $sText) { | ||
| $oPage->ok($sText); | ||
| } | ||
| $oPage->add('</div>'); | ||
|
|
@@ -127,8 +111,68 @@ public function Display(SetupPage $oPage): void | |
| $oPage->add_ready_script('CheckDirectoryConfFilesPermissions("'.utils::GetItopVersionWikiSyntax().'")'); | ||
| } | ||
|
|
||
| /** | ||
| * Add post display stuff to the setup screen | ||
| * @param \SetupPage $oPage | ||
| * | ||
| * @return void | ||
| */ | ||
| public function PostFormDisplay(SetupPage $oPage) | ||
| { | ||
| if ($this->bCanMoveForward) { | ||
| $sBuildConfigFile = APPCONF.ITOP_DEFAULT_ENV.'/'.ITOP_CONFIG_FILE; | ||
| if (file_exists($sBuildConfigFile)) { | ||
| $oPage->add( | ||
| <<<HTML | ||
| <form method="post"> | ||
| <input type="hidden" name="_class" value="WizStepLandingBeforeAudit"/> | ||
| <input type="hidden" name="operation" value="next"/> | ||
| <input type="hidden" name="_params[skip_wizard]" value="1"/> | ||
| <table style="width:100%;" class="ibo-setup--wizard--buttons-container"> | ||
| <tr> | ||
| <td style="text-align: right"><button type="submit" class="ibo-button ibo-is-regular ibo-is-secondary">Keep current choices</button></td> | ||
|
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. maybe a tooltip to detail what will happen if user clicks on this button?
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. this button is so powerfull that I would change his color to highlight it! |
||
| </tr> | ||
| </table> | ||
| </form> | ||
| HTML | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| public function CanMoveForward() | ||
| { | ||
| return $this->bCanMoveForward; | ||
| } | ||
|
|
||
| /** | ||
| */ | ||
| public function CheckInstallation(): void | ||
| { | ||
| $aResults = SetupUtils::CheckPhpAndExtensions(); | ||
| $this->bCanMoveForward = true; | ||
| $this->aInfo = []; | ||
| $this->aWarnings = []; | ||
| $this->aErrors = []; | ||
| foreach ($aResults as $oCheckResult) { | ||
| switch ($oCheckResult->iSeverity) { | ||
| case CheckResult::ERROR: | ||
| $this->aErrors[] = $oCheckResult->sLabel; | ||
| $this->bCanMoveForward = false; | ||
| break; | ||
|
|
||
| case CheckResult::WARNING: | ||
| $this->aWarnings[] = $oCheckResult->sLabel; | ||
| break; | ||
|
|
||
| case CheckResult::INFO: | ||
| $this->aInfo[] = $oCheckResult->sLabel; | ||
| break; | ||
|
|
||
| case CheckResult::TRACE: | ||
| SetupLog::Ok($oCheckResult->sLabel); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the fast-track path is used, this branch only restores
selected_extensionsandselected_modulesfrom the current database. It skips the normalGetAddedAndRemovedExtensions()finalization, so downstream audit and cleanup forms receiveremoved_extensionsas the default empty list. If an installed extension is no longer present or should be treated as removed during the update, the compatibility compile and feature-removal flow can run without the required removal set and miss cleanup work before the upgrade continues.