PHUIErrorView

Summary: Clean up the error view styling.

Test Plan:
Tested as many as I could find, built additional tests in UIExamples

{F280452}

{F280453}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11605
This commit is contained in:
Chad Little
2015-02-01 20:14:56 -08:00
parent 33c0b9423f
commit 3da38c74da
80 changed files with 388 additions and 334 deletions

View File

@@ -107,7 +107,6 @@ phutil_register_library_map(array(
'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php',
'AphrontDialogResponse' => 'aphront/response/AphrontDialogResponse.php',
'AphrontDialogView' => 'view/AphrontDialogView.php',
'AphrontErrorView' => 'view/form/AphrontErrorView.php',
'AphrontException' => 'aphront/exception/AphrontException.php',
'AphrontFileResponse' => 'aphront/response/AphrontFileResponse.php',
'AphrontFormCheckboxControl' => 'view/form/control/AphrontFormCheckboxControl.php',
@@ -1140,6 +1139,8 @@ phutil_register_library_map(array(
'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php',
'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php',
'PHUIDurableColumn' => 'view/phui/PHUIDurableColumn.php',
'PHUIErrorExample' => 'applications/uiexample/examples/PHUIErrorExample.php',
'PHUIErrorView' => 'view/form/PHUIErrorView.php',
'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php',
'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php',
'PHUIFormDividerControl' => 'view/form/control/PHUIFormDividerControl.php',
@@ -1698,7 +1699,6 @@ phutil_register_library_map(array(
'PhabricatorEnglishTranslation' => 'infrastructure/internationalization/translation/PhabricatorEnglishTranslation.php',
'PhabricatorEnv' => 'infrastructure/env/PhabricatorEnv.php',
'PhabricatorEnvTestCase' => 'infrastructure/env/__tests__/PhabricatorEnvTestCase.php',
'PhabricatorErrorUIExample' => 'applications/uiexample/examples/PhabricatorErrorUIExample.php',
'PhabricatorEvent' => 'infrastructure/events/PhabricatorEvent.php',
'PhabricatorEventEngine' => 'infrastructure/events/PhabricatorEventEngine.php',
'PhabricatorEventListener' => 'infrastructure/events/PhabricatorEventListener.php',
@@ -3230,7 +3230,6 @@ phutil_register_library_map(array(
'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration',
'AphrontDialogResponse' => 'AphrontResponse',
'AphrontDialogView' => 'AphrontView',
'AphrontErrorView' => 'AphrontView',
'AphrontException' => 'Exception',
'AphrontFileResponse' => 'AphrontResponse',
'AphrontFormCheckboxControl' => 'AphrontFormControl',
@@ -4337,6 +4336,8 @@ phutil_register_library_map(array(
'PHUIDocumentExample' => 'PhabricatorUIExample',
'PHUIDocumentView' => 'AphrontTagView',
'PHUIDurableColumn' => 'AphrontTagView',
'PHUIErrorExample' => 'PhabricatorUIExample',
'PHUIErrorView' => 'AphrontView',
'PHUIFeedStoryExample' => 'PhabricatorUIExample',
'PHUIFeedStoryView' => 'AphrontView',
'PHUIFormDividerControl' => 'AphrontFormControl',
@@ -4937,7 +4938,6 @@ phutil_register_library_map(array(
'PhabricatorEmptyQueryException' => 'Exception',
'PhabricatorEnglishTranslation' => 'PhabricatorBaseEnglishTranslation',
'PhabricatorEnvTestCase' => 'PhabricatorTestCase',
'PhabricatorErrorUIExample' => 'PhabricatorUIExample',
'PhabricatorEvent' => 'PhutilEvent',
'PhabricatorEventListener' => 'PhutilEventListener',
'PhabricatorEventType' => 'PhutilEventType',

View File

@@ -205,7 +205,7 @@ class AphrontDefaultApplicationConfiguration
}
if ($ex instanceof AphrontUsageException) {
$error = new AphrontErrorView();
$error = new PHUIErrorView();
$error->setTitle($ex->getTitle());
$error->appendChild($ex->getMessage());

View File

@@ -188,8 +188,8 @@ abstract class AlmanacController
),
pht('Learn More'));
$error_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$error_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(
array(
array($message, ' ', $doc_link),

View File

@@ -15,7 +15,7 @@ abstract class PhabricatorAuthController extends PhabricatorController {
}
protected function renderErrorPage($title, array $messages) {
$view = new AphrontErrorView();
$view = new PHUIErrorView();
$view->setTitle($title);
$view->setErrors($messages);

View File

@@ -29,9 +29,9 @@ final class PhabricatorAuthNeedsMultiFactorController
$viewer->updateMultiFactorEnrollment();
if (!$viewer->getIsEnrolledInMultiFactor()) {
$help = id(new AphrontErrorView())
$help = id(new PHUIErrorView())
->setTitle(pht('Add Multi-Factor Authentication To Your Account'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(
array(
pht(
@@ -53,9 +53,9 @@ final class PhabricatorAuthNeedsMultiFactorController
'account.'),
));
} else {
$help = id(new AphrontErrorView())
$help = id(new PHUIErrorView())
->setTitle(pht('Multi-Factor Authentication Configured'))
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(
array(
pht(

View File

@@ -444,8 +444,8 @@ final class PhabricatorAuthRegisterController
$welcome_view = null;
if ($is_setup) {
$welcome_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$welcome_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Welcome to Phabricator'))
->appendChild(
pht(

View File

@@ -128,7 +128,7 @@ EOBODY;
$error_view = null;
if ($errors) {
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setErrors($errors);
}

View File

@@ -28,8 +28,8 @@ final class PhabricatorMustVerifyEmailController
$sent = null;
if ($request->isFormPost()) {
$email->sendVerificationEmail($user);
$sent = new AphrontErrorView();
$sent->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$sent = new PHUIErrorView();
$sent->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$sent->setTitle(pht('Email Sent'));
$sent->appendChild(
pht(

View File

@@ -103,11 +103,11 @@ final class PhabricatorAuthListController
),
$config_name);
$warning = new AphrontErrorView();
$warning = new PHUIErrorView();
$email_domains = PhabricatorEnv::getEnvConfig($config_name);
if ($email_domains) {
$warning->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$warning->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$warning->setTitle(pht('Registration is Restricted'));
$warning->appendChild(
pht(
@@ -116,7 +116,7 @@ final class PhabricatorAuthListController
$config_link,
phutil_tag('strong', array(), implode(', ', $email_domains))));
} else {
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->setSeverity(PHUIErrorView::SEVERITY_WARNING);
$warning->setTitle(pht('Anyone Can Register an Account'));
$warning->appendChild(
pht(

View File

@@ -121,7 +121,7 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
->setError($e_pass));
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$dialog->appendChild($errors);

View File

@@ -194,7 +194,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
}
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$form = id(new PHUIFormLayoutView())

View File

@@ -103,7 +103,7 @@ final class PhabricatorCalendarEventEditController
$error_view = null;
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Status can not be set!'))
->setErrors($errors);
}

View File

@@ -41,6 +41,9 @@ final class PhabricatorCalendarViewController
$month_view->setBrowseURI($request->getRequestURI());
$month_view->setUser($user);
$month_view->setHolidays($holidays);
if ($this->getNoticeView()) {
$month_view->setErrorView($this->getNoticeView());
}
$phids = mpull($statuses, 'getUserPHID');
$handles = $this->loadViewerHandles($phids);
@@ -65,7 +68,6 @@ final class PhabricatorCalendarViewController
$nav->appendChild(
array(
$crumbs,
$this->getNoticeView(),
$month_view,
));
@@ -81,23 +83,23 @@ final class PhabricatorCalendarViewController
$view = null;
if ($request->getExists('created')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully created your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully created your status.'));
} else if ($request->getExists('updated')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully updated your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully updated your status.'));
} else if ($request->getExists('deleted')) {
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(pht('Successfully deleted your status.'));
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('Successfully deleted your status.'));
} else if (!$request->getUser()->isLoggedIn()) {
$login_uri = id(new PhutilURI('/auth/start/'))
->setQueryParam('next', '/calendar/');
$view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setTitle(
$view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(
pht(
'You are not logged in. %s to see your calendar events.',
phutil_tag(

View File

@@ -108,23 +108,23 @@ final class PhabricatorConfigEditController
$error_view = null;
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors);
} else if ($option->getHidden()) {
$msg = pht(
'This configuration is hidden and can not be edited or viewed from '.
'the web interface.');
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Configuration Hidden'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->appendChild(phutil_tag('p', array(), $msg));
} else if ($option->getLocked()) {
$msg = $option->getLockedMessage();
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setTitle(pht('Configuration Locked'))
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(phutil_tag('p', array(), $msg));
}

View File

@@ -18,8 +18,8 @@ final class PhabricatorConfigIssueViewController
PhabricatorSetupCheck::countUnignoredIssues($issues));
if (empty($issues[$this->issueKey])) {
$content = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$content = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Issue Resolved'))
->appendChild(pht('This setup issue has been resolved. '))
->appendChild(

View File

@@ -165,7 +165,7 @@ final class ConpherenceUpdateController
}
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -24,13 +24,13 @@ final class PhabricatorWorkerTaskDetailController
if (!$task) {
$title = pht('Task Does Not Exist');
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setTitle(pht('No Such Task'));
$error_view->appendChild(phutil_tag(
'p',
array(),
pht('This task may have recently been garbage collected.')));
$error_view->setSeverity(AphrontErrorView::SEVERITY_NODATA);
$error_view->setSeverity(PHUIErrorView::SEVERITY_NODATA);
$content = $error_view;
} else {

View File

@@ -56,8 +56,8 @@ final class PhabricatorDashboardManageController
'make changes, make a copy first.');
$box->setErrorView(
id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(array($no_edit)));
}

View File

@@ -66,8 +66,8 @@ final class PhabricatorDashboardViewController
$id = $this->id;
$manage_uri = $this->getApplicationURI("manage/{$id}/");
return id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
return id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild(
pht('This dashboard has no panels '.
'yet. Use %s to add panels.',

View File

@@ -24,8 +24,8 @@ final class DifferentialDiffViewController extends DifferentialController {
return new Aphront404Response();
}
$error_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$error_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
if ($diff->getRevisionID()) {
$error_view->appendChild(
pht(

View File

@@ -52,7 +52,7 @@ final class DifferentialRevisionLandController extends DifferentialController {
} else {
$text = phutil_tag('pre', array(), $ex->getMessage());
}
$text = id(new AphrontErrorView())
$text = id(new PHUIErrorView())
->appendChild($text);
}

View File

@@ -137,9 +137,9 @@ final class DifferentialRevisionViewController extends DifferentialController {
$large = $request->getStr('large');
if (count($changesets) > $limit && !$large) {
$count = count($changesets);
$warning = new AphrontErrorView();
$warning = new PHUIErrorView();
$warning->setTitle('Very Large Diff');
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->setSeverity(PHUIErrorView::SEVERITY_WARNING);
$warning->appendChild(hsprintf(
'%s <strong>%s</strong>',
pht(
@@ -258,8 +258,8 @@ final class DifferentialRevisionViewController extends DifferentialController {
$warning_handle_map,
$handles);
if ($revision_warnings) {
$revision_warnings = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$revision_warnings = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors($revision_warnings);
$revision_detail_box->setErrorView($revision_warnings);
}
@@ -386,8 +386,8 @@ final class DifferentialRevisionViewController extends DifferentialController {
$review_warnings = array_mergev($review_warnings);
if ($review_warnings) {
$review_warnings_panel = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$review_warnings_panel = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors($review_warnings);
$comment_form->setErrorView($review_warnings_panel);
}

View File

@@ -10,7 +10,7 @@ final class DifferentialAddCommentView extends AphrontView {
private $ccs = array();
private $errorView;
public function setErrorView(AphrontErrorView $error_view) {
public function setErrorView(PHUIErrorView $error_view) {
$this->errorView = $error_view;
return $this;
}

View File

@@ -118,8 +118,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
$follow = $request->getStr('follow');
if ($follow) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_WARNING);
$notice->setTitle(pht('Unable to Continue'));
switch ($follow) {
case 'first':
@@ -138,8 +138,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
$renamed = $request->getStr('renamed');
if ($renamed) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice->setTitle(pht('File Renamed'));
$notice->appendChild(
pht("File history passes through a rename from '%s' to '%s'.",

View File

@@ -81,7 +81,7 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
} catch (ConduitException $ex) {
$err = $ex->getErrorDescription();
if ($err != '') {
return id(new AphrontErrorView())
return id(new PHUIErrorView())
->setTitle(pht('Search Error'))
->appendChild($err);
}

View File

@@ -52,7 +52,7 @@ final class DiffusionCommitController extends DiffusionController {
return new Aphront404Response();
}
$error = id(new AphrontErrorView())
$error = id(new PHUIErrorView())
->setTitle(pht('Commit Still Parsing'))
->appendChild(
pht(
@@ -79,9 +79,9 @@ final class DiffusionCommitController extends DiffusionController {
if ($is_foreign) {
$subpath = $commit_data->getCommitDetail('svn-subpath');
$error_panel = new AphrontErrorView();
$error_panel = new PHUIErrorView();
$error_panel->setTitle(pht('Commit Not Tracked'));
$error_panel->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$error_panel->setSeverity(PHUIErrorView::SEVERITY_WARNING);
$error_panel->appendChild(
pht("This Diffusion repository is configured to track only one ".
"subdirectory of the entire Subversion repository, and this commit ".
@@ -251,8 +251,8 @@ final class DiffusionCommitController extends DiffusionController {
->setTag('a')
->setIcon($icon);
$warning_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$warning_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setTitle('Very Large Commit')
->appendChild(
pht('This commit is very large. Load each file individually.'));

View File

@@ -243,8 +243,8 @@ abstract class DiffusionController extends PhabricatorController {
}
protected function renderStatusMessage($title, $body) {
return id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
return id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setTitle($title)
->appendChild($body);
}

View File

@@ -69,9 +69,9 @@ final class DiffusionExternalController extends DiffusionController {
}
$desc .= $id;
$content = id(new AphrontErrorView())
$content = id(new PHUIErrorView())
->setTitle(pht('Unknown External'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->appendChild(phutil_tag(
'p',
array(),

View File

@@ -84,7 +84,7 @@ final class DiffusionMirrorEditController
$form_errors = null;
if ($errors) {
$form_errors = id(new AphrontErrorView())
$form_errors = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -68,9 +68,9 @@ final class DiffusionRepositoryController extends DiffusionController {
if ($page_has_content) {
$content[] = $this->buildNormalContent($drequest);
} else {
$content[] = id(new AphrontErrorView())
$content[] = id(new PHUIErrorView())
->setTitle($empty_title)
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(array($empty_message));
}

View File

@@ -258,8 +258,8 @@ final class DiffusionSetPasswordSettingsPanel extends PhabricatorSettingsPanel {
$saved = null;
if ($request->getBool('saved')) {
$saved = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$saved = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Password Updated'))
->appendChild(pht('Your VCS password has been updated.'));
}

View File

@@ -33,12 +33,12 @@ final class DiffusionEmptyResultView extends DiffusionView {
// TODO: Under git, this error message should be more specific. It
// may exist on some other branch.
$body = pht('This path does not exist anywhere.');
$severity = AphrontErrorView::SEVERITY_ERROR;
$severity = PHUIErrorView::SEVERITY_ERROR;
break;
case DiffusionBrowseResultSet::REASON_IS_EMPTY:
$title = pht('Empty Directory');
$body = pht("This path was an empty directory at %s.\n", $commit);
$severity = AphrontErrorView::SEVERITY_NOTICE;
$severity = PHUIErrorView::SEVERITY_NOTICE;
break;
case DiffusionBrowseResultSet::REASON_IS_DELETED:
$deleted = $this->browseResultSet->getDeletedAtCommit();
@@ -60,7 +60,7 @@ final class DiffusionEmptyResultView extends DiffusionView {
self::linkCommit($drequest->getRepository(), $deleted),
$browse,
"r{$callsign}{$existed}");
$severity = AphrontErrorView::SEVERITY_WARNING;
$severity = PHUIErrorView::SEVERITY_WARNING;
break;
case DiffusionBrowseResultSet::REASON_IS_UNTRACKED_PARENT:
$subdir = $drequest->getRepository()->getDetail('svn-subpath');
@@ -70,13 +70,13 @@ final class DiffusionEmptyResultView extends DiffusionView {
"of the entire repository ('%s'), ".
"but you aren't looking at something in that subdirectory, so no ".
"information is available.", $subdir);
$severity = AphrontErrorView::SEVERITY_WARNING;
$severity = PHUIErrorView::SEVERITY_WARNING;
break;
default:
throw new Exception("Unknown failure reason: $reason");
}
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setSeverity($severity);
$error_view->setTitle($title);
$error_view->appendChild(phutil_tag('p', array(), $body));

View File

@@ -92,10 +92,10 @@ final class DivinerAtomController extends DivinerController {
$warnings = $atom->getWarnings();
if ($warnings) {
$warnings = id(new AphrontErrorView())
$warnings = id(new PHUIErrorView())
->setErrors($warnings)
->setTitle(pht('Documentation Warnings'))
->setSeverity(AphrontErrorView::SEVERITY_WARNING);
->setSeverity(PHUIErrorView::SEVERITY_WARNING);
}
$methods = $this->composeMethods($symbol);

View File

@@ -97,8 +97,8 @@ final class PhabricatorFactHomeController extends PhabricatorFactController {
}
if (!$options) {
return id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
return id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('No Chartable Facts'))
->appendChild(phutil_tag(
'p',

View File

@@ -63,7 +63,7 @@ final class HarbormasterPlanRunController extends HarbormasterController {
}
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$title = pht('Run Build Plan Manually');

View File

@@ -50,7 +50,7 @@ final class HarbormasterStepAddController extends HarbormasterController {
}
if ($errors) {
$errors = id(new AphrontErrorView())
$errors = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -42,8 +42,8 @@ final class HeraldTranscriptController extends HeraldController {
$object_xscript = $xscript->getObjectTranscript();
if (!$object_xscript) {
$notice = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$notice = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Old Transcript'))
->appendChild(phutil_tag(
'p',
@@ -75,8 +75,8 @@ final class HeraldTranscriptController extends HeraldController {
$this->handles = $handles;
if ($xscript->getDryRun()) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice->setTitle(pht('Dry Run'));
$notice->appendChild(pht('This was a dry run to test Herald '.
'rules, no actions were executed.'));
@@ -319,8 +319,8 @@ final class HeraldTranscriptController extends HeraldController {
} else {
return $panel;
}
$panel = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$panel = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setTitle($title)
->appendChild($body);
}

View File

@@ -65,8 +65,8 @@ final class LegalpadDocumentSignController extends LegalpadController {
// If they aren't logged in, we can't be as sure, so don't show
// anything.
if ($viewer->isLoggedIn()) {
$signed_status = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$signed_status = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(
array(
pht('You have not signed this document yet.'),
@@ -95,8 +95,8 @@ final class LegalpadDocumentSignController extends LegalpadController {
phabricator_datetime($signed_at, $viewer));
}
$signed_status = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$signed_status = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(array($signed_text));
}
@@ -121,8 +121,8 @@ final class LegalpadDocumentSignController extends LegalpadController {
$login_text = pht(
'This document requires a corporate signatory. You must log in to '.
'accept this document on behalf of a company you represent.');
$signed_status = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
$signed_status = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setErrors(array($login_text));
}
@@ -254,7 +254,7 @@ final class LegalpadDocumentSignController extends LegalpadController {
if (!$has_signed) {
$error_view = null;
if ($errors) {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -293,8 +293,8 @@ final class LegalpadDocumentSignatureSearchEngine
->appendChild($table);
if (!$this->document) {
$policy_notice = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$policy_notice = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors(
array(
pht(

View File

@@ -261,9 +261,9 @@ final class ManiphestReportController extends ManiphestController {
}
if ($caption) {
$caption = id(new AphrontErrorView())
$caption = id(new PHUIErrorView())
->appendChild($caption)
->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
}
$panel = new PHUIObjectBoxView();

View File

@@ -522,7 +522,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$error_view = null;
if ($errors) {
$error_view = new AphrontErrorView();
$error_view = new PHUIErrorView();
$error_view->setErrors($errors);
}
@@ -692,7 +692,7 @@ final class ManiphestTaskEditController extends ManiphestController {
$field_list->appendFieldsToForm($form);
require_celerity_resource('aphront-error-view-css');
require_celerity_resource('phui-error-view-css');
Javelin::initBehavior('project-create', array(
'tokenizerID' => $project_tokenizer_id,

View File

@@ -247,7 +247,7 @@ final class PhabricatorApplicationEditEmailController
}
if ($errors) {
$errors = id(new AphrontErrorView())
$errors = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -8,7 +8,7 @@ final class PhabricatorNotificationStatusController
$status = PhabricatorNotificationClient::getServerStatus();
$status = $this->renderServerStatus($status);
} catch (Exception $ex) {
$status = new AphrontErrorView();
$status = new PHUIErrorView();
$status->setTitle('Notification Server Issue');
$status->appendChild(hsprintf(
'Unable to determine server status. This probably means the server '.

View File

@@ -55,8 +55,8 @@ abstract class PhabricatorOAuthServerController
}
protected function buildErrorView($error_message) {
$error = new AphrontErrorView();
$error->setSeverity(AphrontErrorView::SEVERITY_ERROR);
$error = new PHUIErrorView();
$error->setSeverity(PHUIErrorView::SEVERITY_ERROR);
$error->setTitle($error_message);
return $error;

View File

@@ -322,7 +322,7 @@ final class PassphraseCredentialEditController extends PassphraseController {
if ($request->isAjax()) {
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
$dialog = id(new AphrontDialogView())

View File

@@ -69,8 +69,8 @@ final class PhabricatorPeopleLdapController
$emails = $request->getArr('email');
$names = $request->getArr('name');
$notice_view = new AphrontErrorView();
$notice_view->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice_view = new PHUIErrorView();
$notice_view->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice_view->setTitle(pht('Import Successful'));
$notice_view->setErrors(array(
pht('Successfully imported users from LDAP'),

View File

@@ -101,7 +101,7 @@ final class PhabricatorPeopleRenameController
->setError($e_username));
if ($errors) {
$errors = id(new AphrontErrorView())->setErrors($errors);
$errors = id(new PHUIErrorView())->setErrors($errors);
}
return $this->newDialog()

View File

@@ -95,8 +95,8 @@ abstract class PhameController extends PhabricatorController {
}
if (empty($stories)) {
return id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
return id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild($nodata);
}

View File

@@ -70,8 +70,8 @@ final class PhamePostNewController extends PhameController {
$nav->appendChild($crumbs);
if (!$blogs) {
$notification = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
$notification = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild(
pht('You do not have permission to join any blogs. Create a blog '.
'first, then you can post to it.'));

View File

@@ -49,8 +49,8 @@ final class PhamePostViewController extends PhameController {
if ($post->isDraft()) {
$object_box->appendChild(
id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setTitle(pht('Draft Post'))
->appendChild(
pht('Only you can see this draft until you publish it. '.
@@ -59,8 +59,8 @@ final class PhamePostViewController extends PhameController {
if (!$post->getBlog()) {
$object_box->appendChild(
id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_WARNING)
id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_WARNING)
->setTitle(pht('Not On A Blog'))
->appendChild(
pht('This post is not associated with a blog (the blog may have '.

View File

@@ -86,8 +86,8 @@ final class PhortuneCartViewController
}
break;
case PhortuneCart::STATUS_PURCHASED:
$error_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$error_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild(pht('This purchase has been completed.'));
break;

View File

@@ -125,7 +125,7 @@ final class PhortunePaymentMethodCreateController
$dialog = id(new AphrontDialogView())
->setUser($viewer)
->setTitle(pht('Error Adding Payment Method'))
->appendChild(id(new AphrontErrorView())->setErrors($errors))
->appendChild(id(new PHUIErrorView())->setErrors($errors))
->addCancelButton($request->getRequestURI());
return id(new AphrontDialogResponse())->setDialog($dialog);

View File

@@ -204,9 +204,9 @@ abstract class PhragmentController extends PhabricatorController {
public function renderConfigurationWarningIfRequired() {
$alt = PhabricatorEnv::getEnvConfig('security.alternate-file-domain');
if ($alt === null) {
return id(new AphrontErrorView())
return id(new PHUIErrorView())
->setTitle(pht('security.alternate-file-domain must be configured!'))
->setSeverity(AphrontErrorView::SEVERITY_ERROR)
->setSeverity(PHUIErrorView::SEVERITY_ERROR)
->appendChild(phutil_tag('p', array(), pht(
'Because Phragment generates files (such as ZIP archives and '.
'patches) as they are requested, it requires that you configure '.

View File

@@ -64,7 +64,7 @@ final class PhragmentCreateController extends PhragmentController {
return id(new AphrontRedirectResponse())
->setURI('/phragment/browse/'.trim($parent_path.'/'.$v_name, '/'));
} else {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors)
->setTitle(pht('Errors while creating fragment'));
}

View File

@@ -43,7 +43,7 @@ final class PhragmentUpdateController extends PhragmentController {
return id(new AphrontRedirectResponse())
->setURI('/phragment/browse/'.$fragment->getPath());
} else {
$error_view = id(new AphrontErrorView())
$error_view = id(new PHUIErrorView())
->setErrors($errors)
->setTitle(pht('Errors while updating fragment'));
}

View File

@@ -42,8 +42,8 @@ final class PhrictionDocumentController
$create_uri = '/phriction/edit/?slug='.$slug;
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NODATA);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NODATA);
$notice->setTitle(pht('No content here!'));
$notice->appendChild(
pht(
@@ -67,8 +67,8 @@ final class PhrictionDocumentController
if ($content->getID() != $document->getContentID()) {
$vdate = phabricator_datetime($content->getDateCreated(), $user);
$version_note = new AphrontErrorView();
$version_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$version_note = new PHUIErrorView();
$version_note->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$version_note->appendChild(
pht('You are viewing an older version of this document, as it '.
'appeared on %s.', $vdate));
@@ -88,16 +88,16 @@ final class PhrictionDocumentController
$core_content = $content->renderContent($user);
} else if ($current_status == PhrictionChangeType::CHANGE_DELETE) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice->setTitle(pht('Document Deleted'));
$notice->appendChild(
pht('This document has been deleted. You can edit it to put new '.
'content here, or use history to revert to an earlier version.'));
$core_content = $notice->render();
} else if ($current_status == PhrictionChangeType::CHANGE_STUB) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice->setTitle(pht('Empty Document'));
$notice->appendChild(
pht('This document is empty. You can edit it to put some proper '.
@@ -119,8 +119,8 @@ final class PhrictionDocumentController
$slug_uri = PhrictionDocument::getSlugURI($new_doc->getSlug());
}
$notice = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
if ($slug_uri) {
$notice->appendChild(
@@ -164,8 +164,8 @@ final class PhrictionDocumentController
$slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug());
}
$move_notice = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$move_notice = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
if ($slug_uri) {
$move_notice->appendChild(

View File

@@ -94,8 +94,8 @@ final class PhrictionEditController
),
pht('discard this draft'));
$draft_note = new AphrontErrorView();
$draft_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$draft_note = new PHUIErrorView();
$draft_note->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$draft_note->setTitle('Recovered Draft');
$draft_note->appendChild(hsprintf(
'<p>Showing a saved draft of your edits, you can %s.</p>',

View File

@@ -138,7 +138,7 @@ final class PhabricatorPolicyEditController
));
if ($errors) {
$errors = id(new AphrontErrorView())
$errors = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -30,8 +30,8 @@ final class PonderQuestionViewController extends PonderController {
$authors = mpull($question->getAnswers(), null, 'getAuthorPHID');
if (isset($authors[$user->getPHID()])) {
$answer_add_panel = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
$answer_add_panel = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild(
pht(
'You have already answered this question. You can not answer '.

View File

@@ -210,8 +210,8 @@ final class ReleephRequestEditController extends ReleephBranchController {
$age_string,
$handles[$pull->getRequestUserPHID()]->renderLink()),
);
$notice_view = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$notice_view = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->setErrors($notice_messages);
}

View File

@@ -161,7 +161,7 @@ final class PhabricatorApplicationSearchController
$errors = $engine->getErrors();
if ($errors) {
$run_query = false;
$errors = id(new AphrontErrorView())
$errors = id(new PHUIErrorView())
->setTitle(pht('Query Errors'))
->setErrors($errors);
}

View File

@@ -61,8 +61,8 @@ final class PhabricatorConduitCertificateSettingsPanel
}
if ($request->getStr('regenerated')) {
$notice = new AphrontErrorView();
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
$notice = new PHUIErrorView();
$notice->setSeverity(PHUIErrorView::SEVERITY_NOTICE);
$notice->setTitle(pht('Certificate Regenerated'));
$notice->appendChild(phutil_tag(
'p',

View File

@@ -228,7 +228,7 @@ final class PhabricatorEmailAddressesSettingsPanel
}
if ($errors) {
$errors = id(new AphrontErrorView())
$errors = id(new PHUIErrorView())
->setErrors($errors);
}

View File

@@ -41,6 +41,7 @@ final class PhabricatorUIExampleRenderController extends PhabricatorController {
require_celerity_resource('phabricator-ui-example-css');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setBorder(true);
$crumbs->addTextCrumb($example->getName());
$header = id(new PHUIHeaderView())

View File

@@ -0,0 +1,69 @@
<?php
final class PHUIErrorExample extends PhabricatorUIExample {
public function getName() {
return 'Errors';
}
public function getDescription() {
return hsprintf(
'Use <tt>PHUIErrorView</tt> to render errors, warnings and notices.');
}
public function renderExample() {
$request = $this->getRequest();
$user = $request->getUser();
$sevs = array(
PHUIErrorView::SEVERITY_ERROR => 'Error',
PHUIErrorView::SEVERITY_WARNING => 'Warning',
PHUIErrorView::SEVERITY_NOTICE => 'Notice',
PHUIErrorView::SEVERITY_NODATA => 'No Data',
);
$views = array();
// Only Title
foreach ($sevs as $sev => $title) {
$view = new PHUIErrorView();
$view->setSeverity($sev);
$view->setTitle($title);
$views[] = $view;
}
// Only Body
foreach ($sevs as $sev => $title) {
$view = new PHUIErrorView();
$view->setSeverity($sev);
$view->appendChild('Several issues were encountered.');
$views[] = $view;
}
// Only Errors
foreach ($sevs as $sev => $title) {
$view = new PHUIErrorView();
$view->setSeverity($sev);
$view->setErrors(
array(
'Overcooked.',
'Too much salt.',
'Full of sand.',
));
$views[] = $view;
}
// All
foreach ($sevs as $sev => $title) {
$view = new PHUIErrorView();
$view->setSeverity($sev);
$view->setTitle($title);
$view->appendChild('Several issues were encountered.');
$view->setErrors(
array(
'Overcooked.',
'Too much salt.',
'Full of sand.',
));
$views[] = $view;
}
return $views;
}
}

View File

@@ -1,42 +0,0 @@
<?php
final class PhabricatorErrorUIExample extends PhabricatorUIExample {
public function getName() {
return 'Errors';
}
public function getDescription() {
return hsprintf(
'Use <tt>AphrontErrorView</tt> to render errors, warnings and notices.');
}
public function renderExample() {
$request = $this->getRequest();
$user = $request->getUser();
$sevs = array(
AphrontErrorView::SEVERITY_ERROR => 'Error',
AphrontErrorView::SEVERITY_WARNING => 'Warning',
AphrontErrorView::SEVERITY_NOTICE => 'Notice',
AphrontErrorView::SEVERITY_NODATA => 'No Data',
);
$views = array();
foreach ($sevs as $sev => $title) {
$view = new AphrontErrorView();
$view->setSeverity($sev);
$view->setTitle($title);
$view->appendChild('Several issues were encountered.');
$view->setErrors(
array(
'Overcooked.',
'Too much salt.',
'Full of sand.',
));
$views[] = $view;
}
return $views;
}
}

View File

@@ -292,7 +292,7 @@ final class AphrontDialogView extends AphrontView {
if ($errors) {
$children = array(
id(new AphrontErrorView())->setErrors($errors),
id(new PHUIErrorView())->setErrors($errors),
$children,
);
}

View File

@@ -1,6 +1,6 @@
<?php
final class AphrontErrorView extends AphrontView {
final class PHUIErrorView extends AphrontView {
const SEVERITY_ERROR = 'error';
const SEVERITY_WARNING = 'warning';
@@ -34,7 +34,7 @@ final class AphrontErrorView extends AphrontView {
final public function render() {
require_celerity_resource('aphront-error-view-css');
require_celerity_resource('phui-error-view-css');
$errors = $this->errors;
if ($errors) {
@@ -48,7 +48,7 @@ final class AphrontErrorView extends AphrontView {
$list = phutil_tag(
'ul',
array(
'class' => 'aphront-error-view-list',
'class' => 'phui-error-view-list',
),
$list);
} else {
@@ -60,7 +60,7 @@ final class AphrontErrorView extends AphrontView {
$title = phutil_tag(
'h1',
array(
'class' => 'aphront-error-view-head',
'class' => 'phui-error-view-head',
),
$title);
} else {
@@ -70,12 +70,24 @@ final class AphrontErrorView extends AphrontView {
$this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
$classes = array();
$classes[] = 'aphront-error-view';
$classes[] = 'aphront-error-severity-'.$this->severity;
$classes[] = 'phui-error-view';
$classes[] = 'phui-error-severity-'.$this->severity;
$classes = implode(' ', $classes);
$children = $this->renderChildren();
$children[] = $list;
if ($list) {
$children[] = $list;
}
$body = null;
if (!empty($children)) {
$body = phutil_tag(
'div',
array(
'class' => 'phui-error-view-body',
),
$children);
}
return phutil_tag(
'div',
@@ -85,12 +97,7 @@ final class AphrontErrorView extends AphrontView {
),
array(
$title,
phutil_tag(
'div',
array(
'class' => 'aphront-error-view-body',
),
$children),
$body,
));
}
}

View File

@@ -93,7 +93,7 @@ final class PHUIObjectBoxView extends AphrontView {
public function setFormErrors(array $errors, $title = null) {
if ($errors) {
$this->formErrors = id(new AphrontErrorView())
$this->formErrors = id(new PHUIErrorView())
->setTitle($title)
->setErrors($errors);
}
@@ -105,15 +105,15 @@ final class PHUIObjectBoxView extends AphrontView {
$text = pht('Changes saved.');
}
if ($saved) {
$save = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NOTICE)
$save = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NOTICE)
->appendChild($text);
$this->formSaved = $save;
}
return $this;
}
public function setErrorView(AphrontErrorView $view) {
public function setErrorView(PHUIErrorView $view) {
$this->errorView = $view;
return $this;
}
@@ -192,7 +192,7 @@ final class PHUIObjectBoxView extends AphrontView {
$messages[] = $error->getMessage();
}
if ($messages) {
$exception_errors = id(new AphrontErrorView())
$exception_errors = id(new PHUIErrorView())
->setErrors($messages);
}
}

View File

@@ -108,8 +108,8 @@ final class PHUIObjectItemListView extends AphrontTagView {
$items = null;
} else {
$string = nonempty($this->noDataString, pht('No data.'));
$string = id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
$string = id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild($string);
$items = phutil_tag(
'li',

View File

@@ -20,8 +20,8 @@ final class PHUIPinboardView extends AphrontView {
if (!$this->items) {
$string = nonempty($this->noDataString, pht('No data.'));
return id(new AphrontErrorView())
->setSeverity(AphrontErrorView::SEVERITY_NODATA)
return id(new PHUIErrorView())
->setSeverity(PHUIErrorView::SEVERITY_NODATA)
->appendChild($string)
->render();
}

View File

@@ -9,6 +9,7 @@ final class PHUICalendarMonthView extends AphrontView {
private $events = array();
private $browseURI;
private $image;
private $error;
public function setBrowseURI($browse_uri) {
$this->browseURI = $browse_uri;
@@ -28,6 +29,11 @@ final class PHUICalendarMonthView extends AphrontView {
return $this;
}
public function setErrorView(PHUIErrorView $error) {
$this->error = $error;
return $this;
}
public function setHolidays(array $holidays) {
assert_instances_of($holidays, 'PhabricatorCalendarHoliday');
$this->holidays = mpull($holidays, null, 'getDay');
@@ -185,6 +191,10 @@ final class PHUICalendarMonthView extends AphrontView {
$box = id(new PHUIObjectBoxView())
->setHeader($this->renderCalendarHeader($first))
->appendChild($table);
if ($this->error) {
$box->setErrorView($this->error);
}
return $box;
}