Page MenuHomePhabricator

Modularize workboard column orders
ClosedPublic

Authored by epriestley on Mar 11 2019, 4:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 4:39 PM
Unknown Object (File)
Fri, Nov 15, 4:12 AM
Unknown Object (File)
Thu, Nov 14, 4:44 AM
Unknown Object (File)
Sun, Nov 10, 7:20 PM
Unknown Object (File)
Thu, Nov 7, 11:36 AM
Unknown Object (File)
Oct 24 2024, 12:21 PM
Unknown Object (File)
Oct 21 2024, 3:38 PM
Unknown Object (File)
Oct 20 2024, 12:36 AM
Subscribers
None

Details

Summary

Depends on D20267. Depends on D20268. Ref T10333. Currently, we support "Natural" and "Priority" orders, but a lot of the particulars are pretty hard-coded, including some logic in ManiphestTask.

Although it's not clear that we'll ever put other types of objects on workboards, it seems generally bad that you need to modify ManiphestTask to get a new ordering.

Pull the ordering logic out into a ProjectColumnOrder hierarchy instead, and let each ordering define the things it needs to work (name, icon, what headers look like, how different objects are sorted, and how to apply an edit when you drop an object under a header).

Then move the existing "Natural" and "Priority" orders into this new hierarchy.

This has a minor bug where using the "Edit" workflow to change a card's priority on a priority-ordered board doesn't fully refresh card/header order since the response isn't ordering-aware. I'll fix that in an upcoming change.

Test Plan

Grouped workboards by "Natural" and "Priority", dragged stuff around within and between columns, grepped for all touched symbols.

Diff Detail

Repository
rP Phabricator
Branch
grip5
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 22247
Build 30419: Run Core Tests
Build 30418: arc lint + arc unit

Event Timeline

amckinley added inline comments.
src/applications/maniphest/storage/ManiphestTask.php
254

Just because this looked like a typo while scrolling... This is the same as

(int) (-1 * $this->getPriority()), right?

274

No cast to int here?

src/applications/project/order/PhabricatorProjectColumnPriorityOrder.php
30

As above, I slightly prefer (-1 * $priority), but this is fine.

This revision is now accepted and ready to land.Mar 12 2019, 7:47 PM
src/applications/maniphest/storage/ManiphestTask.php
254

Yeah. Some future diff swaps this to -(int)X which is arguably more intuitive than (int)-X even though I think they both do the same thing for all inputs since the unary - implies numeric cast.

The (int) in (int)-X isn't technically redundant because -"1.1" has type double.

This is all ultimately rooted in T12678.

Basically: kind of a goofy mess, cleaned up slightly in future changes, means the same thing as (int)((int)-1 * (int)$x), all the tricky cases end up working out for all actual inputs as long as (int) is in there somewhere.

274

(This was just being used to build a "priority(123)" string so the cast didn't actually matter, and I got rid of it in a future change by consolidating the string construction in PHP instead of spreading it out between PHP and JS.)

This revision was automatically updated to reflect the committed changes.