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)
Thu, Apr 11, 11:54 AM
Unknown Object (File)
Wed, Apr 10, 8:25 PM
Unknown Object (File)
Thu, Mar 28, 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
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.