1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +01:00
phorge-phorge/src/view
epriestley 105cbaaee1 Implement a basic version of ApplicationEditor in Paste
Summary:
Ref T9132. Ref T4768. This is a rough v0 of ApplicationEditor, which replaces the edit workflow in Paste.

This mostly looks and works like ApplicationSearch, and is heavily modeled on it.

Roughly, we define a set of editable fields and the ApplicationEditor stuff builds everything else.

This has no functional changes, except:

  - I removed "Fork Paste" since I don't think it's particularly useful now that pastes are editable. We could restore it if users miss it.
  - Subscribers are now editable.
  - Form field order is a little goofy (this will be fixed in a future diff).
  - Subscribers and projects are now race-resistant.

The race-resistance works like this: instead of submitting just the new value ("subscribers=apple, dog") and doing a set operation ("set subscribers = apple, dog"), we submit the old and new values ("original=apple" + "new=apple, dog") then apply the user's changes as an add + remove ("add=dog", "remove=<none>"). This means that two users who do "Edit Paste" at around the same time and each add or remove a couple of subscribers won't overwrite each other, unless they actually add or remove the exact same subscribers (in which case their edits legitimately conflict). Previously, the last user to save would win, and whatever was in their field would overwrite the prior state, potentially losing the first user's edits.

Test Plan:
  - Created pastes.
  - Created pastes via API.
  - Edited pastes.
  - Edited every field.
  - Opened a paste in two windows and did project/subscriber edits in each, saved in arbitrary order, had edits respected.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4768, T9132

Differential Revision: https://secure.phabricator.com/D14390
2015-11-03 10:11:54 -08:00
..
__tests__ Various linter fixes 2015-08-11 22:36:55 +10:00
control Implement a basic version of ApplicationEditor in Paste 2015-11-03 10:11:54 -08:00
form Implement a basic version of ApplicationEditor in Paste 2015-11-03 10:11:54 -08:00
layout Make mobile navigation work properly by default in more cases 2015-11-03 10:11:24 -08:00
page Make mobile navigation work properly by default in more cases 2015-11-03 10:11:24 -08:00
phui Make mobile navigation work properly by default in more cases 2015-11-03 10:11:24 -08:00
widget Add Badge support to Hovercards 2015-07-16 17:17:21 -07:00
AphrontDialogView.php Allow ObjectLists to be set to Dialogs 2015-10-27 19:32:35 +00:00
AphrontJavelinView.php Various linter fixes 2015-05-20 07:27:41 +10:00
AphrontNullView.php Provide hasChildren() to replace isEmptyContent() 2013-08-12 07:51:01 -07:00
AphrontTagView.php Improve handle loading semantics for tokenizers 2015-04-02 13:42:01 -07:00
AphrontView.php Desktop Notification support 2015-06-22 13:11:37 -07:00
viewutils.php Force date/time preferences to valid values 2015-06-18 15:11:01 -07:00