Page MenuHomePhabricator

Simplify PHUIObjectBoxViews handling of Save and Error states
ClosedPublic

Authored by chad on Jan 9 2014, 9:45 PM.
Tags
None
Referenced Files
F19103193: D7924.diff
Fri, Dec 5, 8:33 AM
F19102561: D7924.id17939.diff
Fri, Dec 5, 7:01 AM
F19052158: D7924.id17943.diff
Fri, Nov 28, 3:22 AM
F18932817: D7924.id.diff
Mon, Nov 10, 9:35 AM
F18925160: D7924.diff
Sun, Nov 9, 6:27 PM
F18810590: D7924.id.diff
Oct 19 2025, 10:25 PM
F18790652: D7924.id17939.diff
Oct 15 2025, 4:19 PM
F18775749: D7924.diff
Oct 10 2025, 8:03 PM
Tokens
"Doubloon" token, awarded by btrahan.

Details

Summary

This removes the bulk of the "Form Errors" text, some variations likely exists. These are a bit redundant and space consuming. I'd also like to back ErrorView more into PHUIObjectBox.

Test Plan

Test out the forms, see errors without the text.

Diff Detail

Branch
form-title
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/applications/people/controller/PhabricatorPeopleEditController.php:228XHP5Use of Undeclared Variable
Unit
Tests Passed

Event Timeline

Looks like a regexp went crazy, but the other changes look good.

One thing I think we should do is put a new:

public function setFormErrors($errors) {
  if ($errors) {
    $this->setFormError(id(new ErrorView())->setErrors($errors);
  }
  return $this;
}

...method on ObjectBoxView, and then simplify all the similar constructs that exist elsewhere. Feeling ambitious?

src/applications/people/controller/PhabricatorPeopleEditController.php
220

hahaha

I think if we do setFormErrors and setFormWarnings, then that would be cool, and I could do header treatments on the whole box accordingly. Right now you can just dump any AphrontErrorBox in there.

chad planned changes to this revision.Jan 9 2014, 11:17 PM
chad updated this revision to Unknown Object (????).Jan 10 2014, 5:06 AM
  • change everything everywherey

setFormErrors is a convenience method for viewing an array of errors
setFormSaved is a convenience method for setting a success state
setErrorView lets you dump any ErrorView into the box.

chad requested a review of this revision.Jan 10 2014, 5:11 AM
chad updated this revision to Unknown Object (????).Jan 10 2014, 6:53 AM
  • change everything everywherey
  • Calendar
  • Rebase

Nice, this look awesome -- way cleaner than the old way. Thanks!

Yeah, I'll follow up with a diff for something similar on dialogs.