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

Refactor booking shift admin #578

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

petitalb
Copy link
Collaborator

  • Remove n+1 queries to speedup listing shift (making joins with 'formation' table)
  • Remove 'POST' ajax calls to book shifts
  • Refactor 'admin_shift_book' endpoint to use symfony form
  • Use ajax to load buckets in admin shift booking modals (to avoid loading all buckets)

@@ -3,7 +3,7 @@

<div data-offset="{{ (((bucket.start|date('G')-start)*60 + bucket.start|date('i'))/60) }}" data-length="{{ (100/(end-start+1)) }}"
style="padding: 0 1px;width:{{ (bucket.duration / 60) * (100/(end-start+1)) }}%;position: absolute;left:{{ (((bucket.start|date('G')-start)*60 + bucket.start|date('i'))/60)*(100/(end-start+1)) }}%;top: {{ line*10 }}px;">
<a href="#edit{{ bucket.first.id }}" class="modal-trigger tooltipped" data-position="top" data-delay="100" data-tooltip="{{ bucket.first.job.name }}">
<a href="#modal-bucket" data-source="{{ path('shift_show', { 'id': bucket.first.id }) }}" class="modal-trigger tooltipped" data-position="top" data-delay="100" data-tooltip="{{ bucket.first.job.name }}">
Copy link
Member

Choose a reason for hiding this comment

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

👍

- Remove n+1 queries to speedup listing shift (making joins with 'formation' table)
- Remove 'POST' ajax calls to book shifts
- Refactor 'admin_shift_book' endpoint to use symfony form
- Use ajax to load buckets in admin shift booking modals (to avoid loading all buckets)
@petitalb petitalb force-pushed the feature/use-ajax-to-load-modals branch from 481d725 to bc182b4 Compare November 2, 2022 20:32
@petitalb petitalb merged commit 34a8a83 into master Nov 2, 2022
@petitalb petitalb deleted the feature/use-ajax-to-load-modals branch November 2, 2022 20:33
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