-
Notifications
You must be signed in to change notification settings - Fork 8
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
CS169 Iteration 1 Pull Request #291
Closed
Closed
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
d3b2f5e
Allow manually triggering specs
cycomachead c343618
change reason to denial reason
ArushC 754d4c7
updated relevant deny cucumber test to use denial_reason instead of r…
ArushC 092cce2
rubocop fix
ArushC 2bab1d0
migration adds 'to' feld to email template database
ArushC b1173d2
added to field to view and added a file I forgot to add from prev mig…
ArushC 870491a
update backend to send to all emails specified in To field in email t…
ArushC c231e07
fixed rspec test failures and rubocop by updating seed data which get…
ArushC be305ef
added test with barney the purple dinosaur
ArushC 2088b07
rubocop fix
ArushC 4ce4a2d
Add request reason email template
perryzjc 15da9b5
Fix reason naming
perryzjc 5da7ca6
Add request reason to liquid template engine
perryzjc 2ee19ed
Merge pull request #29 from cs169/187044290-reason-to-denial-reason
ArushC 725ae84
fix request info email template
realmichaeltao f99087d
Add rspec test for request reason email
perryzjc 7a8e473
change prepopulated TO field for form submission email
ArushC 1b42b58
added validations and more descriptive, useful error messages to emai…
ArushC 96267f9
rubocop fixes
ArushC 96c18ec
added cucumber tests and added untracked migration file
ArushC 177c1c6
add flash message to resend welcome email
JacksonXu33 4862e0b
Merge pull request #26 from cs169/cycomachead-patch-1
cycomachead 3aefd1e
add flash message after welcome resend
JacksonXu33 9248494
Added button UI, modified UI logic, added comments for backend
razztech 928c57b
Merge pull request #31 from cs169/feature/187044317-add-email-resend-…
ArushC d4db5b3
Linked UI to email template
razztech 21718e5
Update UI logic for request info and pass the test
perryzjc 325fb70
Merge pull request #32 from cs169/187044299/feature/request_reason
ArushC ac57d48
rebase against main and fix merge conflict in seed data
ArushC d9d096d
Merge pull request #30 from cs169/187044314-add-to-field
perryzjc c64216f
edit redirect to use current path
JacksonXu33 d1a4b1d
Merge pull request #33 from cs169/feature/187044317-edit-resend-welco…
ArushC 9eeb0dc
Fix email template reseed problem
perryzjc 82c5475
Add rspec test for email reseed behavior
perryzjc d00c889
Refract rspec test of email reseed to be more modular
perryzjc 9fb64e9
Add RSpec db check to ensure tests use bjc_teachers_test for safety
perryzjc 2f30dc1
Revert "Add RSpec db check to ensure tests use bjc_teachers_test for …
perryzjc 7464961
Adjust Rspec test to avoid purge old email
perryzjc 755a96b
Update email reseed implementation to avoid purge old email templates
perryzjc 771324f
Merge pull request #34 from cs169/187113121/bugfix/email_reseed
ArushC dad60c5
Refract Rspec test for email reseed
perryzjc 54bd3fd
finish refract email reseed test cases
realmichaeltao 5bffa76
move email reseed test cases to models folder
realmichaeltao ba4a96b
Fix rubocop check
perryzjc 0fe0be5
Change the way of hashing for updating email template seed
perryzjc df52d67
Merge pull request #35 from cs169/187156425/bugfix/refract-test-email…
ArushC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: All Specs | ||
|
||
on: [push, pull_request] | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
specs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<%# This part of the page is the email template form %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would delete a comment like this. |
||
<%= form_with(model: email_template, local: true) do |form| %> | ||
<div class="form"> | ||
<label for="email_template_title"><h3>Title</h3></label> | ||
<%= form.text_field :title, class: "form-control", readonly: email_template.required? %> | ||
<label for="email_template_to"><h3>To</h3></label> | ||
<%= form.text_field :to, class: "form-control" %> | ||
<label for="email_template_subject"><h3>Subject</h3></label> | ||
<%= form.text_field :subject, class: "form-control" %> | ||
<label for="email_template_body"><h3>Body</h3></label> | ||
|
@@ -12,7 +15,7 @@ | |
<%= form.submit "Submit", class: "btn btn-primary" %> | ||
</div> | ||
<% end %> | ||
|
||
<%# This renders the section on "Allowed Tags" %> | ||
<%= render 'liquid_fields' %> | ||
|
||
<script type="text/javascript"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,25 @@ | |
<h4 class="modal-title"></h4> | ||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | ||
</div> | ||
<!-- default action is deny, but it can be dynamically changed. Check the js at the bottom of this file --> | ||
<%= form_tag deny_teacher_path(0), method: :post, class: "form-horizontal" do %> | ||
<div class="modal-body"> | ||
<%= label_tag 'reason', 'Reason', class: 'control-label' %> | ||
<%= text_field_tag :reason, params[:reason], class: "form-control" %> | ||
<!-- <div class="form-group"> | ||
<label for="reason-select">Reason for Denial (Select)</label> | ||
<select id="reason-select" name="reason-select" class="form-control"> | ||
<option value="">Select a reason</option> | ||
<option value="Incomplete Application">Incomplete Application</option> | ||
<option value="Insufficient Experience">Insufficient Experience</option> | ||
<option value="Unfavorable References">Unfavorable References</option> | ||
</select> | ||
</div> --> | ||
<div class="form-check"> | ||
<%= check_box_tag :skip_email, 'skip_email', false, class: 'form-check-input' %> | ||
<%= label_tag 'skip_email', 'Skip email notifcation?', class: 'form-check-label' %> | ||
</div> | ||
<%= hidden_field_tag :action_type, '', class: "form-control action-type" %> | ||
<%= label_tag 'action_reason', 'Reason', class: 'control-label' %> | ||
<%= text_field_tag :action_reason_placeholder, '', class: "form-control action-reason", id: "action_reason" %> | ||
<!-- <div class="form-group"> | ||
<label for="reason-select">Reason for Denial (Select)</label> | ||
<select id="reason-select" name="reason-select" class="form-control"> | ||
<option value="">Select a reason</option> | ||
<option value="Incomplete Application">Incomplete Application</option> | ||
<option value="Insufficient Experience">Insufficient Experience</option> | ||
<option value="Unfavorable References">Unfavorable References</option> | ||
</select> | ||
</div> --> | ||
<div class="form-check"> | ||
<%= check_box_tag :skip_email, 'skip_email', false, class: 'form-check-input' %> | ||
<%= label_tag 'skip_email', 'Skip email notifcation?', class: 'form-check-label' %> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button> | ||
|
@@ -33,31 +35,43 @@ | |
</div> | ||
|
||
<script type="text/javascript"> | ||
let modal = $('.js-denialModal'); | ||
modal.on('shown.bs.modal', function (event) { | ||
let button = $(event.relatedTarget); | ||
let teacherId = button.data('teacher-id'); | ||
let teacherName = button.data('teacher-name'); | ||
let newAction = null; | ||
let newTitle = null; | ||
switch(button.data('modal-type')) { | ||
case "deny": | ||
newAction = `/teachers/${teacherId}/deny`; | ||
newTitle = 'Deny ' + teacherName; | ||
break; | ||
case "request_info": | ||
newAction = `/teachers/${teacherId}/request_info`; | ||
newTitle = 'Request Info from ' + teacherName; | ||
break; | ||
default: | ||
newAction = `/teachers/${teacherId}/deny`; | ||
newTitle = 'Deny ' + teacherName; | ||
} | ||
modal.find('.form-horizontal').attr('action', newAction); | ||
modal.find('.modal-title').text(newTitle); | ||
}); | ||
modal.on('hidden.bs.modal', function () { | ||
$('input[name="reason"]').val(''); | ||
modal.find('.modal-title').text(''); | ||
}); | ||
let modal = $('.js-denialModal'); | ||
modal.on('shown.bs.modal', function (event) { | ||
let button = $(event.relatedTarget); // Button that triggered the modal | ||
let teacherId = button.data('teacher-id'); | ||
let teacherName = button.data('teacher-name'); | ||
let actionType = button.data('modal-type'); // Action type, e.g., "deny", "request_info" | ||
let newAction, newTitle, inputName; | ||
|
||
// Determine the action and title based on the button clicked | ||
switch(actionType) { | ||
case "deny": | ||
newAction = `/teachers/${teacherId}/deny`; | ||
newTitle = 'Deny ' + teacherName; | ||
inputName = 'denial_reason'; // The dynamic part for the input's name attribute | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete the comment at the end of the line. |
||
break; | ||
case "request_info": | ||
newAction = `/teachers/${teacherId}/request_info`; | ||
newTitle = 'Request Info from ' + teacherName; | ||
inputName = 'request_reason'; // Change accordingly | ||
break; | ||
default: | ||
newAction = `/teachers/${teacherId}/deny`; | ||
newTitle = 'Deny ' + teacherName; | ||
inputName = 'denial_reason'; // Fallback option | ||
} | ||
|
||
// Update the form's action and the modal's title | ||
modal.find('.form-horizontal').attr('action', newAction); | ||
modal.find('.modal-title').text(newTitle); | ||
|
||
// Dynamically change the name attribute of the input field | ||
modal.find('#action_reason').attr('name', inputName); | ||
}); | ||
|
||
// Reset the input field when the modal is closed | ||
modal.on('hidden.bs.modal', function () { | ||
modal.find('#action_reason').val('').attr('name', 'action_reason_placeholder'); | ||
modal.find('.modal-title').text(''); | ||
}); | ||
</script> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean this up. :)