Page MenuHomePhabricator

Calendar upgrades
ClosedPublic

Authored by chad on Feb 23 2014, 11:18 PM.
Tags
None
Referenced Files
F13198048: D8317.id19789.diff
Mon, May 13, 3:03 AM
F13194080: D8317.diff
Sun, May 12, 9:17 PM
F13177146: D8317.diff
Wed, May 8, 7:30 PM
Unknown Object (File)
Mon, Apr 29, 1:16 PM
Unknown Object (File)
Sun, Apr 28, 5:19 AM
Unknown Object (File)
Sat, Apr 20, 6:29 PM
Unknown Object (File)
Apr 11 2024, 11:09 PM
Unknown Object (File)
Apr 11 2024, 11:40 AM
Tokens
"Mountain of Wealth" token, awarded by btrahan.

Details

Reviewers
epriestley
btrahan
Maniphest Tasks
Restricted Maniphest Task
T4375: Do a quick / low-hanging-fruit pass on Calendar
Commits
Restricted Diffusion Commit
rP396e8ba82c22: Calendar upgrades
Summary

Does a handful of things to make Calendar significantly more useful

  • Enabled overlapping events
  • Profile has a 'week view' of the user
  • Profile has a 'month view' of the users
  • Multiple users on a calendar are color coded
  • Browse view slightly more useful

This stops short of implementing the new 'home' view on Calendar, mostly this is a big step though to make that happen next.

Test Plan

Make lots of events on diffent users.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

{F117121}

{F117122}

{F117123}

One substantive inline (see marked comment) and some minor nitpicking.

src/applications/calendar/constants/CalendarColors.php
7

(Should we do PHUIColor at some point?)

src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
42–53

This looks like it colors by event creator PHID, but this seems like it won't be too meaningful after events can have multiple invitees. Fine for now, but we might just want to color each event instead or something?

45–47

I think this is unused.

51
If there are more event owners than colors, we'll fatal here, since we still execute this code even though we executed the $allblue part above, and will try to access $calcolors[99] or whatever (for 99 distinct creators).

You could either make $allblue work and skip this part, or do something like:

$eventcolor[$phid] = $calcolors[$i % count($calcolors)]

...so that the color loops around to the beginning again and we get a nice rainbow.

67–68

It's slightly more correct to pht() this now:

pht('%s (%s)', $name_text, $status_text)

If either $name_text or $status_text contain markup in the future, the pht() version will work while the non-pht() version will convert the markup to strings and escape it. This will be safe, but produce the wrong result (overescaped text shown to the user).

68

This could be simplified to just $status_text without the string.

src/applications/calendar/storage/PhabricatorCalendarEvent.php
83–84

We can remove this transaction stuff now too, this block can just read (after the EpochException check):

return parent::save();
src/applications/calendar/view/AphrontCalendarEventView.php
58–60

(Maybe this should happen one level up? There's no way for something rendering this to say "I'm going to render <em>No description.</em> if there's no description, since I'm always rendering the name above it" since it won't be able to tell if the description is missing.)

59

A strlen() test is slightly more correct, in that it will behave like users expect for the description "0".

src/applications/people/controller/PhabricatorPeopleCalendarController.php
22–24

You should include:

if (!$user) {
  return Aphront404Response();
}

...after executeOne().

46

Maybe this should be withInvitedPHIDs()? They mean the same thing right now, but in the future they won't.

src/applications/people/controller/PhabricatorPeopleProfileController.php
153

Likewise for this, withInvitedPHIDs()?

src/view/phui/calendar/PHUICalendarListView.php
41

I'd expect this to sort on start, not end?

43–44

This isn't quite correct on leap days, etc., but we can clean it up later.

src/applications/calendar/controller/PhabricatorCalendarBrowseController.php
52

Yeah I meant to use all_blue here, basically a color per user unless we have more than 8 different people, then just use one color.

src/applications/people/controller/PhabricatorPeopleCalendarController.php
46

Will my PHID be returned in both cases in the future? I didn't know if you planned to duplicate it over, but I guess that makes sense for these kinds of queries.

src/view/phui/calendar/PHUICalendarListView.php
43–44

haha, yeah I realized that. I should just add a check in now. But we have two years. ahahaha

webroot/rsrc/css/application/profile/profile-view.css
29

wth is this?

src/view/phui/calendar/PHUICalendarListView.php
45

It's not correct on DST days, which one is coming up shortly (the day is 23 or 25 hours long).

chad updated this revision to Unknown Object (????).Feb 24 2014, 5:31 PM
  • Review updates

I think I addressed everything except DST and Color consolidation, both of which I'll follow up diffs on.