Details
- Reviewers
amckinley - Maniphest Tasks
- T13272: Remove the hard-coded homepage, and other Dashboards improvements
- Commits
- rP6fac9044632b: Modularize Dashboard transactions
- Created a new Dashboard.
- Edited all fiedls of a dashboard.
- Archived/restored a dashboard.
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
src/applications/dashboard/xaction/dashboard/PhabricatorDashboardIconTransaction.php | ||
---|---|---|
22 | I guess dashboards gained default icons at some point? The original implementation has a "set the icon to foo" case for the title. | |
src/applications/dashboard/xaction/dashboard/PhabricatorDashboardLayoutTransaction.php | ||
23–24 | These won't be very human readable. Do we care about strings like "@amckinley changed the layout mode from layout-mode-full to layout-mode-half-and-half"? Or is this somehow going through PhabricatorDashboardLayoutConfig::getLayoutModeSelectOptions() to get the human names? Oh, and I see the old code didn't render anything for this transaction type anyway. | |
src/applications/dashboard/xaction/dashboard/PhabricatorDashboardNameTransaction.php | ||
22 | Same as above: dashboards have default titles now? |
src/applications/dashboard/xaction/dashboard/PhabricatorDashboardIconTransaction.php | ||
---|---|---|
22 | Briefly: they'll get a default old value in the next diff, which swaps us to EditEngine. More context: In old code, when you created an object for the first time, we wrote a bunch of transactions like this: name: null -> "some name" icon: null -> "some icon" status: null -> "active" ...and so on. Then we had all the transactions do if ($old === null) { return null; }, except one of them which was chosen arbitrarily did if ($old === null) { return pht('%s created this thing.'); }. That worked okay, mostly, but it had some problems:
New code on EditEngine does this instead:
The behavior is then mostly to hide "create" transactions from the UI, except in a handful of cases. This fixes all the problems:
So new/updated code usually throws away all the null handling. The only downside to doing this is that old transactions (in the database) don't have the "create" flag, so throwing away the null handling can make them render a little weird. For common/long-lived objects like Tasks this would probably raise enough eyebrows that we still have null handling code, but for any lesser-used application no one has ever cared that some AlmanacProperty has a transaction from 2015 like alincoln changed the name of this property from "" to "x.y.z".. If we do hit this stuff, we can also migrate fairly safely. As written, this code slightly worsens some rendering since this doesn't move us to EditEngine yet so we don't get all the new handling, but that's coming up in the next diff. | |
src/applications/dashboard/xaction/dashboard/PhabricatorDashboardLayoutTransaction.php | ||
23–24 | I'm going to do another pass on the rendering here after the swap to EditEngine and I fix all the add/remove/move panel transactions. |
Oh, another fixed problem was that null couldn't be used as a real value. It can, now.