Skip to content

Fix #105: Implement time-based separators in agenda view#133

Open
lambeletjp wants to merge 1 commit intoagilare:masterfrom
lambeletjp:feature/105-time-based-separators
Open

Fix #105: Implement time-based separators in agenda view#133
lambeletjp wants to merge 1 commit intoagilare:masterfrom
lambeletjp:feature/105-time-based-separators

Conversation

@lambeletjp
Copy link

  • Add EvenementWithSeparatorCollection to handle separator logic
  • Add EventWithSeparator wrapper class with shouldDisplaySeparator() method
  • Add Separator class to generate separator labels
  • Refactor index.php template to use new collection classes
  • Add test data SQL file for time-based separators

- Add EvenementWithSeparatorCollection to handle separator logic
- Add EventWithSeparator wrapper class with shouldDisplaySeparator() method
- Add Separator class to generate separator labels
- Refactor index.php template to use new collection classes
- Add test data SQL file for time-based separators
Copy link
Owner

@agilare agilare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this proposition, I made some suggestions in the code
Personnaly I would use less classes and variables but it should be also my oldschool procedural style
I did a try with some events and I reveal a problem causing confusion : the hours in separators could mean it the hours of the following event, if we arn't enough attentive

Image

We should find a disambiguation for ex. dès 20h..." instead of only "20h"

Image

or even a separator for each hour change

}
}

private function calculateEvenHour(string $horaire_debut): int
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name could be clearer informing we get the previous even hour
A short DocBlock with an example could also help

$this->date_next_day = date_lendemain($date_current);
}

public function getIterator(): \Traversable
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A synthesis of the process and the intention in a DocBlock would be appreciated

Variables with "no_time" and "autres_horaires" should have their name harmonized and more accurate; all mean there is no horaire debut defined

I wondered if Separator instances could be created here and injected in EventWithSeparator constructor instead of EventWithSeparator ::getCurrentSeparator()

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments explaining the contexte of use of this class could be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants