Page MenuHomePhabricator

Fix an issue where 'Attending' would appear on calendar view unnecessarily
ClosedPublic

Authored by jcowgar on Feb 7 2016, 4:08 PM.
Tags
None
Referenced Files
F14480407: D15207.diff
Sun, Dec 29, 8:08 PM
Unknown Object (File)
Sat, Dec 28, 4:48 PM
Unknown Object (File)
Sat, Dec 21, 7:18 AM
Unknown Object (File)
Sat, Dec 21, 6:58 AM
Unknown Object (File)
Sat, Dec 21, 6:39 AM
Unknown Object (File)
Fri, Dec 20, 6:51 PM
Unknown Object (File)
Wed, Dec 18, 6:19 AM
Unknown Object (File)
Fri, Dec 13, 1:21 AM
Subscribers

Details

Summary

Ref T10295

  • Viewing Upcoming Events in the calendar would display 'Attending: ' even if there were not attendees. This caused confusion, such as 'Is it telling me I am "Attending?"'
  • When a calendar event has no attendees, simply do not display the 'Attending: ' label
Test Plan
  • Add a new event with no one attending.
  • Add a new event with one or more attendees.
  • View the Upcoming Events query of the Calendar app.
  • Notice how the one with no attendees does not show 'Attending: ' while the other with attendees will show the already existing 'Attending: jdoe, ssmith' label.

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 10553
Build 12929: arc lint + arc unit

Event Timeline

jcowgar retitled this revision from to Fix an issue where 'Attending' would appear on calendar view unnecessarily.
jcowgar updated this object.
jcowgar edited the test plan for this revision. (Show Details)
jcowgar added inline comments.
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
269

Wrong variable name, d'oh! Fixing.

jcowgar edited edge metadata.
  • No longer reuse array variable for attendees and display
epriestley added a reviewer: epriestley.

Minor inlines.

src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
276–277

By convention in this codebase, prefer if ($attendees) over if (count($attendees) > 0) for testing arrays for the presence of elements.

291–292

Instead of adding an empty attribute (which may cause us to render extra space or an extra separator character like a middot (·) now or in the future), prefer to add the attribute conditionally:

if ($attendees) {
  // ...
  $item->addAttribute(...);
This revision now requires changes to proceed.Feb 7 2016, 4:34 PM
jcowgar added inline comments.
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php
291–292

I was actually going to do that, but followed suit with the duration.

Should I change the $duration as well or should that be done in a different commit/task/review? I am unsure of project policies here.

There's no hard-and-fast rule (and I'm being extra meticulous about these details because you're a new contributor).

In this case, I'd put both changes in one diff (they're small, conceptually related, and testable in parallel). I'd split them apart only if they were a good bit more substantive or complex.

jcowgar edited edge metadata.
  • No longer reuse array variable
  • Using project standards for array checking and conditional addAttribute calls
epriestley edited edge metadata.
This revision is now accepted and ready to land.Feb 7 2016, 5:59 PM
This revision was automatically updated to reflect the committed changes.