Page MenuHomePhabricator

Phriction - consolidate edit business logic into Editor
ClosedPublic

Authored by btrahan on Nov 6 2014, 8:21 PM.
Tags
None
Referenced Files
F15432224: D10795.id25911.diff
Mon, Mar 24, 4:53 PM
F15423799: D10795.diff
Sat, Mar 22, 6:24 PM
F15353056: D10795.diff
Mon, Mar 10, 7:57 PM
F15342944: D10795.id25922.diff
Sun, Mar 9, 9:40 PM
F15342943: D10795.id25911.diff
Sun, Mar 9, 9:40 PM
F15342939: D10795.id.diff
Sun, Mar 9, 9:40 PM
F15342937: D10795.diff
Sun, Mar 9, 9:40 PM
F15283843: D10795.diff
Tue, Mar 4, 8:45 AM
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.