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

Fix/same time shift protection 2 #175

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

demogorgonzola
Copy link
Contributor

Fixes #113

This is the original solution in #156, with admin warnings enabled.

~ moved indirect access to controller
~ some more consistent nameing changes
+ [docs] also included for how the warning code works
This may come in handy later, but is entirely besides the main point and 
beyond the scope of the issue.
+ slot factory for quick build
~ more robust factories
~ a way to shut off env
+ more scripts for testing
~ better slot tests
~ changed ScheduleFactory to work with recent changes
Copy link
Contributor

@Meleeman01 Meleeman01 left a comment

Choose a reason for hiding this comment

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

on line 186 of the slotController, you need to change the variable name to $user_name so that your code won't error out.

for the userAllowed function in the SlotController, check for banned members.

and get rid of the spaces in the hrefs in the links of your concurrent slot partials.

after that it should be just fine

<span>
@if(isset($admin) && $admin === true)
{{ $user_name }} is currently signed up for another
<a href=" {{ env('SITE_URL') }} /slot/{{ $concurrent_slot_id }}/view">overlapping shift</a>.
Copy link
Contributor

Choose a reason for hiding this comment

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

this space in the href url is causing problems, eliminate the space so we can actually see the page. infact all of the hrefs in this portion of the code

Copy link
Member

Choose a reason for hiding this comment

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

@Meleeman01 Can you fix this issue?

@@ -55,6 +55,11 @@ private function userAllowed(Slot $slot)
}
}

if($slotRoles->isEmpty())
Copy link
Contributor

Choose a reason for hiding this comment

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

this allows banned users to sign up for shifts. i would rework this logic slightly and check for banned

~ ScheduleFactory now has "volunteer" role by default
Copy link
Contributor

@Meleeman01 Meleeman01 left a comment

Choose a reason for hiding this comment

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

everything seems to be working as intended great job

<span>
@if(isset($admin) && $admin === true)
{{ $user_name }} is currently signed up for another
<a href=" {{ env('SITE_URL') }} /slot/{{ $concurrent_slot_id }}/view">overlapping shift</a>.
Copy link
Member

Choose a reason for hiding this comment

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

@Meleeman01 Can you fix this issue?

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.

Add warning when users sign up for multiple shifts at the same time
3 participants