Fix up special casing for closing review requests.
Review Request #9150 — Created Aug. 25, 2017 and submitted
In the case of the close description field, the way that the review request
editor would callreviewRequest.close
instead of setting a field on the model
itself was pretty hacky. The implementation ofsetDraftField
would look at
whether it was setting thecloseDescription
and then special-case its
behavior.Now that we have JavaScript-side implementations for the built-in fields, we
don't need this anymore. I've moved the special casing into the
CloseDescriptionFieldView
.This refactor will also make things easier down the road for new field types.
- Tested setting the close description with both regular and Markdown text.
- Ran js-tests.
- Change Summary:
-
Even better implementation.
- Commit:
-
70a27d6ecf6136e90fed790b388e1d5e5c67e66abed3affb15df2fcace6f2853855d09d5cfa523c1
Checks run (2 succeeded)
- Description:
-
In the case of the close description field, the way that the review request
editor would call reviewRequest.close
instead of setting a field on the modelitself was pretty hacky. The implementation of setDraftField
would look atwhether it was setting the closeDescription
and then special-case itsbehavior. ~ Now that we have javascript-side implementations for the built-in fields, we
~ Now that we have JavaScript-side implementations for the built-in fields, we
don't need this anymore. I've moved the special casing into the CloseDescriptionFieldView
.This refactor will also make things easier down the road for new field types.
- Commit:
-
bed3affb15df2fcace6f2853855d09d5cfa523c1f68e3d25d4ac37a6d6dddac5c340efd6b3caba45
- Diff:
-
Revision 3 (+163 -90)