-
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
Profile UI for CCE Minor Experiences. #1293
base: development
Are you sure you want to change the base?
Conversation
…ts into CCEminorTabs
…ts into CCEMinorTabs
…ts into CCEMinorTabs
…lts into CCEMinorTabs
… forms. Also implemented an 'Edt' and 'Withdraw' functionality for both forms.
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.
- No text in phone number field
- Supervisor phone and email should not be required
- Required fields should have the red * (we have that style from somewhere else)
- Summer experience should connect through the IndividualRequirement table for the minor. See: Admin minor management page
- No big duplicate chunks for read-only vs edit
- Use jquery everywhere instead of vanilla javascript
|
||
|
||
@minor_bp.route('/cceMinor/<username>/updateSummerExperience', methods=['GET', 'POST']) | ||
def updateSummerExperience(username): |
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.
Update and create need to be combined or otherwise share functionality
|
||
|
||
|
||
@minor_bp.route('/profile/<username>/withdrawSummerExperience', methods=['POST']) |
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.
Lets move this code to a different PR since it can't be tested in this one.
|
||
|
||
# ################################################## SUMMER EXPERIENCE END ########################################################### | ||
@minor_bp.route('/cceMinor/<username>/addOtherEngagement', methods=['POST']) |
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.
Lets move this to a different PR where we are implementing the addOtherEngagement functionality.
logging.error(f'An error occurred while adding the engagement: {e}', exc_info=True) | ||
return redirect(url_for('minor.view_other_engagement', username=username)) | ||
|
||
@minor_bp.route('/cceMinor/<username>/otherEngagement', methods=['GET']) |
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.
Lets move this to a different PR where we are implementing the addOtherEngagement functionality.
app/static/js/minorProfilePage.js
Outdated
}) | ||
.catch(error => console.error('Error fetching terms:', error)); | ||
|
||
const editOtherButton = document.getElementById('edit-other-proposal-button'); |
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.
Use ajax instead of JavaScript
|
||
editOtherButton.addEventListener('click', function() { | ||
otherFormFields.forEach(field => field.removeAttribute('disabled')); | ||
document.getElementById('edit-other-buttons').style.display = 'block'; |
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.
Use ajax instead of JavaScript
|
||
cancelOtherButton.addEventListener('click', function() { | ||
otherFormFields.forEach(field => field.setAttribute('disabled', 'disabled')); | ||
document.getElementById('edit-other-buttons').style.display = 'none'; |
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.
Use ajax instead of JavaScript
document.getElementById('view-other-buttons').style.display = 'block'; | ||
}); | ||
|
||
withdrawOtherButton.addEventListener('click', function() { |
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.
Use ajax instead of JavaScript
}); | ||
|
||
withdrawOtherButton.addEventListener('click', function() { | ||
const experienceId = document.getElementById('other-experience-id').value; |
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.
Lets put this withdraw logic in a different PR with other withdrawal logic.
|
||
cancelOtherButton.addEventListener('click', function() { | ||
otherFormFields.forEach(field => field.setAttribute('disabled', 'disabled')); | ||
document.getElementById('edit-other-buttons').style.display = 'none'; |
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.
Use ajax instead.
document.getElementById('edit-buttons').style.display = isEditMode ? 'block' : 'none'; | ||
document.getElementById('view-buttons').style.display = isEditMode ? 'none' : 'block'; |
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.
Use ajax instead of javascript
Completed the backend for both Summer Experience and Other Engagement forms. Also implemented an 'Edt' and 'Withdraw' functionality for both forms.
Fixing issue #1152