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
F15669310: D7924.diff
Mon, May 26, 12:13 AM
Unknown Object (File)
Tue, May 6, 3:48 PM
Unknown Object (File)
Mon, Apr 28, 7:08 PM
Unknown Object (File)
Apr 25 2025, 2:10 AM
Unknown Object (File)
Apr 11 2025, 4:55 PM
Unknown Object (File)
Apr 7 2025, 9:34 AM
Unknown Object (File)
Apr 7 2025, 8:38 AM
Unknown Object (File)
Apr 3 2025, 11:02 AM
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 Passed
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.