-
Notifications
You must be signed in to change notification settings - Fork 0
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
Professional Development Feature #48
Conversation
Align frontend for PD CRUD to be similar to the schools page
187227079/features/pd backend
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 86.03% 86.70% +0.66%
==========================================
Files 20 24 +4
Lines 709 797 +88
==========================================
+ Hits 610 691 +81
- Misses 99 106 +7 ☔ View full report in Codecov by Sentry. |
@perryzjc Overall this looks good. Everything works as intended. But there were two main things that I noticed.
Here are specific comments:
There is no reason why deleting a professional development should fail. In all other places in the app where stuff is destroyed there is no error checking to see if deleting something fails. So remove the if/else stuff.
|
Also nooo.... there's a merge conflict :( |
before_action :set_professional_development, only: [:new, :create, :edit, :update, :destroy] | ||
|
||
def index | ||
@pd_registrations = PdRegistration.where(professional_development_id: @professional_development.id) |
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.
Line 10 not tested
redirect_to professional_development_path(@professional_development), | ||
notice: "Registration was successfully cancelled." | ||
else | ||
flash.now[:alert] = @pd_registration.errors.full_messages.to_sentence |
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.
This path was not tested
def set_pd_registration | ||
@pd_registration = PdRegistration.find(params[:id]) | ||
rescue ActiveRecord::RecordNotFound | ||
redirect_to professional_development_path, alert: "Registration not found." |
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.
if possible, test
def set_professional_development | ||
@professional_development = ProfessionalDevelopment.find_by(id: params[:professional_development_id]) | ||
unless @professional_development | ||
redirect_to professional_developments_path, alert: "Professional Development not found." |
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.
missing test
if @professional_development.destroy | ||
redirect_to professional_developments_url, notice: "Professional development deleted successfully." | ||
else | ||
redirect_to professional_developments_url, alert: "Failed to delete professional development." |
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.
missing test, i think arush mentioned this already?
def set_professional_development | ||
@professional_development = ProfessionalDevelopment.find(params[:id]) | ||
rescue ActiveRecord::RecordNotFound | ||
redirect_to professional_developments_url, alert: "Professional development not found." |
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.
test if possible
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.
Looks good so far! Just some extra testing needed, which is necessary for a large PR like this. Goood job! 🙌
…187384622/new-email-model-pr2
@perryzjc what's the progress on this PR. Is it ready to be merged yet? |
Pivotal Tracker Link
What this PR does:
This pull request fixes|implements implements professional development feature for admins to create PD workshops and add teachers to each workshop
Include screenshots, videos, etc.
CURD for PD
CURD for PD Registrations
Who authored this PR?
How should this PR be tested?
Are there any complications to deploying this?
rails db:migrate
Checklist:
michael/12345-add-new-feature
Any branch name will do as long as the story ID is there. You can usegit checkout -b [new-branch-name]
)