Page MenuHomePhabricator

Phriction - consolidate edit business logic into Editor
ClosedPublic

Authored by btrahan on Nov 6 2014, 8:21 PM.
Tags
None
Referenced Files
F15518330: D10795.diff
Sat, Apr 19, 12:42 PM
F15500783: D10795.id25923.diff
Sun, Apr 13, 7:18 PM
F15493926: D10795.id.diff
Sat, Apr 12, 10:15 PM
F15492991: D10795.id25911.diff
Sat, Apr 12, 8:32 PM
F15492943: D10795.id25922.diff
Sat, Apr 12, 7:57 PM
F15492697: D10795.id25911.diff
Sat, Apr 12, 5:19 PM
F15488771: D10795.diff
Fri, Apr 11, 2:43 AM
F15484937: D10795.id25911.diff
Wed, Apr 9, 9:04 PM
Subscribers

Details

Summary

Ref T4029. Some business logic lives outside the editor. This revision moves that logic from the edit controller into the editor proper. This makes re-using that business logic across other endpoints - say like a conduit end point - possible. This is also part of the general modernization quest for phriction I am on.

This diff also restores the functionality where you can delete a document by wiping out the content and saving.

Test Plan

tried to make a document with no title or content and saw errors. opened a document for edit with user 1, then made edits with user 2, then saw an error when i made the edit with user 1. clicking "overwrite changes" then worked. deleted a document by wiping out the body and clicking save.

Diff Detail

Repository
rP Phabricator
Branch
T4029p2
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/phriction/controller/PhrictionEditController.php:173XHP16TODO Comment
Unit
No Test Coverage
Build Status
Buildable 2973
Build 2977: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

btrahan retitled this revision from to Phriction - consolidate edit business logic into Editor.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.

Oh, my inline misunderstood the behavior. The API seems a little confusing to me but not unreasonable. Maybe clarify it a bit.

src/applications/phriction/editor/PhrictionTransactionEditor.php
12

This seems a little oddly named since it's not an error (right?) but more like hasUserSeenContentVersionError? -- maybe more like forceOverwriteContent or ignoreVersionCheck or something?

This revision is now accepted and ready to land.Nov 6 2014, 8:29 PM

Specifically, when I was reading through, it would have been clearest if there were separate flags for the caller intent (like $ignoreEditConflicts) and generation of the conflict warning (like $rasiedVersionError).

btrahan edited edge metadata.

use a slighter better name - get/set ProcessContentVersionError - and then update negation as necessary.

re-run tests - they still pass

This revision was automatically updated to reflect the committed changes.