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
F14045224: D15207.id36711.diff
Wed, Nov 13, 2:18 AM
F14044926: D15207.id36712.diff
Tue, Nov 12, 10:59 PM
F13982816: D15207.id36714.diff
Sun, Oct 20, 2:08 AM
F13982809: D15207.id36714.diff
Sun, Oct 20, 2:06 AM
Unknown Object (File)
Oct 9 2024, 3:07 AM
Unknown Object (File)
Oct 7 2024, 6:57 PM
Unknown Object (File)
Oct 2 2024, 2:31 PM
Unknown Object (File)
Oct 1 2024, 3:22 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.