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
Unknown Object (File)
Wed, Apr 24, 11:48 PM
Unknown Object (File)
Thu, Apr 11, 11:54 AM
Unknown Object (File)
Wed, Apr 10, 8:25 PM
Unknown Object (File)
Mar 28 2024, 10:12 PM
Unknown Object (File)
Mar 21 2024, 8:06 AM
Unknown Object (File)
Mar 18 2024, 11:47 AM
Unknown Object (File)
Mar 12 2024, 6:16 PM
Unknown Object (File)
Mar 12 2024, 6:16 PM
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 10551
Build 12927: 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
279–285

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

309

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
309

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.