2012-12-30 06:37:49 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorConfigIssueViewController
|
|
|
|
extends PhabricatorConfigController {
|
|
|
|
|
2015-07-27 09:06:26 -07:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $request->getViewer();
|
|
|
|
$issue_key = $request->getURIData('key');
|
2012-12-30 06:37:49 -08:00
|
|
|
|
|
|
|
$issues = PhabricatorSetupCheck::runAllChecks();
|
2015-02-11 13:00:59 -08:00
|
|
|
PhabricatorSetupCheck::setOpenSetupIssueKeys(
|
When multiple web hosts are in service, don't require setup warnings to be dismissed on each one
Summary:
Fixes T10876. Currently, we can end up with a setup warning banner sticking on each web device, since the state is stored in local cache.
Instead:
- When we actually run the setup checks, save the current state in the database.
- Before we show a cached banner, make sure the database still says the checks are a problem.
This could lead to some inconsistencies if setup checks legitimately pass on some hosts but not on others. For example, if you have `git` installed on one machine but not on another, we may raise a setup warning ("No Git Binary!") about it on one host only.
For now, assume users have their operational environments in some sort of reasonable shape and can install the same stuff everywhere. In the future, we could split the issues into "global" and "per-host" issues if we run into problems with this.
Test Plan:
This is somewhat tricky to test locally since you really need multiple webservers to test it properly, but I:
- Created some setup issues, saw banner.
- Ignored/cleared them, saw banner go away.
- Verified database cache writes were occurring properly.
Then I sort of faked it like this:
- Created a setup issue.
- Manually set the database cache value to `[]` ("no issues").
- Reloaded page.
- No more banner.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T10876
Differential Revision: https://secure.phabricator.com/D15802
2016-04-26 07:33:07 -07:00
|
|
|
PhabricatorSetupCheck::getUnignoredIssueKeys($issues),
|
|
|
|
$update_database = true);
|
2012-12-30 06:37:49 -08:00
|
|
|
|
Redesign Config Application
Summary: Ref T11132, significantly cleans up the Config app, new layout, icons, spacing, etc. Some minor todos around re-designing "issues", mobile support, and maybe another pass at actual Group pages.
Test Plan: Visit and test every page in the config app, set new items, resolve setup issues, etc.
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam, Korvin
Maniphest Tasks: T11132
Differential Revision: https://secure.phabricator.com/D16468
2016-08-29 15:36:13 -07:00
|
|
|
$nav = $this->buildSideNavView();
|
|
|
|
$nav->selectFilter('issue/');
|
|
|
|
|
2015-07-27 09:06:26 -07:00
|
|
|
if (empty($issues[$issue_key])) {
|
2015-03-01 14:45:56 -08:00
|
|
|
$content = id(new PHUIInfoView())
|
|
|
|
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
2012-12-30 06:37:49 -08:00
|
|
|
->setTitle(pht('Issue Resolved'))
|
|
|
|
->appendChild(pht('This setup issue has been resolved. '))
|
|
|
|
->appendChild(
|
2013-01-17 19:15:06 -08:00
|
|
|
phutil_tag(
|
2012-12-30 06:37:49 -08:00
|
|
|
'a',
|
|
|
|
array(
|
|
|
|
'href' => $this->getApplicationURI('issue/'),
|
|
|
|
),
|
|
|
|
pht('Return to Open Issue List')));
|
|
|
|
$title = pht('Resolved Issue');
|
|
|
|
} else {
|
2015-07-27 09:06:26 -07:00
|
|
|
$issue = $issues[$issue_key];
|
2012-12-30 06:37:49 -08:00
|
|
|
$content = $this->renderIssue($issue);
|
|
|
|
$title = $issue->getShortName();
|
|
|
|
}
|
|
|
|
|
|
|
|
$crumbs = $this
|
2013-01-01 14:09:29 -08:00
|
|
|
->buildApplicationCrumbs()
|
2015-02-03 09:07:00 -08:00
|
|
|
->setBorder(true)
|
2013-12-18 17:47:34 -08:00
|
|
|
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
|
Redesign Config Application
Summary: Ref T11132, significantly cleans up the Config app, new layout, icons, spacing, etc. Some minor todos around re-designing "issues", mobile support, and maybe another pass at actual Group pages.
Test Plan: Visit and test every page in the config app, set new items, resolve setup issues, etc.
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam, Korvin
Maniphest Tasks: T11132
Differential Revision: https://secure.phabricator.com/D16468
2016-08-29 15:36:13 -07:00
|
|
|
->addTextCrumb($title, $request->getRequestURI())
|
|
|
|
->setBorder(true);
|
2012-12-30 06:37:49 -08:00
|
|
|
|
2016-04-03 00:27:39 +00:00
|
|
|
return $this->newPage()
|
|
|
|
->setTitle($title)
|
|
|
|
->setCrumbs($crumbs)
|
Redesign Config Application
Summary: Ref T11132, significantly cleans up the Config app, new layout, icons, spacing, etc. Some minor todos around re-designing "issues", mobile support, and maybe another pass at actual Group pages.
Test Plan: Visit and test every page in the config app, set new items, resolve setup issues, etc.
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam, Korvin
Maniphest Tasks: T11132
Differential Revision: https://secure.phabricator.com/D16468
2016-08-29 15:36:13 -07:00
|
|
|
->setNavigation($nav)
|
|
|
|
->appendChild($content)
|
|
|
|
->addClass('white-background');
|
2012-12-30 06:37:49 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
private function renderIssue(PhabricatorSetupIssue $issue) {
|
|
|
|
require_celerity_resource('setup-issue-css');
|
|
|
|
|
|
|
|
$view = new PhabricatorSetupIssueView();
|
|
|
|
$view->setIssue($issue);
|
|
|
|
|
2013-01-30 11:26:03 -08:00
|
|
|
$container = phutil_tag(
|
2012-12-30 06:37:49 -08:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'setup-issue-background',
|
|
|
|
),
|
|
|
|
$view->render());
|
|
|
|
|
|
|
|
return $container;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|