Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordonnancer l'affichage des créneaux des membres #625

Merged
merged 3 commits into from
Nov 27, 2022

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Nov 17, 2022

Quoi ?

Lorsqu'un bénéficiaire souhaite afficher ses créneaux, ils sont ordonnés par le "plus récent d'abord".

Mais :

  • si un membre a plusieurs bénéficiaires, l'ordre d'affichage de ses créneaux est mélangé entre les bénéficiaires
  • les créneaux fixe n'ont pas d'ordre particulier

Captures d'écran

Avant Après
Créneaux cycles Screenshot from 2022-11-17 18-23-05 Screenshot from 2022-11-17 18-33-52
Créneaux fixe Screenshot from 2022-11-17 19-26-10 Screenshot from 2022-11-17 19-25-20

@raphodn raphodn self-assigned this Nov 17, 2022
@raphodn raphodn requested a review from petitalb November 17, 2022 18:32
return $a->getStart() < $b->getStart(); // DESC (default $beneficiary->shifts order)
});
$shifts = new ArrayCollection(iterator_to_array($iterator));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

On ne pourrait pas le faire plus proprement en faisant une requête doctrine dans le repository (cf ShiftRepository) ?

Enchainer les 2 foreach + l'iterateur + le filter (si on ignore les dismissed), c'est pas très beau non ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Je suis d'accord qu'en le faisant je n'ai pas trouvé ça très beau... Comme on fait une requête qui agrège plusieurs bénéficiaires, ca demanderait en effet de ré-architecturer la requête, là les repository ca dépasse mes compétences actuelles ^^

@petitalb
Copy link
Collaborator

@raphodn tu as pu regarder mon commit ?

@petitalb petitalb force-pushed the raphodn/member-shift-display-order branch from 0090de9 to 0fdf08f Compare November 27, 2022 13:13
@petitalb petitalb merged commit 8366b6b into master Nov 27, 2022
@petitalb petitalb deleted the raphodn/member-shift-display-order branch November 27, 2022 13:16
@raphodn
Copy link
Member Author

raphodn commented Nov 27, 2022

@raphodn tu as pu regarder mon commit ?

Désolé je n'avais pas vu. Et trop compliqué pour moi je te laisse gérer ^^

quot17 pushed a commit to quot17/gestion-compte that referenced this pull request Nov 29, 2022
* Order all of the members displayed shifts by latest first

* Order beneficiary period positions by dayofweek/start

* Refactor getAllShifts membership to leverage DB filtering and sorting functionalities

Co-authored-by: Albin PETIT <[email protected]>
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.

2 participants